/* ---- tokens ---- */
:root{
  --bg:#f2f2f2;
  --fg:#111111;
  --muted:rgba(17,17,17,.55);
  --line:rgba(17,17,17,.15);
  --accent:#ff1f6b;
  --stroke:var(--fg);
  --ease:cubic-bezier(.16,1,.3,1);
}
body.mode-night{ --bg:#0a0a0a; --fg:#f2f2f2; --muted:rgba(242,242,242,.55); --line:rgba(242,242,242,.18); --stroke:var(--fg); }
body.mode-ultra{ --bg:#c21e56; --fg:#f7eef1; --muted:rgba(247,238,241,.68); --line:rgba(247,238,241,.26); --stroke:#f7eef1; }

*,*::before,*::after{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }
body{
  margin:0; background:var(--bg); color:var(--fg);
  font-family:"Inter",system-ui,sans-serif; font-size:16px; line-height:1.5;
  -webkit-font-smoothing:antialiased; overflow-x:hidden;
  transition:background .6s var(--ease), color .6s var(--ease);
}
a{ color:inherit; text-decoration:none; }

/* ---- giant display type ---- */
.giant{
  font-family:"Archivo Expanded","Archivo",sans-serif;
  font-weight:900; text-transform:uppercase; letter-spacing:.01em;
  line-height:.88; margin:0;
}
.outline{
  color:transparent;
  -webkit-text-stroke:2px var(--stroke);
  text-stroke:2px var(--stroke);
  transition:color .4s var(--ease);
}
/* fill outlined type on hover where it's a link */
a.giant.outline:hover{ color:var(--stroke); }

/* ---- fixed chrome ---- */
.ui{ position:fixed; inset:0 0 auto 0; z-index:10; display:flex; align-items:center;
     justify-content:space-between; padding:22px clamp(20px,5vw,60px); pointer-events:none; }
.ui::before{ content:""; position:fixed; top:0; left:0; right:0; height:96px; z-index:-1; pointer-events:none;
  background:linear-gradient(color-mix(in srgb,var(--bg) 68%, transparent), transparent); }
.ui > *{ pointer-events:auto; }
.logo{ font-family:"Archivo Expanded","Archivo",sans-serif; font-weight:900; text-transform:uppercase;
       font-size:15px; line-height:.9; letter-spacing:.02em; display:flex; gap:.4em; }
.nav ul{ display:flex; gap:26px; margin:0; padding:0; list-style:none; }
.nav a{ font-size:12px; letter-spacing:.04em; opacity:.8; transition:opacity .3s; }
.nav a:hover{ opacity:1; }
.num{ font-size:10px; opacity:.5; margin-right:2px; }

/* mode toggle */
.modeToggle{ display:flex; gap:8px; align-items:center; }
.modeToggle button{ width:14px; height:14px; border-radius:50%; border:1.5px solid var(--fg);
  background:transparent; cursor:pointer; padding:0; transition:transform .3s var(--ease), background .3s; }
.modeToggle button[data-mode="light"]{ background:#f2f2f2; border-color:rgba(0,0,0,.3); }
.modeToggle button[data-mode="night"]{ background:#0a0a0a; }
.modeToggle button[data-mode="ultra"]{ background:#c21e56; }
.modeToggle button:hover{ transform:scale(1.25); }

/* ---- hero ---- */
.hero{ min-height:100vh; min-height:100dvh; display:flex; flex-direction:column; justify-content:center;
       padding:0 clamp(20px,5vw,60px); }
.kicker{ font-size:13px; letter-spacing:.14em; text-transform:uppercase; color:var(--muted); margin:0 0 24px; }
.hero .giant{ font-size:clamp(60px,15vw,240px); }
.hero .giant span span{ display:block; }
/* per-letter hover ripple on hero titles */
.hero .giant .ltr{ display:inline-block; transition:color .35s var(--ease), transform .35s var(--ease); }
.hero .giant:hover .ltr{ color:var(--accent); transform:translateY(-.07em); }
/* on the raspberry theme, fill with a light pink (pops on raspberry, keeps the pink identity) */
body.mode-ultra .hero .giant:hover .ltr{ color:#ff3d88; }
.tagline{ max-width:620px; margin:34px 0 0; font-size:clamp(16px,2vw,20px); color:var(--fg); opacity:.85; }
.scrollHint{ margin-top:56px; font-size:12px; letter-spacing:.14em; text-transform:uppercase; color:var(--muted); }
.scrollHint span{ display:inline-block; animation:bob 1.8s var(--ease) infinite; }
@keyframes bob{ 0%,100%{ transform:translateY(0);} 50%{ transform:translateY(5px);} }

/* ---- sections ---- */
.section{ padding:clamp(80px,14vh,180px) clamp(20px,5vw,60px); border-top:1px solid var(--line); }
.sectionHead{ display:flex; align-items:baseline; gap:16px; margin-bottom:48px; }
.sectionHead .num{ font-size:14px; opacity:.5; }
.sectionHead .giant{ font-size:clamp(44px,9vw,140px); }

.prose{ max-width:760px; }
.prose .lead{ font-size:clamp(22px,3vw,34px); line-height:1.25; margin:0 0 28px; }
.prose p{ color:var(--muted); font-size:18px; margin:0 0 18px; }

/* experience timeline */
.timeline{ list-style:none; margin:0; padding:0; max-width:900px; }
.timeline li{ padding:28px 0; border-top:1px solid var(--line); }
.timeline li:first-child{ border-top:0; }
.tHead{ display:flex; justify-content:space-between; align-items:baseline; gap:20px; flex-wrap:wrap; margin-bottom:10px; }
.tHead h3{ font-size:26px; margin:0; font-weight:600; }
.tMeta{ font-size:13px; letter-spacing:.03em; color:var(--muted); }
.timeline p{ color:var(--muted); max-width:680px; margin:0; }

/* projects — 3D angled stage */
.stage{ perspective:1500px; perspective-origin:100% 50%; }
.projects{ list-style:none; margin:0; padding:0; transform-style:preserve-3d; }
/* the ROW is a flat, full-width hover target (never transformed) */
.projectRow{ padding:clamp(16px,2.4vw,30px) 0; border-top:1px solid var(--line); }
/* the INNER wrapper carries all the 3D motion (visual only) */
.projectInner{ display:flex; flex-direction:column; gap:8px; transform-style:preserve-3d;
  transform-origin:right center; transform:rotateY(-30deg) translateZ(-50px);
  opacity:.5; transition:transform .8s var(--ease), opacity .45s var(--ease), filter .45s var(--ease);
  will-change:transform; }
.projectRow.in .projectInner{ transform:rotateY(-22deg) translateZ(0); opacity:1; }
.projectRow:hover .projectInner{ transform:rotateY(0deg) translateZ(80px); opacity:1; }
/* DR trial spotlight: focusing one project sends the others into shadow */
.projects:hover .projectInner{ opacity:.28; filter:blur(2px) brightness(.6); }
.projects:hover .projectRow:hover .projectInner{ opacity:1; filter:none; }
/* lift the projects above the spotlight + rings so their text is never covered by the rings */
body.trial .stage{ position:relative; z-index:60; }
/* during a page transition, freeze the spotlight/project states so nothing fade-reverts under the blob */
body.navigating .projectInner,
body.navigating .spotlight,
body.navigating .spotRing{ transition:none !important; }

/* dramatic full-screen spotlight: desaturate + darken the edges in a ring, clear colorful center */
.spotlight{ position:fixed; inset:0; z-index:50; pointer-events:none; opacity:0;
  transition:opacity .28s var(--ease);
  -webkit-backdrop-filter:grayscale(1) brightness(.52);
  backdrop-filter:grayscale(1) brightness(.52);
  -webkit-mask-image:radial-gradient(circle 54vmax at var(--sx,50%) var(--sy,50%), transparent 50%, #000 80%);
  mask-image:radial-gradient(circle 54vmax at var(--sx,50%) var(--sy,50%), transparent 50%, #000 80%); }
body.trial .spotlight{ opacity:1; }
/* two white spinning rings, out in the dark, counter-rotating */
.spotRing{ position:fixed; left:var(--sx,50%); top:var(--sy,50%); border-radius:50%;
  border-style:dashed; border-color:var(--accent); opacity:0; z-index:51; pointer-events:none;
  transform:translate(-50%,-50%); transition:opacity .28s var(--ease); }
.r-thick{ width:82vmax; height:82vmax; border-width:4px; }
.r-thin{ width:66vmax; height:66vmax; border-width:1.5px; border-color:color-mix(in srgb,var(--accent) 55%, transparent); }
body.trial .spotRing{ opacity:1; }
body.trial .r-thick{ animation:spinCentered 13s linear infinite; }
body.trial .r-thin{ animation:spinCounter 9s linear infinite; }
@keyframes spinCentered{ from{ transform:translate(-50%,-50%) rotate(0); } to{ transform:translate(-50%,-50%) rotate(360deg); } }
@keyframes spinCounter{ from{ transform:translate(-50%,-50%) rotate(0); } to{ transform:translate(-50%,-50%) rotate(-360deg); } }
@media (hover:none),(pointer:coarse){ .spotlight,.spotRing{ display:none; } }
/* project transition: a theme-filled circle with a contrasting edge scales up from the click (GPU transform = smooth) */
.projCover{ position:fixed; top:50%; left:50%; z-index:200; width:200px; height:200px; border-radius:50%;
  background:var(--bg); border:4px solid var(--stroke); pointer-events:none; will-change:transform;
  transform:translate(-50%,-50%) scale(0); }
body[data-enter="circle"] .pageCurtain{ display:none; }   /* project pages use the circle, not the band */
body[data-enter="circle"] .projCover{ transform:translate(-50%,-50%) scale(42); }   /* cover before JS so the page doesn't flash on arrival */
.projectRow .giant{ font-size:clamp(40px,8vw,120px); }
.pMain{ width:100%; }
/* focused project: center the description under the now-centered title */
.projectRow:hover .pReveal{ text-align:center; }
.projectRow:hover .pDesc{ margin-left:auto; margin-right:auto; }
.pMeta{ font-size:13px; letter-spacing:.03em; color:var(--muted); }

/* project main row: gear + title */
.pMain{ display:flex; align-items:center; }
/* flex spacers glide the title from left to center on hover (flex-grow is animatable) */
.pMain::before,.pMain::after{ content:""; flex:0 0 0; transition:flex-grow .45s var(--ease); }
.pMain::after{ flex-grow:1; }
.projectRow:hover .pMain::before{ flex-grow:1; }
.gear{ flex:0 0 auto; width:clamp(28px,4vw,56px); height:clamp(28px,4vw,56px);
  margin-right:clamp(12px,2vw,28px); display:inline-flex; opacity:.5;
  transition:opacity .4s var(--ease); }
.gear svg{ width:100%; height:100%; fill:var(--accent); transform-origin:50% 50%; }
body.mode-ultra .gear svg{ fill:var(--stroke); }
.projectRow:hover .gear{ opacity:1; }
.projectRow:hover .gear svg{ animation:spin 3.2s linear infinite; }
@keyframes spin{ to{ transform:rotate(360deg); } }

/* expanding detail panel */
.pReveal{ max-height:0; opacity:0; overflow:hidden;
  transition:max-height .55s var(--ease), opacity .45s var(--ease); }
.projectRow:hover .pReveal{ max-height:180px; opacity:1; }
.pDesc{ margin:14px 0 4px; max-width:640px; font-size:clamp(15px,1.6vw,18px); color:var(--fg); opacity:.8; }

/* ---- custom cursor (desktop pointers only) ---- */
.cursor{ position:fixed; top:0; left:0; width:14px; height:14px; border-radius:50%;
  background:var(--stroke); pointer-events:none; z-index:100; mix-blend-mode:difference;
  transform:translate(-50%,-50%); transition:width .25s var(--ease), height .25s var(--ease),
  background .3s; opacity:0; }
.cursor.active{ opacity:1; }
.cursor.hover{ width:52px; height:52px; }
@media (hover:none),(pointer:coarse){ .cursor{ display:none; } }

/* contact */
.contact .mailto{ display:inline-block; font-size:clamp(36px,6vw,84px); margin-bottom:56px; }
.social{ list-style:none; margin:0 0 60px; padding:0; display:flex; gap:40px; flex-wrap:wrap; }
.social a{ font-size:15px; letter-spacing:.03em; opacity:.85; transition:opacity .3s; }
.social a:hover{ opacity:1; }
.copyright{ font-size:12px; color:var(--muted); margin:0; }

/* ---- work: scrolling marquee rows ---- */
.work{ margin:0 calc(clamp(20px,5vw,60px) * -1); }   /* bleed to full width */
.workRow{ display:block; position:relative; padding:clamp(14px,2vw,28px) 0;
  border-top:1px solid var(--line); text-decoration:none; overflow:hidden; }
.workRow:last-child{ border-bottom:1px solid var(--line); }
.workMeta{ display:block; padding:0 clamp(20px,5vw,60px); margin-bottom:2px;
  font-size:13px; letter-spacing:.04em; color:var(--muted); }
.workMeta .num{ margin-right:6px; opacity:.6; }
.marquee{ width:100%; overflow:hidden; padding:.1em 0; background:transparent;
  transition:background .4s var(--ease);
  -webkit-mask-image:linear-gradient(90deg,transparent,#000 6%,#000 94%,transparent);
  mask-image:linear-gradient(90deg,transparent,#000 6%,#000 94%,transparent); }
.marquee__track{ display:inline-flex; align-items:center; white-space:nowrap; will-change:transform; }
/* resting: outlined giant type with pink separators */
.marquee .giant{ font-size:clamp(46px,10vw,150px); line-height:1;
  color:transparent; -webkit-text-stroke:2px var(--stroke); text-stroke:2px var(--stroke);
  transition:color .35s var(--ease), -webkit-text-stroke .35s var(--ease); }
.marquee .sep{ margin:0 .3em; font-size:clamp(18px,3vw,44px); color:var(--accent);
  transition:color .35s var(--ease); }
/* hover: snap into a black-and-white "trial in progress" band (white band on the dark theme) */
.workRow:hover .marquee{ --ink:#f2f2f2; background:#0a0a0a; }
body.mode-night .workRow:hover .marquee{ --ink:#0a0a0a; background:#f2f2f2; }
.workRow:hover .marquee .giant{ color:var(--ink); -webkit-text-stroke:0; text-stroke:0; }
.workRow:hover .marquee .sep{ color:var(--ink); }

/* ---- page transition: trial band expands vertically + hue-shifts to the page color ---- */
.pageCurtain{ position:fixed; inset:0; z-index:200; pointer-events:none;
  transform:scaleY(1); transform-origin:center center; background:var(--bg); will-change:transform,background; }
body.reduced .pageCurtain{ display:none; }
/* work subpages cover with the marquee band color (black on light/ultra, white on night); projects + main use the theme color (base var(--bg)) */
body.subpage:not([data-enter]) .pageCurtain{ background:#0a0a0a; }
body.subpage:not([data-enter]).mode-night .pageCurtain{ background:#f2f2f2; }
.curtainLabel{ position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
  padding:0 5vw; text-align:center; text-transform:uppercase; line-height:.9;
  font-family:"Archivo Expanded","Archivo",sans-serif; font-weight:900; font-size:clamp(48px,12vw,180px);
  color:transparent; -webkit-text-stroke:2px #f2f2f2; text-stroke:2px #f2f2f2; opacity:0; }

/* ---- persistent contact dock ---- */
.contactDock{ position:fixed; left:clamp(20px,5vw,60px); bottom:18px; z-index:15;
  display:flex; gap:18px; font-size:12px; letter-spacing:.04em;
  padding:9px 16px; border-radius:999px; border:1px solid var(--line);
  background:color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter:blur(9px); -webkit-backdrop-filter:blur(9px);
  transition:opacity .4s var(--ease), transform .4s var(--ease); }
.contactDock a{ color:var(--muted); transition:color .3s var(--ease); }
.contactDock a:hover{ color:var(--fg); }
.contactDock.hidden{ opacity:0; transform:translateY(24px); pointer-events:none; }
@media (max-width:720px){ .contactDock{ gap:13px; font-size:11px; bottom:12px; left:14px; padding:7px 13px; } }

/* ---- nav active-section highlight ---- */
.nav a.active{ opacity:1; }
.nav a.active .num{ color:var(--accent); opacity:1; }
body.mode-ultra .nav a.active .num{ color:var(--stroke); }
.nav a.active strong{ text-decoration:underline; text-underline-offset:4px; text-decoration-thickness:1px; }

/* ---- subpage layout ---- */
.subpage main{ padding-top:0; }
.subHero{ min-height:82vh; min-height:82dvh; position:relative; padding-top:clamp(40px,6vh,80px); }
.subHero .giant{ font-size:clamp(52px,13vw,200px); }
.backLink{ font-size:12px; letter-spacing:.06em; text-transform:uppercase; opacity:.8; }
.backLink:hover{ opacity:1; }
.subBlock{ max-width:820px; }
.subBlock .lead{ font-size:clamp(22px,3vw,34px); line-height:1.25; margin:0 0 28px; }
.subBlock p{ color:var(--muted); font-size:18px; margin:0 0 18px; }
.subList{ list-style:none; margin:0; padding:0; }
.subList li{ padding:22px 0; border-top:1px solid var(--line); }
.subList h3{ margin:0 0 8px; font-size:22px; font-weight:600; }
.subList p{ margin:0; color:var(--muted); max-width:680px; }

/* case-study blocks */
.case{ max-width:900px; }
.caseLead{ font-size:clamp(20px,2.6vw,30px); line-height:1.3; margin:0 0 22px; }
.case p{ color:var(--muted); font-size:18px; margin:0 0 18px; max-width:760px; }
.doList{ list-style:none; margin:22px 0 0; padding:0; }
.doList li{ position:relative; padding:10px 0 10px 26px; color:var(--muted); border-top:1px solid var(--line); }
.doList li:before{ content:"▸"; position:absolute; left:0; color:var(--accent); }
body.mode-ultra .doList li:before{ color:var(--stroke); }
.impact{ display:flex; gap:clamp(24px,5vw,64px); flex-wrap:wrap; margin-top:30px;
  padding-top:22px; border-top:2px solid var(--accent); }
body.mode-ultra .impact{ border-top-color:var(--stroke); }
.impact b{ display:block; font-family:"Archivo Expanded","Archivo",sans-serif; font-weight:900;
  font-size:clamp(30px,4.5vw,60px); line-height:1; color:var(--accent); }
body.mode-ultra .impact b{ color:var(--stroke); }
.impact span{ display:block; margin-top:8px; font-size:13px; letter-spacing:.03em; color:var(--muted); max-width:180px; }
.tags{ display:flex; flex-wrap:wrap; gap:10px; margin:0; padding:0; list-style:none; }
.tags li{ font-size:13px; letter-spacing:.02em; padding:7px 14px; border:1px solid var(--line); border-radius:999px; color:var(--muted); }

/* subpage media — monochrome, blended into the theme, full color on hover */
.brandMark{ position:absolute; top:clamp(84px,12vh,120px); right:clamp(20px,5vw,60px);
  width:clamp(58px,7vw,96px); height:auto; margin:0;
  mix-blend-mode:screen; opacity:.4; filter:brightness(1.05);
  transition:opacity .5s var(--ease); }
.brandMark:hover{ opacity:.8; }
body.mode-light .brandMark{ mix-blend-mode:normal; background:#0a0a0a; padding:10px; border-radius:10px; box-sizing:content-box; }
/* large faint monochrome image bleeding in from the right, text overlaps it */
.subBg{ position:fixed; top:0; right:0; height:100vh; height:100dvh; width:min(62vw,860px);
  object-fit:cover; object-position:center; z-index:0; pointer-events:none;
  filter:grayscale(1) contrast(1.05); mix-blend-mode:luminosity; opacity:.22;
  -webkit-mask-image:linear-gradient(90deg,transparent,#000 72%);
  mask-image:linear-gradient(90deg,transparent,#000 72%); }
.subpage main{ position:relative; z-index:1; }   /* keep text above the background image */
@media (max-width:720px){ .subBg{ width:100vw; opacity:.14; } }

/* ---- reveal animation ---- */
.reveal{ display:block; overflow:hidden; }
.reveal > span{ display:block; transform:translateY(115%); transition:transform 1s var(--ease); }
.reveal.in > span{ transform:translateY(0); }
/* staggering for grouped reveals */
.hero .giant .reveal:nth-child(2) > span{ transition-delay:.08s; }

/* fade-up-on-scroll — JS adds .is-in as each element crosses into view */
.sectionHead{ opacity:0; transition:opacity .7s var(--ease); }
.prose,.timeline>li,.contact .mailto,.social,
.subBlock,.caseLead,.case>p,.doList>li,.impact,.subList>li,.tags,.workRow{
  opacity:0; transform:perspective(900px) translateZ(-260px) translateY(30px);
  transition:opacity .8s var(--ease), transform .8s var(--ease); }
.is-in{ opacity:1 !important; transform:perspective(900px) translateZ(0) translateY(0) !important; }

/* scroll-driven Z + Y drift on the giant section headings (JS sets the vars) */
.sectionHead .giant{ transform:perspective(1200px) translateY(var(--drift,0px)) translateZ(var(--driftZ,0px));
  transform-origin:left center; }   /* bulge grows rightward so it never covers the number */

/* loading gate */
body.loading .reveal > span{ transform:translateY(115%); }

/* ---- responsive ---- */
@media (max-width:720px){
  .nav{ display:none; }
  .ui{ padding:16px 20px; }
  .tHead{ flex-direction:column; gap:2px; }
}
/* no-hover (touch): show project details and flatten tilt so content is readable */
@media (hover:none),(pointer:coarse){
  .projectInner{ transform:none; opacity:1; }
  .pReveal{ max-height:180px; opacity:1; }
  .gear{ opacity:1; }
}
@media (prefers-reduced-motion:reduce){
  *{ animation:none !important; transition:none !important; }
  .reveal > span{ transform:none; }
  .sectionHead,.prose,.timeline>li,.mailto,.social,
  .subBlock,.caseLead,.case>p,.doList>li,.impact,.subList>li,.tags,.workRow{ opacity:1; transform:none; }
  .sectionHead .giant{ transform:none; }
}
