/* ==========================================================================
   Agonist — marketing site styles
   --------------------------------------------------------------------------
   Structure:
     1. Design tokens (colors, type, spacing) + light/dark themes
     2. Base / reset
     3. Layout helpers (container, sections, grid)
     4. Header & nav
     5. Buttons & badges
     6. Hero
     7. Cards / features / steps
     8. Screenshots gallery
     9. Pricing
     10. FAQ
     11. Legal / prose pages
     12. Footer
     13. Utilities & motion
   To re-theme, edit the tokens in section 1. Most colors come from the
   prompt's brand palette.
   ========================================================================== */

/* 1. DESIGN TOKENS ------------------------------------------------------- */
:root {
  /* Brand palette */
  --emerald: #1B8A5F;   /* primary — CTAs */
  --emerald-600: #157049;
  --teal: #1C7575;      /* secondary — links/accents */
  --teal-light: #7FC9C0;/* the mark color on dark */
  --ink: #1A1A1A;       /* near-black */
  --cream: #F7F6F2;     /* warm off-white */

  /* Semantic tokens — overridden per theme below */
  --bg: var(--cream);
  --bg-elev: #ffffff;          /* cards */
  --bg-subtle: #efeee8;        /* alternating sections */
  --text: var(--ink);
  --text-muted: #5c5c57;
  --border: #e4e2db;
  --shadow: 0 1px 2px rgba(26,26,26,.04), 0 12px 32px -12px rgba(26,26,26,.16);
  --shadow-sm: 0 1px 2px rgba(26,26,26,.06), 0 6px 16px -10px rgba(26,26,26,.14);
  --logo: var(--teal);
  --primary: var(--emerald);
  --primary-hover: var(--emerald-600);
  --link: var(--teal);
  --ring: rgba(27,138,95,.45);

  /* Type */
  --font-sans: "Satoshi", "General Sans", "Inter", -apple-system,
               BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Scale */
  --maxw: 1120px;
  --radius: 18px;
  --radius-sm: 12px;
  --radius-pill: 999px;
}

/* Dark theme — applied when <html data-theme="dark"> */
:root[data-theme="dark"] {
  --bg: #111312;
  --bg-elev: #1b1d1c;
  --bg-subtle: #161817;
  --text: #f3f4f2;
  --text-muted: #a6a9a4;
  --border: #2a2d2b;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 16px 40px -16px rgba(0,0,0,.6);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4), 0 8px 20px -12px rgba(0,0,0,.5);
  --logo: var(--teal-light);
  --primary: #21a371;        /* brighter emerald for contrast on dark */
  --primary-hover: #2bb37e;
  --link: var(--teal-light);
  --ring: rgba(127,201,192,.5);
}

/* Respect OS preference on first load (no flash — see inline script in <head>) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #111312; --bg-elev: #1b1d1c; --bg-subtle: #161817;
    --text: #f3f4f2; --text-muted: #a6a9a4; --border: #2a2d2b;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 16px 40px -16px rgba(0,0,0,.6);
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4), 0 8px 20px -12px rgba(0,0,0,.5);
    --logo: var(--teal-light); --primary: #21a371; --primary-hover: #2bb37e;
    --link: var(--teal-light); --ring: rgba(127,201,192,.5);
  }
}

/* Satoshi from Fontshare; falls back to system geometric sans if blocked */
@import url("https://api.fontshare.com/v2/css?f[]=satoshi@400,500,700,900&display=swap");

/* 2. BASE / RESET -------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.12; letter-spacing: -.02em; font-weight: 700; margin: 0 0 .4em; }
h1 { font-size: clamp(2.4rem, 6vw, 4rem); font-weight: 900; }
h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h3 { font-size: 1.18rem; }
p { margin: 0 0 1rem; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; border-radius: 6px; }

/* 3. LAYOUT -------------------------------------------------------------- */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: clamp(56px, 9vw, 104px) 0; }
.section--subtle { background: var(--bg-subtle); }
.section__head { max-width: 640px; margin: 0 auto clamp(36px, 5vw, 56px); text-align: center; }
.section__head p { color: var(--text-muted); font-size: 1.1rem; margin: 0; }
.eyebrow {
  display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--teal); margin-bottom: .8rem;
}
:root[data-theme="dark"] .eyebrow { color: var(--teal-light); }
.grid { display: grid; gap: 22px; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }

/* 4. HEADER -------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.site-header__inner { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.2rem; letter-spacing: -.02em; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand__mark { width: 26px; height: auto; color: var(--logo); }
.nav { display: flex; align-items: center; gap: 28px; }
.nav a { color: var(--text-muted); font-weight: 500; font-size: .98rem; }
.nav a:hover { color: var(--text); text-decoration: none; }
.header-actions { display: flex; align-items: center; gap: 14px; }

/* Theme toggle */
.theme-toggle {
  display: inline-grid; place-items: center; width: 40px; height: 40px;
  border-radius: var(--radius-pill); border: 1px solid var(--border);
  background: var(--bg-elev); color: var(--text); cursor: pointer;
}
.theme-toggle:hover { border-color: var(--text-muted); }
.theme-toggle svg { width: 19px; height: 19px; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* Mobile nav */
.nav-toggle { display: none; }
@media (max-width: 820px) {
  .nav { position: fixed; inset: 66px 0 auto 0; flex-direction: column; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--border);
    padding: 8px 24px 20px; transform: translateY(-130%); transition: transform .28s ease; }
  .nav.open { transform: translateY(0); }
  .nav a { width: 100%; padding: 14px 0; border-bottom: 1px solid var(--border); font-size: 1.05rem; }
  .nav .btn { margin-top: 14px; width: 100%; }
  .nav-toggle { display: inline-grid; place-items: center; width: 40px; height: 40px;
    border: 1px solid var(--border); border-radius: var(--radius-pill);
    background: var(--bg-elev); color: var(--text); cursor: pointer; }
  .nav-toggle svg { width: 20px; height: 20px; }
}

/* 5. BUTTONS & BADGES ---------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 700; font-size: 1rem; line-height: 1; cursor: pointer;
  padding: 14px 24px; border-radius: var(--radius-pill);
  border: 1px solid transparent; transition: transform .12s ease, background .2s ease, box-shadow .2s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn--primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--primary-hover); }
.btn--ghost { background: var(--bg-elev); color: var(--text); border-color: var(--border); }
.btn--ghost:hover { border-color: var(--text-muted); }

/* App Store badge link */
.appstore-badge { display: inline-block; line-height: 0; transition: transform .12s ease, opacity .2s ease; }
.appstore-badge:hover { transform: translateY(-2px); }
.appstore-badge img { height: 52px; width: auto; }

/* "Save 50%" style pills */
.pill {
  display: inline-block; font-size: .76rem; font-weight: 700; letter-spacing: .03em;
  padding: 5px 11px; border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--emerald) 16%, transparent); color: var(--emerald);
}
:root[data-theme="dark"] .pill { background: color-mix(in srgb, var(--primary) 24%, transparent); color: #7fe3bb; }

/* 6. HERO ---------------------------------------------------------------- */
.hero { position: relative; overflow: hidden; padding-top: clamp(40px, 6vw, 72px); }
.hero::before { /* soft brand glow */
  content: ""; position: absolute; inset: -20% 30% auto -10%; height: 520px;
  background: radial-gradient(60% 60% at 30% 30%, color-mix(in srgb, var(--teal) 22%, transparent), transparent 70%);
  filter: blur(20px); z-index: 0; pointer-events: none;
}
.hero__inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.hero__copy h1 { margin-bottom: .35em; }
.hero__sub { font-size: 1.2rem; color: var(--text-muted); max-width: 30ch; margin-bottom: 1.8rem; }
.hero__cta { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.hero__note { margin: 18px 0 0; font-size: .92rem; color: var(--text-muted); }
.hero__media { position: relative; display: flex; justify-content: center; gap: 18px; }
.hero__media img {
  width: 100%; max-width: 290px; border-radius: 26px; box-shadow: var(--shadow);
}
.hero__media .phone--back { max-width: 250px; margin-top: 36px; opacity: .96; }
@media (max-width: 900px) {
  .hero__inner { grid-template-columns: 1fr; text-align: center; gap: 36px; }
  .hero__sub { margin-left: auto; margin-right: auto; }
  .hero__cta { justify-content: center; }
  .hero__media { margin-top: 8px; }
  .hero__media .phone--back { display: none; }
}

/* 7. CARDS / FEATURES / STEPS ------------------------------------------- */
.card {
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .25s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.feature__icon {
  width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--teal) 14%, transparent); color: var(--teal); margin-bottom: 16px;
}
:root[data-theme="dark"] .feature__icon { background: color-mix(in srgb, var(--teal-light) 16%, transparent); color: var(--teal-light); }
.feature__icon svg { width: 24px; height: 24px; }
.card h3 { margin-bottom: 6px; }
.card p { color: var(--text-muted); margin: 0; font-size: .98rem; }

/* Steps */
.steps { counter-reset: step; }
.step__num {
  width: 40px; height: 40px; border-radius: var(--radius-pill); display: grid; place-items: center;
  font-weight: 800; background: var(--primary); color: #fff; margin-bottom: 16px;
}

/* 8. SCREENSHOTS GALLERY ------------------------------------------------- */
.gallery { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 28px; max-width: 760px; margin: 0 auto; }
.gallery img { width: 100%; border-radius: 22px; box-shadow: var(--shadow); }
@media (max-width: 560px) { .gallery { grid-template-columns: 1fr; max-width: 340px; } }

/* 9. PRICING ------------------------------------------------------------- */
.pricing { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; max-width: 760px; margin: 0 auto; }
.plan { position: relative; text-align: left; }
.plan--featured { border-color: var(--primary); box-shadow: var(--shadow); }
.plan__badge { position: absolute; top: -13px; right: 22px; }
.plan__name { font-size: 1.05rem; font-weight: 700; margin-bottom: 6px; }
.plan__price { font-size: 2.4rem; font-weight: 900; letter-spacing: -.03em; }
.plan__price span { font-size: 1rem; font-weight: 500; color: var(--text-muted); }
.plan__sub { color: var(--text-muted); font-size: .95rem; margin: 4px 0 20px; }
.plan .btn { width: 100%; }
.pricing__note { text-align: center; color: var(--text-muted); font-size: .92rem; margin: 22px auto 0; max-width: 520px; }
@media (max-width: 560px) { .pricing { grid-template-columns: 1fr; max-width: 380px; } }

/* 10. FAQ ---------------------------------------------------------------- */
.faq { max-width: 740px; margin: 0 auto; }
.faq details {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-elev); padding: 0 22px; margin-bottom: 12px;
}
.faq summary {
  list-style: none; cursor: pointer; font-weight: 700; padding: 18px 0;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.5rem; font-weight: 400; color: var(--text-muted); transition: transform .2s ease; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--text-muted); margin: 0 0 18px; }

/* 11. LEGAL / PROSE ------------------------------------------------------ */
.page-head { padding: clamp(48px,7vw,84px) 0 0; }
.prose { max-width: 760px; margin: 0 auto; padding: 32px 0 64px; }
.prose h2 { font-size: 1.5rem; margin-top: 2.2em; }
.prose h3 { font-size: 1.15rem; margin-top: 1.6em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.prose li { margin-bottom: .4em; }
.prose blockquote {
  margin: 1.4em 0; padding: 16px 20px; border-left: 4px solid var(--teal);
  background: var(--bg-subtle); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--text-muted);
}
.prose code { background: var(--bg-subtle); padding: 2px 6px; border-radius: 6px; font-size: .9em; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.2em 0; font-size: .95rem; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose th { font-weight: 700; }
.prose hr { border: none; border-top: 1px solid var(--border); margin: 2.2em 0; }
.callout {
  border: 1px solid var(--border); background: var(--bg-subtle);
  border-radius: var(--radius-sm); padding: 18px 20px; margin: 22px 0;
}
.callout strong { color: var(--text); }

/* 12. FOOTER ------------------------------------------------------------- */
.site-footer { background: var(--bg-subtle); border-top: 1px solid var(--border); padding: 56px 0 36px; }
.footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; margin-bottom: 36px; }
.footer__brand .brand { margin-bottom: 12px; }
.footer__brand p { color: var(--text-muted); font-size: .95rem; max-width: 34ch; margin: 0; }
.footer__col h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); margin-bottom: 14px; }
.footer__col a { display: block; color: var(--text); padding: 6px 0; font-size: .96rem; }
.footer__col a:hover { color: var(--link); text-decoration: none; }
.footer__bottom { border-top: 1px solid var(--border); padding-top: 24px; display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; align-items: baseline; }
.footer__bottom p { margin: 0; color: var(--text-muted); font-size: .88rem; }
.footer__disclaimer { font-size: .85rem; color: var(--text-muted); max-width: 70ch; margin: 20px 0 0; line-height: 1.55; }
@media (max-width: 720px) { .footer__grid { grid-template-columns: 1fr 1fr; } .footer__brand { grid-column: 1 / -1; } }

/* 13. UTILITIES & MOTION ------------------------------------------------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.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: -999px; top: 8px; background: var(--primary); color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 8px; }

/* Reveal-on-scroll (progressive enhancement; visible by default if JS off) */
.reveal { opacity: 1; }
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.in { opacity: 1; transform: none; }

@media (max-width: 700px) {
  .grid--3, .grid--2 { grid-template-columns: 1fr; }
}
@media (min-width: 561px) and (max-width: 900px) {
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
}
