/* Fresnel landing. Tokens from DESIGN.md: warm blacks, bone text, one tungsten light. */
:root {
  --ink: oklch(0.145 0.004 75);
  --ink-2: oklch(0.185 0.005 75);
  --ink-3: oklch(0.255 0.006 75);
  --ink-4: oklch(0.30 0.006 75);
  --ash: oklch(0.72 0.009 80);
  --bone: oklch(0.955 0.008 85);
  --tungsten: oklch(0.885 0.075 78);
  --sans: "Archivo", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  --out: cubic-bezier(0.16, 1, 0.3, 1);
  --gutter: clamp(20px, 4vw, 56px);
  --max: 1440px;
  --edge: max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter)));
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--bone);
  font: 400 17px/1.6 var(--sans);
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, video, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; }
p { margin: 0; text-wrap: pretty; }
code { font-family: var(--mono); }
:focus-visible { outline: 2px solid var(--tungsten); outline-offset: 3px; border-radius: 4px; }
[id] { scroll-margin-top: 88px; }
::selection { background: var(--tungsten); color: var(--ink); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -64px; z-index: 30; padding: 10px 14px; background: var(--bone); color: var(--ink); border-radius: 6px; text-decoration: none; }
.skip:focus { top: 12px; }
.wrap { max-width: var(--max); margin: 0 auto; padding-inline: var(--gutter); }

/* type */
h1, h2, h3 { margin: 0; font-weight: 400; text-wrap: balance; }
.display { font-size: clamp(40px, 6.6vw, 112px); font-stretch: 112%; font-weight: 300; line-height: 1; }
h2 { font-size: clamp(34px, 4.4vw, 68px); font-stretch: 125%; font-weight: 300; line-height: 1.04; }
h3 { font-size: clamp(24px, 2vw, 30px); font-stretch: 118%; font-weight: 400; line-height: 1.15; }
@media (min-width: 1000px) {
  .display { letter-spacing: -0.02em; }
  h2 { letter-spacing: -0.01em; }
}
.film-text > p, .moves-head p, .relight-copy p, .sets-text p, .lens-head p, .editor-head p, .capture-text > p, .specs-head p, .qa p, .install-text p { color: var(--ash); max-width: 52ch; }

/* controls */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 40px; padding: 0 18px;
  border: 0; border-radius: 6px;
  font: 500 15px/1 var(--sans);
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: transform 220ms var(--out), background-color 220ms var(--out);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--tungsten); color: var(--ink); }
.btn-ghost { background: var(--ink-3); color: var(--bone); }
.btn-ghost:hover { background: var(--ink-4); }
.btn-lg { height: 50px; padding: 0 24px; font-size: 16px; }
.link {
  color: var(--bone); font-weight: 500;
  text-decoration: underline; text-decoration-color: var(--ink-4); text-decoration-thickness: 1px; text-underline-offset: 7px;
  transition: text-decoration-color 220ms var(--out);
}
.link:hover { text-decoration-color: var(--ash); }

/* nav: transparent over the stage, ink once the hero has gone */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 20;
  display: flex; align-items: center; gap: 40px;
  height: 68px;
  padding: env(safe-area-inset-top, 0px) var(--edge) 0;
  transition: background-color 300ms var(--out), box-shadow 300ms var(--out);
}
.nav.solid { background: var(--ink); box-shadow: 0 1px 0 var(--ink-3); }
.nav-mark { padding: 8px 0; }
.nav-mark img { width: 112px; height: auto; }
.nav nav { display: flex; gap: 28px; }
.nav nav a { padding: 10px 0; color: var(--ash); text-decoration: none; font-size: 15px; transition: color 200ms var(--out); }
.nav nav a:hover { color: var(--bone); }
.nav-end { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.lang { min-width: 44px; height: 40px; background: none; border: 0; border-radius: 6px; color: var(--ash); font: 500 14px var(--sans); cursor: pointer; }
.lang:hover { color: var(--bone); }

/* hero: one phone turns with the scroll (72 Fresnel frames), HUD labels anchored with lines */
.turn { position: relative; height: 340vh; }
.turn-stage { position: sticky; top: 0; height: 100vh; height: 100dvh; overflow: hidden; background: var(--ink); }
.turn-still, .turn-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.turn-still { object-fit: cover; object-position: 14% 50%; }
.turn.live .turn-still { visibility: hidden; }
.turn-copy {
  position: absolute; left: var(--edge); bottom: clamp(48px, 10vh, 112px);
  max-width: min(900px, 62vw);
  will-change: transform, opacity;
}
.display .line { display: inline-block; }
.lede { margin-top: 26px; max-width: 34em; font-size: clamp(17px, 1.3vw, 19px); }
.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 28px; margin-top: 34px; }
.meter { position: absolute; right: var(--edge); bottom: 28px; font: 12px var(--mono); color: var(--ash); font-variant-numeric: tabular-nums; }
.meter b { font-weight: 400; color: var(--bone); }
.hud { position: absolute; inset: 0; margin: 0; padding: 0; list-style: none; pointer-events: none; }
.hud li {
  position: absolute; left: 0; top: 0;
  display: grid; gap: 2px; width: max-content;
  font-size: 15px; line-height: 1.3; opacity: 0;
  will-change: transform, opacity;
}
.hud li[data-side="left"] { text-align: right; }
.hud em { font-size: 13px; font-style: normal; color: var(--ash); }
.hud-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.hud-lines line { stroke: var(--ash); stroke-width: 1; }
.hud-lines circle { fill: var(--tungsten); }

@media (prefers-reduced-motion: no-preference) {
  .display .line, .lede, .cta { animation: rise 1100ms var(--out) both; }
  .display .line:nth-child(2) { animation-delay: 70ms; }
  .lede { animation-delay: 160ms; }
  .cta { animation-delay: 240ms; }
  @keyframes rise { from { opacity: 0; transform: translateY(28px); } }
  .rv { opacity: 0; transform: translateY(32px); transition: opacity 700ms var(--out), transform 700ms var(--out); }
  .rv.in { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .turn { height: 100vh; height: 100dvh; }
}

/* sections */
.section { padding-block: clamp(110px, 13vw, 200px); }

/* film: the ad and its edit decision list */
.film-grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: 48px clamp(40px, 7vw, 120px); align-items: center; }
.film-text { display: grid; gap: 26px; align-content: start; }
.prompt { justify-self: start; max-width: 44ch; padding: 14px 18px; border-radius: 12px; background: var(--ink-2); color: var(--bone); }
.edl { margin: 8px 0 0; padding: 0; list-style: none; display: grid; }
.edl li {
  display: grid; grid-template-columns: 9ch 9ch minmax(0, 1fr); gap: 16px; align-items: baseline;
  padding: 11px 0; color: var(--ash); font-size: 15px;
  transition: color 300ms var(--out);
}
.edl time, .edl code { font: 13px var(--mono); font-variant-numeric: tabular-nums; }
.edl li.on { color: var(--bone); }
.edl li time { position: relative; padding-left: 16px; }
.edl li time::before { content: ""; position: absolute; left: 0; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--ink-4); transition: background-color 300ms var(--out); }
.edl li.on time::before { background: var(--tungsten); }
.film-player { position: relative; justify-self: end; width: min(100%, calc(82vh * 0.5625), 520px); }
.film-video { width: 100%; aspect-ratio: 9 / 16; border-radius: 6px; background: #000; }
.film-player .pause { position: absolute; right: 14px; bottom: 14px; height: 34px; padding: 0 14px; font-size: 14px; }

/* moves: a dictionary of camera moves, each a render */
.moves-head { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr) auto; gap: 24px 48px; align-items: end; margin-bottom: 52px; }
.moves-head .pause { justify-self: end; }
.strip {
  --h: clamp(340px, 52vh, 520px);
  display: flex; gap: 16px;
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x proximity; scroll-padding-inline: var(--edge);
  padding: 0 var(--edge) 20px;
  scrollbar-width: thin; scrollbar-color: var(--ink-3) transparent;
}
.strip:focus-visible { outline-offset: -2px; }
.move { flex: none; margin: 0; width: calc(var(--h) * 0.8); scroll-snap-align: start; display: grid; gap: 14px; }
.move video { width: 100%; height: var(--h); object-fit: cover; border-radius: 4px; background: var(--ink-2); }
.move figcaption { display: grid; gap: 4px; font-size: 15px; color: var(--ash); }
.move code { font-size: 13px; color: var(--bone); }

/* desktop: the six moves as one contact sheet, nothing hidden behind a sideways scroll */
@media (min-width: 1001px) {
  .strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px 16px; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); overflow: visible; }
  .move { width: auto; }
  .move video { height: auto; aspect-ratio: 4 / 5; }
}

/* light: the relit stage, then the sets */
.light { padding-top: clamp(40px, 6vw, 80px); }
.relight { position: relative; isolation: isolate; }
.relight-stage { position: relative; height: min(100vh, 62.5vw); min-height: 520px; overflow: hidden; -webkit-mask-image: linear-gradient(transparent, #000 14%, #000 86%, transparent); mask-image: linear-gradient(transparent, #000 14%, #000 86%, transparent); }
.relight-still, .relight-canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 67% 50%; }
.relight-canvas { opacity: 0; transition: opacity 700ms var(--out); }
.relight.live .relight-canvas { opacity: 1; }
.relight-copy { position: absolute; z-index: 1; left: var(--edge); top: clamp(48px, 9vh, 96px); display: grid; gap: 18px; max-width: min(520px, 44vw); }
.instrument { position: absolute; right: var(--edge); bottom: clamp(40px, 8vh, 88px); display: grid; justify-items: end; gap: 10px; }
.relight:not(.live) .instrument { visibility: hidden; }
.instrument-label { font-size: 14px; color: var(--bone); }
.pad {
  position: relative; width: 136px; aspect-ratio: 16 / 10;
  border-radius: 6px;
  background: oklch(0.145 0.004 75 / 0.6);
  box-shadow: inset 0 0 0 1px var(--ink-4);
  cursor: crosshair; touch-action: none;
}
.pad-dot { position: absolute; left: 50%; top: 27%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--tungsten); pointer-events: none; }
.readout { font: 12px/1 var(--mono); color: var(--ash); font-variant-numeric: tabular-nums; white-space: pre; }
.sets-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(32px, 6vw, 96px); align-items: center; padding-top: clamp(80px, 10vw, 140px); }
.set-frame { position: relative; aspect-ratio: 1; border-radius: 4px; overflow: hidden; background: var(--ink-2); }
.set-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity 500ms var(--out); }
.sets-text { display: grid; gap: 22px; align-content: center; }
.sets { display: grid; margin-top: 8px; }
.sets button {
  display: flex; align-items: baseline; gap: 16px;
  padding: 14px 0; border: 0; background: none;
  color: var(--ash); font: 400 22px/1.2 var(--sans); font-stretch: 118%; text-align: left;
  cursor: pointer; transition: color 200ms var(--out);
}
.sets button::before { content: ""; flex: none; align-self: center; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-4); transition: background-color 200ms var(--out); }
.sets button:hover, .sets button[aria-checked="true"] { color: var(--bone); }
.sets button[aria-checked="true"]::before { background: var(--tungsten); }
.sets small { margin-left: auto; font: 400 14px var(--sans); font-stretch: 100%; color: var(--ash); }
.json { margin: 0; font: 13px/1.75 var(--mono); color: var(--ash); white-space: pre; overflow-x: auto; }

/* lens: an aperture ring over five renders */
.lens-head { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: 24px 48px; align-items: end; margin-bottom: 48px; }
.lens-frame { position: relative; aspect-ratio: 14 / 9; border-radius: 4px; overflow: hidden; background: var(--ink-2); }
.lens-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ap-b { opacity: 0; }
.ring { display: grid; gap: 14px; margin-top: 28px; }
.ring input { -webkit-appearance: none; appearance: none; width: 100%; height: 36px; margin: 0; background: none; cursor: ew-resize; touch-action: pan-y; }
.ring input::-webkit-slider-runnable-track {
  height: 36px;
  background:
    linear-gradient(var(--ash), var(--ash)) 100% 50% / 1px 24px no-repeat,
    linear-gradient(var(--ink-4), var(--ink-4)) 0 50% / 100% 1px no-repeat,
    repeating-linear-gradient(90deg, var(--ink-4) 0 1px, transparent 1px calc(2.5% - 0.025px)) 0 50% / 100% 12px no-repeat,
    repeating-linear-gradient(90deg, var(--ash) 0 1px, transparent 1px calc(25% - 0.25px)) 0 50% / calc(100% + 1px) 24px no-repeat;
}
.ring input::-moz-range-track {
  height: 36px;
  background:
    linear-gradient(var(--ash), var(--ash)) 100% 50% / 1px 24px no-repeat,
    linear-gradient(var(--ink-4), var(--ink-4)) 0 50% / 100% 1px no-repeat,
    repeating-linear-gradient(90deg, var(--ink-4) 0 1px, transparent 1px calc(2.5% - 0.025px)) 0 50% / 100% 12px no-repeat,
    repeating-linear-gradient(90deg, var(--ash) 0 1px, transparent 1px calc(25% - 0.25px)) 0 50% / calc(100% + 1px) 24px no-repeat;
}
.ring input::-webkit-slider-thumb { -webkit-appearance: none; width: 3px; height: 36px; border-radius: 2px; background: var(--tungsten); }
.ring input::-moz-range-thumb { width: 3px; height: 36px; border: 0; border-radius: 2px; background: var(--tungsten); }
.ring-marks { display: flex; justify-content: space-between; margin: 0; padding: 0; list-style: none; font: 12px var(--mono); color: var(--ash); }
.ring-marks li { width: 0; display: flex; justify-content: center; white-space: nowrap; transition: color 200ms var(--out); }
.ring-marks li:first-child { justify-content: flex-start; }
.ring-marks li:last-child { justify-content: flex-end; }
.ring-marks li.on { color: var(--bone); }

/* capture: a frame-perfect recording and its clock */
.capture-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 48px clamp(40px, 7vw, 120px); align-items: center; }
.capture-media { justify-self: center; display: grid; justify-items: center; gap: 16px; }
.capture-video { width: min(340px, 70vw); height: auto; aspect-ratio: 480 / 1044; border-radius: 26px; background: var(--ink-2); box-shadow: 0 0 0 1px var(--ink-3); }
.capture-text { display: grid; gap: 26px; }
.ticks { display: grid; grid-template-columns: repeat(60, 1fr); gap: 3px; height: 44px; max-width: 560px; }
.ticks i { display: block; background: var(--ink-3); border-radius: 1px; }
.ticks i.on { background: var(--tungsten); }
.ticks-label { font-size: 13px; color: var(--ash); font-variant-numeric: tabular-nums; }

/* editor: the real app, full width */
.editor-head { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: 24px 48px; align-items: end; margin-bottom: 48px; }
.editor-shot { margin-block: 0; }
.editor-shot img { width: 100%; height: auto; border-radius: 6px; box-shadow: 0 0 0 1px var(--ink-3); }

/* specs: a lens datasheet */
.specs-grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 32px clamp(32px, 6vw, 96px); align-items: start; }
.specs-head { display: grid; gap: 18px; position: sticky; top: 104px; }
.specs { margin: 0; }
.specs div { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); gap: 24px; padding: 13px 0; }
.specs dt { color: var(--ash); }
.specs dd { margin: 0; }
.specs dd[translate="no"] { font: 14px/1.7 var(--mono); }

/* questions: what people ask before installing */
.faq-grid { display: grid; gap: 48px; }
.faq-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px clamp(32px, 6vw, 96px); }
.qa { display: grid; gap: 12px; align-content: start; }
.qa h3 { font-size: clamp(20px, 1.6vw, 24px); font-stretch: 112%; text-wrap: balance; }

/* install */
.install-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 32px clamp(32px, 6vw, 96px); align-items: start; }
.install-text { display: grid; gap: 20px; justify-items: start; }
.install-os, .os-panel { display: grid; gap: 16px; min-width: 0; }
.os-panel[hidden] { display: none; }
.os-tabs { display: inline-flex; justify-self: start; gap: 4px; padding: 4px; border-radius: 10px; background: var(--ink-2); }
.os-tabs button {
  height: 34px; padding: 0 16px; border: 0; border-radius: 7px;
  background: transparent; color: var(--ash); font: 500 14px/1 var(--sans); cursor: pointer;
  transition: background-color 220ms var(--out), color 220ms var(--out);
}
.os-tabs button:hover { color: var(--bone); }
.os-tabs button[aria-selected="true"] { background: var(--ink-3); color: var(--bone); }
.win-get { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.win-meta, .win-note { color: var(--ash); font-size: 14px; }
.code { position: relative; min-width: 0; padding: 28px; border-radius: 10px; background: var(--ink-2); }
.code pre { margin: 0; overflow-x: auto; font: 14px/1.85 var(--mono); }
.code .copy { position: absolute; top: 16px; right: 16px; height: 34px; padding: 0 14px; font-size: 14px; }

/* footer: the page's end card. Links, a colophon, then the wordmark engraved like a lens barrel */
.footer { padding: 0 0 calc(40px + env(safe-area-inset-bottom, 0px)); font-size: 15px; color: var(--ash); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 4fr) minmax(0, 3fr); gap: 40px clamp(32px, 6vw, 96px); align-items: start; }
.footer-about { display: grid; gap: 12px; max-width: 36ch; }
.footer-line { color: var(--bone); font-size: clamp(20px, 1.6vw, 24px); font-stretch: 112%; line-height: 1.2; }
.footer-nav { display: grid; grid-template-rows: repeat(5, auto); grid-auto-flow: column; justify-content: start; gap: 10px 48px; }
.footer-links { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; justify-items: start; }
.footer a { color: var(--ash); text-decoration: none; transition: color 200ms var(--out); }
.footer a:hover { color: var(--bone); }
.footer-mark { width: 100%; height: auto; margin-top: clamp(72px, 9vw, 140px); color: var(--ink-4); }
@media (prefers-reduced-motion: no-preference) {
  .footer-mark.engrave path { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1400ms var(--out); }
  .footer-mark.engrave.in path { stroke-dashoffset: 0; }
}

@media (max-width: 1000px) {
  .nav nav { display: none; }
  .film-grid, .moves-head, .lens-head, .editor-head, .sets-grid, .capture-grid, .install-grid, .specs-grid, .faq-list { grid-template-columns: minmax(0, 1fr); }
  .film-player { justify-self: start; width: min(100%, 420px); }
  .moves-head .pause { justify-self: start; }
  .specs-head { position: static; }
  .hud li { font-size: 13px; }
}
@media (max-width: 760px) {
  .turn-copy { left: var(--gutter); right: var(--gutter); bottom: 40px; max-width: none; }
  .display { font-size: clamp(32px, 9vw, 56px); }
  .display .line { display: inline; animation: none; }
  .lede { margin-top: 16px; font-size: 16px; }
  .cta { margin-top: 24px; gap: 22px; }
  .meter { display: none; }
  .relight-stage { height: 72vh; min-height: 0; }
  .relight-still, .relight-canvas { object-position: 72% 50%; }
  .relight-copy { position: static; max-width: none; padding: 0 var(--gutter) 28px; }
  .pad { width: 112px; }
  .strip { --h: 52svh; }
  .specs div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .edl li { grid-template-columns: 9ch minmax(0, 1fr); }
  .edl li span { grid-column: 2; }
  .footer-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .footer-about { grid-column: 1 / -1; }
  .footer-nav { grid-template-rows: none; grid-auto-flow: row; }
  .code { padding-top: 64px; }
  /* the full editor is unreadable at phone width: show the preview, its render button and the timeline */
  .editor-shot img { aspect-ratio: 1; object-fit: cover; object-position: 100% 50%; }
}
@media (max-width: 760px) and (prefers-reduced-motion: no-preference) {
  .display { animation: rise 1100ms var(--out) both; }
}
