/* Scalin — web. Tokens mirrored from ScaleShared/Design/Tokens.swift. */

:root {
  /* Fields — one flat field per section, never two on one block. */
  --field:        #0F4488;
  --field-deep:   #0A2F57;
  --field-green:  #0A5C33;
  --field-red:    #A8241A;
  --field-slate:  #3C526E;
  --field-purple: #3A21A0;
  --field-amber:  #E09B12;

  --ink:          #111113;
  --accent:       #F5C518;
  --accent-ink:   #2E2405;

  --text:         #fff;
  --text-2:       rgba(255,255,255,.90);
  --text-3:       rgba(255,255,255,.85);
  --text-ink:     #111113;

  --panel:        rgba(0,0,0,.12);
  --panel-strong: rgba(0,0,0,.16);
  --chip:         rgba(0,0,0,.24);

  /* Rounded rectangles. There are no capsules. */
  --r-btn: 20px;
  --r-card: 28px;
  --r-panel: 20px;
  --r-slot: 14px;

  --pad: 22px;
  --max: 1120px;

  --lift: 0 2px 3px rgba(0,0,0,.20), 0 14px 26px rgba(0,0,0,.24);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: Nunito, ui-rounded, -apple-system, "Segoe UI", system-ui, sans-serif;
  font-weight: 800;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }

/* ---------------------------------------------------------------- layout */

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); }

section { position: relative; }

/* Every field sinks into black at the bottom — ScaleScreenBackground. */
.field {
  position: relative;
  isolation: isolate;
  padding: clamp(72px, 12vw, 132px) 0;
}
.field::after {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(to bottom, transparent 0%, transparent 30%, rgba(0,0,0,.58) 100%);
  pointer-events: none;
}
.f-blue   { background: var(--field); }
.f-deep   { background: var(--field-deep); }
.f-green  { background: var(--field-green); }
.f-slate  { background: var(--field-slate); }
.f-purple { background: var(--field-purple); }
.f-red    { background: var(--field-red); }
.f-ink    { background: var(--ink); }
.f-ink::after { display: none; }

/* ------------------------------------------------------------------ type */

h1, h2, h3 { margin: 0; font-weight: 900; letter-spacing: -.02em; line-height: .98; }
h1 { font-size: clamp(42px, 7.4vw, 84px); letter-spacing: -.035em; }
h2 { font-size: clamp(32px, 5vw, 56px); letter-spacing: -.03em; }
h3 { font-size: clamp(19px, 2.2vw, 23px); letter-spacing: -.01em; line-height: 1.15; }

p { margin: 0; line-height: 1.5; }

.lead { font-size: clamp(17px, 2.1vw, 21px); font-weight: 700; color: var(--text-2); max-width: 54ch; }
.helper { font-size: 13px; font-weight: 700; color: var(--text-3); }

.label {
  font-size: 12px; font-weight: 900; letter-spacing: .17em;
  text-transform: uppercase; color: var(--text-3);
}
.gold { color: var(--accent); }

/* --------------------------------------------------------------- buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 62px; padding: 0 30px;
  border: 0; border-radius: var(--r-btn);
  font: inherit; font-size: 19px; font-weight: 900; letter-spacing: .1em;
  text-transform: uppercase; text-decoration: none;
  background: var(--ink); color: #fff;
  box-shadow: var(--lift);
  cursor: pointer;
  transition: transform .22s cubic-bezier(.2,.9,.3,1.2), opacity .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: scale(.985); opacity: .9; }
.btn-gold { background: var(--accent); color: var(--accent-ink); }
.btn-ghost {
  background: transparent; color: #fff; box-shadow: none;
  border: 1.5px solid rgba(255,255,255,.5); font-size: 16px; letter-spacing: 0;
  text-transform: none;
}
.btn-ghost:hover { border-color: #fff; }

.chip {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 14px;
  border-radius: 10px; background: var(--chip);
  font-size: 11px; font-weight: 900; letter-spacing: .13em; text-transform: uppercase;
  color: var(--text-2);
}
.chip-gold { background: var(--accent); color: var(--accent-ink); }

/* ------------------------------------------------------------------- nav */

.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(15,68,136,.82);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255,255,255,.10);
}
.nav-in {
  display: flex; align-items: center; gap: 18px;
  height: 64px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 20px; font-weight: 900; letter-spacing: -.02em;
  text-decoration: none;
}
.brand .logo { width: 34px; height: 34px; border-radius: 22%; flex: none; }
.nav-links { margin-left: auto; display: flex; align-items: center; gap: 22px; }
.nav-links a {
  font-size: 14px; font-weight: 800; color: var(--text-3); text-decoration: none;
  transition: color .18s;
}
.nav-links a:hover { color: #fff; }
.nav .btn { min-height: 40px; padding: 0 18px; font-size: 13px; border-radius: 12px; }
/* .nav-links a outranks .btn-gold on specificity — restore the ink label. */
.nav-links a.btn-gold, .nav-links a.btn-gold:hover { color: var(--accent-ink); }
.nav-links a.btn-ghost:hover { color: #fff; }
@media (max-width: 720px) { .nav-links a:not(.btn) { display: none; } }
@media (max-width: 520px) {
  /* "Download for iPhone" wrapped to two lines at 19px + tracking. */
  .btn { font-size: 16px; letter-spacing: .06em; padding: 0 22px; }
  .hero-cta { flex-direction: column; align-items: stretch; }
}

/* ------------------------------------------------------------- the dock */

/* MascotAvatar: sprite on an ink chip, radius 32% of the side. */
.avatar {
  width: 44px; height: 44px; flex: none;
  border-radius: 32%;
  background: var(--ink);
  overflow: hidden;
  display: grid; place-items: center;
}
.avatar svg { width: 104%; height: 104%; transform: translateY(11%); }

/* SpeechDock: avatar + white bubble, tail bottom-left (22 22 22 6). */
.dock { display: flex; align-items: flex-end; gap: 10px; }
.bubble {
  background: #fff; color: var(--text-ink);
  padding: 13px 16px;
  border-radius: 22px 22px 22px 6px;
  font-size: 16px; font-weight: 800; line-height: 1.35;
  box-shadow: var(--lift);
}
.bubble-r { border-radius: 22px 22px 6px 22px; }

/* VerdictPill */
.verdict {
  display: inline-block;
  background: var(--ink); color: #fff;
  padding: 14px 22px; border-radius: var(--r-btn);
  font-size: 16px; font-weight: 800;
}

/* ------------------------------------------------------------- surfaces */

.panel {
  background: var(--panel-strong);
  border-radius: var(--r-panel);
  padding: 22px;
}
.card {
  background: #fff; color: var(--text-ink);
  border-radius: var(--r-card);
  padding: 26px;
  box-shadow: var(--lift);
}

.grid { display: grid; gap: 16px; }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .g3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .g3, .g2 { grid-template-columns: 1fr; } }

.tile {
  background: var(--panel-strong);
  border-radius: var(--r-panel);
  padding: 24px;
  border: 1px solid rgba(255,255,255,.07);
}
.tile h3 { margin-bottom: 8px; }
.tile p { font-size: 15px; font-weight: 700; color: var(--text-2); }
.tile .icon {
  width: 38px; height: 38px; margin-bottom: 16px;
  border-radius: 12px; background: rgba(255,255,255,.12);
  display: grid; place-items: center;
}
.tile .icon svg { width: 19px; height: 19px; }
.tile.lit .icon { background: var(--accent); color: var(--accent-ink); }

/* ------------------------------------------------------------------ hero */

.hero { padding-top: clamp(56px, 8vw, 92px); padding-bottom: clamp(64px, 9vw, 110px); }
.hero-in {
  display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(24px, 4vw, 56px);
  align-items: center;
}
@media (max-width: 880px) {
  .hero-in { grid-template-columns: 1fr; }
  /* Headline first on a phone; the sprite is 190 units tall and pushed it
     off the first screen. */
  .mascot-big { width: min(230px, 54vw); }
  .hero .lead { margin-bottom: 22px; }
}
.hero h1 { margin-bottom: 20px; }
.hero .lead { margin-bottom: 28px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }

.hero-art { display: grid; place-items: center; position: relative; }
.mascot-big { width: min(340px, 78vw); }

/* --------------------------------------------------- noise → trend chart */

.stage { min-height: 260vh; }
.sticky {
  position: sticky; top: 0; height: 100vh;
  display: grid; place-items: center;
}
.chart-box { width: 100%; max-width: 760px; }
.chart-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.hero-num {
  font-size: clamp(56px, 10vw, 86px); font-weight: 900; letter-spacing: -.05em;
  font-variant-numeric: tabular-nums; line-height: 1;
}
.hero-unit { font-size: 28px; font-weight: 800; color: var(--text-3); }
.chart svg { width: 100%; height: auto; }
.stage-cap { position: relative; margin-top: 20px; min-height: 62px; }
.stage-cap p + p { margin-top: 10px; }
.chart-legend { display: flex; gap: 18px; margin-top: 16px; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; color: var(--text-3); }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; background: rgba(255,255,255,.42); }
.legend-line { width: 18px; height: 4px; border-radius: 2px; background: #fff; }

/* ------------------------------------------------------------ two-column */

.split {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 64px);
  align-items: center;
}
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.stack > * + * { margin-top: 18px; }

/* ------------------------------------------------------------- tone rows */

.tones { display: grid; gap: 14px; }
.tone-row { display: flex; align-items: flex-end; gap: 10px; }
.tone-row.right { flex-direction: row-reverse; }
.tone-name {
  font-size: 11px; font-weight: 900; letter-spacing: .13em; text-transform: uppercase;
  color: var(--text-3); margin-bottom: 6px;
}

/* --------------------------------------------------------------- pricing */

.price {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  max-width: 660px; margin: 0 auto;
}
@media (max-width: 620px) { .price { grid-template-columns: 1fr; } }
.plan {
  background: var(--panel-strong); border: 1px solid rgba(255,255,255,.10);
  border-radius: var(--r-card); padding: 26px;
}
.plan.best { background: #fff; color: var(--text-ink); border-color: transparent; box-shadow: var(--lift); }
.plan .amount { font-size: 40px; font-weight: 900; letter-spacing: -.03em; margin: 10px 0 4px; }
.plan .per { font-size: 14px; font-weight: 700; opacity: .7; }
.plan ul { list-style: none; margin: 18px 0 0; padding: 0; }
.plan li { font-size: 15px; font-weight: 700; padding: 7px 0 7px 24px; position: relative; }
.plan li::before {
  content: ""; position: absolute; left: 0; top: 13px;
  width: 10px; height: 10px; border-radius: 3px; background: var(--accent);
}
.plan.best li::before { background: var(--field); }

/* ------------------------------------------------------------- privacy */

.badge-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

/* ---------------------------------------------------------------- footer */

.foot { background: var(--ink); padding: 56px 0 40px; }
.foot-in { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.foot-links { margin-left: auto; display: flex; flex-wrap: wrap; gap: 26px; }
.foot a { font-size: 14px; font-weight: 800; color: var(--text-3); text-decoration: none; }
.foot a:hover { color: #fff; }
.foot .helper { margin-top: 26px; max-width: 60ch; color: rgba(255,255,255,.55); }

/* ------------------------------------------------------------------ legal */

.legal { background: var(--field-deep); min-height: 100vh; padding: 0 0 90px; }
.legal .doc { max-width: 780px; margin: 0 auto; padding: 0 var(--pad); }
.legal .legal-head { padding-top: clamp(64px, 8vw, 104px); padding-bottom: 34px; }
.legal-head h1 { font-size: clamp(36px, 6vw, 62px); margin-bottom: 14px; }
.doc h2 { font-size: clamp(22px, 3vw, 28px); margin: 46px 0 14px; }
.doc h3 { font-size: 18px; margin: 28px 0 10px; }
.doc p, .doc li { font-size: 16px; font-weight: 600; line-height: 1.65; color: var(--text-2); }
.doc p + p { margin-top: 14px; }
.doc ul, .doc ol { padding-left: 22px; margin: 12px 0; }
.doc li { margin: 7px 0; }
.doc strong { font-weight: 900; color: #fff; }
.doc a { color: var(--accent); text-decoration: none; border-bottom: 1px solid rgba(245,197,24,.4); }
.doc a:hover { border-bottom-color: var(--accent); }
.doc .note {
  background: var(--panel-strong); border-radius: var(--r-panel);
  padding: 20px 22px; margin: 24px 0;
  border: 1px solid rgba(255,255,255,.08);
}
.doc .note p { font-size: 15px; }
.doc table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 15px; }
.doc th, .doc td { text-align: left; padding: 12px 10px; border-bottom: 1px solid rgba(255,255,255,.12); font-weight: 700; }
.doc th { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.toc a { border: 0; }

/* ============================================================== M O T I O N */

/* Everything is visible by default; motion is added only where the browser
   actually has a scroll timeline. No JS, no flash of blank sections. */

@keyframes rise   { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: none; } }
@keyframes riseIn { from { opacity: 0; transform: translateY(28px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes fade   { from { opacity: 0; } to { opacity: 1; } }
@keyframes drawLine { from { stroke-dashoffset: var(--len); } to { stroke-dashoffset: 0; } }
@keyframes scatter { from { transform: none; opacity: 1; } to { transform: translateY(var(--dy)); opacity: .30; } }
@keyframes parallaxUp { to { transform: translateY(-70px); } }
@keyframes drift { to { transform: translateY(-26px) rotate(2deg); } }

/* The mascot hops on its own clock — that is character, not scroll feedback. */
@keyframes hop {
  0%, 62%, 100% { transform: translateY(0) scaleX(1) scaleY(1); }
  66%  { transform: translateY(0) scaleX(1.10) scaleY(.90); }
  74%  { transform: translateY(-16%) scaleX(.94) scaleY(1.08); }
  84%  { transform: translateY(-4%)  scaleX(1) scaleY(1); }
  90%  { transform: translateY(0) scaleX(1.06) scaleY(.94); }
}
@keyframes blink { 0%, 92%, 100% { opacity: 1; } 95% { opacity: 0; } }

.mascot-body { animation: hop 5.2s ease-in-out infinite; transform-origin: 50% 95%; }
.mascot-hop { overflow: visible; }
.mascot-face { animation: blink 5.2s steps(1, end) infinite; }
.mascot-shadow { animation: hop 5.2s ease-in-out infinite reverse; transform-origin: 50% 50%; opacity: .16; }

@supports (animation-timeline: view()) {
  .reveal {
    animation: rise linear both;
    animation-timeline: view();
    animation-range: entry 5% cover 32%;
  }
  .reveal-in {
    animation: riseIn linear both;
    animation-timeline: view();
    animation-range: entry 10% cover 36%;
  }
  /* Children stagger by pushing each one's range a little later. */
  .stagger > *   { animation: riseIn linear both; animation-timeline: view(); }
  .stagger > :nth-child(1) { animation-range: entry 6%  cover 28%; }
  .stagger > :nth-child(2) { animation-range: entry 10% cover 32%; }
  .stagger > :nth-child(3) { animation-range: entry 14% cover 36%; }
  .stagger > :nth-child(4) { animation-range: entry 18% cover 40%; }
  .stagger > :nth-child(5) { animation-range: entry 22% cover 44%; }
  .stagger > :nth-child(6) { animation-range: entry 26% cover 48%; }

  .parallax {
    animation: parallaxUp linear both;
    animation-timeline: view();
    animation-range: cover;
  }
  .hero-art { animation: drift linear both; animation-timeline: view(); animation-range: cover; }

  /* The stage: raw dots scatter and the trend line draws itself as you scroll
     through the sticky section. */
  .stage { view-timeline-name: --stage; }
  /* Captions cross-fade in place once there is a timeline to drive them. */
  .stage-cap p { position: absolute; inset: 0; margin: 0 !important; opacity: 0; }
  .trend-line {
    stroke-dasharray: var(--len);
    animation: drawLine linear both;
    animation-timeline: --stage;
    animation-range: contain 0% contain 62%;
  }
  .raw-dot {
    animation: scatter linear both;
    animation-timeline: --stage;
    animation-range: contain 4% contain 64%;
  }
  .cap-1 { animation: fade linear both; animation-timeline: --stage; animation-range: contain 0% contain 16%; animation-direction: reverse; }
  .cap-2 { animation: fade linear both; animation-timeline: --stage; animation-range: contain 30% contain 46%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .stage { min-height: auto; }
  .sticky { position: static; height: auto; padding: 60px 0; }
  .stage-cap p { position: static; opacity: 1; }
  .stage-cap p + p { margin-top: 10px; }
}
