/* ============================================================
   AmarasApps — site.css
   Tokens mirror BRAND.md. Violet-anchored Aurora.
   Studio pages: dark hero -> light body -> dark footer.
   Sparepay pages override with their own navy+gold (--sp-*).
   ============================================================ */

:root {
  /* Studio — dark */
  --bg: #141018;
  --bg-2: #1b1524;
  --surface: #211A2A;
  --text: #F6F2FA;
  --muted: #B4A7C0;
  --link: #C4B5FD;
  --primary: #6D28D9;
  --primary-hover: #7C3AED;
  --accent: #7C3AED;

  /* Spectrum (identity only) */
  --spec-violet: #A78BFA;
  --spec-magenta: #EC4899;
  --spec-coral: #FB7185;
  --spectrum: linear-gradient(90deg, var(--spec-violet), var(--spec-magenta), var(--spec-coral));
  --spectrum-135: linear-gradient(135deg, var(--spec-violet), var(--spec-magenta), var(--spec-coral));

  /* Studio — light body */
  --bg-light: #FAF7FC;
  --card-light: #FFFFFF;
  --ink: #17121C;
  --ink-soft: #3f3648;
  --muted-light: #61566B;
  --line-light: #ece7f1;

  /* Product hues */
  --hue-gold: #F5C542;
  --hue-emerald: #34D399;
  --hue-sky: #38BDF8;
  --hue-amber: #FBBF24;
  --hue-coral: #FB7185;

  /* Sparepay product palette */
  --sp-navy: #133244;
  --sp-navy-2: #0f2836;
  --sp-gold: #F5C542;

  /* Type */
  --rounded: "SF Pro Rounded", ui-rounded, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Spacing / radii */
  --sp-xs:4px; --sp-sm:8px; --sp-md:12px; --sp-lg:16px; --sp-xl:24px; --sp-2xl:48px; --sp-3xl:96px;
  --r-sm:6px; --r-md:12px; --r-lg:18px; --r-xl:26px;
  --maxw: 1080px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--sans); line-height: 1.6; font-size: 17px;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
h1,h2,h3,h4 { font-family: var(--rounded); font-weight: 800; letter-spacing: -.02em; line-height: 1.08; margin: 0; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* ---- Scroll progress bar ---- */
.progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: var(--spectrum); z-index: 100; transition: width .1s linear;
}

/* ---- Nav ---- */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: var(--sp-md);
  padding: 14px clamp(18px, 5vw, 56px);
  transition: background .3s ease, backdrop-filter .3s ease, border-color .3s ease;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(20,16,24,.72); backdrop-filter: saturate(160%) blur(14px);
  border-bottom-color: rgba(255,255,255,.08);
}
.nav .brand { display: flex; align-items: center; gap: 10px; font-family: var(--rounded); font-weight: 800; font-size: 18px; }
.nav .brand img { width: 30px; height: 30px; border-radius: 8px; }
.nav .brand .b { color: var(--link); }
.nav .spacer { flex: 1; }
.nav .navlinks { display: flex; gap: var(--sp-lg); }
.nav .navlinks a { color: var(--muted); font-size: 14px; font-weight: 600; }
.nav .navlinks a:hover { color: var(--text); text-decoration: none; }
@media (max-width: 620px){ .nav .navlinks { display:none; } }

/* ---- Layout ---- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding-left: clamp(18px,5vw,56px); padding-right: clamp(18px,5vw,56px); }
section { position: relative; }
.section-dark { background: var(--bg); color: var(--text); }
.section-light { background: var(--bg-light); color: var(--ink); }
.section-pad { padding: var(--sp-3xl) 0; }
@media (max-width:620px){ .section-pad{ padding: 56px 0; } }

/* ---- Hero ---- */
.hero {
  position: relative; overflow: hidden;
  padding: clamp(90px,16vh,180px) 0 clamp(70px,12vh,140px);
  background:
    radial-gradient(900px 460px at 12% -10%, rgba(167,139,250,.30), transparent 60%),
    radial-gradient(760px 520px at 116% 18%, rgba(236,72,153,.24), transparent 55%),
    radial-gradient(620px 420px at 55% 128%, rgba(251,113,133,.18), transparent 55%),
    linear-gradient(160deg, var(--bg) 0%, #221a2c 55%, var(--bg) 100%);
}
.hero .glow {
  position: absolute; border-radius: 50%; filter: blur(60px); opacity: .5; pointer-events: none; z-index: 0;
}
.hero .glow.g1 { width: 420px; height: 420px; background: radial-gradient(circle, rgba(124,58,237,.5), transparent 65%); top: -80px; left: -60px; }
.hero .glow.g2 { width: 360px; height: 360px; background: radial-gradient(circle, rgba(236,72,153,.4), transparent 65%); top: 40px; right: -80px; }
.hero .wrap { position: relative; z-index: 1; }
.hero h1 { font-size: clamp(38px, 7vw, 76px); max-width: 16ch; }
.hero h1 .spectrum-text {
  background: var(--spectrum); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .tagline { color: var(--muted); font-size: clamp(16px,2.4vw,22px); margin-top: var(--sp-lg); max-width: 46ch; }
.hero .cta-row { margin-top: var(--sp-xl); display: flex; gap: var(--sp-md); flex-wrap: wrap; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: var(--r-md);
  font-family: var(--rounded); font-weight: 700; font-size: 15px;
  cursor: pointer; border: 1px solid transparent; transition: transform .15s ease, box-shadow .15s ease, background .2s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); box-shadow: 0 8px 24px rgba(109,40,217,.4); }
.btn-ghost { background: transparent; color: var(--link); border-color: rgba(196,181,253,.4); }
.btn-ghost:hover { border-color: var(--link); background: rgba(196,181,253,.08); }
.btn-ghost-light { background: transparent; color: var(--primary); border-color: rgba(109,40,217,.3); }
.btn-ghost-light:hover { background: rgba(109,40,217,.06); }

/* ---- Section headers ---- */
.eyebrow { font-family: var(--rounded); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); }
.section-light .eyebrow { color: var(--muted-light); }
.section-title { font-size: clamp(26px,4vw,40px); margin: 8px 0 10px; }
.section-intro { font-size: 17px; max-width: 60ch; }
.section-dark .section-intro { color: var(--muted); }
.section-light .section-intro { color: var(--muted-light); }

/* ---- Product cards ---- */
.cards { display: grid; grid-template-columns: repeat(3,1fr); gap: var(--sp-lg); margin-top: var(--sp-2xl); }
@media (max-width:820px){ .cards{ grid-template-columns:1fr; } }
.pcard {
  background: var(--card-light); border: 1px solid var(--line-light);
  border-top: 3px solid var(--card-accent, var(--primary));
  border-radius: var(--r-lg); padding: var(--sp-xl);
  transition: transform .2s ease, box-shadow .2s ease;
}
.pcard:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(23,18,28,.12), 0 0 0 1px var(--card-accent, var(--primary)); }
.pcard.soon { opacity: .78; }
.pcard .pc-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.pcard .pc-head img { width: 40px; height: 40px; border-radius: 10px; }
.pcard .pc-icon-ph { width: 40px; height: 40px; border-radius: 10px; background: #eef2f6; display: grid; place-items: center; color: #94a3b8; font-weight: 800; font-family: var(--rounded); }
.pcard h3 { font-size: 19px; color: var(--ink); }
.pcard.soon h3 { color: #94a3b8; }
.pcard p { color: var(--muted-light); font-size: 14.5px; margin: 0 0 var(--sp-md); }
.pcard .learn { font-family: var(--rounded); font-weight: 700; font-size: 14px; color: var(--primary); }

/* ---- Ethos / stat band ---- */
.stats { display: grid; grid-template-columns: repeat(3,1fr); gap: var(--sp-lg); margin-top: var(--sp-xl); }
@media (max-width:620px){ .stats{ grid-template-columns:1fr; } }
.stat { border-radius: var(--r-lg); padding: var(--sp-xl); background: var(--surface); border: 1px solid rgba(255,255,255,.06); }
.stat .num { font-family: var(--rounded); font-weight: 800; font-size: 34px; background: var(--spectrum); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat .lbl { color: var(--muted); font-size: 14px; margin-top: 4px; }

/* ---- Footer ---- */
.footer { background: var(--bg); color: var(--muted); padding: var(--sp-2xl) 0 var(--sp-xl); border-top: 1px solid rgba(255,255,255,.06); }
.footer .frow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.footer .brand { display: flex; align-items: center; gap: 10px; font-family: var(--rounded); font-weight: 800; color: var(--text); font-size: 17px; }
.footer .brand img { width: 26px; height: 26px; border-radius: 7px; }
.footer .brand .b { color: var(--link); }
.footer .spacer { flex: 1; }
.footer a { color: var(--muted); }
.footer .disclaimer { font-size: 12px; color: #8f86a0; margin-top: var(--sp-lg); max-width: 70ch; line-height: 1.5; }

/* ---- Endorsement lockup ---- */
.endorse { display: inline-flex; align-items: center; gap: 8px; font-family: var(--rounded); }
.endorse .by { font-size: 12px; color: var(--muted); }
.endorse img { width: 20px; height: 20px; border-radius: 5px; }

/* ============================================================
   Reveal animation base (JS toggles .in). Static if reduced-motion.
   ============================================================ */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; } .reveal.d2 { transition-delay: .16s; } .reveal.d3 { transition-delay: .24s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .hero .glow { display: none; }
  .btn:hover, .pcard:hover { transform: none; }
  .progress { display: none; }
}

/* ============================================================
   Sparepay product theme (its OWN navy + gold, not Aurora)
   Applied by adding class="sparepay" on <body>.
   ============================================================ */
body.sparepay { background: var(--sp-navy); }
body.sparepay .hero {
  background:
    radial-gradient(760px 420px at 15% -10%, rgba(245,197,66,.14), transparent 60%),
    linear-gradient(160deg, var(--sp-navy), var(--sp-navy-2));
}
body.sparepay .hero h1 .accent-text { color: var(--sp-gold); }
body.sparepay .hero .glow.g1 { background: radial-gradient(circle, rgba(245,197,66,.25), transparent 65%); }
body.sparepay .hero .glow.g2 { background: radial-gradient(circle, rgba(245,197,66,.12), transparent 65%); }
body.sparepay .nav.scrolled { background: rgba(19,50,68,.75); }
body.sparepay .btn-primary { background: var(--sp-gold); color: #10222e; }   /* dark ink on gold = AAA */
body.sparepay .btn-primary:hover { background: #ffda6b; box-shadow: 0 8px 24px rgba(245,197,66,.35); }
body.sparepay .btn-ghost { color: var(--sp-gold); border-color: rgba(245,197,66,.4); }
body.sparepay .footer, body.sparepay .section-dark { background: var(--sp-navy); }
body.sparepay .footer .brand .b, body.sparepay .nav .brand .b { color: var(--sp-gold); }

/* FAQ (Sparepay support) */
.faq { margin-top: var(--sp-xl); }
.faq details { border-bottom: 1px solid rgba(255,255,255,.1); padding: var(--sp-md) 0; }
.faq summary { font-family: var(--rounded); font-weight: 700; font-size: 16px; cursor: pointer; list-style: none; color: var(--text); display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--sp-gold); font-weight: 800; transition: transform .2s ease; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq p { color: var(--muted); font-size: 15px; margin: 10px 0 2px; }

/* Long-form legal (privacy) — light body for readability */
.legal { background: var(--bg-light); color: var(--ink); }
.legal .wrap { max-width: 760px; padding-top: var(--sp-2xl); padding-bottom: var(--sp-3xl); }
.legal h1 { font-size: clamp(28px,5vw,40px); }
.legal h2 { font-size: 20px; margin: var(--sp-xl) 0 var(--sp-sm); color: var(--ink); }
.legal p, .legal li { color: var(--ink-soft); font-size: 15.5px; }
.legal a { color: var(--primary); }
.legal .meta { color: var(--muted-light); font-size: 13px; }
.legal table { border-collapse: collapse; width: 100%; margin: var(--sp-md) 0; font-size: 14px; }
.legal th, .legal td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line-light); }
.legal th { background: #f3eef8; }
