:root {
  --ink: #0b0c0a;
  --ink-2: #131510;
  --ink-3: #1b1e17;
  --line: rgba(237, 230, 214, 0.12);
  --line-2: rgba(237, 230, 214, 0.24);
  --cream: #ede6d6;
  --text-2: #d2cbbb;
  --muted: #aaa496;
  --signal: #ff5b2e;
  --mint: #8fe3c4;
  --display: "Bricolage Grotesque", "Trebuchet MS", sans-serif;
  --serif: "Newsreader", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --gutter: clamp(16px, 5vw, 72px);
  --radius: 18px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scrollbar-color: #3a3d33 var(--ink); }
/* Lenis smooth scroll (desktop) */
html.lenis, html.lenis body { height: auto; }
html.lenis { scroll-behavior: auto; }
.lenis.lenis-stopped { overflow: clip; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--display);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  caret-color: var(--signal);
}
::selection { background: var(--signal); color: #170a05; }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--ink); }
::-webkit-scrollbar-thumb { background: #3a3d33; border-radius: 10px; border: 2px solid var(--ink); }
img, svg, canvas { display: block; }
a { color: inherit; text-underline-offset: 3px; }
h1, h2, h3 { font-weight: 800; letter-spacing: -0.03em; line-height: 1.04; margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; color: var(--signal); }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; border-radius: 6px; }

/* ---------- NAV ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 14px var(--gutter);
  transition: background .3s, border-color .3s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled { background: var(--ink); border-color: var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-height: 44px; }
.brand-word { font-weight: 800; font-size: 26px; letter-spacing: -0.06em; }
.brand-mark { display: flex; align-items: flex-end; gap: 3px; height: 20px; }
.brand-mark i { width: 4px; background: var(--signal); border-radius: 2px; transform-origin: bottom; animation: eq 1.4s ease-in-out infinite; }
.brand-mark i:nth-child(1) { height: 40%; animation-delay: -.2s; }
.brand-mark i:nth-child(2) { height: 100%; animation-delay: -.6s; }
.brand-mark i:nth-child(3) { height: 65%; animation-delay: -1s; }
@keyframes eq { 50% { transform: scaleY(.45); } }
.nav-links { display: flex; gap: 30px; }
.nav-links a { text-decoration: none; font-size: 16px; color: var(--text-2); transition: color .2s; padding-block: 10px; }
.nav-links a:hover { color: var(--cream); }
.nav-links a { position: relative; }
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 4px; height: 2px; background: var(--signal);
  transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease-out);
}
.nav-links a.here { color: var(--cream); }
.nav-links a.here::after { transform: scaleX(1); }

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 15px 26px; border-radius: 999px; border: 0;
  background: var(--signal); color: #170a05;
  font: 600 16px/1.1 var(--display); text-decoration: none; cursor: pointer; text-align: center;
  transition: transform .3s var(--ease-out), box-shadow .3s var(--ease-out), background .2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 24px -14px rgba(0, 0, 0, .9); background: #ff6a40; }
.btn:active { transform: translateY(0); }
.btn-ghost { background: transparent; color: var(--cream); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn-ghost:hover { background: transparent; box-shadow: inset 0 0 0 1px var(--cream); }
.btn-small { min-height: 44px; padding: 10px 18px; font-size: 15px; }
.btn-big { min-height: 60px; padding: 20px 34px; font-size: 18px; }

.lead { font-size: clamp(17px, 1.6vw, 20px); color: var(--text-2); max-width: 54ch; }
.note { font-size: 14px; color: var(--muted); }

/* ---------- STORY (sticky 3D stage + hero + chapters) ---------- */
.story { position: relative; }
.story-stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; z-index: 0; background: var(--ink); }
.story-content { position: relative; z-index: 1; margin-top: -100vh; margin-top: -100svh; pointer-events: none; }
.story-content a, .story-content button { pointer-events: auto; }
.hero {
  position: relative; min-height: 100vh; min-height: 100svh; display: flex; align-items: flex-end;
  padding: 120px var(--gutter) clamp(48px, 9vh, 96px);
}
#cena { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: pan-y; cursor: grab; }
#cena:active { cursor: grabbing; }
.hero-copy { position: relative; z-index: 2; max-width: min(780px, 54vw); pointer-events: none; }
.hero-copy a { pointer-events: auto; }
.hero h1 { font-size: clamp(40px, 5.2vw, 78px); margin-bottom: 24px; line-height: 1.02; }
.hero h1 em { font-size: 1.04em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.hero-hint {
  position: absolute; right: var(--gutter); bottom: 32px; z-index: 2;
  font-size: 14px; color: var(--muted);
  transition: opacity .2s linear;
}
.chapter { min-height: 100vh; min-height: 100svh; display: flex; align-items: center; padding: 96px var(--gutter); }
.chapter-card { max-width: 540px; }
.chapter-card h2 { font-size: clamp(34px, 4.4vw, 60px); margin-bottom: 20px; }
.chapter-card p { color: var(--text-2); font-size: clamp(18px, 1.5vw, 20px); max-width: 44ch; }
.hero-chips { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.chip {
  position: absolute; left: 0; top: 0; white-space: nowrap;
  font: 500 13px/1 var(--mono); padding: 10px 13px 10px 27px; border-radius: 999px;
  background: var(--ink-2); border: 1px solid var(--line-2); color: var(--cream);
  opacity: 0; transition: opacity .5s;
  will-change: transform;
}
.chip::before {
  content: ""; position: absolute; left: 11px; top: 50%; width: 8px; height: 8px; margin-top: -4px;
  border-radius: 50%; background: var(--c, var(--signal));
}
.chip.on { opacity: 1; }

/* ---------- SECTIONS ---------- */
.sec { position: relative; padding: clamp(96px, 12vw, 160px) var(--gutter) clamp(80px, 10vw, 136px); }
.sec h2 { font-size: clamp(34px, 4.6vw, 64px); }
.sec-title { max-width: 18ch; margin-bottom: clamp(36px, 5vw, 64px); }

/* demo */
.demo-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(40px, 6vw, 96px); align-items: center; }
.demo-copy h2 { max-width: 16ch; }
.demo-steps { list-style: none; padding: 0; margin: 36px 0 28px; display: grid; gap: 4px; }
.demo-steps li {
  padding: 16px 18px; border-radius: 12px; color: var(--muted); background: transparent;
  transition: color .4s, background .4s;
}
.demo-steps li b { font: 500 14px var(--mono); color: inherit; margin-right: 10px; }
.demo-steps li.on { color: var(--cream); background: var(--ink-2); }
.demo-steps li.on b { color: var(--signal); }
.phone-stage { perspective: 1400px; display: grid; justify-items: center; position: relative; }
.phone {
  width: min(350px, 100%); height: 600px; border-radius: 44px; padding: 14px;
  background: #0e100c; border: 1px solid var(--line-2);
  box-shadow: inset 0 0 0 6px #1d2019, 0 40px 80px -30px rgba(0, 0, 0, .9);
  transform: rotateY(-12deg) rotateX(5deg); transform-style: preserve-3d;
  transition: transform .6s var(--ease-out);
  display: flex; flex-direction: column; overflow: hidden;
}
.phone-top { display: flex; align-items: center; gap: 12px; padding: 22px 14px 14px; border-bottom: 1px solid var(--line); }
.phone-top b { display: block; font-size: 16px; }
.phone-top small { font-size: 13px; color: var(--muted); }
.phone-avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--mint); color: #0b2a1f; font-weight: 800; font-size: 13px; }
.chat {
  flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; padding: 16px 10px 10px; overflow: hidden;
  background-image: radial-gradient(rgba(237,230,214,.05) 1px, transparent 1px); background-size: 16px 16px;
}
.msg {
  max-width: 86%; padding: 10px 13px 20px; border-radius: 14px; font-size: 15px; line-height: 1.42; position: relative;
  animation: pop .45s var(--ease-out) both;
}
.msg small { position: absolute; right: 10px; bottom: 4px; font: 400 11px var(--mono); opacity: .65; }
.msg.out { align-self: flex-start; background: var(--ink-3); border-top-left-radius: 4px; }
.msg.in { align-self: flex-end; background: #16523f; border-top-right-radius: 4px; }
.msg.typing { padding: 12px 14px; }
.msg.typing i { display: inline-block; width: 6px; height: 6px; margin: 0 2px; border-radius: 50%; background: var(--muted); animation: dot 1s infinite; }
.msg.typing i:nth-child(2) { animation-delay: .15s; }
.msg.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 50% { transform: translateY(-4px); opacity: .4; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.97); } }
.quick { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.quick[hidden] { display: none; }
.quick button {
  flex: 1; min-height: 48px; font: 600 15px var(--display); color: var(--cream); background: var(--ink-3); cursor: pointer;
  border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 8px; transition: background .2s, border-color .2s, transform .2s var(--ease-out);
  animation: pop .45s var(--ease-out) both;
}
.quick button:nth-child(2) { animation-delay: .08s; }
.quick button:hover { background: #16523f; border-color: var(--mint); transform: translateY(-2px); }

/* calculator */
.calc { background: var(--ink-2); border-block: 1px solid var(--line); }
.calc-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(32px, 6vw, 96px); align-items: center; }
.calc-intro h2 { max-width: 14ch; }
.calc-intro p { color: var(--text-2); margin-top: 22px; max-width: 42ch; }
.calc-intro .note { color: var(--muted); margin-top: 16px; }
.calc-box {
  background: var(--ink); border: 1px solid var(--line); border-radius: 24px; padding: clamp(22px, 3vw, 40px);
  display: grid; gap: 22px;
}
.field { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; align-items: end; }
.field span { font-size: 16px; color: var(--text-2); }
.field output { font: 500 16px var(--mono); color: var(--cream); font-variant-numeric: tabular-nums; }
.field input { grid-column: 1 / -1; }
input[type=range] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 44px; background: transparent; cursor: pointer; margin: 0;
  --p: 25%;
}
input[type=range]::-webkit-slider-runnable-track {
  height: 4px; border-radius: 4px;
  background: linear-gradient(90deg, var(--signal) var(--p), #2a2d24 var(--p));
}
input[type=range]::-moz-range-track { height: 4px; border-radius: 4px; background: #2a2d24; }
input[type=range]::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--signal); }
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 26px; height: 26px; margin-top: -11px; border-radius: 50%;
  background: var(--cream); border: 6px solid var(--signal); transition: transform .15s;
}
input[type=range]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--cream); border: 6px solid var(--signal); }
input[type=range]:active::-webkit-slider-thumb { transform: scale(1.12); }
.calc-out { border-top: 1px dashed var(--line-2); padding-top: 24px; }
.calc-label { font-size: 15px; font-weight: 600; color: var(--muted); }
.calc-total { font-size: clamp(52px, 7vw, 92px); font-weight: 800; letter-spacing: -0.04em; line-height: 1; margin: 8px 0 12px; color: var(--signal); font-variant-numeric: tabular-nums; }
.calc-sub { color: var(--text-2); }
.calc-cta { margin-top: 24px; }

/* niches */
.niches { background: var(--ink-2); border-block: 1px solid var(--line); }
.niche-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.niche-tabs button {
  min-height: 44px; font: 600 16px var(--display); color: var(--text-2); background: transparent; cursor: pointer;
  border: 1px solid var(--line-2); border-radius: 999px; padding: 10px 18px; transition: color .25s, background .25s, border-color .25s;
}
.niche-tabs button:hover { color: var(--cream); border-color: var(--cream); }
.niche-tabs button[aria-selected=true] { color: #170a05; background: var(--cream); border-color: var(--cream); }
.niche-panel {
  display: grid; grid-template-columns: minmax(0, 1fr) 90px minmax(0, 1fr); gap: 24px; align-items: center;
  border: 1px solid var(--line); border-radius: 24px; padding: clamp(24px, 4vw, 48px); background: var(--ink);
}
.niche-k { font-size: 15px; font-weight: 600; color: var(--muted); margin-bottom: 12px; }
.niche-pain { font-family: var(--serif); font-style: italic; font-size: clamp(24px, 2.6vw, 34px); line-height: 1.22; color: var(--cream); }
.niche-fix { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.niche-fix li { padding-left: 26px; position: relative; color: var(--text-2); }
.niche-fix li::before { content: ""; position: absolute; left: 0; top: .72em; width: 12px; height: 2px; background: var(--signal); }
.niche-arrow svg { width: 100%; fill: none; stroke: var(--signal); stroke-width: 2; }
.niche-arrow path { stroke-dasharray: 100; stroke-dashoffset: 0; }
.niche-panel.swap .niche-arrow path { animation: draw .6s var(--ease-out); }
@keyframes draw { from { stroke-dashoffset: 100; } }
.niche-panel.swap .niche-pain, .niche-panel.swap .niche-fix { animation: swap .5s var(--ease-out); }
@keyframes swap { from { opacity: 0; transform: translateY(10px); } }

/* fronts: plain three-column list, no cards */
.front-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(28px, 4vw, 56px); }
.front { position: relative; padding-top: 24px; }
.front::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--cream); transform-origin: left; transition: transform .7s var(--ease-out); }
.front-list.pre .front::before { transform: scaleX(0); }
.front-list .front:nth-child(2)::before { transition-delay: .12s; }
.front-list .front:nth-child(3)::before { transition-delay: .24s; }
.front h3 { font-size: clamp(24px, 2.2vw, 30px); margin-bottom: 12px; }
.front p { color: var(--text-2); max-width: 38ch; }

/* process */
.process { background: var(--ink-2); border-block: 1px solid var(--line); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; counter-reset: s; }
.step { padding: 0 28px 0 0; position: relative; counter-increment: s; }
.step::before {
  content: "0" counter(s); display: block; font-size: 64px; font-weight: 800; letter-spacing: -0.04em; line-height: 1;
  color: transparent; -webkit-text-stroke: 1px var(--signal); margin-bottom: 18px;
}
.step::after { content: ""; position: absolute; top: 32px; left: 92px; right: 18px; height: 1px; background: var(--signal); transform-origin: left; transition: transform .45s var(--ease-out); }
.step::before { transition: color .4s var(--ease-out); }
.steps.pre .step::after { transform: scaleX(0); }
.steps.drawn .step::before { color: var(--signal); }
.steps.drawn .step:nth-child(1)::before { transition-delay: 0s; }
.steps.drawn .step:nth-child(1)::after { transition-delay: .25s; }
.steps.drawn .step:nth-child(2)::before { transition-delay: .65s; }
.steps.drawn .step:nth-child(2)::after { transition-delay: .9s; }
.steps.drawn .step:nth-child(3)::before { transition-delay: 1.3s; }
.steps.drawn .step:nth-child(3)::after { transition-delay: 1.55s; }
.steps.drawn .step:nth-child(4)::before { transition-delay: 1.95s; }
.step:last-child::after { display: none; }
.step-time { font: 500 14px var(--mono); color: var(--signal); }
.step h3 { font-size: 26px; margin: 8px 0 10px; }
.step p { color: var(--text-2); font-size: 16px; }

/* faq */
.faq-list { max-width: 900px; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; padding: 26px 52px 26px 0; position: relative;
  font-size: clamp(19px, 2vw, 24px); font-weight: 600; letter-spacing: -0.02em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 8px; top: 50%; width: 16px; height: 16px; margin-top: -8px;
  background:
    linear-gradient(var(--signal), var(--signal)) center / 16px 2px no-repeat,
    linear-gradient(var(--signal), var(--signal)) center / 2px 16px no-repeat;
  transition: transform .3s var(--ease-out);
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--text-2); padding: 0 0 28px; max-width: 64ch; }

/* cta */
.cta { text-align: center; display: grid; justify-items: center; padding-block: clamp(120px, 15vw, 200px); }
.cta h2 { max-width: 16ch; font-size: clamp(38px, 6vw, 84px); clip-path: inset(-10% -10% -10% -10%); transition: clip-path .9s var(--ease-out), transform .9s var(--ease-out); }
.cta .lead, .cta .btn, .cta-alt { transition: opacity .6s var(--ease-out), transform .6s var(--ease-out); }
.cta.pre h2 { clip-path: inset(100% -10% -10% -10%); transform: translateY(40px); }
.cta.pre .lead, .cta.pre .btn, .cta.pre .cta-alt { opacity: 0; transform: translateY(16px); }
.cta.drawn .lead { transition-delay: .35s; }
.cta.drawn .btn { transition-delay: .5s; }
.cta.drawn .cta-alt { transition-delay: .65s; }
.cta .lead { margin: 24px 0 40px; }
.cta-alt { margin-top: 22px; color: var(--muted); font-size: 16px; }
.cta-alt a { color: var(--cream); }

/* footer */
.foot {
  display: flex; flex-wrap: wrap; gap: 12px 32px; align-items: center; justify-content: space-between;
  padding: 36px var(--gutter); border-top: 1px solid var(--line); color: var(--muted); font-size: 15px;
}
.foot .brand-word { color: var(--cream); font-size: 22px; }
.foot-links a { display: inline-block; padding-block: 12px; color: var(--cream); }

/* hero entrance: the only reveal on the page */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease-out), transform 1s var(--ease-out); }
.reveal.in { opacity: 1; transform: none; }
.hero .reveal:nth-child(2) { transition-delay: .08s; }
.hero .reveal:nth-child(3) { transition-delay: .16s; }

/* slots where the 3D objects sit on mobile (desktop keeps them beside the text) */
.m-visual { display: none; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1020px) {
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px 0; }
  .step:nth-child(2)::after { display: none; }
  .calc-grid, .demo-grid { grid-template-columns: 1fr; }
  .front-list { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  body { font-size: 16px; }
  .nav { padding-block: 10px; }
  .nav-links { display: none; }
  .sec { padding: 72px var(--gutter) 64px; }
  .sec h2 { font-size: 32px; }
  .sec-title { margin-bottom: 28px; }

  /* hero: 3D calendar on top, copy below, everything on the first screen */
  .hero { flex-direction: column; align-items: stretch; justify-content: flex-end; padding: 64px var(--gutter) 28px; }
  .hero .m-visual { display: block; flex: 1 1 auto; min-height: 230px; }
  .hero-copy { max-width: none; }
  .hero-hint { display: none; }
  .hero h1 { font-size: 36px; margin-bottom: 14px; }
  .hero .lead { font-size: 16px; }
  .hero-actions { margin-top: 22px; gap: 10px; }
  .hero-actions .btn { flex: 1 1 auto; }

  /* chapters: each object has its own slot above its text and scrolls with it */
  .chapter { display: block; min-height: 0; padding: 8px var(--gutter) 64px; }
  .chapter .m-visual { display: block; height: 54vh; height: 54svh; min-height: 300px; max-height: 470px; }
  .chapter-card { max-width: none; }
  .chapter-card h2 { font-size: 30px; margin-bottom: 14px; }
  .chapter-card p { font-size: 17px; }

  /* demo: title, phone, then the steps */
  .demo-grid { display: flex; flex-direction: column; gap: 0; }
  .demo-copy { display: contents; }
  .demo-copy h2 { order: 1; }
  .phone-stage { order: 2; margin: 28px 0 8px; }
  .demo-steps { order: 3; margin: 16px 0 20px; }
  #demo-replay { order: 4; align-self: flex-start; }
  .phone { transform: none; height: 470px; }

  /* process: compact timeline with small numbers */
  .steps { grid-template-columns: 1fr; gap: 28px; }
  .step { display: grid; grid-template-columns: 52px 1fr; padding: 0; }
  .step::before { grid-row: 1 / span 3; font-size: 34px; margin: 0; }
  .step::after { display: none; }
  .step h3 { font-size: 22px; margin: 4px 0 6px; }

  .niche-panel { grid-template-columns: 1fr; }
  .niche-arrow { width: 60px; transform: rotate(90deg); justify-self: start; margin-left: 6px; }
  .niche-tabs button { flex: 1 1 auto; }
  .faq summary { padding-block: 20px; font-size: 18px; }
  .cta { padding-block: 96px; }
  .calc-cta { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .brand-mark i, .msg, .quick button, .niche-panel.swap .niche-pain, .niche-panel.swap .niche-fix { animation: none; }
  .msg.typing i { animation: none; }
}
