:root {
  --ink: #0d0c0a;
  --ink-2: #151412;
  --panel: #1a1917;
  --line: rgba(243, 241, 234, 0.08);
  --line-2: rgba(243, 241, 234, 0.14);
  --text: #f3f1ea;
  --muted: rgba(243, 241, 234, 0.58);
  --faint: rgba(243, 241, 234, 0.36);
  --yellow: #ffd60a;
  --yellow-hi: #ffe24d;
  --yellow-lo: #f5c400;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
  --display: 'Cabinet Grotesk', 'Satoshi', ui-sans-serif, sans-serif;
  --body: 'Satoshi', ui-sans-serif, system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --pad: clamp(20px, 5vw, 72px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font: 500 17px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2 { font-family: var(--display); font-weight: 800; letter-spacing: -0.022em; margin: 0; }
p { margin: 0; }
.mono { font-family: var(--mono); font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; font-size: 12px; }
.label { color: var(--yellow); margin-bottom: 18px; }
.muted { color: var(--muted); }

/* Grain lives on a fixed, non-scrolling layer (no repaint while scrolling). */
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 100; opacity: 0.06;
  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='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── Nav ── */
.nav {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 50;
  width: min(1120px, calc(100% - 32px));
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 8px 8px 8px 16px; border-radius: 999px;
  background: rgba(21, 20, 18, 0.62);
  backdrop-filter: blur(18px) saturate(160%); -webkit-backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.brand { display: flex; align-items: center; gap: 10px; font: 800 17px var(--display); letter-spacing: -0.02em; }
.brand img { border-radius: 7px; }
.nav-links { display: flex; gap: 28px; font-size: 15px; color: var(--muted); }
.nav-links a { transition: color 160ms ease; }
.nav-links a:hover { color: var(--text); }
@media (max-width: 820px) { .nav-links { display: none; } }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 54px; padding: 0 22px; border-radius: 999px; font-weight: 700; font-size: 16px;
  transition: transform 160ms var(--ease-out), background-color 160ms ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }
.btn-small { height: 40px; padding: 0 18px; font-size: 14px; background: var(--yellow); color: var(--ink); }
.btn-store { background: var(--text); color: var(--ink); padding: 0 24px 0 20px; }
.btn-store svg { width: 24px; height: 24px; fill: currentColor; }
.btn-store span { display: flex; flex-direction: column; line-height: 1.05; font-size: 19px; text-align: left; }
.btn-store small { font-size: 11px; font-weight: 500; opacity: 0.7; }
.btn-store.dark { background: var(--ink); color: var(--text); }
.btn-ghost { border: 1px solid var(--line-2); color: var(--text); }
@media (hover: hover) {
  .btn-ghost:hover { background: rgba(243, 241, 234, 0.06); }
  .btn-store:hover, .btn-small:hover { transform: translateY(-1px); }
}

/* ── Hero ── */
.hero {
  position: relative; min-height: 100dvh;
  display: grid; grid-template-columns: 1.05fr 1fr; align-items: center; gap: clamp(32px, 6vw, 96px);
  padding: 120px var(--pad) 72px; max-width: 1400px; margin: 0 auto;
  isolation: isolate;
}
.hero::before {
  content: ''; position: absolute; inset: 0 calc(50% - 50vw); z-index: -1;
  background: url('/assets/hero-cell.webp') center / cover no-repeat;
  opacity: 0.55;
  mask-image: linear-gradient(to bottom, #000 55%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent);
}
.plaque {
  display: inline-flex; align-items: center; gap: 10px;
  font: 500 12px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line-2); margin-bottom: 28px;
}
.plaque .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--yellow); animation: blink 2.4s var(--ease-io) infinite; }
@keyframes blink { 50% { opacity: 0.25; } }
.hero h1 { font-size: clamp(44px, 6.2vw, 84px); line-height: 0.95; }
.hero h1 em { font-style: normal; color: var(--yellow); white-space: nowrap; }
.lede { margin-top: 24px; font-size: 19px; line-height: 1.55; color: var(--muted); max-width: 46ch; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.fine { margin-top: 22px; font-size: 14px; color: var(--faint); }

/* ── The cell (hero toy) ── */
.cell-wrap { position: relative; display: grid; justify-items: center; gap: 22px; }
.cell {
  position: relative; width: min(440px, 100%); aspect-ratio: 4 / 4.6; border-radius: 34px; overflow: hidden;
  background: radial-gradient(120% 90% at 50% 0%, #2a2926, #141311 70%);
  border: 1px solid var(--line-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 40px 80px -30px rgba(0, 0, 0, 0.9);
  transform: rotate(-1.5deg);
}
.cell-head { position: absolute; top: 16px; left: 16px; right: 16px; display: flex; justify-content: space-between; color: var(--faint); z-index: 4; }
.cell-head span { padding: 5px 10px; border-radius: 999px; background: rgba(13, 12, 10, 0.78); }
.cell[data-state='free'] .cell-head span { background: rgba(255, 255, 255, 0.55); color: var(--ink); }
.cell .status { transition: color 300ms ease; }
.cell[data-state='free'] .status { color: var(--ink); }

.tide { position: absolute; left: -10%; right: -10%; bottom: 0; height: 100%; z-index: 1; transform: translateY(100%); will-change: transform; }
.tide-wave {
  position: absolute; inset: 0; background: var(--yellow);
  border-radius: 46% 54% 0 0 / 14px 14px 0 0;
}
.inmates {
  list-style: none; margin: 0; padding: 0; position: absolute; inset: 64px 34px 74px; z-index: 2;
  display: grid; grid-template-columns: repeat(3, 1fr); align-content: center; gap: 22px 14px; justify-items: center;
}
.inmates li { display: grid; justify-items: center; gap: 8px; }
.inmates img {
  width: clamp(58px, 7vw, 76px); aspect-ratio: 1; border-radius: 22.5%;
  filter: grayscale(1) brightness(0.62) contrast(0.85);
  transition: filter 500ms var(--ease-out);
  box-shadow: 0 10px 24px -10px rgba(0, 0, 0, 0.8);
  animation: idle 5s var(--ease-io) infinite; animation-delay: calc(var(--d) * -0.9s);
}
.inmates span { color: var(--faint); font-size: 10.5px; padding: 2px 7px; border-radius: 6px; background: rgba(13, 12, 10, 0.72); position: relative; z-index: 4; transition: color 300ms ease, background-color 300ms ease; }
@keyframes idle { 50% { transform: translateY(-3px); } }
.cell[data-state='free'] .inmates img { filter: none; animation: pop 640ms var(--ease-out) both; animation-delay: calc(var(--d) * 80ms); }
.cell[data-state='free'] .inmates span { color: var(--ink); background: rgba(255, 255, 255, 0.5); }
@keyframes pop {
  0% { transform: scale(0.82) rotate(-6deg); }
  55% { transform: scale(1.08) rotate(2deg); }
  100% { transform: scale(1) rotate(0); }
}

.bars { position: absolute; inset: 0; z-index: 3; display: flex; justify-content: space-evenly; padding: 0 6px; transition: transform 700ms var(--ease-io); }
.bars i {
  width: 9px; height: 100%; border-radius: 5px;
  background: linear-gradient(90deg, #4a4946, #9a9893 38%, #5c5b57 60%, #2e2d2a);
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.55);
}
.crossbar {
  position: absolute; left: 0; right: 0; top: 22%; height: 10px; border-radius: 5px;
  background: linear-gradient(180deg, #8f8d88, #4b4a46); box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}
.crossbar.low { top: auto; bottom: 22%; }
.cell[data-state='free'] .bars { transform: translateY(-104%); }

.breath {
  position: absolute; left: 50%; bottom: 18px; z-index: 4; transform: translateX(-50%); white-space: nowrap;
  padding: 7px 14px; border-radius: 999px; color: var(--muted);
  background: rgba(13, 12, 10, 0.78); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border: 1px solid var(--line); transition: color 300ms ease, background-color 300ms ease;
}
.cell.filling .breath, .cell[data-state='free'] .breath { color: var(--ink); background: rgba(255, 255, 255, 0.55); border-color: rgba(13, 12, 10, 0.08); }

.bail {
  position: relative; overflow: hidden; width: min(440px, 100%); height: 64px; border-radius: 999px; border: 0;
  background: var(--yellow); color: var(--ink); font: 800 19px var(--display); letter-spacing: -0.01em;
  cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), inset 0 -2px 0 rgba(0, 0, 0, 0.08), 0 16px 32px -18px rgba(255, 214, 10, 0.55);
  transition: transform 160ms var(--ease-out);
}
.bail:active { transform: scale(0.98); }
.bail:focus-visible { outline: 2px solid var(--text); outline-offset: 4px; }
.bail-fill { position: absolute; inset: 0; background: var(--ink); transform: scaleX(0); transform-origin: left; opacity: 0.12; }
.bail-label { position: relative; }
.confetti { position: absolute; left: 50%; top: 50%; width: min(140%, 100vw); height: 180%; transform: translate(-50%, -50%); pointer-events: none; z-index: 5; }

/* ── Statement ── */
.statement { max-width: 1400px; margin: 0 auto; padding: clamp(80px, 14vw, 180px) var(--pad); display: grid; grid-template-columns: 2fr 1fr; gap: 48px; align-items: end; }
.statement .big { font: 800 clamp(36px, 5vw, 68px)/1.02 var(--display); letter-spacing: -0.03em; max-width: 16ch; }
.statement .small { color: var(--muted); font-size: 18px; max-width: 38ch; }
.statement strong { color: var(--text); }

/* ── Features (zig-zag) ── */
.features { max-width: 1200px; margin: 0 auto; padding: 0 var(--pad); display: grid; gap: clamp(80px, 12vw, 160px); }
.feature { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(32px, 7vw, 110px); align-items: center; }
.feature.flip .phone { order: 2; }
.feature h2 { font-size: clamp(34px, 4.2vw, 56px); line-height: 1; }
.feature-copy p:not(.label) { margin-top: 18px; color: var(--muted); font-size: 18px; max-width: 40ch; }
.phone {
  justify-self: center; width: min(320px, 78vw); border-radius: 46px; padding: 9px;
  background: linear-gradient(145deg, #3a3936, #121110 60%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 50px 90px -40px rgba(0, 0, 0, 0.95);
}
.phone img { border-radius: 38px; width: 100%; height: auto; }
.phone.tilt { transform: rotate(3deg); }

/* ── Inmates wall ── */
.inmates-wall { padding: clamp(110px, 16vw, 200px) 0 0; }
.wall-head, .day-head { max-width: 1400px; margin: 0 auto 44px; padding: 0 var(--pad); }
.wall-head h2, .day-head h2 { font-size: clamp(34px, 4.2vw, 56px); line-height: 1; }
.marquee { overflow: hidden; padding: 10px 0; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.track { display: flex; gap: 16px; width: max-content; animation: slide 70s linear infinite; }
.marquee.reverse .track { animation-direction: reverse; animation-duration: 84s; }
.marquee:hover .track { animation-play-state: paused; }
@keyframes slide { to { transform: translateX(-50%); } }
.card {
  width: 268px; padding: 18px; border-radius: 22px; background: var(--panel); border: 1px solid var(--line);
  display: grid; grid-template-columns: 56px 1fr; gap: 6px 14px; align-items: center;
}
.card img { width: 56px; height: 56px; border-radius: 13px; grid-row: span 2; filter: grayscale(1) brightness(0.8); transition: filter 300ms ease; }
.card:hover img { filter: none; }
.card .who { font: 800 18px var(--display); letter-spacing: -0.01em; display: flex; justify-content: space-between; align-items: baseline; }
.card .who .mono { color: var(--faint); font-size: 10px; }
.card .charge { font-size: 13.5px; line-height: 1.35; color: var(--muted); }
.card .charge b { color: var(--yellow); font-weight: 700; }

/* ── Day timeline ── */
.day { padding: clamp(110px, 16vw, 200px) 0 0; }
.timeline { list-style: none; max-width: 1400px; margin: 0 auto; padding: 0 var(--pad); display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line-2); }
.timeline li { padding: 26px 24px 0 0; position: relative; }
.timeline li::before { content: ''; position: absolute; top: -5px; left: 0; width: 9px; height: 9px; border-radius: 50%; background: var(--yellow); }
.timeline li:nth-child(1)::before, .timeline li:nth-child(4)::before { background: var(--ink); border: 1.5px solid var(--faint); }
.timeline .t { display: block; font-size: 15px; color: var(--yellow); margin-bottom: 10px; }
.timeline p { color: var(--muted); font-size: 16px; max-width: 26ch; }

/* ── Max security ── */
.max { max-width: 1200px; margin: 0 auto; padding: clamp(110px, 16vw, 200px) var(--pad) 0; display: grid; grid-template-columns: 1.2fr 1fr; gap: 64px; align-items: center; }
.max h2 { font-size: clamp(34px, 4.2vw, 56px); line-height: 1; }
.rules { list-style: none; padding: 0; margin: 30px 0 22px; display: grid; }
.rules li { display: flex; gap: 18px; align-items: baseline; padding: 16px 0; border-top: 1px solid var(--line); font-size: 19px; }
.rules li:last-child { border-bottom: 1px solid var(--line); }
.rules .mono { color: var(--yellow); }

/* ── Privacy ── */
.privacy { max-width: 900px; margin: 0 auto; padding: clamp(110px, 16vw, 200px) var(--pad) 0; text-align: center; }
.privacy h2 { font-size: clamp(32px, 4vw, 52px); line-height: 1.02; }
.privacy p { margin: 20px auto 0; color: var(--muted); font-size: 18px; max-width: 54ch; }

/* ── FAQ ── */
.faq { max-width: 900px; margin: 0 auto; padding: clamp(110px, 16vw, 200px) var(--pad) 0; }
.faq h2 { font-size: clamp(34px, 4.2vw, 56px); margin-bottom: 30px; }
.qs details { border-top: 1px solid var(--line); }
.qs details:last-child { border-bottom: 1px solid var(--line); }
.qs summary {
  list-style: none; cursor: pointer; padding: 22px 0; font: 700 20px var(--display); letter-spacing: -0.01em;
  display: flex; justify-content: space-between; align-items: center; gap: 24px;
}
.qs summary::-webkit-details-marker { display: none; }
.qs summary::after { content: '+'; font: 500 26px var(--body); color: var(--yellow); transition: transform 220ms var(--ease-out); }
.qs details[open] summary::after { transform: rotate(45deg); }
.qs details p { color: var(--muted); padding: 0 0 22px; max-width: 62ch; }

/* ── Final CTA ── */
.final {
  position: relative; overflow: hidden; margin-top: clamp(110px, 16vw, 200px);
  padding: clamp(110px, 16vw, 190px) var(--pad); text-align: center; color: var(--ink);
  display: grid; justify-items: center; gap: 18px; isolation: isolate;
}
.final-tide { position: absolute; inset: 0; z-index: -1; background: var(--yellow); border-radius: 50% 50% 0 0 / 60px 60px 0 0; transform: translateY(var(--rise, 100%)); }
.final h2 { font-size: clamp(48px, 8vw, 112px); line-height: 0.92; }
.final p { font-size: 19px; opacity: 0.7; margin-bottom: 10px; }

/* ── Footer ── */
.footer { padding: 36px var(--pad) 44px; background: var(--yellow); color: var(--ink); }
.foot-row { max-width: 1400px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; border-top: 1px solid rgba(13, 12, 10, 0.15); padding-top: 28px; }
.foot-row nav { display: flex; gap: 24px; font-weight: 700; }
.fineprint { max-width: 1400px; margin: 18px auto 0; font-size: 13px; opacity: 0.6; }

/* ── Reveal ── */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out); transition-delay: calc(var(--i, 0) * 90ms); }
.reveal.in { opacity: 1; transform: none; }
.cell-wrap.reveal { transform: translateY(24px) scale(0.98); }
.cell-wrap.reveal.in { transform: none; }

/* ── Mobile ── */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 108px; text-align: left; }
  .statement, .feature, .max { grid-template-columns: 1fr; }
  .feature.flip .phone { order: 0; }
  .timeline { grid-template-columns: 1fr 1fr; row-gap: 36px; }
  .cell { transform: none; }
}
@media (max-width: 520px) {
  .timeline { grid-template-columns: 1fr; border-top: 0; border-left: 1px solid var(--line-2); margin-left: var(--pad); padding-left: 24px; row-gap: 28px; }
  .timeline li { padding: 0; }
  .timeline li::before { top: 6px; left: -29px; }
  .lede { font-size: 17px; }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: 1ms !important; }
  .reveal { opacity: 1; transform: none; }
}
