/* kevin michael sullivan — synthetic material poetics
   one typeface (ISOCPEUR), stone neutrals, oxide as the single trace accent,
   0.5px hairlines, 2px radius, generous voids. lowercase everywhere;
   UPPERCASE only for index metadata at 0.34em tracking. */

@font-face { font-family: "ISOCPEUR"; src: url("/fonts/isocpeur.ttf") format("truetype");
  font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "ISOCPEUR"; src: url("/fonts/isocpeui.ttf") format("truetype");
  font-weight: 400; font-style: italic; font-display: swap; }

:root {
  --ground: #ffffff;
  --stone-50: #f4f3ef;     /* plate ground */
  --stone-200: #dddbd1;    /* hairline */
  --stone-600: #55524a;    /* quiet text */
  --stone-900: #1e1d1a;    /* ink */
  --oxide: #3e5651;        /* the single trace accent */
  --rule-soft: rgba(30, 29, 26, 0.10);
  --frost: rgba(255, 255, 255, 0.66);
  --frost-plate: rgba(244, 243, 239, 0.52);
  --hair: 0.5px;
  --radius: 2px;
  --void: 112px;
  --void-l: 176px;
  --gutter: clamp(16px, 4.2vw, 60px);
  --chrome-h: 56px;
  --foot-h: 56px;          /* same as the header; text sits in the top part, clear of the browser's link pop-up */
  --foot-clear: 22px;
  --ease: cubic-bezier(.2, 0, .1, 1);
  --t-name: 13px;          /* name in chrome */
  --t-nav: 11px;
  --t-meta: 10px;          /* uppercase metadata */
  --t-body: 13px;
  --track-meta: 0.34em;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scrollbar-gutter: stable; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font-family: "ISOCPEUR", "Helvetica Neue", Arial, sans-serif; font-weight: 400;
  background: var(--ground); color: var(--stone-900);
  font-size: var(--t-body); line-height: 1.6; letter-spacing: 0.055em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
main { flex: 1 0 auto; }
a { color: inherit; text-decoration: none; transition: color 180ms var(--ease); }
a:hover { color: var(--oxide); }
:focus-visible { outline: 1px solid var(--oxide); outline-offset: 2px; }
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; letter-spacing: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, p, figure, dl, dd { margin: 0; }
h1, h2 { font-weight: 400; }

.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -40px; z-index: 50; padding: 6px 10px; background: var(--ground); font-size: var(--t-nav); }
.skip:focus { top: 8px; }

.k, .fig, .crumbs, .count, .sets, .foot, .traverse, .reg-head, .c-num, .c-set, .c-year, figcaption, .spec dt {
  font-size: var(--t-meta); letter-spacing: var(--track-meta); text-transform: uppercase; color: var(--stone-600);
}

/* ------------------------------------------------------------ chrome */
.chrome {
  position: sticky; top: 0; z-index: 20;
  height: var(--chrome-h); padding: 0 var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--frost);
  -webkit-backdrop-filter: blur(14px) saturate(0.9); backdrop-filter: blur(14px) saturate(0.9);
  border-bottom: var(--hair) solid var(--rule-soft);
}
.id { display: flex; align-items: baseline; gap: 14px; min-width: 0; }
.name { font-size: var(--t-name); letter-spacing: 0.12em; white-space: nowrap; }
.chrome .sets { margin: 0 auto 0 40px; min-width: 0; }
.nav { display: flex; gap: 24px; font-size: var(--t-nav); letter-spacing: 0.18em; color: var(--stone-600); }
.nav a { padding: 12px 0; }
.nav a[aria-current] { color: var(--stone-900); }

/* ------------------------------------------------------------ index */
.bar {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap;
  margin: 40px var(--gutter) 24px; padding-bottom: 12px; border-bottom: var(--hair) solid var(--stone-900);
}
.sets { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 14px; }
.sets a { padding: 6px 0; }
.sets a[aria-current="true"] { color: var(--stone-900); }
.sets .n { letter-spacing: 0.2em; }
.dot { color: var(--stone-200); }
.views { display: flex; align-items: baseline; gap: 8px; }
.views a[aria-current] { color: var(--stone-900); }
.nav a:hover { color: var(--oxide); }
.slash { color: var(--stone-200); }

.index .grid, .index .register { margin-top: 32px; }

/* layout dials (content/site.yaml -> inline :root vars): --grid-gap, --grid-cols-desktop/-tablet/-phone,
   --grid-gutter (index page side margin), --plate-pad (air inside each tile). unset = the fallbacks here. */
.index main { --gutter: var(--grid-gutter, clamp(16px, 4.2vw, 60px)); }
.grid {
  display: grid; gap: var(--grid-gap, 1px); margin: 0 var(--gutter);
  grid-template-columns: repeat(var(--grid-cols-phone, 2), minmax(0, 1fr));
}
@media (min-width: 600px) { .grid { grid-template-columns: repeat(var(--grid-cols-tablet, 4), minmax(0, 1fr)); } }
@media (min-width: 960px) { .grid { grid-template-columns: repeat(var(--grid-cols-tablet, 6), minmax(0, 1fr)); } }
@media (min-width: 1200px) { .grid { grid-template-columns: repeat(var(--grid-cols-desktop, 8), minmax(0, 1fr)); } }
.grid li[hidden], .reg-rows li[hidden] { display: none; }

.plate {
  position: relative; display: block; aspect-ratio: 1 / 1; overflow: hidden; padding: var(--plate-pad, 0);
  background: transparent; border-radius: var(--radius);
  -webkit-tap-highlight-color: transparent;
}
.plate picture, .plate img { width: 100%; height: 100%; }
.plate img { object-fit: contain; }  /* whole image, floating on the white ground */
.plate-name {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  padding: 12px; text-align: center; font-size: 12px; letter-spacing: 0.12em; line-height: 1.4;
  color: var(--stone-900); background: var(--frost-plate);
  opacity: 0; transition: opacity 240ms var(--ease); pointer-events: none;
}
@media (hover: hover) and (pointer: fine) {
  .plate:hover .plate-name {
    opacity: 1;
    -webkit-backdrop-filter: blur(12px) saturate(0.85); backdrop-filter: blur(12px) saturate(0.85);
  }
}
.plate:focus-visible { outline-offset: -1px; }
.plate:focus-visible .plate-name { opacity: 1; }

/* list view: a ruled register */
.register { display: none; position: relative; margin: 0 var(--gutter); }
.view-list .grid { display: none; }
.view-list .register { display: block; }
.reg-head, .row {
  display: grid; align-items: baseline; gap: 0 16px;
  grid-template-columns: 3.2em minmax(0, 1fr) 7.5em;
}
.reg-head { padding: 0 0 10px; }
.row { padding: 11px 0 10px; border-bottom: var(--hair) solid var(--stone-200); font-size: 11px; letter-spacing: 0.12em; }
.reg-rows li:first-child .row { border-top: var(--hair) solid var(--stone-900); }
.c-year, .c-mat { display: none; }
.c-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row:hover .c-name { color: var(--oxide); }
@media (min-width: 720px) {
  .reg-head, .row { grid-template-columns: 3.2em minmax(0, 2fr) minmax(0, 1fr) 5em minmax(0, 2fr); }
  .c-year, .c-mat { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .row .c-mat { text-transform: none; letter-spacing: 0.12em; color: var(--stone-600); }
}
.preview { display: none; }
@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
  .register { padding-right: calc(min(30vw, 400px) + 48px); }
  .preview {
    display: block; position: fixed; right: var(--gutter); top: calc(var(--chrome-h) + 104px); pointer-events: none;
    width: min(30vw, 400px); aspect-ratio: 1 / 1; background: var(--stone-50); border-radius: var(--radius);
    overflow: hidden; opacity: 0; transition: opacity 200ms var(--ease);
  }
  .preview.on { opacity: 1; }
  .preview img { width: 100%; height: 100%; object-fit: cover; }
}

/* the footer: pinned and frosted like the header (index: counts; project: prev / index / next) */
body { padding-bottom: var(--foot-h); }
.foot, .traverse {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  height: calc(var(--foot-h) + env(safe-area-inset-bottom)); margin: 0;
  padding: 0 var(--gutter) calc(var(--foot-clear) + env(safe-area-inset-bottom));
  background: var(--frost);
  -webkit-backdrop-filter: blur(14px) saturate(0.9); backdrop-filter: blur(14px) saturate(0.9);
  border-top: var(--hair) solid var(--rule-soft);
}
.foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
[data-admin] .foot, [data-admin] .traverse { bottom: var(--adm-bar-h); }

/* ------------------------------------------------------------ project */
.project { padding: 40px var(--gutter) 0; max-width: 1560px; margin: 0 auto; }
.corner {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px 24px; flex-wrap: wrap;
  padding-bottom: 12px; border-bottom: var(--hair) solid var(--stone-200);
}
.crumbs { min-width: 0; }
.fig { color: var(--oxide); }
.title { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin: 40px 0 36px; }
.title h1 { font-size: clamp(34px, 5.2vw, 56px); line-height: 1.06; letter-spacing: 0.005em; overflow-wrap: anywhere; }
.count { white-space: nowrap; padding-bottom: 0.6em; }

.hero a, .pl a { display: block; cursor: zoom-in; }
.hero img {
  width: 100%; max-height: min(86vh, 1400px); object-fit: contain;
  background: var(--stone-50); border-radius: var(--radius);
}
.label {
  display: grid; gap: 40px 72px; margin-top: 56px;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 900px) { .label { grid-template-columns: minmax(0, 520px) minmax(0, 1fr); } }
@media (max-width: 899px) { .desc:empty { display: none; } }
.desc .k { margin-bottom: 16px; }
.desc p { color: var(--stone-600); line-height: 1.78; max-width: 60ch; }
.desc p + p { margin-top: 1em; }
.spec {
  display: grid; grid-template-columns: 9.5em minmax(0, 1fr); gap: 13px 24px; align-content: start;
  font-size: 11px; letter-spacing: 0.12em; line-height: 1.5;
}
.spec dt { padding-top: 1px; }

.plates {
  display: grid; gap: 40px 20px; margin-top: var(--void);
  grid-template-columns: minmax(0, 1fr); align-items: start;
}
@media (min-width: 600px) { .plates { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .plates { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.pl img { width: 100%; background: var(--stone-50); border-radius: var(--radius); }
.pl figcaption { margin-top: 9px; }

.traverse { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 16px; align-items: center; }
.traverse .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.traverse a { padding: 6px 0; }
.traverse .next { text-align: right; }
.traverse .up { text-align: center; }

@media (max-width: 599px) {
  :root { --void: 72px; --void-l: 104px; --chrome-h: 52px; }
  .nav { gap: 16px; letter-spacing: 0.14em; }
  .sets { gap: 0 12px; letter-spacing: 0.2em; }
  .sets .dot { display: none; }
  .desc:empty { display: none; }
  .title { margin: 28px 0 24px; }
  .label { margin-top: 36px; }
  .plates { gap: 28px; }
  .traverse .t { display: none; }
  .traverse .prev::after { content: "prev"; }
  .traverse .next::before { content: "next"; }
}

/* ------------------------------------------------------------ info overlay */
.info {
  position: fixed; inset: 0; z-index: 40; display: none;
  overflow-y: auto; overscroll-behavior: contain;
  background: rgba(255, 255, 255, 0.58);
  -webkit-backdrop-filter: blur(22px) saturate(0.85); backdrop-filter: blur(22px) saturate(0.85);
}
.info:target { display: block; }            /* no-JS fallback */
.js .info:target { display: none; }
.js .info.open { display: block; animation: frost-in 260ms var(--ease); }
@keyframes frost-in { from { opacity: 0; } to { opacity: 1; } }
.info-panel {
  position: relative; max-width: 720px; margin: 0 auto;
  padding: calc(var(--chrome-h) + var(--void)) var(--gutter) var(--void);
}
.info-close {
  position: fixed; top: 6px; right: calc(var(--gutter) - 12px);
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  font-size: 26px; line-height: 1; color: var(--stone-900);
}
.info-title { font-size: clamp(28px, 4vw, 36px); line-height: 1.1; letter-spacing: 0.005em; }
.info-sub { margin-top: 10px; font-size: var(--t-nav); letter-spacing: 0.12em; color: var(--stone-600); }
.info-bio { margin-top: 48px; }
.info-bio p { line-height: 1.78; color: var(--stone-900); max-width: 56ch; }
.info-bio p + p { margin-top: 1em; }
.contact { margin-top: 56px; border-top: var(--hair) solid var(--stone-900); }
.contact li {
  display: grid; grid-template-columns: 9.5em minmax(0, 1fr); gap: 16px; align-items: baseline;
  padding: 12px 0; border-bottom: var(--hair) solid var(--stone-200); font-size: 12px; letter-spacing: 0.12em;
}
.contact .k, .contact li > span:first-child { font-size: var(--t-meta); letter-spacing: var(--track-meta); text-transform: uppercase; color: var(--stone-600); }
.contact a { overflow-wrap: anywhere; }
html.info-open { overflow: hidden; }

/* ------------------------------------------------------------ lightbox */
.lb {
  position: fixed; inset: 0; z-index: 45; display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  animation: frost-in 200ms var(--ease);
}
.lb img { max-width: calc(100vw - 2 * var(--gutter)); max-height: calc(100vh - 120px); width: auto; height: auto; object-fit: contain; }
.lb button { position: absolute; width: 48px; height: 48px; font-size: 22px; color: var(--stone-900); }
.lb button:hover { color: var(--oxide); }
.lb .lb-x { top: 6px; right: calc(var(--gutter) - 12px); font-size: 26px; }
.lb .lb-p { left: calc(var(--gutter) - 12px); top: 50%; transform: translateY(-50%); }
.lb .lb-n { right: calc(var(--gutter) - 12px); top: 50%; transform: translateY(-50%); }
.lb .lb-c { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center;
  font-size: var(--t-meta); letter-spacing: var(--track-meta); text-transform: uppercase; color: var(--stone-600); }

/* ------------------------------------------------------------ 404 */
.nf { padding: var(--void) var(--gutter); }
.nf h1 { margin: 20px 0 28px; font-size: clamp(34px, 5vw, 56px); }
.nf a { border-bottom: var(--hair) solid currentColor; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* narrow screens: the set filters drop to a second row of the header */
@media (max-width: 759px) {
  :root { --chrome-h: 84px; }
  .chrome { height: auto; min-height: var(--chrome-h); flex-wrap: wrap; align-content: center; row-gap: 0; padding-top: 6px; padding-bottom: 6px; }
  .chrome .sets { order: 3; flex: 1 0 100%; margin: 0; }
  .chrome .sets a { padding: 4px 0 6px; }
  .index .grid, .index .register { margin-top: 20px; }
}
