/*
  Page frame around the deck: intro, index row, Shelf, footer.
  Loaded after style.css (and before style-dark.css in the dark page), so it uses the
  same variables and follows both themes without its own dark rules.
  Nothing here touches .card, .body, .meta or the deck geometry.
*/
:root {
  --margin: 36px;
  --rule: color-mix(in srgb, var(--charcoal) 16%, transparent);
  --small: 10.5px;                 /* the existing name/label size */
}

a { color: inherit; text-decoration: none; }

/* ---------- index row: the existing name mark, with four quiet destinations ---------- */
.top {
  position: absolute; z-index: 10; top: 28px; left: var(--margin); right: var(--margin);
  display: flex; justify-content: space-between; align-items: baseline;
}
.top .mark, .index a, .shell .name, .shelf .label, .foot {
  font-family: var(--sans); font-weight: 500; font-size: var(--small);
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--charcoal-2);
}
.index { display: flex; gap: 26px; }
.index a, .foot a { transition: color 200ms ease; }
.index a:hover, .foot a:hover, .top .mark:hover { color: var(--charcoal); }

/* ---------- intro: quiet, textual ---------- */
.intro {
  min-height: 100vh; min-height: 100svh;
  padding: 0 var(--margin);
  display: flex; align-items: center;
}
.bio {
  max-width: 30em;
  margin-top: -4vh;
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(20px, 1.9vw, 28px); line-height: 1.42;
  letter-spacing: -0.003em;
  color: var(--charcoal);
  text-wrap: pretty;
}

/* ---------- the deck's own label: WORK and one line, top left of the stage ---------- */
.shell .lede, .shelf .lede {
  margin-top: 9px;
  font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: 15px; line-height: 1.4; color: var(--charcoal-2);
  text-transform: none; letter-spacing: 0;
}

/* shuffle: a quiet utility beside the WORK label, in the label's own type */
.shell .name { display: inline-block; }
.shell .shuffle {
  display: inline-block; margin-left: 22px; padding: 0;
  background: none; border: 0; border-radius: 0; cursor: pointer; pointer-events: auto;
  font-family: var(--sans); font-weight: 500; font-size: var(--small);
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--charcoal-2);
  transition: color 200ms ease;
}
.shell .shuffle:hover { color: var(--charcoal); }
.shell .shuffle:focus-visible { outline: 1px solid var(--charcoal-2); outline-offset: 4px; color: var(--charcoal); }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

/* ---------- Shelf: a short coda. Nine objects on one hairline, artwork and a title each ---------- */
.after { display: none; }
.shelf { padding: 16vh var(--margin) 0; }
.shelf .label { font-size: var(--small); }
.shelf-head { margin-bottom: 40px; }
.objects {
  list-style: none;
  display: grid; grid-template-columns: repeat(10, minmax(0, 1fr));
  padding-bottom: 44px;             /* room for the titles under the edge */
}
.obj {
  --s: 1.06;                        /* shelf scale (+6%) */
  --k: 1;                           /* per-object optical adjustment */
  --h: calc(172px * var(--s) * var(--k));   /* book */
  display: flex; flex-direction: column; justify-content: flex-end;
  border-bottom: 1px solid var(--rule);   /* the shelf edge; continuous across the row */
  padding: 0 10px;
  position: relative;
}
.obj[data-m="comic"] { --h: calc(180px * var(--s) * var(--k)); }
.obj[data-m="game"]  { --h: calc(186px * var(--s) * var(--k)); }
.obj[data-m="tv"]    { --h: calc(194px * var(--s) * var(--k)); }
/* optical weight: the square monochrome album and the pale book read lighter than their neighbours */
.obj:has(img[src$="dijon.webp"])              { --k: 1.07; }
.obj:has(img[src$="science-of-scaling.webp"]) { --k: 1.04; }
.art {
  position: relative; align-self: center;
  width: min(calc(100% * var(--s) * var(--k)), calc(100% + 10px));   /* may use up to 5px of each side's padding */
  max-width: calc(var(--h) * 2 / 3);
  aspect-ratio: 2 / 3;              /* until the artwork says otherwise */
  border-radius: 2px; overflow: hidden;
  box-shadow: 0 1px 1.5px rgba(20, 18, 16, .14), 0 10px 18px -12px rgba(20, 18, 16, .45);
  transform: translateY(0); transition: transform 320ms cubic-bezier(.2,.7,.2,1), box-shadow 320ms ease;
}
.art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.obj:hover .art {
  transform: translateY(-5px);
  box-shadow: 0 2px 3px rgba(20, 18, 16, .16), 0 18px 26px -14px rgba(20, 18, 16, .5);
}
/* placeholder while artwork is missing: plain and obviously unfinished */
.ph { display: none; }
.no-art .art { background: var(--concrete); box-shadow: none; outline: 1px dashed var(--rule); outline-offset: -6px; }
.no-art .ph {
  display: flex; align-items: flex-end; position: absolute; inset: 0; padding: 10px;
  font-family: var(--serif); font-size: 12px; line-height: 1.3; color: var(--charcoal-2);
}
.cap {
  position: absolute; top: calc(100% + 10px); left: 10px; right: 10px;
  font-size: 11.5px; line-height: 1.3; color: var(--charcoal);
  text-align: center; text-wrap: balance;
}

/* tablet: two short shelves */
@media (max-width: 1099px) and (min-width: 760px) {
  .objects { grid-template-columns: repeat(5, minmax(0, 1fr)); row-gap: 56px; }
}

/* ---------- footer: it simply ends ---------- */
.foot {
  margin: 26vh var(--margin) 0; padding: 22px 0 40px;
  border-top: 1px solid var(--rule);
  display: flex; flex-wrap: wrap; gap: 10px 34px; align-items: baseline;
}
.foot .yr { margin-left: auto; }

/* ---------- phone ---------- */
@media (max-width: 759px) {
  :root { --margin: 20px; }
  .top { top: 18px; }
  .index { gap: 14px; }
  .bio { font-size: 20px; line-height: 1.45; margin-top: 0; }
  .shell .lede { font-size: 14px; max-width: 30ch; }
  .shell .shuffle { margin-left: 16px; }
  .shelf { padding-top: 12vh; }
  .shelf-head { margin-bottom: 32px; }
  .objects { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 52px; }
  .obj { padding: 0 8px; --s: 1; }
  .obj:has(img[src$="science-of-scaling.webp"]) { --k: 1; }
  .cap { left: 8px; right: 8px; font-size: 11px; }
  .foot { margin-top: 18vh; gap: 10px 22px; }
  .foot .yr { margin-left: 0; }
}
@media (max-width: 380px) {
  .index { gap: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  .art { transition: none; }
  .obj:hover .art { transform: none; }
}
