:root {
  --bg: #09090a;
  --fg: #f3f1ec;
  --mut: #8d8b85;
  --dim: #4a4945;
  --line: #ffffff14;
  --hl: #f3f1ec;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --gut: clamp(16px, 4vw, 48px);
  --display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, Menlo, monospace;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-gutter: stable; }
html.locked { overflow: hidden; }
/* smooth scrolling (Lenis) */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis:not(.lenis-autoToggle).lenis-stopped { overflow: clip; }
.lenis [data-lenis-prevent] { overscroll-behavior: contain; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.55 Geist, system-ui, sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--hl); color: var(--bg); }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 1px solid var(--fg); outline-offset: 4px; }

#bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
main { position: relative; z-index: 1; }

/* hero: fills the first screen on its own */
.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 40px var(--gut) 120px;
}
h1 {
  font: 500 clamp(64px, 15vw, 230px)/.9 var(--display);
  letter-spacing: -.02em;
  margin: 0;
  white-space: nowrap;
}
.by {
  margin: clamp(28px, 4vw, 56px) 0 0;
  font: 500 clamp(22px, 3vw, 44px)/1 var(--display);
  letter-spacing: -.01em;
}
.split .ch { display: inline-block; text-align: center; white-space: nowrap; }
/* the glyph grows inside a fixed-width box, so a bolder letter never pushes its neighbours */
.split .ch b {
  display: inline-block;
  font-weight: inherit;
  font-variation-settings: "wght" var(--w, 500);
  will-change: translate;
}
.split .sp { display: inline-block; width: .28em; }
.by .ch b { opacity: .55; }
/* the intro only runs once fonts are in, so letters never swap mid-animation */
.ready .split .ch { animation: blurin 1.6s var(--ease) both; animation-delay: calc(var(--i) * 50ms + 120ms); }
.fonts-pending .split { visibility: hidden; }
@keyframes blurin {
  from { opacity: 0; filter: blur(16px); transform: translateY(.22em) scale(.94); }
  60% { filter: blur(0); }
}
@media (max-width: 560px) { h1 { white-space: normal; } }

/* the title lifts away as you scroll (driven from app.js) */
.lift { will-change: transform, opacity, filter; transform-origin: 50% 40%; }

/* scroll cue: fades in after the intro, drifts away once you scroll */
.hero { position: relative; }
.cue {
  position: absolute;
  left: 50%;
  bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  translate: -50% 0;
  display: grid;
  justify-items: center;
  gap: 12px;
  font: 11px var(--mono);
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--mut);
  opacity: 0;
  transition: opacity .8s var(--ease), translate .8s var(--ease);
}
.cue i { position: relative; width: 1px; height: 44px; background: #ffffff2e; overflow: hidden; }
.cue i::after {
  content: "";
  position: absolute;
  left: 0;
  top: -40%;
  width: 1px;
  height: 40%;
  background: linear-gradient(transparent, var(--fg));
  animation: drip 2.2s var(--ease) infinite;
}
@keyframes drip { to { top: 100%; } }
.ready .cue { animation: cuein 1.4s var(--ease) 1.2s both; }
@keyframes cuein { from { opacity: 0; translate: -50% -10px; } to { opacity: 1; translate: -50% 0; } }
.cue.gone { animation: none; opacity: 0; translate: -50% 10px; pointer-events: none; }
.cue:hover { color: var(--fg); }

/* pinned: the list holds still while the quest line takes its time (sizes set in app.js) */
.work.pinned { height: var(--pin-h); }
.work.pinned .quest { position: sticky; top: var(--pin-top); }

/* projects: a quest line draws down the left and lights each project as it passes */
.work { padding: 0 var(--gut); }
.quest { --p: 0; --rail-end: 28px; position: relative; padding-left: 44px; }
.rail { position: absolute; left: 10px; top: 0; bottom: var(--rail-end); width: 1px; background: var(--line); }
.trail {
  position: absolute;
  inset: 0;
  background: linear-gradient(#f3f1ec55, var(--hl));
  transform-origin: top;
  transform: scaleY(var(--p));
}
.rail::after {
  content: "";
  position: absolute;
  left: -2px;
  top: calc(var(--p) * 100%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  translate: 0 -50%;
  background: var(--hl);
  box-shadow: 0 0 14px 2px var(--hl);
  opacity: min(1, calc(var(--p) * 20));
}
.rows li { position: relative; }
.rows li::before {
  content: "";
  position: absolute;
  left: -38.5px;
  top: 50%;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  translate: 0 -50%;
  border: 1px solid #ffffff3a;
  background: var(--bg);
  transition: background .7s var(--ease), border-color .7s var(--ease), box-shadow .9s var(--ease), scale .7s cubic-bezier(.34, 1.6, .64, 1);
}
.rows li.lit::before {
  background: var(--c);
  border-color: var(--c);
  scale: 1.2;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 16%, transparent), 0 0 18px color-mix(in srgb, var(--c) 70%, transparent);
}
/* a single ring pulses out when the quest line reaches a checkpoint */
.rows li::after {
  content: "";
  position: absolute;
  left: -38.5px;
  top: 50%;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  translate: 0 -50%;
  border: 1px solid var(--c);
  opacity: 0;
  pointer-events: none;
}
.rows li.lit::after { animation: checkpoint 1.1s var(--ease) both; }
@keyframes checkpoint { from { opacity: .9; scale: 1; } to { opacity: 0; scale: 4.2; } }
.next { position: relative; height: calc(var(--rail-end) * 2); display: flex; align-items: center; width: fit-content; }
.next .ring {
  position: absolute;
  left: -38px;
  top: 50%;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  translate: 0 -50%;
  border: 1px dashed var(--dim);
  transition: border-color .8s var(--ease);
}
.next .nl em { font-style: normal; color: #c9a7ff; transition: color .6s var(--ease); }
.next:hover .nl em, .next:focus-visible .nl em { color: var(--fg); }
.next .nl { font: 12px var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--dim); opacity: 0; transform: translateX(-8px); transition: opacity 1s var(--ease), transform 1s var(--ease), color 1s; }
.next.lit .ring { border-color: var(--fg); animation: seek 2.4s var(--ease) infinite; }
.next.lit .nl { opacity: 1; transform: none; color: var(--mut); }
@keyframes seek { 0% { box-shadow: 0 0 0 0 #f3f1ec40; } 70%, 100% { box-shadow: 0 0 0 12px #f3f1ec00; } }
@media (max-width: 560px) {
  .quest { padding-left: 30px; }
  .rail { left: 6px; }
  .rows li::before, .rows li::after { left: -28.5px; }
  .next .ring { left: -28px; }
}
.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.row {
  --c: var(--fg);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px 130px;
  align-items: center;
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  position: relative;
  transition: opacity .6s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.row::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--c), transparent 70%);
  opacity: 0;
  transition: opacity .5s var(--ease);
  z-index: -1;
}
.row:hover::before, .row:focus-visible::before, .row.on::before { opacity: .07; }
.row:active::before { opacity: .12; transition-duration: .1s; }
.row:active .t { transform: translateX(6px); color: var(--c); transition-duration: .15s; }
.row .t {
  font: 600 clamp(26px, 4.2vw, 52px)/1.05 var(--display);
  letter-spacing: -.04em;
  transition: transform .7s var(--ease), color .6s var(--ease);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row .g, .row .s { font: 12px var(--mono); color: var(--mut); }
.row .s { display: flex; align-items: center; gap: 8px; }
.row .s i { width: 6px; height: 6px; border-radius: 50%; background: var(--dim); flex: none; }
.row .s i.live { background: #7fd18b; }
.row .s i.wip { background: #f4c95e; }
.row .d { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.rows.hov .row:not(.on) { opacity: .28; }
/* one project at a time: while the list is pinned, only the current stop is fully lit */
.rows.step:not(.hov) li:not(.cur) .row { opacity: .42; }
.rows.done:not(.hov) li .row { transition-delay: calc(var(--n, 0) * 60ms); }
.rows.step:not(.hov) li.cur .t { color: var(--c); transform: translateX(10px); }
.row.on .t { transform: translateX(10px); color: var(--c); }
/* rows rise in as they scroll into view (only when JS is running) */
.reveal .rows li { opacity: 0; transform: translateY(28px); }
.reveal .rows li.seen { opacity: 1; transform: none; transition: opacity 1s var(--ease), transform 1.1s var(--ease); transition-delay: calc(var(--r, 0) * 70ms); }
@media (max-width: 760px) {
  .row { grid-template-columns: minmax(0, 1fr) auto; }
  .row .g { display: none; }
}

/* floating preview */
.card {
  position: fixed;
  left: 0;
  top: 0;
  width: 300px;
  aspect-ratio: 4 / 3;
  border-radius: 14px;
  overflow: hidden;
  pointer-events: none;
  z-index: 40;
  opacity: 0;
  scale: .6;
  transition: opacity .35s var(--ease), scale .7s cubic-bezier(.34, 1.4, .64, 1);
  box-shadow: 0 30px 80px #000c, 0 0 0 1px #ffffff14;
  background: #111;
}
.card.on { opacity: 1; scale: 1; }
.card canvas { width: 100%; height: 100%; display: block; }
.card.sw canvas { animation: cardsw .5s var(--ease); }
.card.tease canvas { filter: blur(7px) saturate(1.2); transform: scale(1.12); }
@keyframes cardsw { from { opacity: .25; transform: scale(1.08); } }
.card .cl { position: absolute; inset: auto 12px 10px; display: flex; justify-content: space-between; font: 11px var(--mono); color: #fff; }
@media (hover: none), (pointer: coarse) { .card { display: none; } }

/* socials */
.links { display: flex; gap: 18px; justify-content: center; padding-block: 22px; }
/* the padding gives each icon a thumb-sized tap area; the negative margin keeps the layout identical */
.ic { display: grid; place-items: center; padding: 14px 8px; margin: -14px -8px; color: #75736d; transition: color .4s var(--ease), transform .6s var(--ease); }
.ic:hover, .ic:focus-visible { color: var(--fg); }

/* project view */
.ov {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: #0a0a0b;
  display: grid;
  grid-template-rows: auto 1fr;
  clip-path: inset(100% 0 0 0);
  transition: clip-path .8s var(--ease);
  overflow: auto;
  overscroll-behavior: contain;
}
.ov.on { clip-path: inset(0 0 0 0); }
.ov.out { clip-path: inset(0 0 100% 0); transition-duration: .7s; }
.ov .top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px var(--gut);
  padding-top: calc(18px + env(safe-area-inset-top, 0px));
  position: sticky;
  top: 0;
  background: #0a0a0bdd;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2;
}
.lab { font: 12px var(--mono); color: var(--mut); text-transform: uppercase; letter-spacing: .14em; }
.ov .x { border: 1px solid var(--line); border-radius: 99px; padding: 8px 16px; font-size: 14px; transition: border-color .3s; }
.ov .x:hover { border-color: #ffffff50; }
.ov .body {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: clamp(24px, 5vw, 72px);
  padding: 24px var(--gut) 60px;
  align-items: start;
}
.ov .vis { position: relative; aspect-ratio: 4 / 3; max-width: 100%; border-radius: 18px; overflow: hidden; background: #111; box-shadow: 0 0 0 1px var(--line); }
.ov .vis canvas { width: 100%; height: 100%; display: block; }
.soon {
  position: absolute;
  top: 16px;
  left: 16px;
  font: 12px var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #1a1420;
  background: var(--c);
  border-radius: 99px;
  padding: 6px 12px;
}
.ov h2 { font: 600 clamp(48px, 7vw, 104px)/.95 var(--display); letter-spacing: -.05em; margin: 0 0 18px; color: var(--c); }
.ov .d { font-size: 18px; color: #cfcdc6; max-width: 40ch; margin: 0 0 28px; }
.ov dl { display: grid; grid-template-columns: 110px 1fr; gap: 10px 16px; margin: 0 0 30px; font-size: 14px; border-top: 1px solid var(--line); padding-top: 20px; }
.ov dt { font: 12px var(--mono); color: var(--mut); padding-top: 2px; }
.ov dd { margin: 0; }
.ov .story { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; font: 12px var(--mono); color: var(--mut); margin-bottom: 28px; }
.ov .story span { border: 1px solid var(--line); border-radius: 99px; padding: 4px 12px; }
.ov .body.enter .vis { animation: rise .9s var(--ease) both .18s; }
.ov .body.enter .info > * { animation: rise .9s var(--ease) both; }
.ov .body.enter #ovt { animation-delay: .26s; }
.ov .body.enter .story > * { animation: rise .8s var(--ease) both; animation-delay: calc(var(--k) * 60ms + .34s); }
.ov .body.enter .story { animation: none; }
.ov .body.enter #ovd { animation-delay: .4s; }
.ov .body.enter #ovl { animation-delay: .46s; }
.ov .body.enter #ovbtn { animation-delay: .52s; }
.ov .body > *, .ov .info > * { transition: opacity .25s ease-in, transform .25s ease-in; }
.ov .body.leaving > *, .ov .body.leaving .info > * { opacity: 0; transform: translateY(-14px); animation: none; }
.ov .story b { font-weight: 400; color: var(--dim); }
@keyframes rise { from { transform: translateY(20px); opacity: 0; } }
.nav2 { display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 99px;
  border: 1px solid var(--line);
  font-weight: 500;
  transition: background .4s var(--ease), color .4s, border-color .4s, transform .6s var(--ease);
}
.btn.solid { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.btn:hover { border-color: #ffffff50; }
.btn .arr { transition: transform .5s var(--ease); }
.btn:hover .arr { transform: translate(3px, -3px); }
@media (max-width: 820px) {
  .ov .body { grid-template-columns: 1fr; gap: 24px; padding-top: 8px; }
  .ov .vis { aspect-ratio: 16 / 10; border-radius: 14px; }
  /* on phones the buttons sit right under the name */
  .info { display: flex; flex-direction: column; }
  .info > * { order: 2; }
  .info h2 { order: 0; }
  .info .nav2 { order: 1; margin-bottom: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ready .cue { opacity: 1; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
}
