/* ScrollRat marketing site — brand tokens from STYLING.md */

:root {
  --sr-bg:           #F7F3EC;
  --sr-card:         #FFFFFF;
  --sr-card-warm:    #FCFAF5;
  --sr-ink:          #1E2A4A;
  --sr-ink-soft:     #7A8099;
  --sr-ink-faint:    #B4B9C9;
  --sr-line:         #ECE7DC;
  --sr-glow:         #4E7FE1;
  --sr-glow-soft:    #E8EFFC;
  --sr-recover:      #3E7C59;
  --sr-recover-soft: #E6F1EA;
  --sr-danger:       #C0392B;
  --sr-night:        #0E1526;   /* mirror-section darkness */
  --radius: 18px;
  --font-display: "Archivo", sans-serif;
  --font-body: "Inter", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--sr-bg);
  color: var(--sr-ink);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 800; }
h2 { font-size: clamp(30px, 4.5vw, 46px); letter-spacing: -1.2px; line-height: 1.08; }
h3 { font-size: clamp(22px, 2.6vw, 28px); letter-spacing: -0.6px; }

.eyebrow {
  font: 700 11px var(--font-body);
  letter-spacing: 1.8px;
  color: var(--sr-ink-soft);
}
.section-head { text-align: center; max-width: 720px; margin: 0 auto 56px; padding: 0 24px; }
.section-head .eyebrow { margin-bottom: 12px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font: 700 15px var(--font-display);
  letter-spacing: -0.2px;
  padding: 0 26px; height: 52px;
  border-radius: 999px; border: none; cursor: pointer;
  transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s, background .25s;
  will-change: transform;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(30,42,74,.18); }
.btn-ink   { background: var(--sr-ink); color: #fff; }
.btn-light { background: #fff; color: var(--sr-ink); }
.btn-outline { background: transparent; color: var(--sr-ink); border: 1.5px solid var(--sr-ink); }
.btn-small { height: 42px; padding: 0 20px; font-size: 13.5px; }

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 100;
  transition: transform .35s ease, background .35s ease, box-shadow .35s ease;
}
.nav.is-solid { background: rgba(247,243,236,.88); backdrop-filter: blur(14px); box-shadow: 0 1px 0 var(--sr-line); }
.nav.is-hidden { transform: translateY(-100%); }
.nav-inner {
  max-width: 1200px; margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.nav-logo { display: flex; align-items: center; gap: 10px; font: 800 19px var(--font-display); letter-spacing: -0.4px; }
.nav-logo-img { width: 34px; height: 34px; object-fit: contain; }
.nav-links { display: flex; gap: 28px; font: 600 14px var(--font-body); color: var(--sr-ink-soft); }
.nav-links a { transition: color .2s; }
.nav-links a:hover { color: var(--sr-ink); }
@media (max-width: 760px) { .nav-links { display: none; } }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 120px 24px 80px; overflow: hidden;
}
.hero-glow {
  position: absolute; top: -20%; right: -10%;
  width: 70vw; height: 70vw; max-width: 900px; max-height: 900px;
  background: radial-gradient(circle, rgba(78,127,225,.22), transparent 65%);
  animation: glowpulse 5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes glowpulse { 50% { opacity: .55; transform: scale(1.08); } }

.hero-inner {
  max-width: 1200px; margin: 0 auto; width: 100%;
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center;
}
/* minmax(0,…) keeps the stage's negative margins from widening the column
   past the viewport and clipping the headline on phones. */
@media (max-width: 900px) { .hero-inner { grid-template-columns: minmax(0, 1fr); } }

.hero-title {
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 900; letter-spacing: -2.5px; line-height: 1.02;
  margin: 18px 0 22px;
}
.hero-title .accent { color: var(--sr-danger); }
.line-mask { display: block; overflow: hidden; }
.line { display: block; transform: translateY(110%); animation: lineup .9s cubic-bezier(.2,.8,.2,1) forwards; }
.line-mask:nth-child(2) .line { animation-delay: .12s; }
.line-mask:nth-child(3) .line { animation-delay: .24s; }
@keyframes lineup { to { transform: translateY(0); } }

.hero-sub { font-size: 17px; line-height: 1.6; color: var(--sr-ink-soft); max-width: 520px; }
.hero-sub strong { color: var(--sr-ink); }

/* Email capture */
.capture { display: flex; gap: 10px; margin-top: 30px; max-width: 480px; }
.capture input {
  flex: 1; min-width: 0; height: 52px; padding: 0 20px;
  /* 16px minimum: anything smaller makes iOS Safari zoom into the field */
  font: 500 16px var(--font-body); color: var(--sr-ink);
  background: #fff; border: 1.5px solid var(--sr-line); border-radius: 999px;
  outline: none; transition: border-color .2s, box-shadow .2s;
}
.capture input:focus { border-color: var(--sr-glow); box-shadow: 0 0 0 4px var(--sr-glow-soft); }
.capture input::placeholder { color: var(--sr-ink-faint); }
.capture-note { margin-top: 12px; font-size: 12.5px; color: var(--sr-ink-faint); }
.capture.is-done { animation: donepop .4s cubic-bezier(.2,.8,.2,1); }
@keyframes donepop { 30% { transform: scale(1.03); } }
.capture .capture-success {
  flex: 1; display: flex; align-items: center; height: 52px; padding: 0 20px;
  font: 700 15px var(--font-display); color: var(--sr-recover);
  background: var(--sr-recover-soft); border-radius: 999px;
}
@media (max-width: 520px) {
  .capture { flex-direction: column; }
  /* In the stacked layout flex:1 resolves against a zero basis and crushes
     the input's height — pin it back to a real field. */
  .capture input { flex: none; width: 100%; height: 54px; }
  .capture .btn { width: 100%; }
}

/* Hero stage: rat + phone */
.hero-stage { position: relative; display: flex; justify-content: center; align-items: flex-end; min-height: 420px; }
.hero-rat-wrap { position: relative; z-index: 2; margin-right: -60px; margin-bottom: -10px; }
.hero-rat { width: clamp(200px, 24vw, 320px); filter: drop-shadow(0 24px 40px rgba(30,42,74,.25)); }
.hero-phone { position: relative; z-index: 1; transform: rotate(5deg); }
@media (max-width: 900px) {
  .hero-stage { min-height: 300px; }
  .hero-rat-wrap { margin-right: -32px; }
  /* Rat + phone must fit 390px viewports side by side */
  .hero-rat { width: clamp(140px, 38vw, 240px); }
  .hero-phone .phone-frame { width: clamp(150px, 42vw, 240px); }
}

.phone-frame {
  width: clamp(200px, 22vw, 280px);
  border-radius: 42px; padding: 10px;
  background: #10182b;
  box-shadow: 0 30px 80px rgba(30,42,74,.35), inset 0 0 0 2px rgba(255,255,255,.06);
  transition: transform .3s cubic-bezier(.2,.8,.2,1);
  will-change: transform;
}
.phone-frame img { border-radius: 32px; width: 100%; }

/* Floating */
.float { animation: floaty 5.5s ease-in-out infinite; }
.float-slow { animation: floaty 7s ease-in-out infinite; }
@keyframes floaty { 50% { transform: translateY(-14px); } }

/* Scroll cue */
.scroll-cue {
  position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font: 700 11px var(--font-body); letter-spacing: 1.4px; text-transform: uppercase;
  color: var(--sr-ink-soft);
}
.scroll-cue-arrow { animation: cuebounce 1.6s ease-in-out infinite; font-size: 16px; }
@keyframes cuebounce { 50% { transform: translateY(6px); } }

/* ---------- Confession ticker ---------- */
.ticker {
  background: var(--sr-ink); color: rgba(255,255,255,.85);
  overflow: hidden; padding: 14px 0; white-space: nowrap;
}
.ticker-track { display: inline-flex; gap: 34px; animation: tickerscroll 30s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-track span { font: 600 14px var(--font-body); font-style: italic; }
.ticker-track i { font-style: normal; opacity: .7; }
@keyframes tickerscroll { to { transform: translateX(-50%); } }

/* ---------- The Mirror ---------- */
.mirror { height: 420vh; position: relative; background: var(--sr-bg); }
.mirror-sticky { position: sticky; top: 0; height: 100svh; overflow: hidden; }
.mirror-dim {
  position: absolute; inset: 0; background: var(--sr-night);
  opacity: 0; transition: opacity .1s linear; pointer-events: none;
}
.mirror-stage {
  position: relative; height: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px;
  display: grid; grid-template-columns: 1fr 1.2fr 1fr; align-items: center; gap: 24px;
}
@media (max-width: 900px) {
  .mirror-stage { grid-template-columns: 1fr; text-align: center; align-content: center; gap: 8px; }
}

.mirror-label {
  font: 700 11px var(--font-body); letter-spacing: 1.8px;
  color: var(--sr-ink-soft); margin-bottom: 14px;
  transition: color .3s;
}
.mirror-clock {
  font: 900 clamp(46px, 6vw, 84px) var(--font-display);
  letter-spacing: -3px; font-variant-numeric: tabular-nums;
  transition: color .3s;
}
.mirror-clock small { font-size: .38em; font-weight: 800; letter-spacing: 0; }

.mirror-battery { margin-top: 22px; max-width: 240px; }
@media (max-width: 900px) { .mirror-battery { margin: 14px auto 0; } }
.mirror-battery-bar { height: 10px; border-radius: 99px; background: rgba(122,128,153,.25); overflow: hidden; }
.mirror-battery-fill {
  height: 100%; width: 100%; border-radius: 99px;
  background: var(--sr-recover);
  transition: width .1s linear, background .3s;
}
.mirror-battery-label {
  display: block; margin-top: 8px;
  font: 700 11px var(--font-body); letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--sr-ink-soft); transition: color .3s;
}

.mirror-ratcol { position: relative; height: min(62svh, 560px); }
.mirror-rat {
  position: absolute; inset: 0;
  /* All five states share one identical box (the PNGs ship on a uniform,
     bottom-anchored canvas), so the rat never shifts between states. */
  width: 100%; height: 100%; object-fit: contain; object-position: center bottom;
  opacity: 0; transform: translateY(12px) scale(.98);
  transition: opacity .35s ease, transform .35s ease;
}
.mirror-rat.is-active { opacity: 1; transform: none; }
.mirror-glowfloor {
  position: absolute; left: 50%; bottom: -4%; transform: translateX(-50%);
  width: 70%; height: 18%;
  background: radial-gradient(ellipse, rgba(78,127,225,.55), transparent 70%);
  filter: blur(12px); opacity: .25; pointer-events: none;
}

.mirror-caption {
  font: 800 clamp(19px, 2.2vw, 26px) var(--font-display);
  letter-spacing: -0.5px; line-height: 1.25;
  position: absolute; opacity: 0; transform: translateY(14px);
  transition: opacity .35s ease, transform .35s ease, color .3s;
  max-width: 300px;
}
.mirror-captioncol { position: relative; height: 120px; display: flex; align-items: center; }
@media (max-width: 900px) { .mirror-captioncol { justify-content: center; height: 90px; } .mirror-caption { max-width: 90%; } }
.mirror-caption.is-active { opacity: 1; transform: none; }

/* Night palette once the dim passes ~50% (JS toggles .is-night on the sticky) */
.mirror-sticky.is-night .mirror-label,
.mirror-sticky.is-night .mirror-battery-label { color: rgba(255,255,255,.55); }
.mirror-sticky.is-night .mirror-clock,
.mirror-sticky.is-night .mirror-caption { color: #fff; }

/* Mirror outro */
.mirror-outro {
  background: var(--sr-night); color: #fff;
  text-align: center; padding: 110px 24px 120px;
}
.mirror-outro h2 { margin-bottom: 18px; }
.mirror-outro em { color: var(--sr-glow); font-style: normal; }
.mirror-outro p { color: rgba(255,255,255,.65); font-size: 17px; line-height: 1.6; max-width: 560px; margin: 0 auto 34px; }
.mirror-outro strong { color: #fff; }

/* ---------- Pain ---------- */
.pain { padding: 110px 24px; }
.pain-grid {
  max-width: 1100px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px;
}
@media (max-width: 860px) { .pain-grid { grid-template-columns: 1fr; max-width: 480px; } }
.pain-card {
  background: var(--sr-card); border: 1px solid var(--sr-line); border-radius: var(--radius);
  padding: 30px 26px; text-align: center;
  transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s;
}
.pain-card:hover { transform: translateY(-8px) rotate(-.5deg); box-shadow: 0 24px 60px rgba(30,42,74,.12); }
.pain-card img { height: 150px; width: auto; margin: 0 auto 20px; object-fit: contain; }
.pain-card h3 { font-size: 19px; letter-spacing: -0.4px; margin-bottom: 10px; }
.pain-card p { font-size: 14.5px; line-height: 1.6; color: var(--sr-ink-soft); }

.pain-bridge {
  text-align: center; margin-top: 80px;
  font: 800 clamp(26px, 3.6vw, 40px) var(--font-display);
  letter-spacing: -1px; line-height: 1.2;
}
.pain-bridge strong { color: var(--sr-danger); }

/* ---------- Features ---------- */
.how { padding: 110px 0 40px; background: var(--sr-card-warm); border-top: 1px solid var(--sr-line); border-bottom: 1px solid var(--sr-line); }
.feature {
  max-width: 1080px; margin: 0 auto; padding: 60px 24px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center;
}
.feature-flip .feature-media { order: 2; }
@media (max-width: 860px) {
  .feature { grid-template-columns: 1fr; gap: 32px; }
  .feature-flip .feature-media { order: 0; }
}
.feature-media { position: relative; display: flex; justify-content: center; }
.feature-rat { position: absolute; bottom: -20px; width: clamp(120px, 12vw, 170px); z-index: 2; filter: drop-shadow(0 16px 30px rgba(30,42,74,.22)); }
.feature-rat-right { right: 2%; }
.feature-rat-left { left: 2%; }

.feature-tag {
  display: inline-block; font: 700 10.5px var(--font-body); letter-spacing: 1.6px;
  padding: 7px 12px; border-radius: 99px; margin-bottom: 16px;
}
.tag-ink     { background: var(--sr-glow-soft); color: var(--sr-glow); }
.tag-danger  { background: #FAE8E5; color: var(--sr-danger); }
.tag-recover { background: var(--sr-recover-soft); color: var(--sr-recover); }
.tag-glow    { background: var(--sr-glow-soft); color: var(--sr-glow); }

.feature-copy h3 { margin-bottom: 14px; }
.feature-copy p { font-size: 15.5px; line-height: 1.65; color: var(--sr-ink-soft); margin-bottom: 20px; }
.feature-copy ul { list-style: none; }
.feature-copy li {
  position: relative; padding-left: 26px; margin-bottom: 10px;
  font: 500 14.5px var(--font-body); line-height: 1.5;
}
.feature-copy li::before {
  content: "🧀"; position: absolute; left: 0; top: 0; font-size: 13px;
}

/* ---------- Stats ---------- */
.stats { background: var(--sr-ink); color: #fff; padding: 90px 24px; }
.stats-grid {
  max-width: 1100px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; text-align: center;
}
@media (max-width: 860px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
.stat-num {
  display: block; font: 900 clamp(34px, 4.4vw, 56px) var(--font-display);
  letter-spacing: -2px; font-variant-numeric: tabular-nums;
}
.stat-label { display: block; margin-top: 8px; font-size: 13.5px; color: rgba(255,255,255,.6); line-height: 1.4; }

/* ---------- Screens marquee ---------- */
.screens { padding: 110px 0; }
.screens-marquee { overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.screens-track {
  display: flex; gap: 26px; width: max-content;
  animation: screensscroll 45s linear infinite;
  padding: 20px 0;
}
.screens-marquee:hover .screens-track { animation-play-state: paused; }
@keyframes screensscroll { to { transform: translateX(-50%); } }
.screen-card {
  width: 220px; flex-shrink: 0;
  border-radius: 30px; padding: 8px; background: #10182b;
  box-shadow: 0 18px 44px rgba(30,42,74,.22);
  transform: rotate(-1.5deg);
  transition: transform .35s cubic-bezier(.2,.8,.2,1);
}
.screen-card:nth-child(even) { transform: rotate(1.5deg); }
.screen-card:hover { transform: rotate(0) scale(1.06); z-index: 2; }
.screen-card img { border-radius: 23px; }

/* ---------- Pricing ---------- */
.pricing { padding: 110px 24px; background: var(--sr-card-warm); border-top: 1px solid var(--sr-line); }
.pricing-sub { margin-top: 14px; color: var(--sr-ink-soft); font-size: 15px; }
.pricing-grid {
  max-width: 820px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1.1fr; gap: 22px; align-items: stretch;
}
@media (max-width: 700px) { .pricing-grid { grid-template-columns: 1fr; max-width: 420px; } }
.price-card {
  background: var(--sr-card); border: 1px solid var(--sr-line); border-radius: var(--radius);
  padding: 34px 30px; display: flex; flex-direction: column;
  transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s;
}
.price-card:hover { transform: translateY(-6px); box-shadow: 0 24px 60px rgba(30,42,74,.12); }
.price-card-hero { background: var(--sr-ink); color: #fff; border-color: var(--sr-ink); position: relative; }
.price-badge {
  position: absolute; top: -12px; left: 30px;
  background: var(--sr-danger); color: #fff;
  font: 700 10px var(--font-body); letter-spacing: 1.2px;
  padding: 6px 12px; border-radius: 99px;
}
.price-name { font: 700 13px var(--font-body); letter-spacing: 1.2px; text-transform: uppercase; opacity: .7; }
.price-num { font: 900 44px var(--font-display); letter-spacing: -1.8px; margin: 10px 0 4px; }
.price-num span { font-size: 16px; font-weight: 700; letter-spacing: 0; opacity: .6; }
.price-math { font-size: 13px; line-height: 1.5; color: rgba(255,255,255,.65); margin-bottom: 6px; }
.price-card ul { list-style: none; margin: 18px 0 26px; flex: 1; }
.price-card li { position: relative; padding-left: 24px; margin-bottom: 10px; font-size: 14.5px; }
.price-card li::before { content: "✓"; position: absolute; left: 0; font-weight: 700; color: var(--sr-recover); }
.price-card-hero li::before { color: #7BD3A2; }

/* ---------- Waitlist ---------- */
.waitlist { background: var(--sr-ink); color: #fff; padding: 120px 24px; text-align: center; }
.waitlist-inner { max-width: 560px; margin: 0 auto; }
.waitlist-rat { height: 170px; width: auto; margin: 0 auto 26px; object-fit: contain; }
.waitlist p { color: rgba(255,255,255,.65); font-size: 16px; line-height: 1.6; margin-top: 14px; }
.waitlist .capture { margin: 34px auto 0; }
.waitlist .capture input { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.18); color: #fff; }
.waitlist .capture input::placeholder { color: rgba(255,255,255,.4); }
.waitlist .capture input:focus { border-color: var(--sr-glow); box-shadow: 0 0 0 4px rgba(78,127,225,.25); }
.waitlist .capture-note { color: rgba(255,255,255,.35); }

/* ---------- Footer ---------- */
.footer { background: var(--sr-night); color: rgba(255,255,255,.5); padding: 50px 24px; text-align: center; }
.footer-brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 10px; color: #fff; font: 800 18px var(--font-display); }
.footer-brand img { width: 30px; height: 30px; object-fit: contain; }
.footer p { font-size: 13.5px; line-height: 1.7; }
.footer-fine { margin-top: 14px; font-size: 12px; opacity: .7; }
.footer a { text-decoration: underline; }

/* ---------- Scroll reveals ---------- */
.reveal, .reveal-left, .reveal-right {
  opacity: 0; transform: translateY(28px);
  transition: opacity .8s cubic-bezier(.2,.8,.2,1) var(--d, 0s), transform .8s cubic-bezier(.2,.8,.2,1) var(--d, 0s);
}
.reveal-left  { transform: translateX(-44px); }
.reveal-right { transform: translateX(44px); }
.in-view { opacity: 1; transform: none; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .reveal, .reveal-left, .reveal-right, .line { opacity: 1; transform: none; }
  .mirror { height: auto; }
  .mirror-sticky { position: static; height: auto; }
  .mirror-rat { position: static; display: none; }
  .mirror-rat.is-active { display: block; }
}
