/* Gainnit landing page. Tokens mirror src/theme (colors.ts, typography.ts). */
:root {
  --bg: #0D0F0E;
  --surface: #171A18;
  --surface-2: #202421;
  --border: #2A2E2B;
  --border-strong: #3A403B;
  --highlight: rgba(255, 255, 255, 0.05);
  --text: #F5F7F5;
  --text-2: #9CA39D;
  --text-3: #6B726C;
  --lime: #B7F34A;
  --lime-pressed: #9ED631;
  --lime-muted: rgba(183, 243, 74, 0.14);
  --lime-border: rgba(183, 243, 74, 0.22);
  --error: #EF6262;

  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 24px;

  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Anton", "Impact", "Arial Narrow", sans-serif;

  --gutter: 16px;
  --max: 1160px;
}
@media (min-width: 640px) { :root { --gutter: 24px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -48px; z-index: 100; background: var(--lime); color: var(--bg); padding: 8px 14px; border-radius: 8px; font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }
.lime { color: var(--lime); }

/* Type */
.display {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  font-size: clamp(52px, 12vw, 96px);
  line-height: 0.98;
}
.display .lime { display: block; }
.display-md {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  font-size: clamp(40px, 8vw, 64px);
  line-height: 1;
}
.display-md .lime { display: block; }
.h2 { font-size: clamp(28px, 5vw, 40px); line-height: 1.15; letter-spacing: -0.02em; font-weight: 700; }
.lede { color: var(--text-2); font-size: clamp(17px, 2.2vw, 20px); line-height: 1.5; max-width: 34em; }
.sub { color: var(--text-2); font-size: 17px; max-width: 34em; }
.overline { color: var(--lime); font-size: 13px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 14px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 7px 14px 7px 12px;
  border: 1px solid var(--lime-border); background: var(--lime-muted);
  border-radius: 999px; color: var(--lime);
  font-size: 13px; font-weight: 600;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 0 rgba(183, 243, 74, 0.6); animation: pulse 2.2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(183, 243, 74, 0.55); } 70% { box-shadow: 0 0 0 10px rgba(183, 243, 74, 0); } 100% { box-shadow: 0 0 0 0 rgba(183, 243, 74, 0); } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 24px;
  border: 0; border-radius: var(--r-md);
  background: linear-gradient(180deg, #D4FF7A 0%, var(--lime) 45%, #A6E23A 100%);
  color: var(--bg); font: 600 16px/1 var(--font-body);
  text-decoration: none; cursor: pointer; white-space: nowrap;
  box-shadow: 0 8px 24px -8px rgba(183, 243, 74, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.btn:hover { filter: brightness(1.05); box-shadow: 0 10px 30px -8px rgba(183, 243, 74, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.4); }
.btn:active { transform: scale(0.97); }
.btn[disabled] { opacity: 0.7; cursor: progress; }
.btn-small { min-height: 40px; padding: 0 16px; font-size: 14px; border-radius: 10px; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(13, 15, 14, 0.72);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.nav.scrolled { border-bottom-color: var(--border); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 18px; letter-spacing: -0.02em; }

/* Glows */
.glow { position: absolute; pointer-events: none; border-radius: 50%; filter: blur(60px); }
.glow-hero { width: 720px; height: 720px; right: -200px; top: -120px; background: radial-gradient(closest-side, rgba(183, 243, 74, 0.18), transparent); }
.glow-cta { width: 900px; height: 500px; left: 50%; top: 50%; transform: translate(-50%, -50%); background: radial-gradient(closest-side, rgba(183, 243, 74, 0.14), transparent); }

/* Hero */
.hero { position: relative; overflow: hidden; padding: 40px 0 72px; }
.hero::after { /* faint grid */
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: -1;
  background-image: linear-gradient(var(--highlight) 1px, transparent 1px), linear-gradient(90deg, var(--highlight) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 70% 30%, #000 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 70% 30%, #000 0%, transparent 70%);
}
.hero-grid { position: relative; display: grid; gap: 56px; align-items: center; }
.hero-copy { display: grid; gap: 24px; justify-items: start; }
.fineprint { color: var(--text-3); font-size: 13px; margin-top: -12px; }

.hero-visual { position: relative; justify-self: center; width: min(92vw, 480px); aspect-ratio: 1 / 1.34; }
.hero-visual .phone { position: absolute; width: 62%; border-radius: 38px; padding: 9px; }
.hero-visual .phone::before { height: 22px; border-radius: 30px 30px 0 0; }
.hero-visual .phone::after { top: 15px; height: 15px; }
.hero-visual .phone picture, .hero-visual .phone img { border-radius: 0 0 30px 30px; }
.hero-back { left: 0; top: 0; transform: rotate(-6deg); }
.hero-front { right: 0; top: 9%; transform: rotate(4deg); z-index: 2; }
.chip {
  position: absolute; display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: 999px;
  background: rgba(32, 36, 33, 0.85); border: 1px solid var(--border-strong);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font-size: 14px; font-weight: 600; white-space: nowrap;
  box-shadow: 0 16px 32px -12px rgba(0, 0, 0, 0.7);
  animation: float 6s ease-in-out infinite;
}
.chip svg { color: var(--lime); }
.chip-a { left: -4%; bottom: 6%; z-index: 3; }
.chip-b { left: 2%; top: -3%; z-index: 3; animation-delay: -3s; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* Phones */
.phone {
  position: relative;
  border-radius: 44px;
  padding: 10px;
  background: linear-gradient(145deg, #2E332F, #141715 60%, #232724);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 40px 80px -24px rgba(0, 0, 0, 0.85),
    0 0 80px -20px rgba(183, 243, 74, 0.18);
}
.phone::before { /* the screen's top area, standing in for a status bar */
  content: ""; display: block; height: 26px;
  background: var(--bg); border-radius: 34px 34px 0 0;
}
.phone::after { /* camera notch */
  content: ""; position: absolute; top: 18px; left: 50%; transform: translateX(-50%);
  width: 30%; height: 18px; border-radius: 999px; background: #000;
}
.phone picture, .phone img { border-radius: 0 0 34px 34px; overflow: hidden; }

/* Problem */
.problem { padding: 72px 0; border-top: 1px solid var(--border); }
.problem .h2 { max-width: 16em; }
.problem .sub { margin-top: 14px; }
.pains { list-style: none; margin: 40px 0 0; padding: 0; display: grid; gap: 16px; }
.pain {
  padding: 24px; border-radius: var(--r-xl);
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 var(--highlight);
}
.pain-num { display: inline-block; font-family: var(--font-display); color: var(--lime); font-size: 28px; line-height: 1; margin-bottom: 14px; }
.pain h3 { font-size: 19px; letter-spacing: -0.01em; margin-bottom: 6px; }
.pain p { color: var(--text-2); font-size: 15px; }

/* Features */
.features { padding: 24px 0 40px; overflow-x: clip; }
.feature { display: grid; gap: 40px; align-items: center; padding: 56px 0; }
.feature-copy { display: grid; gap: 18px; justify-items: start; }
.feature-copy .overline { margin-bottom: -4px; }
.ticks { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 12px; }
.ticks li { position: relative; padding-left: 34px; font-size: 16px; }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: 1px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--lime-muted) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='%23B7F34A' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat;
  border: 1px solid var(--lime-border);
}

.duo { position: relative; width: min(86vw, 440px); justify-self: center; aspect-ratio: 1 / 1.12; }
.duo .phone { position: absolute; width: 60%; border-radius: 36px; padding: 8px; }
.duo .phone::before { height: 20px; border-radius: 28px 28px 0 0; }
.duo .phone::after { top: 14px; height: 14px; }
.duo .phone picture, .duo .phone img { border-radius: 0 0 28px 28px; }
.duo .phone-back { left: 0; top: 0; transform: rotate(-6deg); opacity: 0.9; }
.duo .phone-front { right: 0; top: 10%; transform: rotate(4deg); z-index: 2; }
.flip .duo .phone-back { left: auto; right: 0; transform: rotate(6deg); }
.flip .duo .phone-front { right: auto; left: 0; transform: rotate(-4deg); }

/* CTA */
.cta { position: relative; overflow: hidden; padding: 96px 0 104px; border-top: 1px solid var(--border); text-align: center; }
.cta-inner { position: relative; display: grid; gap: 22px; justify-items: center; }
.cta .lede { margin: 0 auto; }
.cta .display .lime { display: inline; }
.cta-mark { filter: drop-shadow(0 0 24px rgba(183, 243, 74, 0.45)); }

/* Waitlist form */
.waitlist { display: grid; gap: 10px; width: 100%; max-width: 480px; }
.waitlist input[type="email"] {
  width: 100%; min-height: 52px; padding: 0 16px;
  border-radius: var(--r-md); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text);
  font: 400 16px/1 var(--font-body);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.waitlist input[type="email"]::placeholder { color: var(--text-3); }
.waitlist input[type="email"]:focus { outline: none; border-color: var(--lime); box-shadow: 0 0 0 4px var(--lime-muted); }
.waitlist input[aria-invalid="true"] { border-color: var(--error); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form-msg { grid-column: 1 / -1; min-height: 1.4em; font-size: 14px; color: var(--text-2); text-align: left; }
.form-msg.is-error { color: var(--error); }
.form-msg.is-ok { color: var(--lime); font-weight: 600; }
.cta .form-msg { text-align: center; }
.waitlist.done input[type="email"], .waitlist.done .btn { display: none; }
.waitlist.done .form-msg { font-size: 16px; padding: 14px 16px; border-radius: var(--r-md); background: var(--lime-muted); border: 1px solid var(--lime-border); }
@media (min-width: 480px) {
  .waitlist { grid-template-columns: 1fr auto; }
}

/* Footer */
.footer { border-top: 1px solid var(--border); padding: 40px 0 calc(40px + env(safe-area-inset-bottom)); }
.footer-inner { display: grid; gap: 18px; }
.footer-top { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; }
.footer-link { color: var(--text-2); text-decoration: none; font-size: 15px; }
.footer-link:hover { color: var(--text); }
.disclaimer { color: var(--text-3); font-size: 13px; max-width: 60em; }
.copyright { color: var(--text-3); font-size: 13px; }

/* Larger screens */
@media (min-width: 720px) {
  .pains { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 960px) {
  .hero { padding: 72px 0 112px; }
  .hero-grid { grid-template-columns: 1.15fr 0.85fr; }
  .hero-visual { width: 100%; max-width: 480px; }
  .feature { grid-template-columns: 1fr 1fr; gap: 72px; padding: 72px 0; }
  .feature.flip .feature-copy { order: 2; }
  .problem { padding: 96px 0; }
}

/* Hero entrance: pure CSS, so it plays on first paint without waiting for JS. */
.rise { animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.r1 { animation-delay: 0.05s; } .r2 { animation-delay: 0.12s; } .r3 { animation-delay: 0.19s; }
.r4 { animation-delay: 0.26s; } .r5 { animation-delay: 0.33s; } .r6 { animation-delay: 0.2s; animation-duration: 0.9s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* Scroll reveal below the fold: only hidden once JS has run, so the page reads fine without it. */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1); }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rise { animation: none; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .chip, .dot { animation: none; }
}

/* Progress section: the phone with the weekly check-in floating over it as a card
   (cropped to its content, so no empty screen shows). */
.duo-card .phone-front { right: 4%; top: 0; transform: rotate(4deg); z-index: 1; }
.duo-card .float-card {
  position: absolute; left: -2%; bottom: -10%; width: 56%; z-index: 2;
  border-radius: 22px; overflow: hidden;
  border: 1px solid var(--border-strong);
  transform: rotate(-4deg);
  box-shadow: 0 30px 60px -18px rgba(0, 0, 0, 0.9), 0 0 60px -18px rgba(183, 243, 74, 0.25);
}
.duo-card .float-card img { width: 100%; }
@media (min-width: 960px) { .duo-card .float-card { left: -6%; } }
