/* GrammarPatch website — brand tokens from src/theme/tokens.ts + docs/DESIGN_GUIDE.md */

/* Self-hosted Nunito (latin subset, weights 700/800/900). Served locally so no
   visitor IP is sent to Google fonts CDNs before consent (GDPR / LG München). */
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/nunito-latin-700.woff2") format("woff2");
}
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/assets/fonts/nunito-latin-800.woff2") format("woff2");
}
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url("/assets/fonts/nunito-latin-900.woff2") format("woff2");
}

:root {
  /* Light (default) */
  --bg: #F3F6FA;
  --surface: #FFFFFF;
  --surface-2: #F7F9FC;
  --ink: #12233F;
  --body: #5B6B82;
  --muted: #8A97AB;
  --brand: #2B6BEE;
  --brand-deep: #1E4FD0;
  --brand-tint: #E9F1FE;
  --border: #E4EAF2;
  --success: #12B76A;
  --success-text: #067647;
  --success-tint: #E7F6EF;
  --diff-wrong-bg: #FBE3DE;
  --diff-wrong-text: #B0413A;
  --diff-right-bg: #D7F0E2;
  --diff-right-text: #1E7A4C;

  --hero-gradient: linear-gradient(155deg, #2B6BEE 0%, #1E4FD0 100%);
  --card-shadow: 0 4px 14px rgba(20, 36, 63, 0.05);
  --card-shadow-lg: 0 10px 30px rgba(20, 36, 63, 0.08);
  --btn-shadow: 0 12px 24px rgba(43, 107, 238, 0.30);

  --radius-btn: 16px;
  --radius-card: 20px;
  --radius-chip: 8px;
  --radius-pill: 999px;

  --space: 4px;
  --pad: 20px;
  --maxw: 1080px;

  --font-head: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, "JetBrains Mono", Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0D1420;
    --surface: #18202E;
    --surface-2: #131B27;
    --ink: #F2F5FA;
    --body: #A8B4C6;
    --muted: #748196;
    --brand: #5B8DF5;
    --brand-deep: #2B6BEE;
    --brand-tint: #1B2C4D;
    --border: #26303F;
    --success: #3CCF8E;
    --success-text: #3CCF8E;
    --success-tint: #12261E;
    --diff-wrong-bg: #3A2420;
    --diff-wrong-text: #F0A79E;
    --diff-right-bg: #12332A;
    --diff-right-text: #7FE0B5;

    --card-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    --card-shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.45);
    --btn-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  color: var(--ink);
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.02em;
}

h1 { font-weight: 900; font-size: clamp(2rem, 6vw, 3.25rem); }
h2 { font-weight: 800; font-size: clamp(1.5rem, 4vw, 2.25rem); }
h3 { font-weight: 800; font-size: 1.2rem; }

p { margin: 0 0 1em; }

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--pad);
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 1.15rem;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--hero-gradient);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--card-shadow);
  flex-shrink: 0;
}
.brand-mark svg { width: 22px; height: 22px; }
.nav-links { display: flex; align-items: center; gap: 22px; }
.nav-links a { color: var(--body); font-weight: 600; font-size: 0.95rem; }
.nav-links a:hover { color: var(--ink); text-decoration: none; }
@media (max-width: 640px) {
  .nav-links { gap: 14px; }
  .nav-links .nav-hide { display: none; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1rem;
  padding: 14px 26px;
  border-radius: var(--radius-btn);
  border: none;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn-primary {
  background: var(--brand);
  color: #FFFFFF;
  box-shadow: var(--btn-shadow);
}
.btn-primary:hover { transform: translateY(-1px); text-decoration: none; }
.btn-ghost {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
}
.btn-ghost:hover { text-decoration: none; }

/* Coming-soon App Store badge (disabled placeholder) */
.appstore-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: var(--radius-btn);
  background: color-mix(in srgb, var(--ink) 90%, black);
  color: #FFFFFF;
  font-family: var(--font-head);
  cursor: not-allowed;
  opacity: 0.9;
  user-select: none;
}
@media (prefers-color-scheme: dark) {
  .appstore-badge { background: #05070B; border: 1px solid var(--border); }
}
.appstore-badge svg { width: 26px; height: 26px; flex-shrink: 0; }
.appstore-badge .as-text { display: flex; flex-direction: column; line-height: 1.1; text-align: left; }
.appstore-badge .as-small { font-size: 0.62rem; font-weight: 600; opacity: 0.85; letter-spacing: 0.02em; }
.appstore-badge .as-big { font-size: 1.05rem; font-weight: 800; }

/* ---------- Hero ---------- */
.hero {
  background: var(--hero-gradient);
  color: #FFFFFF;
  border-radius: 0 0 32px 32px;
  padding: clamp(48px, 9vw, 96px) 0 clamp(56px, 10vw, 104px);
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(1200px 400px at 80% -10%, rgba(255, 255, 255, 0.16), transparent 60%);
  pointer-events: none;
}
.hero h1 { color: #FFFFFF; max-width: 16ch; }
.hero-sub {
  color: rgba(255, 255, 255, 0.92);
  font-size: clamp(1.05rem, 2.4vw, 1.35rem);
  max-width: 44ch;
  margin-bottom: 1.8em;
}
.hero-ctas { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.hero .btn-primary { background: #FFFFFF; color: var(--brand-deep); }
.hero-note { color: rgba(255, 255, 255, 0.8); font-size: 0.85rem; margin: 1.4em 0 0; }

/* ---------- Sections ---------- */
section { padding: clamp(48px, 8vw, 88px) 0; }
.section-eyebrow {
  font-family: var(--font-head);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  color: var(--brand);
  margin: 0 0 0.6em;
}
.section-lead { font-size: 1.1rem; max-width: 52ch; margin-bottom: 2.4em; }

/* Problem examples */
.mistakes { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.mistake-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 22px;
  box-shadow: var(--card-shadow);
}
.mistake-card .said {
  font-family: var(--font-mono);
  font-size: 0.98rem;
  color: var(--diff-wrong-text);
  background: var(--diff-wrong-bg);
  border-radius: var(--radius-chip);
  padding: 10px 12px;
  display: inline-block;
}
.mistake-card .label { display: block; font-size: 0.82rem; color: var(--muted); margin-top: 12px; }

/* Steps */
.steps { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 26px 22px;
  box-shadow: var(--card-shadow);
  position: relative;
}
.step-num {
  width: 40px; height: 40px;
  border-radius: var(--radius-pill);
  background: var(--brand-tint);
  color: var(--brand);
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 1.1rem;
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.step h3 { margin-bottom: 6px; }
.step p { margin: 0; font-size: 0.96rem; }

/* Use cases */
.usecases { display: flex; flex-wrap: wrap; gap: 12px; }
.chip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 12px 22px;
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--ink);
  box-shadow: var(--card-shadow);
}

/* Pricing */
.pricing-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); align-items: stretch; }
.price-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 30px 26px;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
}
.price-card.featured {
  border: 1.5px solid var(--brand);
  box-shadow: var(--card-shadow-lg);
}
.price-tag { font-family: var(--font-head); font-weight: 900; color: var(--ink); font-size: 2.2rem; margin: 6px 0 2px; }
.price-tag .per { font-size: 1rem; font-weight: 700; color: var(--muted); }
.price-card h3 { margin-bottom: 4px; }
.price-badge {
  align-self: flex-start;
  background: var(--brand-tint);
  color: var(--brand);
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  margin-bottom: 12px;
}
.feature-list { list-style: none; margin: 16px 0 0; padding: 0; }
.feature-list li { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; font-size: 0.96rem; }
.feature-list li svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 3px; color: var(--success); }
.trial-note { text-align: center; color: var(--muted); margin-top: 20px; font-size: 0.92rem; }

/* Final CTA */
.final-cta {
  background: var(--hero-gradient);
  color: #FFFFFF;
  border-radius: var(--radius-card);
  padding: clamp(40px, 7vw, 72px) var(--pad);
  text-align: center;
}
.final-cta h2 { color: #FFFFFF; }
.final-cta p { color: rgba(255, 255, 255, 0.9); max-width: 44ch; margin: 0 auto 1.6em; }
.final-cta .cta-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; }

/* ---------- Legal / prose pages ---------- */
.legal { padding: clamp(40px, 7vw, 72px) 0 80px; }
.legal .container { max-width: 780px; }
.legal h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); }
.legal .updated { color: var(--muted); font-size: 0.9rem; margin-top: -0.4em; margin-bottom: 2.2em; }
.legal h2 { font-size: 1.35rem; margin-top: 2em; }
.legal h3 { font-size: 1.08rem; margin-top: 1.5em; }
.legal p, .legal li { color: var(--body); }
.legal ul { padding-left: 1.2em; }
.legal li { margin-bottom: 0.5em; }
.legal .placeholder {
  background: var(--brand-tint);
  color: var(--brand-deep);
  font-family: var(--font-mono);
  font-size: 0.9em;
  padding: 1px 6px;
  border-radius: 5px;
  font-weight: 600;
}
@media (prefers-color-scheme: dark) {
  .legal .placeholder { color: var(--brand); }
}
.callout {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius-chip);
  padding: 16px 20px;
  margin: 1.6em 0;
}
.callout p:last-child { margin-bottom: 0; }
.legal table { width: 100%; border-collapse: collapse; margin: 1.4em 0; font-size: 0.94rem; }
.legal th, .legal td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.legal th { font-family: var(--font-head); color: var(--ink); font-weight: 800; }
.table-wrap { overflow-x: auto; }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  margin-top: 24px;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
}
.footer .brand { font-size: 1rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 20px; }
.footer-links a { color: var(--body); font-weight: 600; font-size: 0.92rem; }
.footer-links a:hover { color: var(--ink); text-decoration: none; }
.footer-note { color: var(--muted); font-size: 0.82rem; width: 100%; margin-top: 8px; }

.mt-lead { margin-top: 8px; }
