/* ============================================================================
   Warden — shared stylesheet (landing, privacy, terms)
   ----------------------------------------------------------------------------
   • No external assets: premium system-font stack, all icons are inline SVG.
   • Dark theme by default; light theme via [data-theme="light"].
   • "Warden" is a brand name — rename in the HTML + app.js BRAND const.
   Product: an on-device VPN firewall / tunnel that filters network traffic
   locally (no remote servers, no logs).
   ============================================================================ */

/* =========================================================================
   1. DESIGN TOKENS
   ========================================================================= */
:root {
  color-scheme: dark;

  /* Brand accents — an emerald→sky→cyan "shielded / secure" gradient. */
  --brand-1: #10b981;   /* emerald */
  --brand-2: #0ea5e9;   /* sky     */
  --brand-3: #22d3ee;   /* cyan    */
  --safe:    #34d399;   /* "protected / active" status green */
  --brand-grad: linear-gradient(135deg, #10b981 0%, #0ea5e9 58%, #22d3ee 100%);
  --brand-grad-soft: linear-gradient(135deg, rgba(16,185,129,.16), rgba(14,165,233,.16));

  /* Dark surfaces & text */
  --bg: #070b12;
  --bg-grid: rgba(255,255,255,.025);
  --surface: #0f1723;
  --surface-2: #151f2f;
  --surface-3: #1b273b;
  --border: rgba(255,255,255,.09);
  --border-strong: rgba(255,255,255,.16);
  --text: #eaf1f6;
  --text-muted: #9db0c2;
  --text-faint: #6a7d92;

  /* Effects */
  --ring: rgba(16,185,129,.5);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.45);
  --shadow-md: 0 14px 34px -14px rgba(0,0,0,.65);
  --shadow-lg: 0 40px 80px -28px rgba(0,0,0,.8);
  --glow: 0 24px 60px -22px rgba(16,185,129,.6);

  /* Type */
  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
               "Liberation Mono", monospace;

  /* Shape & spacing */
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;
  --maxw: 1160px;
  --gutter: clamp(1.15rem, 4vw, 2.5rem);

  /* Motion */
  --ease: cubic-bezier(.22,.61,.36,1);
  --ease-out: cubic-bezier(.16,1,.3,1);
  --dur: .28s;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f7fa;
  --bg-grid: rgba(15,30,45,.03);
  --surface: #ffffff;
  --surface-2: #eef3f8;
  --surface-3: #e5edf4;
  --border: rgba(15,30,45,.10);
  --border-strong: rgba(15,30,45,.17);
  --text: #0b1622;
  --text-muted: #43596c;
  --text-faint: #74889a;
  --ring: rgba(16,185,129,.35);
  --shadow-sm: 0 1px 2px rgba(20,40,60,.08);
  --shadow-md: 0 14px 34px -16px rgba(20,45,70,.26);
  --shadow-lg: 0 40px 80px -30px rgba(20,45,70,.3);
  --glow: 0 24px 60px -24px rgba(16,185,129,.38);
}

/* =========================================================================
   2. RESET & BASE
   ========================================================================= */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
[id] { scroll-margin-top: 96px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

/* Ambient dotted grid + brand glow (pure CSS, no images). */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -2;
  background-image: radial-gradient(var(--bg-grid) 1px, transparent 1px);
  background-size: 26px 26px;
  pointer-events: none;
}
body::after {
  content: "";
  position: fixed; top: -18%; left: 50%;
  width: min(1200px, 120vw); height: 720px;
  transform: translateX(-50%); z-index: -2;
  background:
    radial-gradient(45% 55% at 28% 30%, rgba(16,185,129,.22), transparent 70%),
    radial-gradient(40% 50% at 76% 18%, rgba(14,165,233,.16), transparent 70%);
  filter: blur(8px);
  pointer-events: none;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: none; }
input, textarea, select { font: inherit; color: inherit; }
ul { list-style: none; padding: 0; }

:focus-visible { outline: 2px solid var(--brand-1); outline-offset: 2px; border-radius: 6px; }

.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;
}

/* =========================================================================
   3. LAYOUT HELPERS
   ========================================================================= */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
section { padding-block: clamp(4rem, 9vw, 7.5rem); }

.eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-muted); padding: .4rem .8rem;
  border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--surface);
}
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--safe); box-shadow: 0 0 0 4px rgba(52,211,153,.18); }

.section-head { max-width: 640px; margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head h2 { font-size: clamp(1.9rem, 4.2vw, 2.9rem); line-height: 1.1; letter-spacing: -.02em; margin-top: 1rem; }
.section-head p { margin-top: 1rem; color: var(--text-muted); font-size: 1.075rem; }

.gradient-text { background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* =========================================================================
   4. BUTTONS
   ========================================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  padding: .8rem 1.35rem; border-radius: var(--radius-pill);
  font-weight: 600; font-size: .95rem; line-height: 1;
  border: 1px solid transparent; white-space: nowrap;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
              background var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.btn svg { width: 18px; height: 18px; }
.btn:active { transform: translateY(1px) scale(.99); }

.btn-primary { background: var(--brand-grad); color: #04120c; box-shadow: var(--glow); font-weight: 700; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 30px 70px -20px rgba(16,185,129,.75); }

.btn-ghost { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn-ghost:hover { transform: translateY(-2px); border-color: var(--brand-1); background: var(--surface-2); }

.btn-outline { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn-outline:hover { border-color: var(--brand-1); background: var(--surface); }

.btn-lg { padding: 1rem 1.7rem; font-size: 1.02rem; }
.btn-block { width: 100%; }

/* Google Play style button (the app is Android). */
.btn-store {
  display: inline-flex; align-items: center; gap: .7rem;
  padding: .7rem 1.4rem; border-radius: var(--radius);
  background: var(--brand-grad); color: #04120c; box-shadow: var(--glow);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.btn-store:hover { transform: translateY(-2px); box-shadow: 0 30px 70px -20px rgba(16,185,129,.75); }
.btn-store svg { width: 26px; height: 26px; }
.btn-store .store-copy { display: flex; flex-direction: column; line-height: 1.05; text-align: left; }
.btn-store .store-copy small { font-size: .68rem; font-weight: 600; opacity: .8; }
.btn-store .store-copy strong { font-size: 1.05rem; font-weight: 800; letter-spacing: -.01em; }

/* =========================================================================
   5. HEADER / NAVBAR
   ========================================================================= */
.site-header { position: sticky; top: 0; z-index: 50; border-bottom: 1px solid transparent;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), backdrop-filter var(--dur) var(--ease); }
.site-header.scrolled { background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: saturate(140%) blur(14px); border-bottom-color: var(--border); }
.nav { display: flex; align-items: center; gap: 1.5rem; height: 72px; }

.brand { display: inline-flex; align-items: center; gap: .65rem; font-weight: 700; font-size: 1.12rem; letter-spacing: -.01em; }
/* Brand mark = the real app icon (square master PNG, rounded by CSS so the
   same asset serves the launcher, Play Store, and the site). */
.brand .logo { width: 34px; height: 34px; flex: none; display: block; border-radius: 10px; object-fit: cover; box-shadow: 0 10px 26px -10px rgba(16, 185, 129, .5); }

.nav-links { display: flex; align-items: center; gap: .35rem; margin-left: auto; }
.nav-links a { position: relative; padding: .5rem .8rem; border-radius: 8px; color: var(--text-muted); font-weight: 500; font-size: .95rem; transition: color var(--dur) var(--ease); }
.nav-links a::after { content: ""; position: absolute; left: .8rem; right: .8rem; bottom: .28rem; height: 2px; background: var(--brand-grad); transform: scaleX(0); transform-origin: left; transition: transform var(--dur) var(--ease); border-radius: 2px; }
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { transform: scaleX(1); }

.nav-actions { display: flex; align-items: center; gap: .6rem; }

.icon-btn { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 11px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease), background var(--dur) var(--ease); }
.icon-btn:hover { border-color: var(--brand-1); transform: translateY(-1px); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn .i-sun { display: none; }
[data-theme="light"] .icon-btn .i-sun { display: block; }
[data-theme="light"] .icon-btn .i-moon { display: none; }

.hamburger { display: none; }

/* =========================================================================
   6. HERO + APP MOCKUP
   ========================================================================= */
.hero { padding-top: clamp(3rem, 7vw, 5.5rem); }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.hero h1 { font-size: clamp(2.4rem, 6vw, 4.05rem); line-height: 1.04; letter-spacing: -.03em; margin-top: 1.25rem; }
.hero p.lead { margin-top: 1.35rem; font-size: clamp(1.05rem, 2.2vw, 1.2rem); color: var(--text-muted); max-width: 38ch; }
.hero-cta { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; }
.hero-trust { margin-top: 2.25rem; display: flex; flex-wrap: wrap; align-items: center; gap: 1.4rem; color: var(--text-faint); font-size: .88rem; }
.hero-trust .stat strong { display: block; font-size: 1.35rem; color: var(--text); letter-spacing: -.01em; }
.hero-trust .divider { width: 1px; height: 34px; background: var(--border); }

/* --- Phone dashboard mockup (pure CSS/SVG) --- */
.app-visual { position: relative; display: flex; justify-content: center; }
.phone {
  position: relative; width: 300px; max-width: 100%;
  border-radius: 38px; padding: 12px;
  background: linear-gradient(160deg, #1c2740, #0d1421);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  animation: floaty 7s ease-in-out infinite;
}
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
.phone-screen { position: relative; border-radius: 28px; overflow: hidden; background: var(--surface);
  background-image: radial-gradient(70% 40% at 50% 0%, rgba(16,185,129,.14), transparent 60%); }
.phone-notch { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); width: 96px; height: 18px; border-radius: 12px; background: #0b1220; z-index: 3; }

.app-statusbar { display: flex; align-items: center; justify-content: space-between; padding: .7rem 1.1rem .3rem; font-size: .72rem; color: var(--text-muted); }
.app-statusbar .vpn-key { display: inline-flex; align-items: center; gap: .3rem; color: var(--safe); font-weight: 700; }
.app-statusbar .vpn-key svg { width: 12px; height: 12px; }
.app-statusbar .sysicons { display: inline-flex; gap: .35rem; }
.app-statusbar .sysicons svg { width: 13px; height: 13px; }

.app-screen { padding: .6rem 1rem 1.2rem; }

/* Protection card */
.shield-card { text-align: center; padding: 1.2rem .5rem .4rem; }
.shield-ring { width: 92px; height: 92px; margin: 0 auto .8rem; display: grid; place-items: center; border-radius: 50%;
  background: radial-gradient(circle, rgba(52,211,153,.18), transparent 70%);
  border: 2px solid rgba(52,211,153,.45); color: var(--safe);
  box-shadow: 0 0 0 8px rgba(52,211,153,.06), 0 0 40px rgba(52,211,153,.35);
  animation: pulse-ring 3.4s ease-in-out infinite; }
@keyframes pulse-ring { 0%,100% { box-shadow: 0 0 0 8px rgba(52,211,153,.06), 0 0 30px rgba(52,211,153,.28); } 50% { box-shadow: 0 0 0 12px rgba(52,211,153,.09), 0 0 48px rgba(52,211,153,.45); } }
.shield-ring svg { width: 44px; height: 44px; }
.shield-card h3 { font-size: 1.15rem; letter-spacing: -.01em; }
.shield-card p { font-size: .8rem; color: var(--text-muted); margin-top: .2rem; }
.toggle-on { margin: .9rem auto 0; width: 58px; height: 32px; border-radius: 999px; background: linear-gradient(135deg, var(--brand-1), var(--brand-2)); position: relative; box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); }
.toggle-on::after { content: ""; position: absolute; top: 3px; right: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); }

/* Stat row */
.mock-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin: 1rem 0; }
.mock-stats .s { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: .6rem .4rem; text-align: center; }
.mock-stats .s strong { display: block; font-size: 1.05rem; letter-spacing: -.02em; }
.mock-stats .s span { font-size: .62rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: .04em; }
.mock-stats .s.block strong { color: #f87171; }
.mock-stats .s.safe strong { color: var(--safe); }

/* App list */
.mock-list { display: flex; flex-direction: column; gap: .45rem; }
.mock-list .row { display: flex; align-items: center; gap: .6rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: .5rem .6rem; }
.mock-list .ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; font-size: .78rem; color: #fff; flex: none; }
.mock-list .meta { flex: 1; min-width: 0; }
.mock-list .meta b { font-size: .8rem; font-weight: 650; }
.mock-list .meta small { display: block; font-size: .66rem; color: var(--text-faint); }
.mock-pill { font-size: .64rem; font-weight: 700; padding: .25rem .55rem; border-radius: 999px; }
.mock-pill.allow { color: var(--safe); background: rgba(52,211,153,.14); }
.mock-pill.block { color: #f87171; background: rgba(248,113,113,.14); }

/* Floating chips around the phone */
.floating-chip { position: absolute; display: inline-flex; align-items: center; gap: .5rem; padding: .55rem .85rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-pill); box-shadow: var(--shadow-md); font-size: .82rem; font-weight: 600; white-space: nowrap; }
.floating-chip svg { width: 16px; height: 16px; }
.chip-nolog { top: 12%; left: -8%; animation: floaty 6s ease-in-out infinite; }
.chip-nolog svg { color: var(--safe); }
.chip-kill { bottom: 14%; right: -10%; animation: floaty 5.2s ease-in-out .6s infinite; }
.chip-kill svg { color: #fbbf24; }

/* =========================================================================
   7. FEATURES
   ========================================================================= */
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
.feature-card { padding: 1.6rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); position: relative; overflow: hidden;
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.feature-card::before { content: ""; position: absolute; inset: 0; background: var(--brand-grad-soft); opacity: 0; transition: opacity var(--dur) var(--ease); }
.feature-card:hover { transform: translateY(-5px); border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.feature-card:hover::before { opacity: 1; }
.feature-card > * { position: relative; }
.feature-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 13px; background: var(--brand-grad-soft); border: 1px solid var(--border); color: var(--brand-1); margin-bottom: 1.1rem; }
[data-theme="light"] .feature-icon { color: #0891b2; }
.feature-icon svg { width: 24px; height: 24px; }
.feature-card h3 { font-size: 1.15rem; letter-spacing: -.01em; }
.feature-card p { margin-top: .5rem; color: var(--text-muted); font-size: .96rem; }

/* =========================================================================
   8. CONTACT ("Get in touch") — modal triggers
   ========================================================================= */
#contact { background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--surface) 60%, transparent)); }
.contact-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
.contact-card { text-align: left; padding: 1.7rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; gap: .6rem; align-items: flex-start;
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.contact-card:hover { transform: translateY(-5px); border-color: var(--brand-1); box-shadow: var(--shadow-md); }
.contact-card .feature-icon { margin-bottom: .4rem; }
.contact-card h3 { font-size: 1.15rem; }
.contact-card p { color: var(--text-muted); font-size: .94rem; flex: 1; }
.contact-card .go { display: inline-flex; align-items: center; gap: .4rem; color: var(--brand-1); font-weight: 600; font-size: .92rem; margin-top: .4rem; }
[data-theme="light"] .contact-card .go { color: #0891b2; }
.contact-card .go svg { width: 16px; height: 16px; transition: transform var(--dur) var(--ease); }
.contact-card:hover .go svg { transform: translateX(4px); }

/* =========================================================================
   9. DONATION
   ========================================================================= */
.donate-card { text-align: center; max-width: 820px; margin-inline: auto; padding: clamp(2.2rem, 5vw, 3.5rem); border-radius: var(--radius-lg); border: 1px solid var(--border);
  background: radial-gradient(120% 120% at 50% 0%, rgba(16,185,129,.14), transparent 60%), var(--surface); box-shadow: var(--shadow-md); }
.donate-card h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: -.02em; }
.donate-card p.sub { margin: 1.1rem auto 0; max-width: 62ch; color: var(--text-muted); font-size: 1.05rem; }
.donate-heart { width: 64px; height: 64px; margin: 0 auto 1.4rem; display: grid; place-items: center; border-radius: 50%; background: var(--brand-grad-soft); border: 1px solid var(--border); }
.donate-heart svg { width: 30px; height: 30px; color: #f472b6; }
.donate-row { margin-top: 2.2rem; display: flex; flex-wrap: wrap; justify-content: center; gap: .9rem; }
.donate-btn { display: inline-flex; align-items: center; gap: .6rem; padding: .85rem 1.3rem; border-radius: var(--radius-pill); font-weight: 700; font-size: .95rem; border: 1px solid rgba(0,0,0,.06); box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), filter var(--dur) var(--ease); }
.donate-btn:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); filter: brightness(1.03); }
.donate-btn svg { width: 20px; height: 20px; flex: none; }
.bmc  { background: #ffdd00; color: #0d0c22; }
.kofi { background: #ff5e5b; color: #ffffff; }
.paypal { background: #ffffff; color: #003087; border-color: #d9def0; }
.paypal .pp-a { color: #002d82; } .paypal .pp-b { color: #009cde; font-weight: 800; }
.ghs  { background: #1b1f2a; color: #ffffff; border-color: rgba(255,255,255,.12); }
.ghs .heart { color: #db61a2; }
.donate-note { margin-top: 1.6rem; font-size: .84rem; color: var(--text-faint); }

/* =========================================================================
   10. FOOTER
   ========================================================================= */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding-block: clamp(3rem, 6vw, 4.5rem) 2rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 2.5rem; }
.footer-brand p { color: var(--text-muted); margin-top: .9rem; max-width: 34ch; font-size: .95rem; }
.footer-col h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-faint); margin-bottom: 1rem; }
.footer-col ul { display: flex; flex-direction: column; gap: .7rem; }
.footer-col a, .footer-col button { color: var(--text-muted); font-size: .95rem; text-align: left; display: inline-flex; align-items: center; gap: .5rem; transition: color var(--dur) var(--ease); }
.footer-col a:hover, .footer-col button:hover { color: var(--text); }
.footer-col button svg { width: 15px; height: 15px; color: var(--text-faint); }
.footer-bottom { margin-top: 3rem; padding-top: 1.6rem; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; color: var(--text-faint); font-size: .88rem; }
.footer-bottom .mini-links { display: flex; gap: 1.2rem; }
.footer-bottom .mini-links a:hover { color: var(--text); }

/* =========================================================================
   11. MODAL + FORM  (markup is injected by app.js on every page)
   ========================================================================= */
.modal-root { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 1.15rem; }
.modal-root[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(3,6,11,.64); backdrop-filter: blur(6px); opacity: 0; transition: opacity var(--dur) var(--ease); }
.modal-dialog { position: relative; width: 100%; max-width: 540px; max-height: calc(100dvh - 2.3rem); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  padding: clamp(1.5rem, 4vw, 2.25rem); opacity: 0; transform: translateY(16px) scale(.97);
  transition: opacity var(--dur) var(--ease-out), transform var(--dur) var(--ease-out); }
.modal-root.is-open .modal-backdrop { opacity: 1; }
.modal-root.is-open .modal-dialog { opacity: 1; transform: translateY(0) scale(1); }

.modal-close { position: absolute; top: 1rem; right: 1rem; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; color: var(--text-muted); border: 1px solid transparent; transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
.modal-close:hover { background: var(--surface-2); color: var(--text); }
.modal-close svg { width: 20px; height: 20px; }

.modal-head { display: flex; flex-direction: column; gap: .7rem; margin-bottom: 1.5rem; padding-right: 2.5rem; }
.modal-badge { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 14px; background: var(--brand-grad-soft); border: 1px solid var(--border); color: var(--brand-1); }
[data-theme="light"] .modal-badge { color: #0891b2; }
.modal-badge svg { width: 26px; height: 26px; }
.modal-title { font-size: 1.5rem; letter-spacing: -.01em; }
.modal-desc { color: var(--text-muted); font-size: .98rem; }

.field { margin-bottom: 1.05rem; }
.field label { display: block; font-size: .88rem; font-weight: 600; margin-bottom: .4rem; }
.field label .req { color: #f472b6; margin-left: .15rem; }
.field .control { width: 100%; padding: .75rem .9rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); font-size: .96rem;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease); }
.field .control::placeholder { color: var(--text-faint); }
.field .control:focus { outline: none; border-color: var(--brand-1); box-shadow: 0 0 0 4px var(--ring); background: var(--surface); }
textarea.control { resize: vertical; min-height: 110px; line-height: 1.5; }
.field.invalid .control { border-color: #f87171; }
.field.invalid .control:focus { box-shadow: 0 0 0 4px rgba(248,113,113,.25); }
.field-error { display: none; color: #f87171; font-size: .8rem; margin-top: .35rem; }
.field.invalid .field-error { display: block; }

.modal-foot { display: flex; gap: .7rem; margin-top: 1.5rem; }
.modal-foot .btn { flex: 1; }
.form-note { margin-top: 1rem; font-size: .8rem; color: var(--text-faint); text-align: center; }

.modal-success { text-align: center; padding: 1.5rem 0 .5rem; }
.modal-success[hidden] { display: none; }
.success-icon { width: 68px; height: 68px; margin: 0 auto 1.2rem; display: grid; place-items: center; border-radius: 50%; background: rgba(52,211,153,.14); color: var(--safe); animation: pop .4s var(--ease-out); }
@keyframes pop { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: scale(1); } }
.success-icon svg { width: 34px; height: 34px; }
.modal-success h3 { font-size: 1.35rem; }
.modal-success p { color: var(--text-muted); margin-top: .5rem; }

/* =========================================================================
   12. LEGAL PAGES (privacy.html / terms.html)
   ========================================================================= */
.legal-hero { padding-top: clamp(3rem, 7vw, 5rem); padding-bottom: 0; }
.legal-hero h1 { font-size: clamp(2.1rem, 5vw, 3.2rem); letter-spacing: -.02em; margin-top: 1rem; }
.legal-hero .updated { margin-top: .9rem; color: var(--text-faint); font-size: .92rem; }

.callout { display: flex; gap: .8rem; align-items: flex-start; margin-top: 1.6rem; padding: 1rem 1.15rem; border-radius: var(--radius); border: 1px solid var(--border); background: var(--brand-grad-soft); font-size: .92rem; color: var(--text-muted); }
.callout svg { width: 20px; height: 20px; color: var(--brand-1); flex: none; margin-top: .1rem; }
.callout strong { color: var(--text); }

.legal-layout { display: grid; grid-template-columns: 240px 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; padding-top: clamp(2.5rem, 5vw, 3.5rem); }
.toc { position: sticky; top: 96px; font-size: .92rem; }
.toc h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-faint); margin-bottom: .9rem; }
.toc ul { display: flex; flex-direction: column; gap: .1rem; }
.toc a { display: block; padding: .4rem .65rem; border-radius: 8px; color: var(--text-muted); border-left: 2px solid transparent; transition: color var(--dur) var(--ease), background var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.toc a:hover { color: var(--text); background: var(--surface); }
.toc a.active { color: var(--text); border-left-color: var(--brand-1); background: var(--surface); }

.legal-content { max-width: 72ch; }
.legal-content section { padding-block: 0; margin-bottom: 2.4rem; }
.legal-content h2 { font-size: 1.4rem; letter-spacing: -.01em; margin-bottom: .8rem; scroll-margin-top: 96px; }
.legal-content h3 { font-size: 1.05rem; margin: 1.3rem 0 .5rem; }
.legal-content p { color: var(--text-muted); margin-bottom: .9rem; }
.legal-content ul.bullets { display: flex; flex-direction: column; gap: .55rem; margin: 0 0 1rem; padding-left: 1.1rem; }
.legal-content ul.bullets li { color: var(--text-muted); position: relative; }
.legal-content ul.bullets li::before { content: ""; position: absolute; left: -1.1rem; top: .62em; width: 6px; height: 6px; border-radius: 50%; background: var(--brand-1); }
.legal-content strong { color: var(--text); }
.legal-content a.inline { color: var(--brand-1); text-decoration: underline; text-underline-offset: 2px; }
[data-theme="light"] .legal-content a.inline { color: #0891b2; }
.legal-content .ph { color: var(--brand-3); background: rgba(34,211,238,.1); padding: 0 .35em; border-radius: 5px; font-family: var(--font-mono); font-size: .88em; }

.back-top { display: inline-flex; align-items: center; gap: .4rem; margin-top: 1rem; color: var(--text-muted); font-size: .88rem; }
.back-top:hover { color: var(--text); }
.back-top svg { width: 15px; height: 15px; }

/* =========================================================================
   13. SCROLL-REVEAL
   Hidden state applies ONLY when JS is active (html.js). Without JS — or if the
   observer never fires — content stays fully visible. app.js also has a failsafe.
   ========================================================================= */
.js [data-reveal] { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); transition-delay: var(--reveal-delay, 0s); }
.js [data-reveal].in-view { opacity: 1; transform: none; }

/* =========================================================================
   14. RESPONSIVE
   ========================================================================= */
@media (max-width: 940px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero p.lead { max-width: 50ch; }
  .app-visual { margin-top: 1rem; }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .legal-layout { grid-template-columns: 1fr; }
  .toc { position: static; border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.2rem; background: var(--surface); }
}
@media (max-width: 720px) {
  .nav-links {
    position: absolute; top: 72px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: .2rem;
    padding: 1rem var(--gutter) 1.4rem; margin-left: 0;
    background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    transform: translateY(-12px); opacity: 0; pointer-events: none;
    transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
  }
  .nav-links.open { opacity: 1; transform: none; pointer-events: auto; }
  .nav-links a { padding: .8rem; border-radius: 10px; }
  .nav-links a::after { display: none; }
  .nav-links a:hover { background: var(--surface); }
  .nav .cta-desktop { display: none; }
  .hamburger { display: grid; }
}
@media (max-width: 560px) {
  .features-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .modal-foot { flex-direction: column-reverse; }
  .hero-trust .divider { display: none; }
}

/* =========================================================================
   15. REDUCED MOTION + PRINT
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .js [data-reveal] { opacity: 1 !important; transform: none !important; }
}

@media print {
  .site-header, .site-footer, .toc, .callout, .back-top { display: none !important; }
  body::before, body::after { display: none !important; }
  body { background: #fff; color: #000; }
  .legal-layout { display: block; }
  .legal-content { max-width: none; }
  a { color: #000; }
}
