/* Scroll-build site template.
   Two modes, picked before first paint by the inline script in index.html:
   - .film   one fixed canvas that scrolling scrubs, copy in a fixed layer
   - default stacked stills with their copy (reduced motion, Save-Data, no JS)
   One accent per site (--accent, --accent-ink) comes from brand.json via the page.
   System fonts only, nothing downloaded: SF Pro / New York on Apple devices. */

:root {
  color-scheme: dark;
  --ground: #0c0e0f;
  --ink: #f3efe9;
  --ink-2: #d9d3ca;
  --ink-3: rgb(243 239 233 / 0.82);
  --hair: rgb(243 239 233 / 0.22);
  --serif: ui-serif, "New York", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --gutter: clamp(20px, 4.4vw, 72px);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --rail-h: 62px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--ground); color: var(--ink); -webkit-text-size-adjust: 100%; overflow-x: clip; scrollbar-color: rgb(243 239 233 / 0.3) transparent; }
body { margin: 0; font: 400 17px/1.5 var(--sans); overflow-x: clip; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
::selection { background: var(--accent); color: var(--accent-ink); }
a { color: inherit; text-underline-offset: 0.2em; }
img { display: block; max-width: 100%; height: auto; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.skip { position: fixed; z-index: 9; left: var(--gutter); top: calc(var(--safe-t) + 10px); padding: 10px 14px; border-radius: 999px; background: var(--ink); color: var(--ground); font: 600 14px/1 var(--sans); text-decoration: none; transform: translateY(-200%); }
.skip:focus-visible { transform: none; }

/* ---------------------------------------------------------------- header */

.top {
  position: fixed; z-index: 5; inset: 0 0 auto 0;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: calc(var(--safe-t) + 14px) calc(var(--gutter) + var(--safe-r)) 14px calc(var(--gutter) + var(--safe-l));
  pointer-events: none;
}
.top > * { pointer-events: auto; }
.mark { display: grid; gap: 4px; padding: 6px 0; text-decoration: none; line-height: 1; }
.mark__name { font: 500 21px/1 var(--serif); letter-spacing: -0.01em; }
.mark__sub { font: 600 10.5px/1 var(--sans); letter-spacing: 0.15em; text-transform: uppercase; color: var(--ink); }

.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 24px; border-radius: 999px;
  font: 600 16px/1 var(--sans); letter-spacing: -0.005em; text-decoration: none; white-space: nowrap;
  transition: transform 120ms var(--ease), background-color 160ms var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }
.btn--glass {
  min-height: 40px; padding: 0 16px; font-size: 14px; color: var(--ink);
  background: rgb(12 14 15 / 0.5); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.24);
  -webkit-backdrop-filter: blur(14px) saturate(150%); backdrop-filter: blur(14px) saturate(150%);
}
.btn--glass::after { content: ""; position: absolute; inset: -4px -2px; } /* 48px tap target around a 40px pill */
.btn--solid { min-height: 52px; padding: 0 26px; color: var(--accent-ink); background: var(--accent); }
@media (hover: hover) and (pointer: fine) {
  .btn--glass:hover { background: rgb(12 14 15 / 0.68); }
  .btn--solid:hover { background: color-mix(in oklab, var(--accent), white 12%); }
}

/* ------------------------------------------------- copy (both modes) */

.copy__tag { margin: 0 0 12px; font: 600 13px/1.2 var(--sans); letter-spacing: 0.01em; color: var(--accent); }
.copy__name {
  margin: 0; font: 400 clamp(2.6rem, 1.6rem + 2.9vw, 4.75rem)/1.02 var(--serif);
  letter-spacing: -0.022em; text-wrap: balance;
}
.copy__name--hero { max-width: 10.5em; font-size: clamp(2.4rem, 1.45rem + 2.7vw, 4.4rem); line-height: 1.04; }
.copy__name em { font-style: italic; padding-right: 0.04em; }
.copy__line { margin: 16px 0 0; max-width: 33ch; font-size: clamp(16px, 0.86rem + 0.3vw, 19px); line-height: 1.5; color: var(--ink-2); text-wrap: pretty; }
.copy--end .btn { margin-top: 28px; }

/* ------------------------------------- stacked stills (the default) */

.view, .track, .rail { display: none; }
html:not(.film) .top { background: rgb(12 14 15 / 0.88); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: 0 1px 0 var(--hair); }
.stages { list-style: none; margin: 0; padding: calc(var(--safe-t) + 84px) 0 0; }
.stage { margin: 0 0 clamp(64px, 10vw, 128px); }
.stage__still { margin: 0 auto; max-width: 1600px; }
.stage__still img { width: 100%; height: auto; }
.stage .copy { padding: 24px calc(var(--gutter) + var(--safe-r)) 0 calc(var(--gutter) + var(--safe-l)); max-width: 44rem; }
.foot { margin: 0; padding: 0 var(--gutter) calc(var(--safe-b) + 40px); font-size: 14px; color: var(--ink-2); }
.foot p { margin: 0; }

/* --------------------------------------------------------- film mode */

.film .view {
  display: block; position: fixed; inset: 0; z-index: 0;
  background: var(--ground) 50% 50% / cover no-repeat;
}
.film .view canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; visibility: hidden; }
.film .view.is-drawn canvas { visibility: visible; }
.film .scrim { position: absolute; pointer-events: none; }
.film .scrim--top { inset: 0 0 auto 0; height: 180px; background: linear-gradient(rgb(9 11 12 / 0.62), rgb(9 11 12 / 0.34) 45%, rgb(9 11 12 / 0)); }
/* Density only where the words sit: the bottom-left corner under the copy, and
   a low band under the rail. Measured by scripts/verify.mjs, not tuned by eye. */
.film .scrim--copy {
  left: 0; bottom: 0; width: min(1180px, 86vw); height: 100%;
  background:
    radial-gradient(ellipse 62% 78% at 0% 100%, rgb(8 10 11 / 0.9) 0%, rgb(8 10 11 / 0.8) 42%, rgb(8 10 11 / 0.45) 70%, rgb(8 10 11 / 0) 100%);
}
/* Full width, so it has no edge of its own: the rail and footer sit on it. */
.film .scrim--band { inset: auto 0 0 0; height: 180px; background: linear-gradient(to top, rgb(8 10 11 / 0.75), rgb(8 10 11 / 0)); }
/* The closing frame is the bright terrace, so the call to action gets more density, only then. */
.film .scrim--end {
  inset: 0 auto 0 0; width: min(1000px, 74vw); opacity: var(--end, 0);
  background: linear-gradient(to right, rgb(8 10 11 / 0.72), rgb(8 10 11 / 0.5) 45%, rgb(8 10 11 / 0));
}
.film .scrim--fade { display: none; }

.film .stages { position: fixed; inset: 0; z-index: 2; margin: 0; padding: 0; pointer-events: none; }
.film .stage { position: absolute; inset: 0; margin: 0; opacity: 0; }
.film .stage:first-child { opacity: 1; }
.film .stage__still { display: none; }
.film .stage .copy {
  position: absolute; padding: 0; max-width: min(36rem, 54vw);
  left: calc(var(--gutter) + var(--safe-l));
  bottom: calc(var(--safe-b) + var(--rail-h) + clamp(28px, 5.5vh, 64px));
  will-change: transform;
}
.film .stage.is-live .copy { pointer-events: auto; }
.film .track { display: block; height: calc(var(--T) * 100svh + 100svh); }

.film .rail {
  display: block; position: fixed; z-index: 3;
  left: calc(var(--gutter) + var(--safe-l)); bottom: calc(var(--safe-b) + 14px);
  width: min(620px, calc(100vw - 2 * var(--gutter)));
}
.rail__line { position: relative; height: 2px; border-radius: 2px; background: var(--hair); overflow: hidden; }
.rail__fill { position: absolute; inset: 0; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); }
.rail__list { position: relative; list-style: none; margin: 0; padding: 0; height: 44px; }
.rail__list li { position: absolute; top: 0; left: calc(var(--at) * 100%); transform: translateX(-50%); }
.rail__list li:first-child { transform: none; }
.rail__list li:last-child { transform: translateX(-100%); }
.rail__list a {
  display: block; padding: 14px 6px 16px; margin: 0 -6px;
  font: 500 12px/1 var(--sans); letter-spacing: 0.01em; color: var(--ink-3); text-decoration: none; white-space: nowrap;
  transition: color 160ms var(--ease);
}
.rail__list a[aria-current] { color: var(--ink); font-weight: 600; }
@media (hover: hover) and (pointer: fine) { .rail__list a:hover { color: var(--ink); } }

.film .foot {
  position: fixed; z-index: 3; padding: 0; opacity: 0;
  left: calc(var(--gutter) + var(--safe-l)); bottom: calc(var(--safe-b) + 22px);
}

/* Phone: picture on top, words underneath. A cropped frame set made for
   portrait (pack.phone) fills the top; the copy sits on the ground below. */
@media (orientation: portrait) {
  /* As wide as the screen at the frame's own shape, but never so tall that the
     words and the rail run out of room underneath (short phones crop the sky). */
  :root { --img-h: min(111.2vw, 100svh - 300px); }
  .film .view { bottom: auto; height: var(--img-h); }
  .film .scrim--copy, .film .scrim--end, .film .scrim--band { display: none; }
  .film .scrim--fade { display: block; inset: auto 0 0 0; height: 30%; background: linear-gradient(rgb(12 14 15 / 0), var(--ground)); }
  /* The words fill the space between picture and rail, centred in it. */
  .film .stage .copy {
    top: var(--img-h); bottom: calc(var(--safe-b) + var(--rail-h) + 14px); right: calc(var(--gutter) + var(--safe-r));
    max-width: 30rem; display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
  }
  .film .rail { right: calc(var(--gutter) + var(--safe-r)); width: auto; }
  .copy__name { font-size: clamp(2.3rem, 1.3rem + 5vw, 3.4rem); }
  .copy__name--hero { font-size: clamp(2.1rem, 1.2rem + 4.6vw, 3.1rem); }
  .copy__line { font-size: 16px; }
}
@media (orientation: portrait) and (max-height: 700px) {
  :root { --img-h: min(111.2vw, 100svh - 320px); }
  .copy__name { font-size: 2rem; }
  .copy__name--hero { font-size: 1.85rem; }
  .copy__line { margin-top: 10px; font-size: 15px; }
  .copy__tag { margin-bottom: 8px; }
  .copy--end .btn { margin-top: 18px; min-height: 48px; }
}

/* Short landscape screens (a phone on its side): tighter type, rail labels stay. */
@media (orientation: landscape) and (max-height: 520px) {
  .copy__name { font-size: clamp(1.9rem, 1.2rem + 2.4vw, 2.6rem); }
  .copy__name--hero { font-size: clamp(1.8rem, 1.1rem + 2.2vw, 2.4rem); }
  .copy__line { margin-top: 10px; font-size: 15px; }
  .copy__tag { margin-bottom: 8px; }
  .film .stage .copy { bottom: calc(var(--safe-b) + var(--rail-h) + 14px); }
}

@media (prefers-reduced-motion: reduce) {
  .btn, .rail__list a { transition: none; }
}
