/* panel.css: the left panel (panel.js), one component for the homepage and the case pages. Left = the panel,
   right = the page's own column. The print is a canvas under the panel (canvas.flood): the panel itself is
   transparent, its type in paper over the blue. Pages set the tokens (--paper, --ink, --accent, --body). */
:root { --gut: clamp(22px, 2.6vw, 38px); --head: 68px; --head-y: 22px; }   /* --head: the header's band over the right column (desktop); --head-y: the header's type from the window's top */
html { -webkit-tap-highlight-color: transparent; }   /* phone: the tap pulse in the print is the feedback, not the grey box */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }   /* thirds (2026-10-14): the work gets twice the panel's room */

/* labels: quiet and exact, so the print can be loud */
.lab, .ctx .kick { font-family: var(--body); font-size: var(--fs-label); font-weight: 500; letter-spacing: var(--ls-label); text-transform: none; font-variant-numeric: tabular-nums; }

/* ── the panel: sticky, the top row, the print's band, the context, the footer ── */
.stage { position: sticky; top: 0; z-index: 4; height: 100svh; overflow: hidden; display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
         color: var(--paper); background: transparent; }
/* multiply: where a shape runs onto the page it overprints like a second ink */
canvas.flood { position: fixed; left: 0; top: 0; z-index: 3; pointer-events: none; image-rendering: pixelated; mix-blend-mode: multiply; }
#art { position: relative; min-height: 0; }
#art canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#art .art-work { visibility: hidden; }

/* the top row: the name, and the links at full strength; Contact a red button, CV an outlined one (his pick 2026-10-04).
   Desktop: the links sit at the top right of the page, over the paper, on a band the right column scrolls under;
   the name stays in the panel's corner. Phone: all in the panel's top row */
.top { display: flex; justify-content: space-between; align-items: baseline; padding: var(--head-y) var(--gut) 16px; position: relative; z-index: 2; }
.top a { text-decoration: none; }
.top .name { font-weight: 500; white-space: nowrap; margin-right: 14px; clip-path: inset(-6px -12px 0 -12px); }
/* the mark (panel.js mark()): the bare VH letters, centred on the tags' text, in the header's colour (a mask over it) */
.top .name { align-self: flex-start; margin-top: 3px; margin-bottom: 0; }
.top .name i.mark { display: block; background: currentColor; -webkit-mask-size: 100% 100%; mask-size: 100% 100%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; }
/* homepage: no mark in the header while the panel's title is the name; halfway to the work it slides up into place
   (panel.js toggles .noname), at the pace of the panel's own text swaps */
.top .name span { display: block; transition: transform .4s cubic-bezier(.2,.7,.2,1); }
.top.noname .name span { transform: translateY(110%); }
.top.noname .name { pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .top .name span { transition: none; } }
.top nav { display: flex; align-items: baseline; gap: clamp(14px, 1.6vw, 26px); }
.top nav a { flex-shrink: 0; white-space: nowrap; font-size: var(--fs-body); font-weight: 600; }
.top nav a:not(.on):hover { color: var(--accent); }
.top nav a.on::before { content: ''; display: inline-block; width: 6px; height: 6px; background: var(--accent); margin-right: 7px; vertical-align: 1px; }
.top nav a[data-nav="intro"] { display: none; }   /* About made room for Cases (2026-10-13); the name already links to the intro */
.top nav a[data-nav="contact"], .top nav a[href$=".pdf"] { padding: 6px 12px; margin: -8px -4px; background: var(--accent); color: var(--paper); border: 2px solid var(--accent); transition: background .2s, border-color .2s; }
.top nav a[data-nav="contact"]:hover { background: var(--ink); border-color: var(--paper); color: var(--paper); }
.top nav a[data-nav="contact"]::before { display: none; }
.top nav a[href$=".pdf"] { background: none; border-color: color-mix(in srgb, var(--paper) 55%, transparent); }
.top nav a[href$=".pdf"]:hover { border-color: var(--paper); color: var(--paper); }
@media (min-width: 861px) {
  :root { --head-y: 32px; --head: 78px; }   /* clear of the print's grainy top edge (his call 2026-10-14), on every page so the header never jumps */
  .top nav { position: fixed; top: var(--head-y); right: var(--gutR, 40px); color: var(--ink); }
  .top .name { margin-top: 4px; }   /* the letters on the tags' text, which runs a little taller here */
  /* every link on a paper tag (his pick 2026-10-14): over a case page's photo it keeps them legible; on the paper it doesn't show */
  .top nav a:not([data-nav="contact"]) { background: var(--paper); }
  .top nav a:not([data-nav="contact"]):not([href$=".pdf"]) { padding: 6px 12px; margin: -8px -4px; border: 2px solid var(--paper); }
  .top nav a[data-nav="contact"]:hover { border-color: var(--ink); }
  .top nav a[href$=".pdf"] { color: var(--ink); border-color: color-mix(in srgb, var(--ink) 35%, var(--paper)); }
  .top nav a[href$=".pdf"]:hover { border-color: var(--ink); color: var(--ink); }
  /* the band: paper, fading at its foot, under the print (z 3) and the links (in the panel, z 4), over the right column */
  .headband { position: fixed; left: 0; right: 0; top: 0; height: var(--head); z-index: 2; pointer-events: none;
              background: linear-gradient(var(--paper) calc(100% - 16px), color-mix(in srgb, var(--paper) 0%, transparent)); }
  .stage.mc-ink .top nav { display: none; }   /* the cursor's red copy of the panel's type (micro.js) leaves the links alone */
}

/* a case page on desktop (data-layout="top", his call 2026-10-14): the panel is a band across the top of the page, from the
   window's top edge like the homepage's panel, that scrolls away under the pinned header; the story gets the page below it */
@media (min-width: 861px) {
  .layout:has(> .stage[data-layout="top"]) { display: block; }
  body:has(.stage[data-layout="top"]) canvas.flood { position: absolute; }
  body:has(.stage[data-layout="top"]) .headband { display: none; }   /* the header brings its own paper once the band has gone */
  .stage[data-layout="top"] { position: relative; height: auto; overflow: visible; padding-top: var(--head);
                              grid-template-rows: auto auto; padding-bottom: clamp(36px, 6vh, 64px); }
  /* the header stays pinned, as on every page (his call 2026-10-14). Over the band: no paper, the name in paper on the blue and
     the links on their tags over the photo; once the band has gone under it, its paper band fades in (panel.js: .docked) */
  .stage[data-layout="top"] > .top { position: fixed; left: 0; right: 0; top: 0; height: var(--head); padding: var(--head-y) var(--gutR, 40px) 16px; color: var(--paper); transition: color .2s; }
  .stage[data-layout="top"] > .top::before { content: ''; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .2s; pointer-events: none;
                                             background: linear-gradient(var(--paper) calc(100% - 16px), color-mix(in srgb, var(--paper) 0%, transparent)); }
  .stage[data-layout="top"] > .top nav { position: static; }
  .stage[data-layout="top"].docked > .top { color: var(--ink); }
  .stage[data-layout="top"].docked > .top::before { opacity: 1; }
  .stage[data-layout="top"] #art { height: clamp(96px, 16vh, 180px); }
  .stage[data-layout="top"] .ctx { padding: 0 var(--gutR, 40px); }
  .stage[data-layout="top"] .ctx dl.rows { grid-auto-flow: column; grid-template-rows: auto auto; grid-template-columns: none; justify-content: start; align-items: start; gap: 7px clamp(28px, 4vw, 64px); }
  .stage[data-layout="top"] .foot { display: none; }
  /* the project's photo in its real colours, the band's full height on its right side: dithered in the print's 2px cells,
     the dots windows onto the photo and the band's blue between them, its edges dissolving in grain (panel.js) */
  .stage[data-layout="top"] .band-photo { display: block; position: absolute; top: 0; bottom: 0; right: 0; width: 52%; pointer-events: none; }   /* the dither cover-crops it */
  .stage[data-layout="top"] .band-photo canvas { image-rendering: pixelated; }
  .stage[data-layout="top"] .band-photo img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; }   /* the dither's source, hidden */
  .stage[data-layout="top"]:has(.band-photo) .ctx { padding-right: calc(52% + 16px); }
}
.band-photo { display: none; }

/* the context: a kick row, the title, the facts */
.ctx { padding: 22px var(--gut) 0; }
.ctx > * { transition: opacity .2s ease, transform .4s cubic-bezier(.2,.7,.2,1); }
.ctx.out > * { opacity: 0; transform: translateY(8px); }
.ctx .c2 { transition-delay: .04s; } .ctx .c3 { transition-delay: .08s; } .ctx .c4 { transition-delay: .12s; }
.ctx .kick { display: flex; justify-content: space-between; margin-bottom: 10px; }
.ctx .kick > span { opacity: .7; transition: opacity .16s ease; }   /* the text, not the marks: the current one stays full accent */
.ctx .kick > span.swap { opacity: 0; }
.ctx.out.keep > .kick { opacity: 1; transform: none; }   /* project to project the progress row doesn't blink, it animates */
.ctx h1 { font-weight: 600; font-size: var(--fs-display); line-height: var(--lh-display); letter-spacing: var(--ls-display); }
/* the facts as a spec row: label above value, side by side under a hairline */
.ctx dl { display: grid; grid-auto-flow: column; grid-template-rows: auto auto; justify-content: start;
          gap: 7px clamp(22px, 2.6vw, 44px); margin-top: 22px; padding-top: 16px; border-top: 1px solid color-mix(in srgb, var(--paper) 22%, transparent); }
.ctx dt { opacity: .55; }
.ctx dd { font-family: var(--body); text-transform: none; letter-spacing: -.01em; font-weight: 500; font-size: var(--fs-body); line-height: 1.25; }
/* more facts than fit a row (a case page): label beside value, one per line */
.ctx dl.rows { grid-auto-flow: row; grid-template-rows: none; grid-template-columns: auto 1fr; align-items: baseline; gap: 10px clamp(22px, 2.6vw, 44px); }
.ctx dl.rows dd { max-width: 34ch; }
.ctx p { display: none; }

/* the footer: one mark per section, the current one long and in the accent; where you are; the next one */
.foot { display: flex; justify-content: space-between; gap: 14px; margin: 20px var(--gut) 0; padding: 12px 0 20px;
        border-top: 1px solid color-mix(in srgb, var(--paper) 25%, transparent); }
.foot .step-name { margin-right: auto; }
.steps { display: flex; gap: 6px; align-items: center; }
.steps button { width: 9px; height: 9px; padding: 0; border: 0; background: var(--paper); opacity: .32; cursor: pointer;
                transition: width .45s cubic-bezier(.2,.7,.2,1), opacity .2s, background-color .3s; }
.steps button:hover { opacity: .75; }
.steps button.on { width: 30px; background: var(--accent); opacity: 1; }
.step-name { opacity: .6; }
.step-next { font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; opacity: .85; }
.step-next:hover { opacity: 1; text-decoration: underline; text-underline-offset: 3px; }

/* phone. The homepage (data-phone="overlay") lays the panel over a full-screen print in its own CSS; elsewhere the
   panel is the page's first block, the print drawn on the page over it (canvas.flood.block) and scrolling away with it */
@media (max-width: 860px) {
  :root { --gut: 28px; --head-y: 40px; }   /* clear of the print's grain edge; the header row too: its tags and the mark start
                                             32px down (the grain reaches up to 26px in from the print's edge) */
  .top nav a[href$=".pdf"] { margin-right: 0; }   /* the last tag ends on the gutter, not 4px past it into the grain */
  .stage > .top { padding-right: 32px; }
  .top.noname .name span { transform: none; } .top.noname .name { pointer-events: auto; }   /* phone: the letters are always there, no slide-in (his call) */
  .layout { grid-template-columns: minmax(0, 1fr); }
  .top nav { display: flex; gap: clamp(10px, 3.4vw, 16px); }
  .top nav a[data-nav="intro"], .top nav a[data-nav="work"] { display: none; }
  .foot { display: none; }
  .headband { display: none; }
  .stage:not([data-phone="overlay"]) { position: relative; height: auto; overflow: visible; grid-template-rows: auto auto auto; padding-bottom: 40px; }
  .stage:not([data-phone="overlay"]) #art { height: min(42svh, 84vw); }
  .stage[data-layout="top"]:not([data-phone="overlay"]) #art { height: 24px; }   /* a case page: no shape there (his call), so no empty blue for it either */
  canvas.flood.block { position: absolute; }
  .ctx dl.rows { gap: 10px 22px; }
  /* the print's edges, redrawn over the page (overlay only): what scrolls under the pinned row never shows through its grain */
  canvas.edge { position: fixed; left: 0; top: 0; z-index: 3; pointer-events: none; image-rendering: pixelated; }   /* under the pinned row (4), over the page (1) */
  canvas.edge.down { top: auto; bottom: 0; }
}

/* how the page comes in (panel.js), printed in passes. html.pending holds it (set in each page's head) until the font, the
   print's settings and the first view's pictures are in. Then the blue lays down from the top, the red grows in, and the
   type sets in reading order (html.setting, a delay per element); the phone's redrawn edges come with the blue (html.inked),
   the bottom one as the front gets there */
html.pending :is(.stage .ctx > *, .stage .foot, .top .name, .top nav, .band-photo, .layout > main > *, .intro .pin > *, .intro .lead > :not(.pin), .full > .intro > *, .grid .text > *, .grid .tile) { opacity: 0; }   /* the last three: /cases/ */
html.setting :is(.top .name, .top nav, .band-photo, .layout > main > :not(.intro):not([id="work"]), .intro .pin > *, .intro .lead > :not(.pin), .intro > :not(.lead), .full > .intro > .lead, .grid .text > *) {
  animation: set-in .45s cubic-bezier(.2,.7,.2,1) var(--in-d, 0ms) both; }
html.setting :is(.stage .ctx > *, .stage .foot) { animation: fade-in .45s ease var(--in-d, 0ms) both; }   /* the panel's type only fades: the panel clips (the phone's name sits on its bottom edge) */
html.setting #work { animation: fade-in .45s ease both; }   /* the work only fades: it holds fixed and sticky parts */
@keyframes set-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes fade-in { from { opacity: 0; } }
html.pending:not(.inked) canvas.edge, html.pending:not(.inked) .stage::after { opacity: 0; }   /* the phone's top bar band too */
canvas.edge { transition: opacity .15s ease; }
canvas.edge.down { transition-delay: .3s; }
html.pending :is(.full > .intro, .grid li) { border-color: transparent; }   /* /cases/: the rules come in with the type, not before it */
:is(.full > .intro, .grid li) { transition: border-color .45s ease; }
canvas.wipe { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; image-rendering: pixelated; }   /* /cases/: a case's picture prints in under it (panel.js wipe()) */
/* pictures and prototypes still loading when the page comes in: hidden until they land, then a short fade */
.arriving { opacity: 0 !important; }
.landed { transition: opacity .35s ease !important; }
@media (prefers-reduced-motion: reduce) { html.setting * { animation: none !important; } }
