/* =============================================================================
   Prepwise — stylesheet
   Mobile-first. System font for body, Sora for headings. Light + dark aware.
   ============================================================================= */

/* ---------------------------------------------------------------- tokens */
:root {
  --teal-50:  #f0fdfa;
  --teal-100: #ccfbf1;
  --teal-500: #14b8a6;
  --teal-600: #0d9488;
  --teal-700: #0f766e;
  --teal-800: #115e59;
  --indigo-600: #4f46e5;

  --bg:         #ffffff;
  --bg-soft:    #f7faf9;
  --bg-elev:    #ffffff;
  --surface:    #ffffff;
  --border:     #e4ebe9;
  --text:       #10201d;
  --text-soft:  #4b5c58;
  --text-mute:  #6b7a76;
  --primary:    var(--teal-700);
  --primary-ink:#ffffff;
  --primary-soft: var(--teal-50);
  --accent:     var(--indigo-600);
  --ring:       rgba(15, 118, 110, .35);

  --radius:   14px;
  --radius-lg:20px;
  --radius-sm:10px;
  --shadow-sm: 0 1px 2px rgba(16,32,29,.06), 0 1px 3px rgba(16,32,29,.05);
  --shadow-md: 0 6px 20px -8px rgba(16,32,29,.18);
  --shadow-lg: 0 24px 60px -24px rgba(16,32,29,.30);

  --container: 1120px;
  --gap: clamp(1rem, 3vw, 2rem);
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "Noto Sans", sans-serif;
  --font-head: "Sora", var(--font-body);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:        #0b1412;
    --bg-soft:   #0f1a18;
    --bg-elev:   #12201d;
    --surface:   #12201d;
    --border:    #21322e;
    --text:      #eaf3f0;
    --text-soft: #b6c6c1;
    --text-mute: #8ea19c;
    --primary:   var(--teal-500);
    --primary-ink:#04120f;
    --primary-soft: #0f2b26;
    --accent:    #8b8bff;
    --ring:      rgba(20,184,166,.40);
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
    --shadow-md: 0 8px 24px -10px rgba(0,0,0,.6);
    --shadow-lg: 0 28px 60px -24px rgba(0,0,0,.7);
  }
}

/* ---------------------------------------------------------------- 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-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.2; color: var(--text); font-weight: 700; margin: 0 0 .5em; letter-spacing: -.02em; }
h1 { font-size: clamp(2.1rem, 6vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 4vw, 2.3rem); }
h3 { font-size: 1.2rem; }
p  { margin: 0 0 1rem; color: var(--text-soft); }
ul { margin: 0; padding: 0; }

/* ---------------------------------------------------------------- layout */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2rem); }
.section { padding-block: clamp(3rem, 8vw, 5.5rem); }
.section-soft { background: var(--bg-soft); }
.section-head { max-width: 46rem; margin-bottom: clamp(1.5rem, 4vw, 2.5rem); }
.section-head.center { margin-inline: auto; text-align: center; }
.eyebrow { display: inline-flex; align-items: center; gap: .45rem; font-family: var(--font-head); font-weight: 600; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--primary); background: var(--primary-soft); padding: .35rem .7rem; border-radius: 999px; margin-bottom: 1rem; }
.lead { font-size: 1.12rem; color: var(--text-soft); }

.skip-link { position: absolute; left: -999px; top: 0; background: var(--primary); color: var(--primary-ink); padding: .6rem 1rem; border-radius: 0 0 var(--radius-sm) 0; z-index: 200; }
.skip-link:focus { left: 0; }

:where(a, button, input, textarea, [tabindex]):focus-visible {
  outline: 3px solid var(--ring); outline-offset: 2px; border-radius: 6px;
}

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: var(--font-head); font-weight: 600; font-size: 1rem;
  padding: .8rem 1.4rem; border-radius: 999px; border: 1.5px solid transparent;
  cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
  text-decoration: none; line-height: 1.1; white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--primary); color: var(--primary-ink); box-shadow: var(--shadow-md); }
.btn-primary:hover { background: var(--teal-800); }
@media (prefers-color-scheme: dark){ :root:not([data-theme="light"]) .btn-primary:hover { background: var(--teal-600); } }
.btn-outline { background: transparent; color: var(--primary); border-color: var(--border); }
.btn-outline:hover { border-color: var(--primary); background: var(--primary-soft); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { border-color: var(--primary); }
.btn-sm { padding: .5rem 1rem; font-size: .92rem; }
.btn-lg { padding: .95rem 1.7rem; font-size: 1.06rem; }
.btn[aria-disabled="true"], .btn.is-disabled { opacity: .55; cursor: not-allowed; box-shadow: none; pointer-events: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: .8rem; }

.icon { width: 1.5rem; height: 1.5rem; flex: none; }
.icon-sm { width: 1.15rem; height: 1.15rem; }

/* ---------------------------------------------------------------- header */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: .55rem; font-family: var(--font-head); font-weight: 700; color: var(--text); font-size: 1.2rem; }
.brand:hover { text-decoration: none; }
.brand-mark { border-radius: 8px; }
.nav-toggle { display: none; align-items: center; justify-content: center; width: 44px; height: 44px; background: transparent; border: 1px solid var(--border); border-radius: 10px; color: var(--text); cursor: pointer; }
.nav-toggle-close { display: none; }
.site-nav ul { display: flex; align-items: center; gap: .35rem; list-style: none; }
.site-nav a { display: inline-block; padding: .5rem .8rem; border-radius: 999px; color: var(--text-soft); font-weight: 500; }
.site-nav a:hover { color: var(--text); background: var(--bg-soft); text-decoration: none; }
.site-nav a[aria-current="page"] { color: var(--primary); background: var(--primary-soft); }
.nav-cta a { display: inline-flex; color: var(--primary-ink) !important; }
.nav-cta a:hover { color: var(--primary-ink) !important; background: var(--primary); }

@media (max-width: 820px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    position: fixed; inset: 64px 0 auto 0; background: var(--bg-elev);
    border-bottom: 1px solid var(--border); box-shadow: var(--shadow-lg);
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: opacity .18s ease, transform .18s ease, visibility .18s;
  }
  .site-nav ul { flex-direction: column; align-items: stretch; gap: .15rem; padding: 1rem clamp(1rem,4vw,2rem) 1.4rem; }
  .site-nav a { padding: .8rem 1rem; font-size: 1.05rem; }
  .nav-cta { margin-top: .4rem; }
  .nav-cta a { justify-content: center; }
  body.nav-open .site-nav { transform: translateY(0); opacity: 1; visibility: visible; }
  body.nav-open .nav-toggle-open { display: none; }
  body.nav-open .nav-toggle-close { display: block; }
}

/* ---------------------------------------------------------------- hero */
.hero { position: relative; overflow: hidden; padding-block: clamp(3rem, 8vw, 6rem); }
.hero::before {
  content: ""; position: absolute; inset: -20% -10% auto -10%; height: 80%;
  background: radial-gradient(60% 60% at 70% 20%, color-mix(in srgb, var(--teal-500) 22%, transparent), transparent 70%),
              radial-gradient(50% 50% at 15% 10%, color-mix(in srgb, var(--indigo-600) 16%, transparent), transparent 70%);
  z-index: -1; pointer-events: none;
}
.hero-grid { display: grid; gap: clamp(2rem, 5vw, 3.5rem); align-items: center; }
.hero h1 { margin-bottom: .4em; }
.hero .lead { font-size: 1.18rem; max-width: 34rem; }
.hero-cta { margin-top: 1.6rem; }
.hero-meta { margin-top: 1.2rem; color: var(--text-mute); font-size: .95rem; display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; }
.hero-meta span { display: inline-flex; align-items: center; gap: .4rem; }

/* Phone mockup (pure CSS/SVG, lightweight) */
.hero-visual { display: grid; place-items: center; }
.phone {
  width: min(280px, 74vw); aspect-ratio: 9 / 19; background: var(--surface);
  border: 10px solid #0b1412; border-radius: 34px; box-shadow: var(--shadow-lg);
  padding: 14px; position: relative;
}
@media (prefers-color-scheme: dark){ :root:not([data-theme="light"]) .phone { border-color: #05100e; } }
.phone::after { content: ""; position: absolute; top: 16px; left: 50%; transform: translateX(-50%); width: 46%; height: 6px; border-radius: 999px; background: #0b1412; opacity: .5; }
.phone-screen { height: 100%; border-radius: 22px; background: linear-gradient(160deg, var(--teal-700), var(--teal-800)); color: #fff; padding: 1.4rem 1rem; display: flex; flex-direction: column; gap: .7rem; overflow: hidden; }
.phone-screen .ps-title { font-family: var(--font-head); font-weight: 700; font-size: 1.05rem; }
.phone-screen .ps-sub { font-size: .78rem; opacity: .85; margin-bottom: .3rem; }
.ps-card { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.16); border-radius: 12px; padding: .6rem .7rem; font-size: .8rem; display: flex; align-items: center; gap: .5rem; }
.ps-card .icon { width: 1.1rem; height: 1.1rem; }
.ps-bar { height: 8px; border-radius: 999px; background: rgba(255,255,255,.22); overflow: hidden; }
.ps-bar > i { display: block; height: 100%; width: 68%; background: #fff; border-radius: 999px; }

@media (min-width: 860px) {
  .hero-grid { grid-template-columns: 1.05fr .95fr; }
}

/* ---------------------------------------------------------------- cards */
.grid { display: grid; gap: var(--gap); }
.cards { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.4rem; box-shadow: var(--shadow-sm); transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  height: 100%;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); }
.card-icon { display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); margin-bottom: .9rem; }
.card h3 { margin-bottom: .35rem; }
.card p { margin: 0; font-size: .96rem; color: var(--text-soft); }

/* Split feature blocks */
.split { display: grid; gap: clamp(1.5rem, 5vw, 3rem); align-items: center; }
@media (min-width: 800px) { .split { grid-template-columns: 1fr 1fr; } .split.reverse .split-media { order: 2; } }
.split-media { background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: clamp(1.5rem, 4vw, 2.4rem); box-shadow: var(--shadow-sm); }
.pill-list { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; }
.pill-list li { display: inline-flex; align-items: center; gap: .4rem; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: .45rem .85rem; font-size: .9rem; font-weight: 500; color: var(--text-soft); box-shadow: var(--shadow-sm); }
.pill-list .icon { color: var(--primary); }
.check-list { list-style: none; display: grid; gap: .7rem; }
.check-list li { display: flex; gap: .6rem; align-items: flex-start; color: var(--text-soft); }
.check-list .icon { color: var(--primary); margin-top: .15rem; }

/* highlight trio */
.trio { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.trio .card { text-align: left; }

/* ---------------------------------------------------------------- CTA band */
.cta-band { background: linear-gradient(135deg, var(--teal-700), var(--teal-800)); color: #fff; border-radius: var(--radius-lg); padding: clamp(2rem, 5vw, 3rem); text-align: center; box-shadow: var(--shadow-lg); }
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255,255,255,.9); max-width: 40rem; margin-inline: auto; }
.cta-band .btn-primary { background: #fff; color: var(--teal-800); }
.cta-band .btn-primary:hover { background: #eafcf8; }
.cta-band .btn-outline { color: #fff; border-color: rgba(255,255,255,.5); }
.cta-band .btn-outline:hover { background: rgba(255,255,255,.12); border-color: #fff; }

/* ---------------------------------------------------------------- article / legal */
.page-hero { padding-block: clamp(2.4rem, 6vw, 3.6rem); background: var(--bg-soft); border-bottom: 1px solid var(--border); }
.prose { max-width: 46rem; }
.prose h2 { margin-top: 2.2rem; }
.prose h3 { margin-top: 1.6rem; }
.prose ul, .prose ol { padding-left: 1.3rem; margin: 0 0 1rem; }
.prose li { margin-bottom: .4rem; color: var(--text-soft); }
.prose a { text-decoration: underline; }
.toc { background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem 1.4rem; margin-bottom: 2rem; }
.toc h2 { font-size: 1rem; margin: 0 0 .6rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-mute); }
.toc ul { list-style: none; display: grid; gap: .3rem; }
.toc a { text-decoration: none; }

.callout { border-left: 4px solid var(--primary); background: var(--primary-soft); padding: 1rem 1.2rem; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin: 1.2rem 0; }
.callout p { margin: 0; color: var(--text); }
.placeholder { background: #fff7ed; border: 1px dashed #f59e0b; color: #7c2d12; border-radius: var(--radius-sm); padding: 1rem 1.2rem; margin: 1.2rem 0; font-size: .95rem; }
.placeholder strong { color: #92400e; }
@media (prefers-color-scheme: dark){ :root:not([data-theme="light"]) .placeholder { background: #2a1c05; border-color: #b45309; color: #fcd9a1; } :root:not([data-theme="light"]) .placeholder strong { color: #fde3ad; } }
mark.repl { background: color-mix(in srgb, #f59e0b 30%, transparent); color: inherit; padding: 0 .25em; border-radius: 4px; font-style: normal; }

/* ---------------------------------------------------------------- download */
.dl-card { max-width: 40rem; margin-inline: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: clamp(1.5rem, 5vw, 2.5rem); text-align: center; }
.dl-badge { display: inline-flex; align-items: center; gap: .5rem; background: var(--primary-soft); color: var(--primary); font-weight: 600; border-radius: 999px; padding: .4rem .9rem; font-size: .88rem; margin-bottom: 1rem; }
.dl-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem 1.4rem; color: var(--text-mute); font-size: .92rem; margin-top: 1rem; }
.dl-meta span { display: inline-flex; align-items: center; gap: .4rem; }
.store-btns { display: flex; flex-wrap: wrap; gap: .8rem; justify-content: center; margin-top: 1.3rem; }
.coming-soon { position: relative; }
.coming-soon .tag { position: absolute; top: -.6rem; right: -.4rem; background: var(--accent); color: #fff; font-size: .62rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: .15rem .45rem; border-radius: 999px; }
.steps { counter-reset: step; list-style: none; display: grid; gap: 1rem; max-width: 40rem; margin-inline: auto; }
.steps li { position: relative; padding-left: 3rem; color: var(--text-soft); }
.steps li::before { counter-increment: step; content: counter(step); position: absolute; left: 0; top: -.1rem; width: 2rem; height: 2rem; display: grid; place-items: center; background: var(--primary); color: var(--primary-ink); border-radius: 50%; font-family: var(--font-head); font-weight: 700; font-size: .95rem; }

/* ---------------------------------------------------------------- forms */
.form-grid { display: grid; gap: 1.1rem; max-width: 34rem; }
.field { display: grid; gap: .35rem; }
.field label { font-weight: 600; font-size: .95rem; color: var(--text); }
.field input, .field textarea {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: .7rem .85rem;
}
.field input:focus, .field textarea:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px var(--ring); }
.field textarea { min-height: 140px; resize: vertical; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-note { font-size: .88rem; color: var(--text-mute); }
.alert { border-radius: var(--radius-sm); padding: .9rem 1.1rem; margin-bottom: 1.2rem; border: 1px solid; }
.alert-ok { background: var(--teal-50); border-color: var(--teal-500); color: var(--teal-800); }
.alert-err { background: #fef2f2; border-color: #ef4444; color: #991b1b; }
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]) .alert-ok { background: #0f2b26; color: #a7f3d0; }
  :root:not([data-theme="light"]) .alert-err { background: #2a1212; color: #fca5a5; }
}
.contact-methods { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); margin-bottom: 2rem; }

/* ---------------------------------------------------------------- 404 */
.error-wrap { min-height: 60vh; display: grid; place-items: center; text-align: center; padding-block: 4rem; }
.error-code { font-family: var(--font-head); font-weight: 700; font-size: clamp(4rem, 18vw, 8rem); line-height: 1; background: linear-gradient(135deg, var(--teal-600), var(--indigo-600)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------------------------------------------------------------- footer */
.site-footer { background: var(--bg-soft); border-top: 1px solid var(--border); padding-block: clamp(2.5rem, 6vw, 3.5rem) 1.5rem; margin-top: 2rem; }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.footer-brand .footer-tagline { margin-top: .8rem; color: var(--text-mute); max-width: 22rem; font-size: .95rem; }
.footer-col h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-mute); margin-bottom: .8rem; font-family: var(--font-head); }
.footer-col ul { list-style: none; display: grid; gap: .5rem; }
.footer-col a { color: var(--text-soft); }
.footer-col a:hover { color: var(--primary); }
.footer-social { margin-top: .8rem; }
.footer-bottom { margin-top: 2.2rem; padding-top: 1.4rem; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: .3rem 1.5rem; justify-content: space-between; }
.footer-bottom p { margin: 0; font-size: .86rem; color: var(--text-mute); }

/* ---------------------------------------------------------------- utilities */
.center { text-align: center; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.reveal { opacity: 0; transform: translateY(14px); }
.reveal.in { opacity: 1; transform: none; transition: opacity .5s ease, transform .5s ease; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }
