/* Night palette from the sunset scroll story. The home page opens over the landscape in
   index.html's inline SVG (its colours live in that SVG's gradients); everything after it, and the
   Safety page, sits on --ink. */
:root {
  --ink: #08070f;
  --ink-2: #110f1d;
  --ink-3: #191628;
  --line: rgba(255, 255, 255, 0.09);
  --text: #ece8f5;
  --muted: #a39cbc;
  --pink: #fd75a8;
  --sun: #f5c54e;
  --peach: #ffab93;
  --violet: #8f74e0;
  --plum: #2a1631;
  --safe: #5fd38a;
  --check: #f2b84b;
  --font: "Inter", "Segoe UI", system-ui, sans-serif;
  --display: "Space Grotesk", "Inter", "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "Cascadia Mono", Consolas, ui-monospace, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font: 16px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
code { font-family: var(--mono); font-size: 0.88em; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--pink); outline-offset: 3px; }

/* Nav: transparent plum over the sunset, glass once the page scrolls (scene.js), always glass elsewhere. */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 18px clamp(16px, 4vw, 48px);
  color: var(--plum);
  border-bottom: 1px solid transparent;
  transition: background .35s, color .35s, padding .35s, border-color .35s;
}
.nav.solid {
  background: rgba(10, 9, 19, 0.72);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  color: var(--text); padding-top: 12px; padding-bottom: 12px;
  border-bottom-color: var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font: 700 1.2rem var(--display); letter-spacing: .01em; text-decoration: none; }
.brand svg { width: 26px; height: 26px; }
/* Plum over the bright sunset; the app icon's gold-to-pink sun once the nav is on night. */
.nav.solid .brand g, .nav.open .brand g { fill: url(#brand-sun-fill); }
.nav-links { display: flex; gap: 28px; list-style: none; margin: 0 0 0 auto; padding: 0; font-size: .92rem; font-weight: 500; }
.nav-links a { text-decoration: none; opacity: .85; transition: opacity .2s; }
.nav-links a:hover { opacity: 1; }
.nav-cta {
  font-size: .88rem; font-weight: 600; text-decoration: none;
  padding: 9px 16px; border-radius: 999px; border: 1px solid currentColor;
  transition: background .2s, color .2s, border-color .2s;
}
.nav-cta:hover { background: var(--plum); color: #fff; border-color: var(--plum); }
.nav.solid .nav-cta:hover { background: var(--text); color: var(--ink); border-color: var(--text); }
.nav-toggle { display: none; position: relative; width: 42px; height: 42px; margin-right: -8px; padding: 6px; background: none; border: 0; color: inherit; cursor: pointer; }
.burger { position: absolute; inset: 0; }
.burger i {
  position: absolute; left: 10px; right: 10px; height: 2px; border-radius: 2px; background: currentColor;
  transition: transform .45s cubic-bezier(.7, 0, .2, 1), opacity .25s, top .45s cubic-bezier(.7, 0, .2, 1);
}
.burger i:nth-child(1) { top: 14px; }
.burger i:nth-child(2) { top: 20px; }
.burger i:nth-child(3) { top: 26px; }
.nav-meta { display: none; }

/* Buttons */
.btn-primary, .btn-ghost, .btn-light {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 600; font-size: .95rem; text-decoration: none; padding: 13px 22px; border-radius: 999px;
  transition: transform .2s, background .2s, color .2s;
}
.btn-primary svg, .btn-light svg { width: 17px; height: 17px; fill: currentColor; }
.btn-primary { background: var(--plum); color: #fff; }
.btn-primary:hover { transform: translateY(-2px); background: #3d2046; }
.btn-ghost { border: 1px solid rgba(42, 22, 49, .5); background: rgba(255, 236, 226, .72); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.btn-ghost:hover { background: rgba(255, 255, 255, .9); }
.btn-light { background: #fff; color: var(--plum); }
.btn-light:hover { transform: translateY(-2px); }

/* Install command. min-width: 0 lets the long command scroll inside its box instead of widening the page. */
.command {
  display: flex; align-items: center; gap: 4px; min-width: 0; max-width: 100%;
  padding: 6px 6px 6px 16px; border-radius: 14px;
  border: 1px solid rgba(42, 22, 49, .28); background: rgba(255, 240, 232, .62);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.command code {
  white-space: nowrap; overflow-x: auto; min-width: 0; padding-right: 12px; font-size: .82rem; scrollbar-width: none;
  /* On narrow screens the command scrolls; fade its cut edge instead of slicing a word in half. */
  -webkit-mask-image: linear-gradient(to left, transparent, #000 14px); mask-image: linear-gradient(to left, transparent, #000 14px);
}
.command .prompt { opacity: .55; user-select: none; }
.copy {
  flex: none; cursor: pointer; padding: 6px 12px; border-radius: 9px;
  border: 1px solid rgba(42, 22, 49, .3); background: rgba(255, 255, 255, .7); color: var(--plum);
  font: 600 .8rem var(--font);
}
.copy:hover { background: #fff; }
.command.dark { border-color: rgba(255, 255, 255, .25); background: rgba(10, 8, 20, .38); color: #fff; }
.command.dark .copy { border-color: rgba(255, 255, 255, .3); background: rgba(255, 255, 255, .12); color: #fff; }
.command.dark .copy:hover { background: rgba(255, 255, 255, .22); }

/* ===== Home: the scroll story ===== */
.wrapper { position: relative; }

/* The sky rect is 80% opaque and was drawn over white. */
svg.parallax { display: block; position: fixed; z-index: 3; top: 0; left: 0; width: 100%; height: 100vh; background: #fff; }

/* .scrollElement and .spacer set the story's length; every trigger in scene.js is timed against it. */
.scrollElement { position: absolute; z-index: 4; top: 0; width: 100%; height: 6000px; }
.spacer { height: 6000px; }

.hero {
  position: fixed; z-index: 5; left: 0; right: 0; top: 0;
  padding: clamp(110px, 17vh, 170px) clamp(16px, 4vw, 48px) 0;
  text-align: center; color: var(--plum); pointer-events: none;
}
.hero > * { pointer-events: auto; }
.hero::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  left: 50%; top: 70px; width: min(1180px, 130vw); height: calc(100% - 10px); transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(255, 214, 194, .82), rgba(255, 206, 186, .5) 58%, rgba(255, 206, 186, 0));
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 22px; padding: 6px 12px;
  border-radius: 999px; background: rgba(255, 255, 255, .35);
  font-family: var(--mono); font-size: .76rem; letter-spacing: .08em; text-transform: uppercase;
}
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: #e2456f; box-shadow: 0 0 0 4px rgba(226, 69, 111, .2); }
.hero h1 {
  font-family: var(--display); font-weight: 700; letter-spacing: -.035em; line-height: .98;
  font-size: clamp(2.6rem, 7vw, 5.6rem); margin: 0 auto 20px; max-width: 12ch;
}
.hero .lede { font-size: clamp(1rem, 1.6vw, 1.18rem); line-height: 1.55; max-width: 560px; margin: 0 auto 28px; opacity: .92; }
.hero-ctas { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero .command { width: fit-content; margin: 16px auto 0; }

.caption {
  position: fixed; z-index: 5; left: 0; right: 0; top: 20vh; padding: 0 16px;
  text-align: center; color: #fff; text-shadow: 0 2px 30px rgba(20, 10, 40, .55);
  opacity: 0; visibility: hidden; pointer-events: none;
}
.caption-inner {
  display: inline-block; padding: 26px clamp(22px, 4vw, 44px) 30px; border-radius: 28px;
  background: rgba(14, 9, 28, .32); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, .12);
}
.caption .mono { font-family: var(--mono); font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; opacity: .85; }
.caption h2 { font-family: var(--display); font-weight: 700; letter-spacing: -.03em; line-height: 1; font-size: clamp(2.2rem, 6vw, 4.6rem); margin: 14px 0 0; }

.content { position: relative; z-index: 10; background: var(--ink); }
.content::before {
  content: ""; position: absolute; left: 0; right: 0; top: -180px; height: 180px; pointer-events: none;
  background: linear-gradient(to bottom, rgba(8, 7, 15, 0), var(--ink));
}

.section { max-width: 1200px; margin: 0 auto; padding: clamp(72px, 11vw, 140px) clamp(16px, 4vw, 48px); }
.kicker { margin: 0 0 16px; font-family: var(--mono); font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--pink); }
.section h2 { font-family: var(--display); font-size: clamp(2rem, 4.4vw, 3.4rem); letter-spacing: -.03em; line-height: 1.04; margin: 0 0 18px; max-width: 18ch; }
.section .intro { color: var(--muted); font-size: 1.08rem; line-height: 1.65; max-width: 620px; margin: 0; }
.section .intro a { color: var(--text); text-decoration-color: rgba(253, 117, 168, .6); text-underline-offset: 3px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); max-width: 1200px; margin: 0 auto; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stat { padding: 34px clamp(16px, 2.5vw, 32px); border-left: 1px solid var(--line); }
.stat:first-child { border-left: 0; }
.stat .num {
  font-family: var(--display); font-weight: 600; font-size: clamp(1.7rem, 3.2vw, 2.5rem); letter-spacing: -.03em; line-height: 1.15;
  background: linear-gradient(120deg, var(--sun), var(--pink)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat .label { margin-top: 6px; font-family: var(--mono); font-size: .76rem; line-height: 1.5; letter-spacing: .04em; color: var(--muted); }

.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 56px; }
.card {
  display: flex; flex-direction: column; padding: 28px 24px;
  background: var(--ink-2); border: 1px solid var(--line); border-radius: 18px;
  transition: border-color .3s, transform .3s;
}
.card:hover { border-color: rgba(253, 117, 168, .45); transform: translateY(-4px); }
.card .idx { font-family: var(--mono); font-size: .75rem; color: var(--muted); }
.card .icon {
  display: grid; place-items: center; width: 44px; height: 44px; margin: 22px 0 18px; border-radius: 12px;
  background: linear-gradient(140deg, rgba(245, 197, 78, .18), rgba(253, 117, 168, .18)); color: var(--peach);
}
.card .icon svg { width: 22px; height: 22px; }
.card h3 { margin: 0 0 10px; font-family: var(--display); font-size: 1.2rem; letter-spacing: -.01em; }
.card p { flex: 1; margin: 0 0 18px; color: var(--muted); font-size: .94rem; line-height: 1.6; }
.card .spec { padding-top: 14px; border-top: 1px dashed var(--line); font-family: var(--mono); font-size: .74rem; color: var(--sun); }

.shot { margin: 0; }
.shot img {
  display: block; width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--line);
  box-shadow: 0 40px 120px -40px rgba(253, 117, 168, .25), 0 24px 60px -24px rgba(0, 0, 0, .7);
}
.shot figcaption { margin-top: 14px; color: var(--muted); font-size: .94rem; }
.hero-shot { margin-top: 56px; }
.screens { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 24px; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 48px 1fr; gap: 16px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.steps li::before { content: counter(s, decimal-leading-zero); padding-top: 3px; font-family: var(--mono); font-size: .85rem; color: var(--pink); }
.steps h4 { margin: 0 0 6px; font-family: var(--display); font-size: 1.08rem; }
.steps p { margin: 0; color: var(--muted); font-size: .94rem; line-height: 1.6; }

.faq-list { max-width: 820px; margin-top: 40px; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  position: relative; cursor: pointer; list-style: none; padding: 20px 40px 20px 0;
  font-family: var(--display); font-weight: 600; font-size: 1.1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 6px; top: 16px; font: 400 1.4rem var(--mono); color: var(--pink); }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 0 0 22px; max-width: 70ch; color: var(--muted); line-height: 1.65; }
.faq details a { color: var(--text); text-underline-offset: 3px; }

.cta {
  width: min(1104px, calc(100% - 2 * clamp(16px, 4vw, 48px))); margin: 0 auto clamp(72px, 10vw, 120px); padding: clamp(48px, 8vw, 96px) clamp(24px, 5vw, 64px);
  border-radius: 28px; text-align: center;
  background: radial-gradient(120% 140% at 50% 120%, #fd75a8 0%, #8a4b9a 35%, #2b2050 70%, #15122a 100%);
}
.cta h2 { margin: 0 auto 18px; max-width: 16ch; font-family: var(--display); font-size: clamp(2rem, 5vw, 3.6rem); letter-spacing: -.03em; line-height: 1.02; }
.cta > p { max-width: 520px; margin: 0 auto 30px; line-height: 1.6; color: rgba(255, 255, 255, .78); }
.cta-actions { display: flex; gap: 12px; justify-content: center; align-items: center; flex-wrap: wrap; }
.cta .note { margin: 18px auto 0; font-family: var(--mono); font-size: .74rem; color: rgba(255, 255, 255, .7); }
.cta .note a { color: #fff; text-underline-offset: 3px; }

/* ===== Footer (both pages) ===== */
.site-footer {
  display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  max-width: 1200px; margin: 0 auto; padding: 40px clamp(16px, 4vw, 48px);
  border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem;
}
.site-footer nav { display: flex; gap: 8px 22px; flex-wrap: wrap; }
.site-footer a { text-decoration: none; }
.site-footer span a { color: var(--text); }
.site-footer a:hover { color: var(--text); }

/* ===== Safety page ===== */
.doc { max-width: 900px; margin: 0 auto; padding: 130px clamp(16px, 4vw, 48px) 96px; }
.doc h1 { margin: 0 0 16px; font-family: var(--display); font-size: clamp(2.4rem, 6vw, 4rem); letter-spacing: -.035em; line-height: 1; }
.doc > p { color: var(--muted); font-size: 1.05rem; line-height: 1.65; }
.doc h2 { margin: 56px 0 10px; font-family: var(--display); font-size: 1.6rem; letter-spacing: -.02em; }
.doc .note { margin: 0 0 16px; color: var(--muted); }
.table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--ink-2); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; font-size: .88rem; }
.table th, .table td { text-align: left; vertical-align: top; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.table tr:last-child td { border-bottom: 0; }
.table th { background: var(--ink-3); font: 500 .72rem var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.table td { color: var(--muted); line-height: 1.55; }
.table td strong { color: var(--text); font-weight: 600; }
.table td code { font-size: .78rem; color: var(--peach); word-break: break-all; }
.tag { display: inline-block; margin-top: 4px; padding: 1px 8px; border-radius: 999px; font: 500 .68rem var(--mono); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.tag.safe { color: var(--safe); background: rgba(95, 211, 138, .1); border: 1px solid rgba(95, 211, 138, .3); }
.tag.check { color: var(--check); background: rgba(242, 184, 75, .1); border: 1px solid rgba(242, 184, 75, .3); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.chips li { max-width: 100%; overflow-wrap: anywhere; padding: 4px 10px; border-radius: 8px; background: var(--ink-2); border: 1px solid var(--line); font-family: var(--mono); font-size: .8rem; color: var(--muted); }

/* ===== Responsive ===== */
@media (max-width: 960px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 760px) {
  .nav-links, .nav-cta { display: none; }
  .nav-toggle { display: block; }
  .nav.open {
    bottom: 0; height: 100vh; height: 100dvh; color: var(--text);
    display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto 1fr auto auto; align-items: center;
    padding: 18px 20px calc(24px + env(safe-area-inset-bottom));
    background:
      radial-gradient(90% 55% at 50% 115%, rgba(253, 117, 168, .32), transparent 70%),
      radial-gradient(70% 40% at 100% 0%, rgba(143, 116, 224, .22), transparent 70%),
      #0a0913;
    -webkit-backdrop-filter: none; backdrop-filter: none; border-bottom-color: transparent;
    animation: menuFade .35s ease both;
  }
  .nav.open .brand { grid-column: 1; grid-row: 1; }
  .nav.open .nav-toggle { grid-column: 2; grid-row: 1; }
  .nav.open .nav-links { grid-column: 1 / -1; grid-row: 2; align-self: center; display: flex; flex-direction: column; gap: 0; margin: 0; counter-reset: m; }
  .nav.open .nav-links li { counter-increment: m; border-bottom: 1px solid var(--line); animation: menuIn .6s cubic-bezier(.2, .8, .2, 1) both; }
  .nav.open .nav-links li:first-child { border-top: 1px solid var(--line); }
  .nav.open .nav-links li:nth-child(1) { animation-delay: .08s; }
  .nav.open .nav-links li:nth-child(2) { animation-delay: .14s; }
  .nav.open .nav-links li:nth-child(3) { animation-delay: .20s; }
  .nav.open .nav-links li:nth-child(4) { animation-delay: .26s; }
  .nav.open .nav-links li:nth-child(5) { animation-delay: .32s; }
  .nav.open .nav-links a {
    display: flex; align-items: baseline; gap: 14px; padding: 14px 2px; opacity: 1;
    font: 600 clamp(2rem, 9.5vw, 3rem)/1.05 var(--display); letter-spacing: -.03em;
  }
  .nav.open .nav-links a::before {
    content: counter(m, decimal-leading-zero); transform: translateY(-1.1em);
    font: 400 .75rem var(--mono); letter-spacing: .08em; color: var(--pink);
  }
  .nav.open .nav-links a::after { content: "→"; margin-left: auto; font-size: .55em; color: var(--muted); transition: transform .25s, color .25s; }
  .nav.open .nav-links a:active::after, .nav.open .nav-links a:hover::after { transform: translateX(4px); color: var(--pink); }
  .nav.open .nav-cta {
    grid-column: 1 / -1; grid-row: 3; display: block; margin: 20px 0 0; padding: 16px; text-align: center;
    font-size: 1rem; background: var(--text); color: var(--ink); border-color: var(--text);
    animation: menuIn .6s cubic-bezier(.2, .8, .2, 1) .38s both;
  }
  .nav.open .nav-meta {
    grid-column: 1 / -1; grid-row: 4; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    margin-top: 18px; font: .7rem var(--mono); letter-spacing: .04em; color: var(--muted);
    animation: menuIn .6s cubic-bezier(.2, .8, .2, 1) .44s both;
  }
  .nav.open .burger i:nth-child(1) { top: 20px; transform: rotate(45deg); }
  .nav.open .burger i:nth-child(2) { opacity: 0; transform: scaleX(.2); }
  .nav.open .burger i:nth-child(3) { top: 20px; transform: rotate(-45deg); }
  @keyframes menuFade { from { opacity: 0; } to { opacity: 1; } }
  @keyframes menuIn { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

  .screens { grid-template-columns: 1fr; }
  .hero .command { width: 100%; }
  .cta-actions { flex-direction: column; align-items: stretch; }
  .cta-actions .btn-light { justify-content: center; }
  .table th:nth-child(3), .table td:nth-child(3) { display: none; }
}
@media (max-width: 520px) {
  .grid-4 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
  .stat { border-left: 0; }
  .stat:nth-child(n+2) { border-top: 1px solid var(--line); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .nav.open, .nav.open * { animation: none !important; }
}
