:root {
  color-scheme: dark;
  --ink: #0e0e0e;
  --ink-2: #181818;
  --paper: #f3f0ea;
  --paper-2: #e8e4dc;
  --signal: #ff4f1f;
  --on-dark: #f3f0ea;
  --on-dark-muted: #a8a49c;
  --on-paper-muted: #5c5850;
  --line-dark: rgba(243, 240, 234, 0.12);
  --line-paper: rgba(14, 14, 14, 0.12);
  --radius: 20px;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1240px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
  font: 100%/1.55 system-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ink); color: var(--on-dark); overflow-x: clip; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
img { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--display); font-optical-sizing: auto; margin: 0; text-wrap: balance; }
h1 i, h2 i, h3 i, .brand i { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; }

/* Navigation */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 20; display: flex; align-items: center; gap: 28px;
  padding: 12px var(--gutter); padding-top: max(12px, env(safe-area-inset-top));
  background: rgba(14, 14, 14, 0.6); -webkit-backdrop-filter: blur(18px) saturate(160%); backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid transparent; transition: border-color 300ms ease, background 300ms ease;
}
.nav.scrolled { border-bottom-color: var(--line-dark); background: rgba(14, 14, 14, 0.78); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 1.15rem; letter-spacing: -0.02em; }
.brand i { font-size: 1.25rem; }
.nav nav { display: flex; gap: 26px; margin-left: auto; }
.nav nav a { text-decoration: none; color: var(--on-dark-muted); font-size: 0.92rem; transition: color 150ms ease; }
.nav nav a:hover { color: var(--on-dark); }
.pill {
  text-decoration: none; font-size: 0.88rem; font-weight: 650; padding: 8px 16px; border-radius: 999px;
  background: var(--signal); color: var(--ink); transition: transform 100ms ease-out, background 150ms ease;
}
.pill:hover { background: #ff6a3f; }
.pill:active { transform: scale(0.96); }

/* Buttons */
.button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 0 26px; border-radius: 999px;
  font-weight: 650; font-size: 1rem; text-decoration: none; transition: transform 100ms ease-out, background 160ms ease, color 160ms ease;
}
.button:active { transform: scale(0.97); }
.button.primary { background: var(--signal); color: var(--ink); }
.button.primary:hover { background: #ff6a3f; }
.button.ghost { color: var(--on-dark); border: 1.5px solid rgba(243, 240, 234, 0.35); }
.button.ghost:hover { background: var(--on-dark); color: var(--ink); }

/* Hero: copy on the left, the icon orbit on the right */
.hero {
  position: relative; min-height: 100svh; display: grid; align-items: center;
  padding: 120px var(--gutter) 80px; overflow: hidden; isolation: isolate;
}
#scene { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; touch-action: pan-y; }
.hero-fallback { display: none; }
.no-webgl #scene { display: none; }
.no-webgl .hero-fallback { display: grid; grid-template-columns: repeat(3, 96px); gap: 20px; position: absolute; right: 8%; top: 50%; translate: 0 -50%; z-index: -1; }
.no-webgl .hero-fallback img { width: 96px; height: 96px; }
.hero-copy { position: relative; max-width: 640px; width: 100%; margin-left: max(0px, calc((100vw - var(--max)) / 2 - var(--gutter))); pointer-events: none; }
.hero-copy a { pointer-events: auto; }
.chip { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 28px; font-weight: 650; font-size: 0.95rem; }
.chip em { font-style: normal; font-weight: 500; color: var(--on-dark-muted); padding-left: 10px; border-left: 1px solid var(--line-dark); }
h1 { font-size: clamp(3rem, 7.4vw, 6.4rem); line-height: 0.95; letter-spacing: -0.045em; font-weight: 800; }
h1 i { color: var(--signal); font-size: 1.08em; letter-spacing: -0.02em; }
.lede { margin: 28px 0 0; max-width: 500px; font-size: clamp(1.05rem, 1.6vw, 1.22rem); line-height: 1.5; color: var(--on-dark-muted); text-wrap: pretty; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.hint { position: absolute; right: var(--gutter); bottom: 36px; margin: 0; min-height: 1.4em; font-size: 0.9rem; color: var(--on-dark-muted); pointer-events: none; }

/* Sections */
section { padding: clamp(90px, 12vw, 160px) var(--gutter); }
.section-head { max-width: 820px; margin: 0 auto 64px; text-align: center; }
.eyebrow { margin: 0 0 18px; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--signal); }
h2 { font-size: clamp(2.4rem, 5.6vw, 4.6rem); line-height: 0.98; letter-spacing: -0.04em; font-weight: 780; }
h2 i { font-size: 1.06em; }
h3 { font-size: 1.5rem; line-height: 1.1; letter-spacing: -0.025em; font-weight: 720; }
.sub { margin: 22px auto 0; max-width: 600px; color: var(--on-dark-muted); font-size: 1.12rem; text-wrap: pretty; }

/* Showcase: the studio window tilts up and settles flat as you scroll */
.showcase { height: 230vh; padding: 0 var(--gutter); }
.show-sticky {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: clamp(24px, 4vh, 48px); padding-top: 72px; overflow: hidden;
}
.show-copy { text-align: center; max-width: 760px; will-change: transform, opacity; }
.show-window { margin: 0; width: min(1120px, 100%, (100vh - 300px) * 1.667); transform-origin: 50% 100%; will-change: transform; }
.show-window img { width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--line-dark); box-shadow: 0 60px 120px rgba(0, 0, 0, 0.7); }

/* Stats on paper */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); max-width: none; margin: 0; padding: 56px var(--gutter);
  background: var(--paper); color: var(--ink);
}
.stats div { padding: 8px 24px; border-left: 1px solid var(--line-paper); }
.stats div:first-child { border-left: 0; }
.stats strong { display: block; font-family: var(--display); font-size: clamp(2.4rem, 5vw, 4rem); line-height: 1; letter-spacing: -0.04em; font-weight: 800; font-variant-numeric: tabular-nums; }
.stats span { display: block; margin-top: 8px; color: var(--on-paper-muted); font-size: 0.95rem; }

/* Story: pinned, one app at a time */
.story { background: var(--paper); color: var(--ink); padding-bottom: 0; }
.story .sub { color: var(--on-paper-muted); }
.story-track { position: relative; height: calc(var(--n, 8) * 100vh); margin-inline: calc(var(--gutter) * -1); }
.story-sticky { position: sticky; top: 0; height: 100vh; overflow: hidden; display: grid; place-items: center; padding-top: 56px; }
.story-panels { position: relative; width: 100%; max-width: 1320px; height: min(80vh, 760px); }
.panel {
  --a: 255 79 31;
  position: absolute; inset: 0; display: grid; grid-template-columns: minmax(300px, 0.75fr) 1.25fr; gap: clamp(32px, 5vw, 80px);
  align-items: center; padding: 0 var(--gutter);
}
.panel-copy, .panel-art { will-change: transform, opacity; }
.panel-head { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.panel-head img { width: 52px; height: 52px; }
.panel-head span { font-weight: 650; font-size: 1rem; }
.panel-head small { display: block; color: var(--on-paper-muted); font-size: 0.85rem; font-weight: 500; }
.panel-num { margin-left: auto; font-family: var(--display); font-weight: 600; font-size: 0.9rem; color: var(--on-paper-muted); font-variant-numeric: tabular-nums; }
.panel h3 { font-size: clamp(2.2rem, 4.4vw, 3.8rem); line-height: 0.98; letter-spacing: -0.04em; font-weight: 800; }
.panel h3 i { color: rgb(var(--a)); }
.panel p { margin: 20px 0 0; font-size: 1.08rem; line-height: 1.55; color: var(--on-paper-muted); max-width: 440px; }
.panel ul { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 0; padding: 0; list-style: none; }
.panel li { font-size: 0.82rem; font-weight: 650; padding: 6px 12px; border-radius: 999px; border: 1.5px solid var(--ink); }
.panel .button { margin-top: 28px; background: var(--ink); color: var(--paper); }
.panel .button:hover { background: #2a2a2a; }
.panel-art { position: relative; height: 100%; max-height: 640px; }
.panel-photo { position: absolute; inset: 0 12% 14% 0; border-radius: 22px; overflow: hidden; background: var(--paper-2); }
.panel-photo img { width: 100%; height: 100%; object-fit: cover; }
.panel-shot {
  position: absolute; right: 0; bottom: 0; width: 64%; border-radius: 12px; overflow: hidden;
  box-shadow: 0 40px 80px rgba(14, 14, 14, 0.35), 0 0 0 1px rgba(14, 14, 14, 0.25); will-change: transform;
}
.panel-shot img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top left; }
.story-rail { position: absolute; left: 50%; bottom: 22px; translate: -50% 0; display: flex; gap: 8px; padding: 6px; border-radius: 999px; background: rgba(14, 14, 14, 0.06); }
.story-rail button { border: 0; padding: 0; background: none; cursor: pointer; border-radius: 9px; opacity: 0.35; transition: opacity 200ms ease, transform 200ms var(--ease-out); }
.story-rail button img { width: 30px; height: 30px; }
.story-rail button.on { opacity: 1; transform: scale(1.12); }
.story-rail button:hover { opacity: 0.8; }

/* Palette demo */
.palette {
  max-width: 660px; margin: 0 auto; padding: 12px; border-radius: 18px; background: var(--ink-2);
  border: 1px solid var(--line-dark); box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
}
.palette-input { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: rgba(0, 0, 0, 0.4); font-size: 1.1rem; min-height: 50px; }
.palette-input .glyph { color: var(--on-dark-muted); font-size: 1.2rem; }
.caret { width: 2px; height: 1.2em; background: var(--signal); animation: blink 1.05s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
#results { list-style: none; margin: 8px 0 0; padding: 0; min-height: 228px; }
#results li {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 14px; border-radius: 10px; font-size: 0.98rem;
  opacity: 0; transform: translateY(6px); transition: opacity 240ms var(--ease-out), transform 240ms var(--ease-out), background 200ms ease;
}
#results li.in { opacity: 1; transform: none; }
#results li.on { background: rgba(255, 79, 31, 0.16); }
#results small { color: var(--on-dark-muted); font-size: 0.8rem; white-space: nowrap; }

/* Features: numbered cards on paper with real imagery */
.features { overflow: clip; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; background: var(--paper); color: var(--ink); }
.feature { display: flex; flex-direction: column; padding: 28px 26px 0; border-radius: var(--radius); background: #fff; overflow: hidden; }
.num { font-family: var(--display); font-weight: 600; font-size: 0.85rem; color: var(--on-paper-muted); margin-bottom: 18px; }
.feature h3 { font-size: clamp(1.8rem, 2.6vw, 2.3rem); letter-spacing: -0.035em; font-weight: 800; }
.feature h3 i { color: var(--signal); }
.feature p { margin: 14px 0 26px; color: var(--on-paper-muted); }
.feature img { margin: auto -26px 0; width: calc(100% + 52px); max-width: none; aspect-ratio: 4 / 3; object-fit: cover; }

/* Formats */
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; max-width: 920px; margin: 0 auto; padding: 0; list-style: none; }
.chips li { display: flex; align-items: center; gap: 12px; padding: 10px 18px 10px 10px; border-radius: 14px; border: 1px solid var(--line-dark); }
.chips b { display: grid; place-items: center; min-width: 60px; height: 36px; padding: 0 10px; border-radius: 9px; font-family: var(--display); font-size: 0.85rem; letter-spacing: 0.02em; background: rgb(var(--c)); color: var(--ink); }
.chips span { font-size: 0.94rem; color: var(--on-dark-muted); }
.chips span strong { color: var(--on-dark); font-weight: 650; }

/* Privacy: a full-bleed signal band */
.privacy { background: var(--signal); color: var(--ink); }
.privacy-inner { max-width: 980px; margin: 0 auto; }
.privacy h2 { font-size: clamp(2.6rem, 7vw, 6rem); }
.privacy p { max-width: 640px; margin: 28px 0 0; font-size: 1.2rem; line-height: 1.5; }

/* Download */
.download { background: var(--paper); color: var(--ink); }
.download .sub, .download .note { color: var(--on-paper-muted); }
.dl-main { display: flex; align-items: center; gap: 22px; max-width: 780px; margin: 0 auto 14px; padding: 22px 26px; border-radius: var(--radius); background: var(--ink); color: var(--on-dark); }
.dl-main h3 { font-size: 1.5rem; }
.dl-main p { margin: 4px 0 0; color: var(--on-dark-muted); font-size: 0.92rem; }
.dl-main .button { margin-left: auto; }
.dl-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; max-width: 780px; margin: 0 auto; }
.dl-item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 16px; background: #fff; }
.dl-item img { width: 42px; height: 42px; }
.dl-item strong { display: block; font-size: 1rem; }
.dl-item span { font-size: 0.8rem; color: var(--on-paper-muted); }
.dl-item .links { margin-left: auto; display: flex; gap: 6px; }
.dl-item .links a { text-decoration: none; font-size: 0.8rem; font-weight: 650; padding: 7px 12px; border-radius: 999px; border: 1.5px solid var(--ink); transition: background 150ms ease, color 150ms ease; }
.dl-item .links a:hover { background: var(--ink); color: var(--paper); }
.dl-item .links a:active { transform: scale(0.96); }
.note { max-width: 780px; margin: 22px auto 0; font-size: 0.85rem; text-align: center; }

.footer {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
  padding: 36px var(--gutter) max(36px, env(safe-area-inset-bottom)); color: var(--on-dark-muted); font-size: 0.86rem;
}
.footer div { display: flex; align-items: center; gap: 10px; }
.footer nav { display: flex; flex-wrap: wrap; gap: 20px; }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--on-dark); }

/* Scroll reveal */
.reveal { opacity: 0; transform: translateY(32px); transition: opacity 800ms var(--ease-out), transform 900ms var(--ease-out); }
.reveal.in { opacity: 1; transform: none; }

/* Without the pinned scene (small screens, reduced motion) the story is a plain list */
.story.flat .story-track { height: auto; margin: 0; }
.story.flat .story-sticky { position: static; height: auto; overflow: visible; padding: 0 0 clamp(90px, 12vw, 160px); }
.story.flat .story-panels { height: auto; display: grid; gap: 96px; }
.story.flat .panel { position: static; padding: 0; }
.story.flat .panel-art { height: auto; aspect-ratio: 5 / 4; }
.story.flat .story-rail { display: none; }

@media (max-width: 1000px) {
  .features { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .panel { grid-template-columns: 1fr; gap: 28px; }
  .hero { align-items: end; }
}
@media (max-width: 720px) {
  .nav nav { display: none; }
  .pill { margin-left: auto; }
  .stats { grid-template-columns: repeat(2, 1fr); row-gap: 28px; }
  .stats div:nth-child(3) { border-left: 0; }
  .dl-list { grid-template-columns: 1fr; }
  .dl-main { flex-wrap: wrap; }
  .dl-main .button { width: 100%; margin-left: 0; }
  .showcase { height: 170vh; }
  .chip em { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { transform: none; transition: opacity 300ms ease; }
  .caret { animation: none; }
  #results li { transform: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .nav, .nav.scrolled { background: var(--ink); -webkit-backdrop-filter: none; backdrop-filter: none; border-bottom-color: var(--line-dark); }
}
@media (prefers-contrast: more) {
  :root { --line-dark: rgba(243, 240, 234, 0.4); --line-paper: rgba(14, 14, 14, 0.4); --on-dark-muted: #d6d2ca; --on-paper-muted: #33302a; }
}
