/* ==========================================================================
   Swolly — swolly.io marketing site
   Design tokens mirror the app's SwollyColors ThemeExtension exactly.
   Hanken Grotesk is self-hosted: keeps the CSP tight (no external origins)
   and avoids shipping visitor IPs to Google Fonts.
   ========================================================================== */

@font-face {
  font-family: 'Hanken Grotesk';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/hanken-grotesk-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --- Theme tokens -------------------------------------------------------- */

:root,
:root[data-theme='dark'] {
  --bg: #0F1419;
  --card: #1A2030;
  --stage: #12171F;
  --chip: #252C3B;
  --seg: #1E2433;
  --ink: #F4F5F7;
  --ink2: #B6BCC5;
  --ink3: #6B7280;
  --line: rgba(244, 245, 247, 0.10);
  --cardLine: transparent;
  --headerBg: rgba(15, 20, 25, 0.78);
  --navBg: rgba(37, 44, 59, 0.88);
  --logoFilter: invert(1) brightness(2);
  --legalInk: #B6BCC5;   /* 9.7:1 on --bg */
  --aiPanel: linear-gradient(150deg, rgba(139, 92, 246, 0.16), rgba(139, 92, 246, 0.04) 55%, transparent);
  --glow: rgba(16, 185, 129, 0.20);
  --phoneShadow: 0 50px 90px -30px rgba(0, 0, 0, 0.75);
  --phoneShadowSm: 0 40px 80px -30px rgba(0, 0, 0, 0.70);
}

:root[data-theme='light'] {
  --bg: #F4F5F7;
  --card: #FFFFFF;
  --stage: #F4F5F7;
  --chip: #EEF1F5;
  --seg: #E9ECF1;
  --ink: #111827;
  --ink2: #6B7280;
  --ink3: #9CA3AF;
  --line: rgba(17, 24, 39, 0.09);
  --cardLine: rgba(17, 24, 39, 0.07);
  --headerBg: rgba(244, 245, 247, 0.82);
  --navBg: rgba(255, 255, 255, 0.92);
  --logoFilter: none;
  --legalInk: #4B5563;   /* 6.8:1 on --bg */
  --aiPanel: linear-gradient(150deg, rgba(139, 92, 246, 0.10), rgba(139, 92, 246, 0.03) 55%, transparent);
  --glow: rgba(16, 185, 129, 0.14);
  --phoneShadow: 0 50px 90px -34px rgba(17, 24, 39, 0.28);
  --phoneShadowSm: 0 40px 80px -34px rgba(17, 24, 39, 0.22);
}

/* Semantic colors — identical in both themes, exactly as in the app. */
:root {
  --accent: #10B981;
  --accentSoft: rgba(16, 185, 129, 0.14);
  --accentGrad: linear-gradient(135deg, rgba(16, 185, 129, 0.22), rgba(16, 185, 129, 0.06));
  --onAccent: #06251A;
  --warning: #F59E0B;
  --error: #EF4444;
  --info: #3B82F6;
  --purple: #8B5CF6;
  --teal: #14B8A6;
  --navy: #152436;
  --navy2: #1E3149;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* --- Base ---------------------------------------------------------------- */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--ink);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; transition: color .25s ease; }
a:hover { color: var(--accent); }

h1, h2, h3, p, figure { margin: 0; }

img { max-width: 100%; }

::selection { background: var(--accent); color: var(--onAccent); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.container { max-width: 1280px; margin: 0 auto; padding: 0 40px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--accent); color: var(--onAccent);
  padding: 12px 20px; border-radius: 999px;
  font-size: 15px; font-weight: 600;
  transition: top .25s ease;
}
.skip-link:focus { top: 12px; color: var(--onAccent); }

/* --- Typography ---------------------------------------------------------- */

.eyecap {
  font-size: 11.5px; font-weight: 700; letter-spacing: 1.15px;
  text-transform: uppercase; color: var(--ink3);
  margin-bottom: 20px;
}
.eyecap--accent  { color: var(--accent); }
.eyecap--fuel    { color: var(--warning); }
.eyecap--compete { color: var(--info); }
.eyecap--ai      { color: var(--purple); }

.h1 {
  font-size: 88px; line-height: .94; font-weight: 600;
  letter-spacing: -4px; text-wrap: balance;
}
.h2 {
  font-size: 52px; line-height: 1; font-weight: 600;
  letter-spacing: -2px; text-wrap: balance;
}
.lede {
  margin-top: 22px; max-width: 480px;
  font-size: 18px; line-height: 1.55; font-weight: 500;
  color: var(--ink2); text-wrap: pretty;
}
/* Legal text — health disclaimer, AI disclaimer, subscription terms.
   Deliberately NOT --ink3: at 13px that token lands at 3.8:1 on dark and
   2.3:1 on light, which fails WCAG AA and undercuts the "clear and
   conspicuous" standard these disclosures exist to meet. --legalInk is
   tuned to clear 4.5:1 in both themes (9.7:1 dark, 6.8:1 light). */
.fine {
  font-size: 13.5px; line-height: 1.6; font-weight: 500; color: var(--legalInk);
}

/* --- Buttons ------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  padding: 15px 28px; border-radius: 999px;
  font-family: inherit; font-size: 16px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .3s var(--ease), background-color .3s ease, border-color .3s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn--accent { background: var(--accent); color: var(--onAccent); }
.btn--accent:hover { color: var(--onAccent); }
.btn--ink { background: var(--ink); color: var(--bg); }
.btn--ink:hover { color: var(--bg); }
.btn--ghost { border-color: var(--line); color: var(--ink); }
.btn--ghost:hover { color: var(--ink); border-color: var(--accent); }
.btn--block { display: flex; width: 100%; }

/* Pre-launch: the app is not on the App Store yet, so the primary CTA is a
   status badge, not a link. No dead App Store URL ships. */
.badge-soon {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 15px 28px; border-radius: 999px;
  background: var(--accent); color: var(--onAccent);
  font-size: 16px; font-weight: 600;
}
.badge-soon .glyph { font-size: 22px; line-height: 1; }

/* --- Header -------------------------------------------------------------- */

.header {
  position: sticky; top: 0; z-index: 50;
  background: var(--headerBg);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .4s ease;
}
.header.is-scrolled { box-shadow: 0 14px 40px -26px rgba(0, 0, 0, .75); }
.header__inner {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1280px; margin: 0 auto; padding: 16px 40px; gap: 24px;
}
.brand { display: flex; align-items: center; gap: 11px; flex: none; }
.brand__mark { width: 32px; height: 32px; object-fit: contain; filter: var(--logoFilter); }
.brand__word { font-size: 21px; font-weight: 600; letter-spacing: -.2px; color: var(--ink); }
.nav { display: flex; align-items: center; gap: 32px; font-size: 15px; font-weight: 500; color: var(--ink2); }
.header__actions { display: flex; align-items: center; gap: 14px; }

.seg {
  display: inline-flex; padding: 4px; gap: 2px;
  border-radius: 999px; background: var(--seg);
}
.seg__btn {
  font-family: inherit; font-size: 13px; font-weight: 600;
  padding: 7px 15px; border-radius: 999px;
  border: 0; background: transparent; color: var(--ink3);
  cursor: pointer; transition: background-color .3s ease, color .3s ease;
}
.seg__btn[aria-pressed='true'] { background: var(--card); color: var(--ink); }

/* --- Hero ---------------------------------------------------------------- */

.hero { position: relative; padding: 96px 40px 0; overflow: hidden; }
.hero__glow {
  position: absolute; top: 20px; left: 50%; transform: translateX(-50%);
  width: 1100px; height: 760px; border-radius: 50%;
  background: radial-gradient(ellipse, var(--glow), transparent 60%);
  pointer-events: none;
}
.hero__inner { position: relative; max-width: 980px; margin: 0 auto; text-align: center; }

.pill-badge {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--card); border: 1px solid var(--line);
  padding: 7px 16px 7px 8px; border-radius: 999px; margin-bottom: 30px;
}
.pill-badge__tag {
  background: rgba(139, 92, 246, .16); color: var(--purple);
  font-size: 11.5px; font-weight: 700; letter-spacing: 1.15px;
  padding: 4px 10px; border-radius: 999px;
}
.pill-badge__text { font-size: 14px; font-weight: 500; color: var(--ink2); }

.hero__sub { margin: 30px auto 0; max-width: 620px; font-size: 20px; line-height: 1.5; font-weight: 500; color: var(--ink2); }
.hero__cta { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 36px; flex-wrap: wrap; }
.hero__trust {
  display: flex; justify-content: center; align-items: center; gap: 20px;
  margin-top: 26px; font-size: 13.5px; font-weight: 500; color: var(--legalInk);
  flex-wrap: wrap;
}
.dot { width: 4px; height: 4px; border-radius: 50%; background: currentColor; flex: none; }

/* --- Phone mockups ------------------------------------------------------- */

.phones {
  position: relative; max-width: 1280px; margin: 66px auto 0;
  display: flex; justify-content: center; align-items: flex-end;
  gap: 26px; height: 440px; overflow: hidden;
}
.phone { background: #000; flex: none; }
.phone__screen { width: 100%; height: 100%; background: var(--bg); overflow: hidden; position: relative; }

/* Real app screenshots, one per theme, cross-faded by the theme toggle.
   Both are in the DOM so switching never shows a loading gap. The screens are
   1206x2622 captures downscaled to 720px wide — the widest a phone renders at
   is 320 CSS px, so this is comfortably past 2x. */
.shot {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: top center;
  display: block;
}
:root[data-theme='dark'] .shot--light,
:root[data-theme='light'] .shot--dark { display: none; }

.phone--lg { width: 300px; height: 620px; border-radius: 48px; padding: 10px; z-index: 2; box-shadow: var(--phoneShadow); }
.phone--lg .phone__screen { border-radius: 39px; }

.phone--sm {
  width: 262px; height: 540px; border-radius: 44px; padding: 9px;
  transform: translateY(56px); box-shadow: var(--phoneShadowSm);
}
.phone--sm .phone__screen { border-radius: 36px; }

.phone--tall { width: 320px; height: 660px; border-radius: 50px; padding: 10px; box-shadow: var(--phoneShadow); }
.phone--tall .phone__screen { border-radius: 41px; }

.phone--parallax { transition: transform .6s var(--ease); }

.phone-figure { display: flex; justify-content: center; }

.p-title { font-size: 24px; font-weight: 600; letter-spacing: -.6px; color: var(--ink); margin-bottom: 14px; }

.tile {
  display: flex; align-items: center; justify-content: center; flex: none;
  border-radius: 12px;
}
.tile--38 { width: 38px; height: 38px; }
.tile--40 { width: 40px; height: 40px; }
.tile--44 { width: 44px; height: 44px; }
.tile--accent  { background: var(--accentSoft); color: var(--accent); }
.tile--fuel    { background: rgba(245, 158, 11, .14); color: var(--warning); }
.tile--compete { background: rgba(59, 130, 246, .14); color: var(--info); }
.tile--ai      { background: rgba(139, 92, 246, .14); color: var(--purple); }
.tile--teal    { background: rgba(20, 184, 166, .14); color: var(--teal); }
.tile--error   { background: rgba(239, 68, 68, .14); color: var(--error); }
.tile--muted   { background: var(--chip); color: var(--ink2); }

/* --- Pillars ------------------------------------------------------------- */

.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.pillar {
  background: var(--card); border: 1px solid var(--cardLine);
  border-radius: 22px; padding: 28px;
  transition: transform .4s var(--ease), border-color .4s ease;
}
.pillar:hover { transform: translateY(-6px); border-color: var(--accent); }
.pillar__title { font-size: 22px; font-weight: 600; letter-spacing: -.44px; color: var(--ink); margin-top: 20px; }
.pillar__body { font-size: 15px; font-weight: 500; line-height: 1.5; color: var(--ink2); margin-top: 8px; }

/* --- Deep dives ---------------------------------------------------------- */

.section { padding-top: 120px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: center; }
.split__media--first { order: -1; }

.features { display: flex; flex-direction: column; gap: 16px; margin-top: 36px; }
.feature { display: flex; align-items: flex-start; gap: 14px; }
.feature__title { font-size: 16px; font-weight: 600; letter-spacing: -.16px; color: var(--ink); }
/* Marks a feature that requires a PRO subscription. Used wherever a benefit
   is described outside the pricing table, so nothing reads as free when it
   isn't. */
.pro-tag {
  display: inline-block; vertical-align: 1px; margin-left: 7px;
  background: var(--accentSoft); color: var(--accent);
  font-size: 10px; font-weight: 700; letter-spacing: 1px;
  padding: 3px 7px; border-radius: 999px;
}
.feature__body { font-size: 14px; font-weight: 500; color: var(--ink2); margin-top: 2px; }

.chips { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 32px; }
.chip {
  background: var(--chip); color: var(--ink2);
  font-size: 13px; font-weight: 600; padding: 9px 16px; border-radius: 999px;
}

.stat-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 36px; }
.stat-card { background: var(--card); border: 1px solid var(--cardLine); border-radius: 22px; padding: 22px; }
.stat-card__fig { font-size: 34px; font-weight: 600; letter-spacing: -1.4px; color: var(--ink); line-height: 1; }
.stat-card__body { font-size: 14px; font-weight: 500; color: var(--ink2); margin-top: 6px; }

/* --- AI panel ------------------------------------------------------------ */

.ai-panel {
  background: var(--aiPanel);
  border: 1px solid rgba(139, 92, 246, .28);
  border-radius: 40px; padding: 64px 56px;
}
.ai-panel .split { gap: 64px; }
.ai-card { background: var(--card); border-radius: 28px; padding: 26px; }
.ai-card__head { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.ai-card__title { font-size: 16px; font-weight: 600; color: var(--ink); }
.ai-prompts { display: flex; flex-direction: column; gap: 10px; }
.ai-prompt {
  background: var(--chip); border-radius: 16px; padding: 14px 16px;
  font-size: 15px; font-weight: 500; color: var(--ink);
}
.ai-input {
  display: flex; align-items: center; gap: 10px; margin-top: 20px;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 999px; padding: 12px 12px 12px 18px;
}
.ai-input__text {
  flex: 1; font-size: 15px; font-weight: 500; color: var(--ink3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ai-caret {
  display: inline-block; width: 2px; height: 15px; margin-left: 2px;
  vertical-align: -2px; background: var(--purple);
  animation: blink 1.05s steps(1, end) infinite;
}
.ai-send {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--purple); color: #fff; flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
}

/* --- Pricing ------------------------------------------------------------- */

.pricing { max-width: 1080px; margin: 0 auto; padding: 120px 40px 0; text-align: center; }
.pricing .h2 { font-size: 56px; letter-spacing: -2.4px; }
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 40px; text-align: left; }
.plan {
  background: var(--card); border: 1px solid var(--cardLine);
  border-radius: 32px; padding: 36px; position: relative;
  transition: transform .4s var(--ease);
}
.plan:hover { transform: translateY(-6px); }
.plan--pro { border-color: var(--accent); }
.plan__tag {
  position: absolute; top: 36px; right: 36px;
  background: var(--accentSoft); color: var(--accent);
  font-size: 11.5px; font-weight: 700; letter-spacing: 1.15px;
  padding: 6px 12px; border-radius: 999px;
}
.plan__name { font-size: 18px; font-weight: 600; letter-spacing: -.18px; color: var(--ink); }
.plan__note { margin-top: 14px; font-size: 15px; font-weight: 500; line-height: 1.5; color: var(--ink2); }
.plan__list { display: flex; flex-direction: column; gap: 13px; margin-top: 28px; }
.plan__item { display: flex; gap: 11px; align-items: flex-start; font-size: 15px; font-weight: 500; color: var(--ink2); }
.plan__mark { font-size: 15px; font-weight: 700; color: var(--accent); flex: none; }
.plan__mark--ai { color: var(--purple); }
.plan__cta { margin-top: 32px; }
.pricing__lede {
  margin: 22px auto 0; max-width: 640px;
  font-size: 18px; line-height: 1.55; font-weight: 500;
  color: var(--ink2); text-wrap: pretty;
}
.pricing__fine { margin-top: 28px; max-width: 720px; margin-left: auto; margin-right: auto; }

/* --- Closing CTA --------------------------------------------------------- */

.closing {
  background: var(--card); border: 1px solid var(--cardLine);
  border-radius: 40px; padding: 76px 40px; text-align: center;
  position: relative; overflow: hidden;
}
.closing__glow {
  position: absolute; bottom: -320px; left: 50%; transform: translateX(-50%);
  width: 900px; height: 600px; border-radius: 50%;
  background: radial-gradient(ellipse, var(--glow), transparent 65%);
  pointer-events: none;
}
.closing__inner { position: relative; }
.closing__mark { width: 52px; height: 52px; object-fit: contain; filter: var(--logoFilter); margin-bottom: 24px; }
.closing .h2 { font-size: 60px; line-height: .98; letter-spacing: -2.6px; max-width: 16ch; margin: 0 auto; }
.closing__cta { display: flex; justify-content: center; gap: 14px; margin-top: 36px; flex-wrap: wrap; }

/* --- Footer -------------------------------------------------------------- */

.footer { padding: 88px 40px 56px; max-width: 1280px; margin: 0 auto; }
.footer__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 48px; flex-wrap: wrap; }
.footer__about { max-width: 360px; }
.footer__brand { display: flex; align-items: center; gap: 11px; margin-bottom: 16px; }
.footer__brand img { width: 28px; height: 28px; object-fit: contain; filter: var(--logoFilter); }
.footer__brand span { font-size: 19px; font-weight: 600; letter-spacing: -.2px; color: var(--ink); }
.footer__blurb { font-size: 14px; line-height: 1.55; font-weight: 500; color: var(--ink2); }
.footer__mail { display: inline-block; margin-top: 12px; font-size: 14px; font-weight: 600; color: var(--accent); }
.footer__cols { display: flex; gap: 64px; flex-wrap: wrap; }
.footer__col { display: flex; flex-direction: column; gap: 11px; }
.footer__col a { font-size: 14px; font-weight: 500; color: var(--ink2); }
.footer__rule { height: 1px; background: var(--line); margin: 44px 0 24px; }
.footer__legal { max-width: 760px; margin-bottom: 18px; }
.footer__copy { font-size: 13px; font-weight: 500; color: var(--ink3); }

/* --- Motion -------------------------------------------------------------- */

@keyframes blink { 0%, 45% { opacity: 1; } 55%, 100% { opacity: 0; } }
[data-reveal] {
  opacity: 0; transform: translateY(24px);
  transition: opacity .85s var(--ease), transform .85s var(--ease);
}
[data-reveal].is-in { opacity: 1; transform: none; }

/* --- Responsive ---------------------------------------------------------- */
/* The handoff prototype was desktop-only at 1440px; these breakpoints are
   added here per the handoff's own recommendation. */

@media (max-width: 1100px) {
  .h1 { font-size: 64px; letter-spacing: -2.6px; }
  .h2 { font-size: 42px; letter-spacing: -1.6px; }
  .pricing .h2 { font-size: 44px; letter-spacing: -1.8px; }
  .closing .h2 { font-size: 46px; letter-spacing: -1.8px; }
  .split { grid-template-columns: 1fr; gap: 48px; }
  .split__media--first { order: 0; }
  .pillars { grid-template-columns: 1fr; }
  .ai-panel { padding: 48px 32px; }
  .nav { gap: 22px; font-size: 14px; }
  .section { padding-top: 96px; }
}

@media (max-width: 820px) {
  .container, .hero, .pricing, .footer { padding-left: 28px; padding-right: 28px; }
  .header__inner { padding: 14px 28px; }
  .nav { display: none; }
  .h1 { font-size: 52px; letter-spacing: -2px; }
  .hero { padding-top: 64px; }
  .hero__sub { font-size: 18px; }
  .phones { gap: 0; height: 400px; }
  .phone--sm { display: none; }
  .plans { grid-template-columns: 1fr; }
  .stat-cards { grid-template-columns: 1fr; }
  .footer__cols { gap: 40px; }
}

@media (max-width: 520px) {
  .container, .hero, .pricing, .footer { padding-left: 20px; padding-right: 20px; }
  .header__inner { padding: 12px 20px; gap: 12px; }
  .brand__word { font-size: 18px; }
  .h1 { font-size: 44px; letter-spacing: -2px; }
  .h2, .pricing .h2, .closing .h2 { font-size: 34px; letter-spacing: -1.3px; }
  .lede, .hero__sub { font-size: 16px; }
  .hero__cta { flex-direction: column; align-items: stretch; }
  .hero__cta .btn, .hero__cta .badge-soon { width: 100%; justify-content: center; }
  .closing { padding: 56px 24px; border-radius: 32px; }
  .closing__cta .badge-soon { width: 100%; justify-content: center; }
  .ai-panel { padding: 36px 22px; border-radius: 28px; }
  .plan { padding: 28px; }
  .plan__tag { top: 28px; right: 28px; }
  .section { padding-top: 72px; }
  .pricing { padding-top: 72px; }
  .phones { height: 330px; margin-top: 44px; }
  .phone--lg { width: 260px; height: 540px; border-radius: 42px; }
  .phone--lg .phone__screen { border-radius: 34px; }
  .phone--tall { width: 290px; height: 600px; }
  .seg__btn { padding: 7px 12px; font-size: 12.5px; }
  /* The header CTA wraps and crowds the theme toggle at this width, and the
     hero carries the same call to action a few hundred pixels below. */
  .header__cta { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
  .btn:hover, .pillar:hover, .plan:hover { transform: none; }
}
