/* ============================================================
   CASE STUDY PAGES — shared shell (matches index.html theme)
============================================================ */
:root{
  --bg:#131313; --paper:#fcfdff; --grey:#b7b7b7; --grey-d:#8a8a8a;
  --grey-dd:#4a4a4a; --spread:#a9a9a9;
  --pad:clamp(1.2rem,4vw,4rem);
  /* header top offset — ONE place, mirrors index.html. .header padding-top, .nav top
     and #ctb top all read from this. Desktop resolves to 2.2rem exactly as before.
     31 Jul round 5: viewport-fit=cover means the page now runs under the Dynamic
     Island, so the safe-area inset is added HERE (env() is 0 everywhere else).
     Keep this value in sync with index.html's --htop. */
  --htop:calc(clamp(1.25rem,4vw,2.2rem) + env(safe-area-inset-top,0px));
  --font-main:'Space Grotesk',sans-serif; --font-mono:'JetBrains Mono',monospace;
}
/* ONE GUTTER on mobile (3 Aug, his call from rendered options): the shell's
   --pad rode 19px at 390 while the pages' story columns sit on
   --spad:clamp(1.4rem,5vw,6rem) = 22px — a visible 3px stagger wherever a
   shell block stacked on a column block (audit finding 3). ≤750px the shell
   adopts the column's clamp, so every left edge on a case page agrees.
   Desktop keeps the original --pad above — do not unify there. */
@media(max-width:750px){
  :root{--pad:clamp(1.4rem,5vw,6rem)}
}
*{margin:0;padding:0;box-sizing:border-box}
html{scrollbar-width:none;background:var(--bg)}
html::-webkit-scrollbar{display:none}
body{background:var(--bg);color:var(--grey);font-family:var(--font-main)}
::selection{background:#131313;color:#fcfdff}
img{max-width:100%;display:block}

/* fixed overlays */
/* film grain DROPPED sitewide (31 Jul, Akshay's call). Canvas elements stay
   in the case pages' HTML, hidden; the drawing IIFE was removed from case.js. */
#grain{display:none}
.scrollbar{position:fixed;top:0;right:0;width:6px;height:100vh;z-index:90;pointer-events:none}
.scrollbar__handle{width:100%;height:44px;background:var(--paper);opacity:.85}

/* ---------- header (identical on every page — same shell as home) ---------- */
.header{position:fixed;top:0;left:0;width:100%;z-index:80;
  display:flex;align-items:flex-start;justify-content:space-between;
  padding:var(--htop) var(--pad);mix-blend-mode:difference}
.brand{display:flex;align-items:center;-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}
.brand canvas{width:41px;height:41px;display:block}
.nav{position:absolute;left:50%;top:var(--htop);transform:translateX(-50%)}
.nav ul{display:flex;flex-direction:column;align-items:center;list-style:none}
.nav a{display:flex;align-items:center;font-size:1.28rem;letter-spacing:.02em;
  text-transform:uppercase;color:#a9a9a9;text-decoration:none;transition:color .3s,font-size .35s}
.nav a:hover{color:var(--paper)}
.nav a.is-active{text-decoration:underline;text-underline-offset:.18em}
/* words dissolve into a dot-stack on scroll-down; reassemble on hover / scroll-up */
.nav-txt{display:inline-block;white-space:nowrap;overflow:hidden;max-width:12em;
  transition:opacity .35s,transform .35s,max-width .35s}
.nav-dot{width:0;height:5px;border-radius:50%;background:var(--grey);flex:none;
  opacity:0;transform:scale(0);transition:opacity .35s,transform .35s,width .35s}
.nav li:nth-child(2) .nav-dot,.nav li:nth-child(2) .nav-txt{transition-delay:.05s}
.nav li:nth-child(3) .nav-dot,.nav li:nth-child(3) .nav-txt{transition-delay:.1s}
.header.is-mini:not(:hover) .nav-txt{max-width:0;opacity:0;transform:translateX(.45em)}
.header.is-mini:not(:hover) .nav a{font-size:.55rem}
.header.is-mini:not(:hover) .nav-dot{width:5px;opacity:1;transform:scale(1);
  background:#d7d7d7;animation:dotBreathe 2.4s ease-in-out infinite}
.header.is-mini:not(:hover) .nav li:nth-child(2) .nav-dot{animation-delay:.4s}
.header.is-mini:not(:hover) .nav li:nth-child(3) .nav-dot{animation-delay:.8s}
@keyframes dotBreathe{0%,100%{opacity:.5}50%{opacity:1}}
/* mobile: the whole header slides away on scroll-down, returns on scroll-up (JS adds is-hidden ≤750px) */
.header{transition:transform .4s ease}
.header.is-hidden{transform:translateY(-120%)}
#ctb{transition:opacity .4s ease,transform .4s ease}
#ctb.is-hidden{transform:translateY(-220%)}

/* ---------- hero ---------- */
.cs-hero{min-height:88vh;display:flex;flex-direction:column;justify-content:flex-end;
  padding:16vh var(--pad) 7vh;position:relative;isolation:isolate;
  /* owns its dark bg (31 Jul): the hero used to sit bare on body, which was
     fine while body was constantly dark — but body now flips grey when the
     light sheet crosses the viewport centre, and around that seam the bare
     hero visibly sat on grey mid-scroll (his 11:35 video, page end). Every
     section paints its own colour; body is only the canvas. Static element,
     so this does NOT feed the iOS bar sampler (fixed/sticky only). */
  background:var(--bg)}
/* hero mesh grid — canvas injected by case.js; warps toward the cursor on desktop */
.cs-hero-grid{position:absolute;inset:0;width:100%;height:100%;z-index:0;pointer-events:none}
.cs-hero>.cs-kicker,.cs-hero>h1,.cs-hero>.cs-lede,.cs-hero>.cs-org,.cs-hero>.cs-meta,
.cs-hero>.num-nav{position:relative;z-index:2}
.cs-hero>.cs-rule{z-index:2}
.cs-kicker{font-family:var(--font-mono);font-size:.72rem;letter-spacing:.12em;
  color:var(--grey-d);text-transform:uppercase}
.cs-hero h1{font-size:clamp(3rem,9.4vw,10rem);font-weight:700;text-transform:uppercase;
  line-height:.92;color:#d7d7d7;margin:.18em 0 .22em;letter-spacing:-.01em}
.cs-hero h1 em{font-style:normal;color:#656565}
.cs-lede{font-size:clamp(1.05rem,1.6vw,1.4rem);max-width:36ch;line-height:1.45;color:#9a9a9a}
/* hub-level credit: the org shape stated once, so the per-chapter readouts stay
   specific to their own collaborators. Sentence register, not a tag — no uppercase
   (rule 4) and a step brighter than .cs-meta so it never reads as another chip row. */
.cs-org{font-family:var(--font-mono);font-size:.68rem;letter-spacing:.08em;line-height:1.8;
  color:#a9a9a9;max-width:60ch;margin-top:1.5rem}
.nb{white-space:nowrap}   /* multi-word tokens stay whole; readouts break BETWEEN items, never inside one */
@media(max-width:750px){.cs-org{font-size:.62rem;margin-top:1.2rem;max-width:44ch}}
/* metadata = passive labels, NOT chips — must never look like controls */
.cs-meta{display:flex;gap:0;flex-wrap:wrap;margin-top:2.2rem;
  font-family:var(--font-mono);font-size:.66rem;letter-spacing:.12em;
  text-transform:uppercase;color:#8a8a8a}
.cs-meta span+span::before{content:"·";margin:0 .9em;color:#4a4a4a}  /* decorative separator on the DARK hero — stays #4a4a4a */
.cs-rule{display:none}

/* ---------- body: grey spread ---------- */
.cs-body{background:var(--spread);color:#131313;padding:2vh 0 4vh;border-radius:22px 22px 0 0}
.cs-block{padding:10vh var(--pad) 6vh;display:grid;grid-template-columns:1fr 1.4fr;gap:4vw}
@media(max-width:900px){.cs-block{grid-template-columns:1fr}}
.cs-block+.cs-block{border-top:1px solid rgba(19,19,19,.28)}
.cs-ch{font-family:var(--font-mono);font-size:.68rem;letter-spacing:.14em;color:#3a3a3a;
  text-transform:uppercase}
/* sentence case by house rule 4 — uppercase is reserved for mono micro-labels */
.cs-block h2{font-size:clamp(1.6rem,3vw,2.6rem);font-weight:700;
  line-height:1.04;letter-spacing:-.012em;margin-top:.5em}
.cs-block .cs-text p{font-size:clamp(1rem,1.35vw,1.2rem);line-height:1.6;color:#2e2e2e;
  max-width:58ch}
.cs-block .cs-text p+p{margin-top:1.2em}

/* ---------- image plates (specimen style) ---------- */
.cs-plates{padding:4vh var(--pad) 10vh;display:grid;grid-template-columns:1fr 1fr;gap:3vw}
.cs-plates .wide{grid-column:1/-1}
@media(max-width:900px){.cs-plates{grid-template-columns:1fr}}
.plate{
  position:relative;background:#b4b4b4;aspect-ratio:16/10;
  background-image:
    linear-gradient(rgba(19,19,19,.10) 1px,transparent 1px),
    linear-gradient(90deg,rgba(19,19,19,.10) 1px,transparent 1px);
  background-size:28px 28px;
  border:1px solid rgba(19,19,19,.5);
  display:flex;align-items:center;justify-content:center;
}
.plate.wide{aspect-ratio:21/9}
.plate>img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.plate .fig{position:absolute;left:1rem;bottom:.8rem;font-family:var(--font-mono);
  font-size:.62rem;letter-spacing:.12em;text-transform:uppercase;color:#131313;opacity:.75}
.plate .empty{font-family:var(--font-mono);font-size:.68rem;letter-spacing:.12em;
  text-transform:uppercase;color:#3a3a3a}
.plate i{position:absolute;width:15px;height:15px;pointer-events:none}
.plate i::before,.plate i::after{content:"";position:absolute;background:#131313}
.plate i::before{left:7px;top:0;width:1px;height:15px}
.plate i::after{top:7px;left:0;height:1px;width:15px}
.plate i.tl{top:-8px;left:-8px}.plate i.tr{top:-8px;right:-8px}
.plate i.bl{bottom:-8px;left:-8px}.plate i.br{bottom:-8px;right:-8px}

/* ---------- credit readout — what the designer actually owned ----------
   Hiring managers look for role/team before they read a word of the story, so it
   gets its own rule and its own air, directly under each chapter lede. Mono
   register throughout: labels in the on-spread ink #3a3a3a (see the contrast law
   in CLAUDE.md), values at full ink. Field names are per-instance — a chapter with
   a real date range says TIMELINE, one without says SCOPE rather than inventing one. */
.credit{display:flex;flex-wrap:wrap;gap:1.9rem 3.6rem;margin-top:3rem;padding-top:1.7rem;
  border-top:1px solid rgba(19,19,19,.28)}
.credit>div{min-width:0}
.credit dt{font-family:var(--font-mono);font-size:.62rem;letter-spacing:.18em;
  text-transform:uppercase;color:#3a3a3a;line-height:1.9}
.credit dd{font-family:var(--font-mono);font-size:.78rem;letter-spacing:.01em;
  line-height:1.5;color:#131313;max-width:26ch;margin-top:.25em}
@media(max-width:750px){
  .credit{gap:1.35rem 2.4rem;margin-top:2.4rem;padding-top:1.3rem}
  .credit dd{font-size:.72rem;max-width:30ch}
}

/* ---------- context block: the gallery pages' one paragraph of prose ----------
   Krispy Kreme / Churchill are pure dark galleries with no paper sheet, so the
   credit readout gets a dark variant rather than dragging a light band in between
   the ring and the footer. Prose first, credit under it — same order as a case chapter.
   Placed AFTER the ring (Akshay, 24 Jul): the work lands first, the context closes. */
.cs-context{padding:7vh var(--pad)}
.cs-context-body{font-size:clamp(1rem,1.3vw,1.15rem);line-height:1.65;color:#b7b7b7;max-width:62ch}
.credit--dark{border-top-color:rgba(215,215,215,.18)}
.credit--dark dt{color:#8a8a8a}
.credit--dark dd{color:#d7d7d7}
@media(max-width:750px){.cs-context{padding:6vh var(--pad)}}

/* ---------- next-projects footer ---------- */
.cs-next{background:var(--bg);color:var(--grey);padding:8vh var(--pad) 9vh;
  position:relative;overflow:hidden}
.cs-next-label{font-family:var(--font-mono);font-size:.62rem;letter-spacing:.18em;
  text-transform:uppercase;color:var(--grey-d);margin-bottom:3vh}
.cs-next-grid{display:grid;grid-template-columns:1fr 1fr;gap:0}
.cs-next-card.cs-next-card--m{display:none}  /* third card rides only in the mobile stack */
.cs-next-card{position:relative;display:flex;flex-direction:column;
  text-decoration:none;color:inherit;padding:.4vh 4vw .4vh 0}
.cs-next-card+.cs-next-card{padding:.4vh 0 .4vh 4vw;
  border-left:1px solid rgba(215,215,215,.16)}
.cs-next-card strong{display:block;font-size:clamp(1.5rem,3.4vw,3rem);font-weight:700;
  text-transform:uppercase;line-height:1;color:#d7d7d7;margin:0 0 .55em;
  transition:transform .5s cubic-bezier(.2,.8,.2,1)}
.cs-next-card strong em{font-style:normal;color:#656565}
.cs-next-foot{margin-top:auto}
.cs-next-meta{font-family:var(--font-mono);font-size:.62rem;letter-spacing:.12em;
  text-transform:uppercase;color:var(--grey-d)}
.cs-next-card:hover strong{transform:translateX(.8vw)}
@media(max-width:750px){
  .cs-next-grid{grid-template-columns:1fr}
  .cs-next-card,.cs-next-card+.cs-next-card{padding:3vh 0;border-left:0}
  .cs-next-card.cs-next-card--m{display:flex}
  .cs-next-card+.cs-next-card{border-top:1px solid rgba(215,215,215,.16)}
}

/* ---------- contact button: dot-matrix envelope, sibling of the brand mark ----------
   OUTSIDE .header on purpose — the header carries mix-blend-mode:difference, which
   would invert this against the grey body section. Same 41px footprint as the mark. */
/* 44px, not the mark's 41: an envelope is a landscape shape, so at an identical
   box it reads smaller than the square dot grid. The extra 7% evens the optical
   weight. top is nudged 1.5px so the two marks share a centre line, not a top edge. */
/* SAME rendering path as the brand mark — .header's mix-blend-mode:difference is the
   only reason the mark reads on the dark hero AND on the light story card. This button
   is outside the header, so it carries its own. Ground-agnostic by construction. */
#ctb{position:fixed;top:calc(var(--htop) - 1.5px);right:var(--pad);width:44px;height:44px;z-index:85;
  background:none;border:0;padding:0;cursor:pointer;display:block;mix-blend-mode:difference}
#ctb canvas{width:100%;height:100%;display:block}
/* comfort margin on the tap target — the button itself already clears iOS's 44px */
#ctb::after{content:"";position:absolute;inset:-4px}
#ctb:focus-visible{outline:1px solid rgba(255,201,29,.65);outline-offset:6px}

/* ---------- reveals ---------- */
.rv{opacity:0;transform:translateY(28px);transition:opacity .8s ease,transform .8s cubic-bezier(.2,.8,.2,1)}
.rv.on{opacity:1;transform:none}
@media (prefers-reduced-motion:reduce){.rv{opacity:1;transform:none;transition:none}}

/* ================= FOOTER: the drive out (shared with home) ================= */
.footer{position:relative;background:var(--bg);padding-bottom:env(safe-area-inset-bottom,0px)}
.goplane{position:relative;height:100vh;overflow:hidden}
#grid-gl{position:absolute;inset:0;width:100%;height:100%}
#goBtn{position:absolute;left:50%;top:50%;z-index:3;
  width:96px;height:96px;border-radius:50%;border:0;cursor:pointer;
  /* button and disc are both the grey spread (29 Jul) — they are one object
     mid-transition. #131313 on #a9a9a9 is 7.9:1, clear of AA. */
  background:#a9a9a9;color:#131313;font-family:var(--font-main);
  font-weight:700;font-size:1.5rem;letter-spacing:.02em;
  transform:translate(calc(-50% + var(--mx,0px)),calc(-50% + var(--my,0px))) scale(var(--gs,1));
  transition:transform .25s ease-out,opacity .3s}
#goBtn:hover{--gs:1.12}
.goplane.open #goBtn{opacity:0;pointer-events:none;--gs:.4}
.disc{position:absolute;left:50%;top:50%;z-index:2;
  width:min(74vh,88vw);aspect-ratio:1;border-radius:50%;
  /* matches #goBtn — the button scales down as the disc scales up, so two
     different greys read as a mismatch mid-transition, not as a reveal. */
  background:#a9a9a9;
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2rem;
  transform:translate(-50%,-50%) scale(0);
  transition:transform .85s cubic-bezier(.3,1.35,.35,1)}
.goplane.open .disc{transform:translate(-50%,-50%) scale(1)}
.disc-words{text-align:center;font-weight:700;text-transform:uppercase;
  color:#131313;font-size:clamp(2.4rem,7vh,4.4rem);line-height:.96}
.disc-words span{display:block;overflow:hidden}
.disc-words span{transform:translateY(130%);transition:transform .6s cubic-bezier(.2,.9,.2,1)}
.goplane.open .disc-words span{transform:none}
.goplane.open .disc-words span:nth-child(2){transition-delay:.12s}
.goplane.open .disc-words span:nth-child(3){transition-delay:.24s}
.disc-mail{font-family:var(--font-mono);font-size:.78rem;letter-spacing:.1em;
  text-transform:uppercase;color:#131313;text-decoration:none;
  border-bottom:1px solid rgba(19,19,19,.5);padding-bottom:.3em;
  opacity:0;transition:opacity .5s .45s}
.goplane.open .disc-mail{opacity:1}
.disc-mail:hover{border-color:#131313}
.foot-bar{display:flex;align-items:center;justify-content:space-between;gap:2rem;
  padding:1.6rem var(--pad);border-top:1px solid #2a2a2a;
  font-family:var(--font-mono);font-size:.66rem;letter-spacing:.1em;
  text-transform:uppercase;color:var(--grey-d)}
.foot-links{display:inline-flex;gap:1.7rem;align-items:center}
/* links are actions, the colophon is not: two tones apart so they never read as one line */
.foot-link{position:relative;color:#d7d7d7;text-decoration:none;transition:color .3s;padding-right:1em}
.foot-bar>span:last-child{color:#8a8a8a}
.foot-link .ft{display:inline-block}
.foot-link::after{content:"";position:absolute;right:.15em;top:50%;transform:translateY(-50%);
  width:.42em;height:1.05em;background:#fcfdff;opacity:0;transition:opacity .18s}
.foot-link:hover{color:var(--paper)}
.foot-link:hover::after,.foot-link:focus-visible::after{opacity:1;animation:ftcaret .85s steps(1) infinite}
@keyframes ftcaret{0%,50%{opacity:1}51%,100%{opacity:0}}
@media screen and (max-width:750px){
  #goBtn{width:84px;height:84px;font-size:1.3rem}
  .disc-mail{font-size:.66rem}
  .foot-bar{flex-direction:column;gap:1.6rem;text-align:center;padding:2rem var(--pad) 1.7rem}
  /* TAP TARGETS (3 Aug, audit finding 1) — mirrors index.html. Padding +
     equal negative margin = zero visual / zero layout shift. Mobile only. */
  .foot-link{padding-top:16px;padding-bottom:16px;margin-top:-16px;margin-bottom:-16px}  /* 14 → 46 */
  .brand{padding:6px;margin:-6px}  /* 41 → 53 */
  /* the GO plane centers its dot patch — dropping the next-section's bottom
     padding makes the space above the dots equal the space below them */
  .cs-next{padding-bottom:0}
}

/* ---------- contact modal (opened by nav Contact; injected by case.js) ---------- */
/* ⚠️ Scrim colour lives on .open, NOT here — mirrors index.html. iOS 26 Safari
   tints its toolbars by sampling the background-color of FIXED elements near
   the viewport edges and ignores opacity:0, so a closed full-viewport modal
   with a near-black background hijacked the chrome on every screen. Transparent
   when closed is invisible on-page and takes it out of the sampler. */
.cmodal{position:fixed;inset:0;z-index:3400;background:transparent;display:flex;
  align-items:center;justify-content:center;padding:6vh var(--pad);
  opacity:0;pointer-events:none;transition:opacity .35s ease,background .35s ease}
.cmodal.open{opacity:1;pointer-events:auto;background:rgba(9,9,9,.94)}
.cmodal-panel{width:min(560px,100%);background:var(--bg);border:1px solid rgba(169,169,169,.22);
  padding:clamp(2rem,4vw,3.2rem);position:relative;
  transform:translateY(14px);transition:transform .35s ease}
.cmodal.open .cmodal-panel{transform:none}
.cmodal-kicker{font-family:var(--font-mono);font-size:.62rem;letter-spacing:.22em;
  text-transform:uppercase;color:var(--grey-d)}
.cmodal-title{font-size:clamp(1.7rem,3.4vw,2.4rem);font-weight:700;color:#d7d7d7;
  line-height:1.05;margin:.55em 0 1.35em;letter-spacing:-.01em}
.cmodal-x{position:absolute;top:clamp(2rem,4vw,3.2rem);right:clamp(2rem,4vw,3.2rem);
  background:none;border:0;cursor:pointer;padding:0 1em 0 0;
  font-family:var(--font-mono);font-size:.66rem;letter-spacing:.14em;text-transform:uppercase;
  color:var(--grey-d);transition:color .3s}
.cmodal-x .ft{display:inline-block}
.cmodal-x::after{content:"";position:absolute;right:.15em;top:50%;transform:translateY(-50%);
  width:.42em;height:1.05em;background:#fcfdff;opacity:0;transition:opacity .18s}
.cmodal-x:hover{color:var(--paper)}
.cmodal-x:hover::after,.cmodal-x:focus-visible::after{opacity:1;animation:ftcaret .85s steps(1) infinite}
.cmodal-act{display:flex;align-items:center;justify-content:space-between;gap:1rem;
  text-decoration:none;border-top:1px solid rgba(169,169,169,.16);padding:1.15rem .1rem}
.cmodal-act:last-of-type{border-bottom:1px solid rgba(169,169,169,.16)}
.cmodal-act strong{display:block;font-family:var(--font-main);font-weight:500;font-size:1.06rem;
  color:#d7d7d7;transition:color .25s}
.cmodal-act em{display:block;font-style:normal;font-family:var(--font-mono);font-size:.62rem;
  letter-spacing:.14em;color:var(--grey-d);margin-top:.3rem;text-transform:uppercase}
.cmodal-arrow{color:var(--grey-d);font-size:1.1rem;transition:color .25s,transform .25s}
.cmodal-act:hover strong{color:var(--paper)}
.cmodal-act:hover .cmodal-arrow{color:#ffc91d;transform:translateX(4px)}
.cmodal-panel:focus{outline:none}
.cmodal-act:focus,.cmodal-x:focus{outline:none}
.cmodal-act:focus-visible,.cmodal-x:focus-visible{outline:1px solid rgba(255,201,29,.65);outline-offset:4px}
@media(max-width:750px){
  .cmodal{align-items:flex-end;padding:0}
  .cmodal-panel{width:100%;border-left:0;border-right:0;border-bottom:0;padding:2.2rem 6vw 3.2rem}
  /* TAP TARGET (3 Aug): 14 → 44 tall — mirrors index.html (anchored
     top+right; margin-top compensates padding-top; zero visual shift). */
  .cmodal-x{top:2.2rem;right:6vw;padding:16px 1em 16px 16px;margin-top:-16px}
}


