/* ── site-chrome.css — the ONE shared stylesheet for the static (non-React) pages. ──
 *
 *  Linked by every page in public/ (about, blog guides, ebook, legal, etc.) so the
 *  header + footer + brand variables are defined ONCE, not copy-pasted per page.
 *  Mirrors the React app's Header.jsx + Footer.jsx so navigating between the app (/)
 *  and any static page feels continuous.
 *
 *  Key design: header and footer are FULL-WIDTH bars (edge-to-edge), with their
 *  CONTENT centered and constrained to 720px — matching the React app's full-width
 *  chrome. Pages keep their own <style> for body/content rules.
 */

:root {
  /* Mirrors web/tailwind.config.js (Direction B "Exam Ink + Marks Green", 2026-07-04).
     brand = brand-600 / brand-dark = brand-700 / accent = accent-600 (marks green).
     Change the Tailwind config and this block TOGETHER — docs/DESIGN_SYSTEM.md. */
  --brand: #1d4e79;
  --brand-dark: #163d61;
  --brand-50: #eef4f9;     /* brand wash (tints/soft surfaces) */
  --accent: #0d9668;
  --accent-50: #e9f7f1;
  --accent-100: #d7efe3;
  --accent-700: #087a56;
  --ember: #e07c00;
  --ember-50: #fdf3e3;
  --ember-100: #fbe5c0;
  --ember-700: #9d5602;
  --danger: #dc2626;       /* errors / required markers */
  --ink: #0f172a;
  --ink-soft: #1e293b;     /* body text (one step lighter than headings) */
  --muted: #475569;
  --muted-faint: #64748b;  /* secondary text + captions */
  --muted-ghost: #94a3b8;  /* dividers / placeholder / footer micro */
  --line: #e2e8f0;
  --line-soft: #f1f5f9;    /* tinted backgrounds (feature chips, code bg) */
  --bg: #f8fafc;
  /* Content width — matches the body max-width on all pages. Header/footer inner
     content is constrained to this so the bar is full-width but content stays aligned. */
  --content-width: 720px;
  /* Bar/surface color — a variable so the design variant below can warm it. */
  --surface: #ffffff;
  /* Card + soft-tint defaults used by a few pages (ebook-style cards / pill chips).
     Promoted here from per-page :root blocks so the [data-design] remaps below can
     warm them too — the per-page redeclarations were overriding the variant remap. */
  --card: #ffffff;
  --soft: #eef4f9;
}

/* ── Variant B — "Question Paper" (founder A/B experiment; ?design=b on the app). ──
 *  Mirrors web/src/index.css [data-design="b"]: blue-black exam ink, deeper
 *  qualified-green, saffron ember, warm booklet-paper neutrals, serif wordmark.
 *  The attribute is stamped by the bootstrap in _includes/site-header.html, which
 *  reads the same localStorage key ("deduce_design") the app persists. */
[data-design="b"] {
  --brand: #1f3d55;
  --brand-dark: #162e41;
  --brand-50: #edf1f4;
  --accent: #0c7248;
  --accent-50: #e8f3ec;
  --accent-100: #d1e8d9;
  --accent-700: #085a39;
  --ember: #bc620c;
  --ember-50: #faf0e2;
  --ember-100: #f4dfc0;
  --ember-700: #824407;
  --danger: #dc2626;
  --ink: #191813;
  --ink-soft: #23211b;
  --muted: #67635a;
  --muted-faint: #8b8678;
  --muted-ghost: #b3ad9b;
  --line: #d8d4c3;
  --line-soft: #eae7da;
  --bg: #f3f1e9;
  --surface: #fcfbf5;
}
[data-design="b"] header.site .wordmark {
  font-family: Georgia, "Times New Roman", "Noto Serif", serif;
}

/* ── Variant C — "Bold Aspirant" (founder experiment; ?design=c on the app). ──
 *  Mirrors web/src/index.css [data-design="c"]: deep indigo brand, coral accent
 *  (the CTA), green success, amber ember, indigo-biased neutrals, chunky sans
 *  wordmark. The attribute is stamped by the bootstrap in _includes/site-header.html,
 *  which reads the same localStorage key ("deduce_design") the app persists. */
[data-design="c"] {
  --brand: #3D2E8F;
  --brand-dark: #2A1E6B;
  --brand-50: #EEEBFA;
  --accent: #FF5A5F;
  --accent-50: #FFECEC;
  --accent-100: #FFE0E0;
  --accent-700: #E8434A;
  --ember: #FFB020;
  --ember-50: #FFF3DC;
  --ember-100: #FFECBF;
  --ember-700: #B87408;
  --danger: #dc2626;
  --ink: #191634;
  --ink-soft: #221E47;
  --muted: #8A87A6;
  --muted-faint: #8A87A6;
  --muted-ghost: #A09DB3;
  --line: #E8E7F1;
  --line-soft: #F0F0F6;
  --bg: #F5F5FA;
  --surface: #FFFFFF;
}
[data-design="c"] header.site .wordmark {
  letter-spacing: -0.02em;
  /* The app's C wordmark is title-case "De" + amber "duce" (Header.jsx) — mirror it
     exactly so every page shows ONE brand lockup (founder, 2026-07-18). */
  text-transform: none;
}
[data-design="c"] header.site .wm-accent { color: #FFB020; }

/* Variant C display face (mirrors web/src/index.css — the "change both together"
 * rule, docs/DESIGN_SYSTEM.md). ONE self-hosted Poppins-ExtraBold latin woff2
 * (~8 KB, OFL), font-display: swap, fetched ONLY under C (the @font-face resolves
 * only when a C-scoped selector matches an element). The wordmark + page headings
 * pick it up; body text stays the system sans. A/B get no @font-face. */
@font-face {
  font-family: "Deduce Display";
  src: url("/fonts/poppins-extrabold-latin.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
[data-design="c"] header.site .wordmark,
[data-design="c"] main h1,
[data-design="c"] main h2 {
  font-family: "Deduce Display", "Segoe UI", system-ui, -apple-system, Roboto,
    "Helvetica Neue", sans-serif;
  /* The subset woff2's space glyph advances only ~0.2em (system ≈ 0.35em), so headline
     words visually fuse ("Pickyourrung" — founder-reported). Compensate the word gap
     only. Mirrors web/src/index.css .font-extrabold (change both together). */
  word-spacing: 0.12em;
}

/* Variant C content headings on the static SEO pages: the app's Bold Aspirant
 * identity uses chunky weight-800 display type, so the static pages' <main> headings
 * step up to match (they're 700 by each page's inline style) — keeps FAQ/About/etc.
 * feeling like the same product as the app, not a separate site. Scoped to
 * [data-design="c"] so A/B pages are unchanged. Color/ground/ink are already synced
 * via the token block above; this closes the last gap (heading weight + tracking). */
[data-design="c"] main h1,
[data-design="c"] main h2 {
  font-weight: 800;
  letter-spacing: -0.015em;
}

/* Variant C page identity: indigo header band + coral CTA + energy ground, mirroring the
 * app's Bold Aspirant treatment (prototype/purple). Scoped to [data-design="c"]; A/B
 * pages keep their white-header / brand-navy / marks-green identity unchanged. */
/* Indigo header band — the prototype's 135deg indigo→indigo-lift panel with white content,
   rounded to the app-feel radii. A/B keep the white surface + border header above. */
[data-design="c"] header.site {
  border-bottom: none;
  background-image: linear-gradient(135deg, #3D2E8F, #5B49C9);
  box-shadow: 0 8px 24px rgba(61, 46, 143, 0.18);
  /* Band GEOMETRY matches the app homepage's topbar (founder, 2026-07-18: the static
     band was full-bleed while the app's floats rounded at the content width): a
     rounded band capped at the app column width (max-w-5xl = 1024px), centered,
     floating below a small top gap. The 50%-based margins recenter it from inside
     the page's narrower (720px) content column. */
  --band-w: min(1024px, 100vw - 24px);
  width: var(--band-w);
  margin-left: calc(50% - var(--band-w) / 2);
  margin-right: calc(50% - var(--band-w) / 2);
  padding-left: 20px;
  padding-right: 20px;
  margin-top: 10px;
  border-radius: 18px;
}
/* The band's content spans the band (the app topbar's row fills its column) — not
   the page's 720px article measure. */
[data-design="c"] header.site > .site-inner {
  max-width: none;
}
[data-design="c"] header.site .wordmark,
[data-design="c"] header.site .tagline,
[data-design="c"] header.site nav a {
  color: #fff;
}
[data-design="c"] header.site .tagline { color: rgba(255, 255, 255, 0.72); }
[data-design="c"] header.site nav a:hover { color: rgba(255, 255, 255, 0.8); }
[data-design="c"] header.site .logo {
  background: rgba(255, 255, 255, 0.16);
  box-shadow: none;
}
[data-design="c"] header.site .acct {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}
[data-design="c"] header.site .acct.in {
  background: rgba(255, 255, 255, 0.22);
}

/* Coral CTA — the strict grammar reserves coral for THE one action per screen. The pages'
   .cta / .btn-primary source from var(--brand) (indigo under C), so under C only recolor
   those surfaces coral with the prototype's coral glow shadow. A/B keep brand-navy CTAs. */
[data-design="c"] .cta,
[data-design="c"] .btn-primary {
  background: #FF5A5F !important;
  color: #fff !important;
  border-color: transparent !important;
  box-shadow: 0 6px 16px rgba(255, 90, 95, 0.32) !important;
}
[data-design="c"] .cta:hover,
[data-design="c"] .btn-primary:hover {
  background: #E8434A !important;
}
/* Secondary buttons stay a translucent-white glass on the indigo/ground identity (not
   a second coral surface — the grammar is one coral action per screen). */
[data-design="c"] .btn-secondary,
[data-design="c"] .btn-ghost {
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  border: 1px solid var(--line);
}

/* Energy ground — the ground background with subtle indigo/coral radial washes (the
   prototype's desktop adaptation). Applied to body via the same var the pages already
   read; here we add the wash layer under C only. */
[data-design="c"] body {
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 12% 0%, rgba(91, 73, 201, 0.08), transparent 42%),
    radial-gradient(circle at 92% 8%, rgba(255, 90, 95, 0.07), transparent 38%);
  background-attachment: fixed;
}

/* ── Header — full-width bar, mirrors the React app's Header.jsx ──
 *  The header.site element spans edge-to-edge; its inner content (logo + nav) is
 *  centered and capped at --content-width. This matches the app header, which is
 *  full-width with centered content — NOT trapped inside the body's max-width column. */
header.site {
  width: 100%;
  box-sizing: border-box;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  /* Break out of any parent max-width/padding: stretch to the viewport edges. */
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding-left: calc(50vw - var(--content-width) / 2);
  padding-right: calc(50vw - var(--content-width) / 2);
  /* Pinned while scrolling — mirrors the app header (browser tabs got sticky on
     2026-07-18; the static pages follow so the chrome behaves identically). */
  position: sticky;
  top: 0;
  z-index: 40;
}
/* Phone widths: the app's topbar runs edge-to-edge from the very top (the app-shell
   bleeds it over the page padding; 820px = the shell breakpoint in standalone.js).
   Match it so app ⇄ static feels like one surface on a phone. */
@media (max-width: 820px) {
  [data-design="c"] header.site {
    --band-w: 100vw;
    margin-top: 0;
    top: 0;
  }
}
/* The inner row: logo left, nav right, capped to content width. */
header.site > .site-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  flex-wrap: wrap;
}
header.site .brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
header.site .logo {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(to bottom right, var(--brand), var(--brand-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
  flex-shrink: 0;
}
header.site .logo svg { display: block; }
header.site .wordmark {
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-size: 18px;
  line-height: 1;
  /* A/B render the classic all-caps "DEDUCE"; the markup is "De·duce" (one lockup for
     every variant — Variant C lifts this transform and colors .wm-accent amber below). */
  text-transform: uppercase;
}
header.site .tagline {
  font-size: 10px;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.025em;
  margin-top: 2px;
}
header.site nav a {
  margin-left: 16px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  color: var(--muted);
}
header.site nav a:hover { color: var(--brand); }
/* Nav + account chip travel together on the right. */
header.site .site-right {
  display: flex;
  align-items: center;
  gap: 4px;
}
/* Account entry (mirrors the app header's): grey icon when signed out, brand-gradient
 * avatar initial (.in, set by the header's session probe) when signed in. */
header.site .acct {
  margin-left: 16px;
  width: 36px;
  height: 36px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--line-soft);
  color: var(--muted-faint);
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
header.site .acct:hover { background: var(--line); }
header.site .acct.in {
  background: linear-gradient(to bottom right, var(--brand), var(--brand-dark));
  color: #fff;
}
header.site .acct.in:hover { opacity: 0.9; }
header.site .acct svg { display: block; }
/* Signed-in chip with a verified Google photo (mirrors the app's Avatar primitive). */
header.site .acct img {
  width: 100%;
  height: 100%;
  border-radius: 9999px;
  object-fit: cover;
  display: block;
}

/* ── Mobile nav hamburger (≤820px = the app-shell breakpoint) ──
 *  The inline links collapse behind a chip-styled toggle, mirroring the app header's
 *  More menu, and open as a white dropdown card under the band. Desktop unchanged. */
header.site .nav-toggle {
  display: none;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 9999px;
  align-items: center;
  justify-content: center;
  background: var(--line-soft);
  color: var(--muted-faint);
  cursor: pointer;
  flex-shrink: 0;
}
[data-design="c"] header.site .nav-toggle {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}
@media (max-width: 820px) {
  header.site .nav-toggle { display: flex; }
  header.site nav { display: none; }
  /* One row like the app header: logo left, chips right (the tagline wraps inside
     the brand instead of pushing the chips to a second row). */
  header.site > .site-inner { flex-wrap: nowrap; }
  header.site .brand { min-width: 0; }
  header.site.nav-open nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    position: absolute;
    right: 12px;
    top: calc(100% + 8px);
    min-width: 180px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.22);
    padding: 8px;
    z-index: 50;
  }
  /* Dropdown links sit on the white card — ink, not the band's white-on-indigo. */
  header.site.nav-open nav a,
  [data-design="c"] header.site.nav-open nav a {
    margin-left: 0;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--ink);
  }
  header.site.nav-open nav a:hover,
  [data-design="c"] header.site.nav-open nav a:hover {
    background: var(--line-soft);
    color: var(--brand);
  }
}

/* ── Footer — full-width bar, mirrors the React app's Footer.jsx grouped layout ──
 *  Same break-out trick as the header: full-width background, content centered + capped.
 *  Uses the 3-group layout (Learn / Community / Legal & support) from Footer.jsx. */
footer.site {
  width: 100%;
  box-sizing: border-box;
  border-top: 1px solid var(--line);
  background: var(--surface);
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding: 20px calc(50vw - var(--content-width) / 2);
}
footer.site > .site-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  text-align: center;
}
footer.site .foot-group {
  margin-bottom: 8px;
}
footer.site .foot-group:last-of-type { margin-bottom: 0; }
footer.site .foot-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-ghost);
  margin-bottom: 4px;
}
footer.site .foot-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 8px;
}
footer.site .foot-links a {
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  background: var(--bg);
  border-radius: 999px;
  padding: 2px 8px;
  transition: background 0.15s, color 0.15s;
}
footer.site .foot-links a:hover {
  background: var(--line-soft);
  color: var(--brand);
}
footer.site .foot-copy {
  font-size: 10px;
  color: var(--muted-ghost);
  margin-top: 8px;
}
footer.site .foot-company {
  font-size: 10px;
  color: var(--muted-ghost);
  margin-top: 2px;
}

/* ── Mobile ── */
@media (max-width: 520px) {
  header.site > .site-inner { padding: 10px 16px; }
  footer.site .foot-links a { font-size: 11px; padding: 2px 6px; }
}
