/* ═══════════════════════════════════════════════════════════════════════════
   GreyTomato
   Palette:  charcoal ground + one tomato accent. Nothing else.
   Radius:   zero, everywhere. The register is poster, not card.
   Motion:   gated behind .motion, which JS adds only when the user allows it.
   ═════════════════════════════════════════════════════════════════════════ */

@font-face {
  font-family: "Bricolage";
  src: url("fonts/bricolage-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Bricolage";
  src: url("fonts/bricolage-latin-ext.woff2") format("woff2");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Second family, used only for the caption voice. Two sans faces normally pair
   badly, but these two are doing different jobs: Bricolage is idiosyncratic and
   makes statements, Jakarta is smooth and reads as an annotation underneath. */
@font-face {
  font-family: "Jakarta";
  src: url("fonts/jakarta-latin.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Jakarta";
  src: url("fonts/jakarta-latin-ext.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ── Tokens ──────────────────────────────────────────────────────────────── */

:root {
  /* Ground: cool near-black, pulled from the logo's charcoal rather than pure #000 */
  --ink:        oklch(0.13 0.012 268);
  --ink-deep:   oklch(0.10 0.012 268);
  --ink-raise:  oklch(0.19 0.014 268);

  /* Type */
  --chalk:      oklch(0.96 0.004 268);
  --chalk-dim:  oklch(0.745 0.010 268);   /* 8.3:1 on --ink */

  /* The one accent. Named for the brand, not chosen for the category. */
  --tomato:     oklch(0.65 0.215 32);     /* 4.8:1 against --ink, both directions */

  --focus:      var(--tomato);

  --font: "Bricolage", ui-sans-serif, system-ui, "Helvetica Neue", Arial, sans-serif;
  --font-note: "Jakarta", ui-sans-serif, system-ui, "Helvetica Neue", Arial, sans-serif;

  --pad-x:      clamp(1.25rem, 5vw, 5.5rem);
  --gap-lg:     clamp(4rem, 12vh, 11rem);

  --ease:       cubic-bezier(0.16, 1, 0.3, 1);   /* ease-out-expo, no overshoot */

  /* Semantic layers. */
  --z-gl:       -1;
  --z-media:    0;
  --z-scrim:    1;
  --z-copy:     2;
  --z-nav:      10;
  --z-grain:    20;
  --z-splash:   30;
}

/* ── Reset ───────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--ink); }
body, h1, h2, h3, p, figure, ul { margin: 0; }
figure, ul { padding: 0; }
ul { list-style: none; }
img { display: block; max-width: 100%; height: auto; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--ink);
  color: var(--chalk);
  font-family: var(--font);
  font-weight: 400;
  font-size: clamp(1rem, 0.82rem + 0.55vw, 1.2rem);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

:where(a):focus-visible,
:where(button):focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 5px;
}

.skip {
  --focus: var(--ink);
  position: fixed; left: var(--pad-x); top: -100%;
  z-index: var(--z-splash);
  background: var(--tomato); color: var(--ink);
  padding: 0.75rem 1.25rem; font-weight: 700; text-decoration: none;
}
.skip:focus { top: 84px; }

.sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ── Nav and progress ────────────────────────────────────────────────────── */

.nav {
  position: fixed; inset: 0 var(--pad-x) auto;
  z-index: var(--z-nav);
  height: 68px;
  padding-top: clamp(1rem, 2.6vw, 2rem);
  display: flex; align-items: center; justify-content: center;
}
.nav__mark { display: block; line-height: 0; }
.nav__mark img {
  width: auto; height: clamp(22px, 2.85vw, 32px);
  filter: brightness(0) invert(1);
}

/* Stops: a thin line down the left edge that fills with the journey, with an
   arrow above and below to step between stations. Only the world shows it;
   the plain page scrolls like any page. */
.progress {
  position: fixed; left: calc(var(--pad-x) * 0.5); top: 50%;
  transform: translate(-50%, -50%);
  z-index: var(--z-nav);
  display: none;
  flex-direction: column; align-items: center; gap: 0.6rem;
}
.gl .progress { display: flex; }
.progress__track {
  position: relative; display: block;
  width: 1px; height: 36vh;
  background: oklch(0.96 0.004 268 / 0.16);
}
.progress__bar {
  position: absolute; left: 0; top: 0; width: 100%;
  height: calc(var(--progress, 0) * 100%);
  background: var(--tomato);
}
.progress__btn {
  appearance: none; background: none; border: 0; padding: 0.35rem;
  color: var(--chalk); opacity: 0.7; cursor: pointer; line-height: 0;
  transition: opacity 0.3s var(--ease), color 0.3s var(--ease), transform 0.3s var(--ease);
}
.progress__btn:hover { opacity: 1; color: var(--tomato); }
.progress__btn--up:hover { transform: translateY(-2px); }
.progress__btn--down:hover { transform: translateY(2px); }
.is-first .progress__btn--up, .is-last .progress__btn--down { visibility: hidden; pointer-events: none; }
@media (max-width: 800px) { .progress { left: 18px; } .progress__track { height: calc(100dvh - 240px); } }

/* ── The email link ──────────────────────────────────────────────────────── */

.mail {
  --u: oklch(0.96 0.004 268 / 0.4);
  display: inline-block;
  color: var(--chalk); text-decoration: none;
  font-size: clamp(1.05rem, 0.9rem + 0.7vw, 1.5rem);
  font-weight: 700; letter-spacing: -0.02em;
  white-space: nowrap;
  padding-bottom: 0.18em;
  background-image: linear-gradient(var(--u), var(--u));
  background-size: 100% 2px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: color 0.4s var(--ease), background-size 0.4s var(--ease);
}
.mail:hover { --u: var(--tomato); color: var(--tomato); background-size: 100% 3px; }

/* ── Stations: the plain page ────────────────────────────────────────────── */
/* This is the layout the page has with no WebGL: a photograph and its text,
   one station per screen, alternating sides. The scene reuses every element
   here and only changes where they sit. */

.rail { position: relative; }

.st {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  align-items: center;
  gap: clamp(1.5rem, 4vw, 4rem);
  padding: clamp(5rem, 12vh, 8rem) var(--pad-x);
}
.st__media { grid-column: 1 / 7; aspect-ratio: 1; overflow: hidden; background: var(--ink-raise); }
.st__media img { width: 100%; height: 100%; object-fit: cover; }
.st__body { grid-column: 7 / 13; display: grid; gap: clamp(0.9rem, 2vh, 1.4rem); align-content: center; }
.st:nth-child(even) .st__media { grid-column: 7 / 13; order: 2; }
.st:nth-child(even) .st__body  { grid-column: 1 / 7; }
.st--text .st__body { grid-column: 2 / 12; text-align: center; justify-items: center; }

.st__title {
  font-size: clamp(2.7rem, 7.5vw, 6rem);
  font-weight: 800; line-height: 0.97; letter-spacing: -0.035em;
  text-wrap: balance;
}
.st__word {
  font-size: clamp(2.5rem, 7vw, 5.5rem);
  font-weight: 800; line-height: 1; letter-spacing: -0.035em;
  padding-bottom: 0.06em;
}
.st__lead {
  font-size: clamp(2.4rem, 6.4vw, 5rem);
  font-weight: 800; line-height: 0.98; letter-spacing: -0.035em;
}
.st__claim {
  font-size: clamp(2.2rem, 7vw, 5.5rem);
  font-weight: 800; line-height: 1.02; letter-spacing: -0.035em;
  padding-bottom: 0.05em;
}
.st__claim span { display: block; }
.st__cta { margin-top: 0.4rem; }

/* Fact register: Bricolage at text weight. */
.st__fact, .st__text {
  font-weight: 400;
  font-size: clamp(1.05rem, 0.93rem + 0.55vw, 1.4rem);
  line-height: 1.5; letter-spacing: -0.012em;
  max-width: 40ch; text-wrap: pretty;
}
.st__tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.st__tags li {
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.01em;
  padding: 0.3rem 0.65rem;
  border: 1px solid var(--tomato); color: var(--chalk);
}
.st__name { font-weight: 700; }
.st__name a { color: var(--chalk); }

/* Caption register: Jakarta, fiction only. */
.st__note {
  font-family: var(--font-note);
  font-weight: 400;
  font-size: clamp(0.97rem, 0.86rem + 0.42vw, 1.15rem);
  line-height: 1.62;
  color: var(--chalk-dim);
  max-width: 44ch; text-wrap: pretty;
}
.st--title .st__note { color: var(--chalk); }

.studio__nums {
  display: grid; grid-template-columns: repeat(4, auto);
  justify-content: start; gap: clamp(1.5rem, 4vw, 3.5rem);
}
.st--text .studio__nums { justify-content: center; }
.num { display: grid; gap: 0.15rem; }
.num__n {
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 800; line-height: 1; letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.num__l { color: var(--chalk-dim); font-size: 0.9rem; font-weight: 500; letter-spacing: 0.01em; }

.st__pitch {
  font-size: clamp(1.4rem, 3.2vw, 2.5rem);
  font-weight: 800; line-height: 1.12; letter-spacing: -0.03em;
  padding-bottom: 0.05em;
}
.st__pitch span { display: block; }
.st__send { font-size: clamp(1rem, 1.5vw, 1.2rem); font-weight: 500; color: var(--chalk-dim); }
.st__mail {
  color: var(--chalk); text-decoration: none;
  font-size: clamp(1.45rem, 6vw, 4.5rem);
  font-weight: 800; line-height: 1; letter-spacing: -0.038em;
  padding-bottom: 0.1em;
  border-bottom: clamp(3px, 0.4vw, 6px) solid oklch(0.96 0.004 268 / 0.3);
  transition: color 0.45s var(--ease), border-color 0.45s var(--ease), transform 0.45s var(--ease);
  overflow-wrap: anywhere;
}
.st__mail:hover { color: var(--tomato); border-color: var(--tomato); }

@media (max-width: 800px) {
  .st { grid-template-columns: 1fr; gap: 1.5rem; padding-block: clamp(4rem, 10vh, 6rem); }
  .st__media, .st:nth-child(even) .st__media { grid-column: 1 / -1; order: 0; }
  .st__body, .st:nth-child(even) .st__body, .st--text .st__body { grid-column: 1 / -1; }
  .studio__nums { grid-template-columns: repeat(2, auto); }
}

/* ── Footer ──────────────────────────────────────────────────────────────── */

.foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; flex-wrap: wrap;
  padding: clamp(2.5rem, 7vh, 4.5rem) var(--pad-x);
}
.foot__mark { width: auto; height: 16px; filter: brightness(0) invert(1); opacity: 0.72; }
.foot__meta { color: var(--chalk-dim); font-size: 0.85rem; letter-spacing: 0.01em; }
.gl .foot { display: none; }

/* ── Grain ───────────────────────────────────────────────────────────────── */

.grain {
  position: fixed; inset: 0;
  z-index: var(--z-grain);
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}
.motion .grain { animation: grain 0.7s steps(1) infinite; }
@keyframes grain {
  0%   { background-position: 0 0; }
  14%  { background-position: -37px 21px; }
  28%  { background-position: 52px -46px; }
  42%  { background-position: -18px 63px; }
  56%  { background-position: 71px 9px; }
  70%  { background-position: -60px -33px; }
  84%  { background-position: 25px 58px; }
}

/* ── Splash ──────────────────────────────────────────────────────────────── */
/* Inert unless the head gate put .has-splash on <html>. The CSS beat here is
   the whole show if Three arrives late; splash.js adds .splash--gl and takes
   over the pixels when it can. Either way .splash--out fades it and the gate
   removes it at 2.2s no matter what. */
.splash { display: none; }
html.has-splash .splash {
  position: fixed; inset: 0; z-index: var(--z-splash);
  display: grid; place-items: center;
  background: var(--ink);
  transition: opacity 0.38s var(--ease);
}
.splash--out { opacity: 0; pointer-events: none; }
.splash__mark {
  width: min(62vw, 720px); height: auto;
  filter: brightness(0) invert(1);
  opacity: 0;
  animation: splash-in 1.1s var(--ease) 0.2s forwards, splash-hold 2.4s ease-in-out 1.4s infinite;
}
@keyframes splash-hold {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.72; }
}
.splash--gl .splash__mark, .splash--wait .splash__mark { opacity: 0; animation: none; }
.splash__gl { position: absolute; inset: 0; width: 100%; height: 100%; }
@keyframes splash-in {
  from { opacity: 0; transform: scale(0.94); }
  to   { opacity: 1; transform: none; }
}
html.has-splash body { overflow: hidden; }

/* ═══════════════════════════════════════════════════════════════════════════
   MOTION (plain page)
   Inert until main.js adds .motion to <html>. Reveals enhance a visible
   default; they never gate it.
   ═════════════════════════════════════════════════════════════════════════ */

.motion .line { display: block; overflow: hidden; padding-bottom: 0.09em; margin-bottom: -0.09em; }
.motion .line > span {
  display: block;
  transform: translateY(115%);
  transition: transform 1s var(--ease);
}
.motion .line:nth-child(2) > span { transition-delay: 0.09s; }
.motion [data-reveal].is-in .line > span { transform: translateY(0); }

.motion .st__media, .motion .st__body > :not(h1, h2, .st__claim) {
  opacity: 0; transform: translateY(24px);
  transition: opacity 0.9s var(--ease) 0.15s, transform 0.9s var(--ease) 0.15s;
}
.motion [data-reveal].is-in .st__media,
.motion [data-reveal].is-in .st__body > :not(h1, h2, .st__claim) { opacity: 1; transform: none; }

/* Magnetic links: the address leans toward a real pointer. */
.fine [data-magnet] {
  transform: translate(var(--mx, 0px), var(--my, 0px));
  transition: transform 0.45s var(--ease), color 0.35s var(--ease), border-color 0.35s var(--ease), background-size 0.4s var(--ease);
}

@media (prefers-reduced-motion: reduce) {
  .motion .line > span,
  .motion .st__media,
  .motion .st__body > * {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .motion .grain { animation: none !important; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   THE WORLD
   While .gl is on <html> the canvas owns the screen. The rail becomes a tall
   empty scroll track; every station is lifted out of flow and parked as a
   fixed overlay that world.js moves and fades each frame. Photographs come
   from the scene, so the DOM images are hidden.
   ═════════════════════════════════════════════════════════════════════════ */

canvas.gl { display: none; }
.gl canvas.gl {
  display: block; position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: var(--z-gl);
}
.gl body { background: transparent; }
.gl .rail { height: calc(var(--stations, 14) * 100vh + 30vh); }

.gl .st {
  position: fixed; left: 0; top: 0;
  min-height: 0; display: block;
  width: min(40vw, 540px);
  padding: 0;
  opacity: 0; visibility: hidden;
  pointer-events: none;
  will-change: transform, opacity;
  z-index: var(--z-copy);
}
.gl .st a { pointer-events: auto; }
.gl .st__media { display: none; }
.gl .st__body { display: grid; gap: clamp(0.8rem, 1.8vh, 1.2rem); text-align: left; justify-items: start; }
.gl .st--text { width: min(76vw, 820px); }
.gl .st--text .st__body { text-align: center; justify-items: center; }
.gl .st__word { font-size: clamp(2.4rem, 5.6vw, 4.6rem); }
.gl .st__title { font-size: clamp(2.6rem, 6vw, 5.2rem); }
.gl .st__lead { font-size: clamp(2.2rem, 5vw, 4.2rem); }
.gl .st__claim { font-size: clamp(2.2rem, 6.4vw, 5.8rem); }
.gl .st__fact, .gl .st__text { max-width: 34ch; }
.gl .st--studio .st__text { max-width: 46ch; }

/* The scene fades stations by distance; the plain-page wipes and rises stay
   out of its way. */
.gl.motion .line > span { transform: none !important; transition: none !important; }
.gl.motion .st__body > * { opacity: 1 !important; transform: none !important; transition: none !important; }

/* The last stop: the world turns tomato, the sphere stays grey, and every
   piece of chrome flips to ink so it still reads. */
.is-red { --focus: var(--ink); }
.is-red .st--exit .st__body,
.is-red .st__send { color: var(--ink); }
.is-red .nav__mark img { filter: none; }
.is-red .st__mail { color: var(--ink); border-color: oklch(0.13 0.012 268 / 0.3); }
.is-red .st__mail:hover { color: var(--ink); border-color: var(--ink); }
.is-red .progress__track { background: oklch(0.13 0.012 268 / 0.2); }
.is-red .progress__bar { background: var(--ink); }
.is-red .progress__btn { color: var(--ink); }
.is-red .progress__btn:hover { color: var(--ink); }
.st--exit .st__body, .st__send, .st__mail, .progress__bar, .nav__mark img {
  transition: color 0.6s var(--ease), border-color 0.6s var(--ease), background 0.6s var(--ease), filter 0.6s var(--ease);
}

@media (max-width: 800px), (max-aspect-ratio: 9/10) {
  .gl .st { width: min(86vw, 520px); }
  .gl .st__body, .gl .st--text .st__body { text-align: center; justify-items: center; }
  .gl .st__tags { justify-content: center; }
  .gl .studio__nums { justify-content: center; }
}
