/* ===== 1. CSS VARIABLES & RESET ===== */
:root {
  /* Palette */
  --bg-page: #ffffff;
  --bg-header: #ffffff;
  --bg-footer: #0f1410;
  --bg-surface: #f7f9f7;
  --text-body: #1a1a1a;
  --text-heading: #0a0d0a;
  --text-muted: #5a635c;
  --text-on-dark: #c8d0ca;
  --text-on-dark-strong: #ffffff;
  --accent: #19e56e;
  --accent-dark: #0d8a3f;
  --accent-soft: rgba(25, 229, 110, 0.10);
  --border: #e6ebe7;
  --border-on-dark: #1f2823;
  --danger: #c43d3d;
  --danger-soft: rgba(196, 61, 61, 0.08);

  /* Layout */
  --content-width: 720px;
  --max-width: 1200px;
  --section-gap: clamp(2.5rem, 5vw, 4.5rem);

  /* Fonts */
  --font-head: 'Archivo', system-ui, sans-serif;
  --font-body: 'Source Serif 4', Georgia, serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
  --font-logo: 'Unbounded', system-ui, sans-serif;

  /* Shadow */
  --shadow-sm: 0 1px 2px rgba(10, 13, 10, 0.04), 0 1px 1px rgba(10, 13, 10, 0.03);
  --shadow-md: 0 2px 8px rgba(10, 13, 10, 0.06), 0 1px 3px rgba(10, 13, 10, 0.04);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  padding: 0;
  background: var(--bg-page);
  color: var(--text-body);
  font-family: var(--font-body);
  font-size: clamp(1rem, 1.15vw, 1.125rem);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-dark); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; transition: color 0.2s ease; }
a:hover { color: var(--text-heading); }

/* ===== 2. TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--text-heading);
  line-height: 1.2;
  margin: 0 0 0.75em;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2rem, 4.5vw, 3.5rem); margin-bottom: 0.5em; }
h2 { font-size: clamp(1.625rem, 3vw, 2.25rem); margin-top: 0; scroll-margin-top: 2rem; }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); scroll-margin-top: 2rem; }

p, li, td, blockquote, summary, details {
  text-align: left;
}

p { margin: 0 0 1.2em; }

ul, ol { margin: 0 0 1.2em; padding-left: 1.3em; }
li { margin-bottom: 0.5em; }
li:last-child { margin-bottom: 0; }

strong { font-weight: 700; color: var(--text-heading); }
em { font-style: italic; }

blockquote {
  margin: 1.5em 0;
  padding: 0.5em 0 0.5em 1.5em;
  border-left: 3px solid var(--accent);
  font-style: italic;
  color: var(--text-muted);
}

figure {
  margin: 1.5em auto;
  max-width: 100%;
}
figure img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}
figcaption {
  text-align: center;
  font-style: italic;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.75em;
}

/* ===== 3. LAYOUT: SECTIONS ===== */
main { width: 100%; }

article { width: 100%; }

[data-content] {
  max-width: var(--content-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  margin-top: var(--section-gap);
  margin-bottom: 0;
  scroll-margin-top: 2rem;
}

[data-content]:first-of-type { margin-top: var(--section-gap); }

/* ===== 4. HEADER ===== */
.site-header {
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.5rem;
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.site-logo {
  display: inline-block;
  text-decoration: none;
  flex-shrink: 0;
}
.site-logo img {
  width: 200px;
  height: auto;
  max-height: 38px;
}
.header-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.header-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}
.header-badge-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}
.header-trust {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ===== 5. HERO ===== */
.hero {
  background: var(--bg-page);
  padding: clamp(3rem, 7vw, 5.5rem) 1.5rem clamp(2.5rem, 5vw, 4rem);
  text-align: center;
  max-width: none;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  margin-top: 0;
  position: relative;
  overflow: hidden;
}
.hero > * {
  position: relative;
  z-index: 1;
}
.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-dark);
  margin: 0 auto 1.2rem;
  text-align: center;
}
.hero-kicker::before, .hero-kicker::after {
  content: "";
  display: inline-block;
  width: 24px;
  height: 1px;
  background: var(--accent-dark);
}
.hero h1 {
  max-width: 900px;
  margin: 0 auto 1.2rem;
  text-align: center;
  position: relative;
  padding-left: 12px;
}
.hero h1::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.15em;
  bottom: 0.15em;
  width: 4px;
  background: var(--accent);
  display: none;
}
.hero-subtitle {
  max-width: 700px;
  margin: 0 auto 1.5rem;
  font-family: var(--font-body);
  font-style: italic;
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  color: var(--text-muted);
  text-align: center;
}
.hero-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
  margin: 0 auto 2rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
}
.hero-byline {
  font-family: var(--font-head);
  font-weight: 400;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  color: var(--text-heading);
}
.hero-meta-sep {
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--text-muted);
  opacity: 0.5;
}
.hero figure {
  margin: 2rem auto 0;
  max-width: var(--content-width);
}
.hero-image {
  width: 100%;
  height: auto;
  border-radius: 4px;
  box-shadow: var(--shadow-md);
}

/* ===== 6. COMPONENTS ===== */

/* info-box */
.info-box {
  background: var(--bg-surface);
  border-left: 4px solid var(--accent);
  padding: 1.5rem 1.75rem;
  margin-top: 1.75rem;
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow-sm);
  border-radius: 0 4px 4px 0;
}
.info-box h3 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 1.15rem;
}
.info-box p:last-child, .info-box ul:last-child, .info-box ol:last-child {
  margin-bottom: 0;
}
.info-box p, .info-box li {
  text-align: left;
  font-size: 0.98rem;
}

/* callout */
.callout {
  position: relative;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.25rem 1.5rem 1.25rem 3rem;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  font-size: 0.98rem;
}
.callout::before {
  content: "◆";
  position: absolute;
  left: 1rem;
  top: 1.15rem;
  color: var(--accent);
  font-size: 1rem;
  line-height: 1;
}
.callout p { text-align: left; }
.callout p:last-child { margin-bottom: 0; }

/* key-takeaway */
.key-takeaway {
  border-top: 2px solid var(--accent);
  padding: 1.5rem 0 0;
  margin-top: 2rem;
  margin-bottom: 2rem;
  background: transparent;
  box-shadow: none;
}
.key-takeaway h3 {
  font-size: 1.4rem;
  margin-top: 0;
  margin-bottom: 0.5rem;
}
.key-takeaway p, .key-takeaway li {
  font-family: var(--font-head);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-heading);
}
.key-takeaway p { text-align: left; }

/* fun-fact */
.fun-fact {
  position: relative;
  padding: 0.75rem 0 0.75rem 1.5rem;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  background: transparent;
  border: none;
  box-shadow: none;
}
.fun-fact::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.1rem;
  width: 1rem;
  height: 1px;
  background: var(--accent);
}
.fun-fact p {
  font-style: italic;
  color: var(--text-muted);
  font-size: 1.02rem;
  text-align: left;
  margin: 0;
}

/* glossary-term */
.glossary-term {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-top: 0.75rem;
  margin-bottom: 0.75rem;
  padding: 0.4rem 0;
  border-bottom: 1px dotted var(--border);
}
.glossary-term p {
  margin: 0;
  text-align: left;
  font-size: 0.98rem;
}
.glossary-term strong {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.92em;
  color: var(--accent-dark);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
  flex-shrink: 0;
}

/* odds-example */
.odds-example {
  background: var(--text-heading);
  color: #f4f6f4;
  padding: 1.5rem 1.75rem;
  border-radius: 4px;
  margin-top: 1.75rem;
  margin-bottom: 1.75rem;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  box-shadow: var(--shadow-md);
}
.odds-example p {
  text-align: left;
  color: #f4f6f4;
  margin-bottom: 0.5rem;
}
.odds-example p:last-child { margin-bottom: 0; }
.odds-example p strong {
  display: block;
  font-family: var(--font-head);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

/* course-fit */
.course-fit {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin: 1.5rem 0;
  padding: 1rem;
  background: var(--bg-surface);
  border-radius: 4px;
}
.course-fit > div {
  padding: 1rem 0.75rem;
  text-align: center;
  background: var(--bg-page);
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

/* pre-bet-checklist */
.pre-bet-checklist {
  margin-top: 1.75rem;
  margin-bottom: 1.75rem;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}
.pre-bet-checklist p:first-child, .pre-bet-checklist > p:first-child {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-dark);
  margin-bottom: 1.2rem;
  text-align: left;
}
.pre-bet-checklist ul {
  list-style: none;
  margin: 0;
  padding: 0 0 0 1.75rem;
  border-left: 2px solid var(--border);
  position: relative;
}
.pre-bet-checklist li {
  position: relative;
  padding: 0.25rem 0 0.75rem;
  margin-bottom: 0.25rem;
  text-align: left;
  font-size: 0.98rem;
}
.pre-bet-checklist li::before {
  content: "☐";
  position: absolute;
  left: -2.45rem;
  top: 0.15rem;
  color: var(--accent);
  font-size: 1.1rem;
  width: 1.4rem;
  height: 1.4rem;
  background: var(--bg-page);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* dos-donts */
.dos-donts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: 1.75rem;
  margin-bottom: 1.75rem;
}
.dos-donts > div {
  padding: 1.25rem 1.5rem;
  border-radius: 4px;
  background: var(--bg-page);
  box-shadow: var(--shadow-sm);
}
.dos-donts > div:first-child {
  border-top: 3px solid var(--accent);
}
.dos-donts > div:last-child {
  border-top: 3px solid var(--danger);
}
.dos-donts p {
  text-align: left;
  font-size: 0.96rem;
}
.dos-donts > div > p:first-child {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.85rem;
}
.dos-donts > div:first-child > p:first-child { color: var(--accent-dark); }
.dos-donts > div:first-child > p:first-child::before { content: "✓ "; }
.dos-donts > div:last-child > p:first-child { color: var(--danger); }
.dos-donts > div:last-child > p:first-child::before { content: "✗ "; }
.dos-donts ul {
  margin: 0;
  padding-left: 1.1em;
  list-style: none;
}
.dos-donts li {
  position: relative;
  padding-left: 1.1em;
  margin-bottom: 0.6em;
  text-align: left;
  font-size: 0.94rem;
  line-height: 1.55;
}
.dos-donts > div:first-child li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--accent-dark);
  font-weight: bold;
}
.dos-donts > div:last-child li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--danger);
}

/* comparison */
.comparison {
  margin-top: 1.75rem;
  margin-bottom: 1.75rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: var(--shadow-sm);
  width: 100%;
}
@media (min-width: 1000px) {
  .comparison {
    width: calc(100% + 10rem);
    margin-left: -5rem;
    margin-right: -5rem;
  }
}
.comparison table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-body);
  font-size: 0.9rem;
}
.comparison th, .comparison td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.comparison th {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-heading);
  background: var(--bg-surface);
}
.comparison td {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-body);
}
.comparison td:first-child {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-heading);
}
.comparison tr:last-child td { border-bottom: none; }
.comparison tbody tr:hover { background: var(--bg-surface); }

/* section-bridge */
.section-bridge {
  text-align: center;
  margin: 2.5rem 0;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  position: relative;
}

/* at-a-glance */
.at-a-glance {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin-top: 1.75rem;
  margin-bottom: 1.75rem;
  padding: 1.5rem 0;
  border-top: 2px solid var(--text-heading);
  border-bottom: 1px solid var(--border);
}
.at-a-glance > div {
  padding: 0.5rem 1.25rem;
  border-right: 1px solid var(--border);
  text-align: left;
}
.at-a-glance > div:last-child { border-right: none; }
.at-a-glance > div > p:first-child {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 1.15rem;
  color: var(--text-heading);
  margin-bottom: 0.3rem;
  line-height: 1.1;
  text-align: left;
  white-space: nowrap;
}
.at-a-glance > div > p:first-child strong {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--text-heading);
}
.at-a-glance > div > p:last-child {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.4;
  text-align: left;
}

/* worked-example */
.worked-example {
  background: var(--bg-surface);
  padding: 1.75rem 2rem;
  margin-top: 1.75rem;
  margin-bottom: 1.75rem;
  border-radius: 4px;
  position: relative;
  box-shadow: var(--shadow-sm);
}
.worked-example::before {
  content: "Worked Example";
  position: absolute;
  top: -0.65rem;
  left: 1.5rem;
  background: var(--bg-page);
  padding: 0 0.6rem;
  font-family: var(--font-head);
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-dark);
  font-weight: 700;
}
.worked-example p {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  margin-bottom: 0.85rem;
}
.worked-example p strong {
  display: block;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-dark);
  margin-bottom: 0.4rem;
  margin-top: 0.85rem;
}
.worked-example p:first-child strong { margin-top: 0; }
.worked-example p:last-child { margin-bottom: 0; }

/* card-grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin: 1.75rem 0;
}
.card-grid > div {
  padding: 1.25rem 1.5rem;
  background: var(--bg-surface);
  border-radius: 4px;
  box-shadow: var(--shadow-sm);
}

/* tldr */
.tldr {
  background: var(--bg-surface);
  border-left: 4px solid var(--text-heading);
  padding: 1.5rem 1.75rem;
  margin-top: var(--section-gap);
  margin-bottom: 0;
  border-radius: 0 4px 4px 0;
}
.tldr h2 {
  font-family: var(--font-head);
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  letter-spacing: 0.02em;
  margin-top: 0;
  margin-bottom: 0.85rem;
  color: var(--text-heading);
  scroll-margin-top: 2rem;
  text-transform: none;
}
.tldr ul {
  margin: 0;
  padding-left: 1.2em;
}
.tldr li {
  text-align: left;
  font-size: 0.98rem;
  margin-bottom: 0.6em;
  line-height: 1.55;
}
.tldr li:last-child { margin-bottom: 0; }

/* author-bio */
.author-bio {
  max-width: var(--content-width);
  margin: 2.5rem auto 0;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}
.author-bio-inner {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
  flex-wrap: wrap;
}
.author-bio-inner strong {
  font-family: var(--font-head);
  font-style: normal;
  font-weight: 700;
  color: var(--text-heading);
}

/* ===== 7. TABLE OF CONTENTS (vertical, 2-column at 8+) ===== */
.toc {
  background: var(--bg-surface);
  padding: 1.75rem 2rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.toc-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-dark);
  margin: 0 0 1.25rem;
}
.toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  column-count: 2;
  column-gap: 2.25rem;
}
.toc-list > li {
  break-inside: avoid;
  margin-bottom: 0.85rem;
}
.toc-list > li > a {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-heading);
  text-decoration: none;
  display: inline-block;
  padding-left: 0;
  line-height: 1.35;
}
.toc-list > li > a:hover {
  color: var(--accent-dark);
}
.toc-sub {
  list-style: none;
  margin: 0.45rem 0 0;
  padding: 0 0 0 0.85rem;
  border-left: 1px solid var(--border);
}
.toc-sub li {
  margin-bottom: 0.3rem;
}
.toc-sub a {
  font-family: var(--font-body);
  font-size: 0.84rem;
  font-weight: 400;
  color: var(--text-muted);
  text-decoration: none;
  line-height: 1.4;
}
.toc-sub a:hover {
  color: var(--accent-dark);
}

/* ===== 8. FAQ ===== */
[data-content="faq"] details {
  border-bottom: 1px solid var(--border);
  padding: 0;
  margin: 0;
}
[data-content="faq"] details:first-of-type {
  border-top: 1px solid var(--border);
}
[data-content="faq"] summary {
  list-style: none;
  cursor: pointer;
  padding: 1.25rem 2.5rem 1.25rem 0;
  position: relative;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--text-heading);
  line-height: 1.4;
  transition: color 0.2s ease;
}
[data-content="faq"] summary::-webkit-details-marker { display: none; }
[data-content="faq"] summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 1.1rem;
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--accent-dark);
  line-height: 1;
  transition: transform 0.3s ease;
}
[data-content="faq"] details[open] summary::after {
  transform: rotate(45deg);
}
[data-content="faq"] summary:hover { color: var(--accent-dark); }
[data-content="faq"] details > div {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.35s ease, opacity 0.3s ease, padding 0.3s ease;
  padding: 0 0;
}
[data-content="faq"] details[open] > div {
  max-height: 1200px;
  opacity: 1;
  padding: 0 0 1.5rem;
}
[data-content="faq"] details > div p {
  font-size: 0.98rem;
  color: var(--text-body);
  margin: 0;
}
[data-content="faq"] .info-box {
  margin-top: 0;
  margin-bottom: 2rem;
}

/* ===== 9. NAVIGATION BUTTONS ===== */
.back-to-top {
  display: block;
  max-width: var(--content-width);
  margin: 3rem auto 0;
  padding: 0 1.5rem;
  text-align: center;
}
.back-to-top a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.2rem;
  background: transparent;
  color: var(--text-heading);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  transition: all 0.2s ease;
}
.back-to-top a::before {
  content: "↑";
  font-size: 1rem;
}
.back-to-top a:hover {
  background: var(--text-heading);
  color: var(--bg-page);
  border-color: var(--text-heading);
}

/* ===== 10. FOOTER ===== */
.site-footer {
  background: var(--bg-footer);
  color: var(--text-on-dark);
  padding: 3.5rem 1.5rem 0;
  margin-top: 5rem;
  font-size: 0.85rem;
  line-height: 1.6;
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--border-on-dark);
}
.footer-col h4 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1rem;
}
.footer-col p, .footer-col li {
  font-size: 0.82rem;
  color: var(--text-on-dark);
  margin-bottom: 0.6rem;
  text-align: left;
  line-height: 1.55;
}
.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.footer-col a {
  color: var(--text-on-dark);
  text-decoration: none;
  transition: color 0.2s ease;
}
.footer-col a:hover { color: var(--accent); }
.footer-help-phone {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  color: var(--text-on-dark-strong);
  font-weight: 500;
  display: block;
  margin-top: 0.3rem;
  margin-bottom: 0.6rem;
}
.footer-bottom {
  padding: 1.5rem 0;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.76rem;
  color: var(--text-on-dark);
}
.footer-bottom-disclaimer {
  max-width: 65ch;
}

/* ===== 11. RESPONSIVE ===== */
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 2rem; }
  .at-a-glance { grid-template-columns: repeat(2, 1fr); }
  .at-a-glance > div { border-right: none; border-bottom: 1px solid var(--border); padding: 1rem 0.75rem; }
  .at-a-glance > div:nth-last-child(-n+2) { border-bottom: none; }
  .course-fit { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root { --content-width: 100%; }
  body { font-size: 1rem; }
  [data-content] { padding-left: 1rem; padding-right: 1rem; }
  .header-inner { gap: 0.75rem; }
  .site-logo img { width: 160px; max-height: 32px; }
  .header-meta { gap: 0.5rem; }
  .header-trust { font-size: 0.62rem; }
  .header-badge { font-size: 0.66rem; padding: 0.3rem 0.6rem; }
  .hero { padding-left: 1rem; padding-right: 1rem; }
  .hero h1 { padding-left: 0; }
  .hero h1::before { display: none; }
  .toc-list { column-count: 1; }
  .toc { padding: 1.25rem 1.25rem; }
  .dos-donts { grid-template-columns: 1fr; }
  .glossary-term { flex-direction: column; gap: 0.2rem; }
  .glossary-term strong { display: block; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.75rem; padding-bottom: 2rem; }
  .footer-bottom { flex-direction: column; gap: 0.75rem; }
  .info-box, .worked-example, .odds-example { padding: 1.25rem 1.25rem; }
  .comparison { font-size: 0.82rem; }
  .comparison th, .comparison td { padding: 0.5rem 0.7rem; }
  .author-bio { padding-left: 1rem; padding-right: 1rem; }
}

@media (max-width: 480px) {
  .at-a-glance { grid-template-columns: 1fr; }
  .at-a-glance > div { border-right: none; }
  .at-a-glance > div:nth-last-child(2) { border-bottom: 1px solid var(--border); }
  .course-fit { grid-template-columns: 1fr; }
}

/* ===== 12. FOCUS / A11Y ===== */
a:focus-visible, summary:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}

/* =========================================
   UNIVERSAL DESKTOP & MOBILE MENU + LOGO
   ========================================= */

/* Header Base */
.site-header {
    background-color: var(--color-bg, #121212);
    border-bottom: 1px solid var(--color-border, #333333);
    position: sticky;
    top: 0;
    z-index: 100;
}

/* Mobile defaults for navigation bar */
.top-navigation-bar {
    width: 100%;
    margin: 0 auto;
    padding: 15px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Logo Fixes */
.site-logo {
    min-width: 180px;
    margin: 0;
}

.site-logo img {
    max-height: 50px !important;
    max-width: none !important;
    width: auto !important; 
    display: block;
    transition: transform 0.2s ease;
}

.site-logo img:hover {
    transform: scale(1.02);
}

/* Desktop Menu */
.site-nav--desktop {
    display: none; 
}

/* Desktop Grid Layout: Logo left, Menu center */
@media (min-width: 1024px) {
    .top-navigation-bar {
        max-width: 100%;
        padding: 15px 40px; 
        display: flex; 
        justify-content: space-between;
        align-items: center;
        gap: 30px;
    }
    
    .site-nav--desktop {
        display: block;
        flex: 1; 
        min-width: 0; 
    }

    .mobile-controls {
        display: none; 
    }
    
    .site-nav--desktop ul {
        display: flex;
        flex-wrap: wrap; 
        justify-content: flex-end; 
        gap: 15px 25px; 
        list-style: none;
        margin: 0;
        padding: 0;
    }
    
    .site-nav--desktop a {
        text-decoration: none;
        color: var(--color-text, #ffffff);
        font-family: var(--font-body, sans-serif);
        font-weight: 500;
        font-size: 14px; 
        transition: color 0.2s ease;
        white-space: normal !important;
        line-height: 1.2;
    }
    
    .site-nav--desktop a:hover {
        color: var(--color-accent, #eab308);
    }
}

/* Mobile Burger Button */
.burger {
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 5px;
    z-index: 1000;
}

.burger span {
    display: block;
    width: 28px;
    height: 3px;
    background-color: var(--color-text, #ffffff);
    transition: transform 0.3s ease, opacity 0.3s ease;
    border-radius: 2px;
}

/* Burger Animation to X */
.burger.is-active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}
.burger.is-active span:nth-child(2) {
    opacity: 0;
}
.burger.is-active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* Mobile Menu Slider */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%; 
    width: 85%;
    max-width: 400px;
    height: 100vh;
    background-color: var(--color-bg, #121212);
    box-shadow: -5px 0 20px rgba(0,0,0,0.5);
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    overflow-y: auto;
    padding: 60px 30px;
}

.mobile-menu.is-open {
    right: 0; 
}

.mobile-menu__close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    font-size: 36px;
    line-height: 1;
    color: var(--color-text, #ffffff);
    cursor: pointer;
    transition: color 0.2s ease;
}

.mobile-menu__close:hover {
    color: var(--color-accent, #eab308);
}

.menu-mobile {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.menu-mobile a {
    text-decoration: none;
    color: var(--color-text, #ffffff);
    font-size: 20px;
    font-family: var(--font-display, sans-serif);
    font-weight: 600;
    display: block;
    transition: color 0.2s ease, padding-left 0.2s ease;
}

.menu-mobile a:hover {
    color: var(--color-accent, #eab308);
    padding-left: 10px; 
}

/* Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(3px); 
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s;
    z-index: 998;
}

.mobile-menu-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

.sitemap-main{
  max-width: 900px;
  margin: 0 auto;
  padding: 24px;
}

.sitemap-title{
  margin: 0 0 8px;
  text-align: center;
}

.sitemap-subtitle{
  margin: 0 0 24px;
  text-align: center;
  opacity: 0.75;
}

.sitemap-list{
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.sitemap-link{
  display: block;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  text-decoration: none;
}

.sitemap-link:hover{
  border-color: rgba(255,255,255,0.2);
}

/* ===== Universal hub (NO body_class needed) ===== */

main.hub-children-main{
  padding-bottom: 48px;
}

/* Article wrapper */
main.hub-children-main .hub-children-article{
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 16px;
  padding-right: 16px;
}

/* Header */
main.hub-children-main .hub-children-header{
  text-align: center;
  margin-top: 24px;
  margin-bottom: 24px;
}

main.hub-children-main .hub-children-title{
  margin: 0 0 10px;
}

main.hub-children-main .hub-children-intro{
  max-width: 900px;
  margin: 0 auto;
  opacity: .9;
}

/* Grid */
main.hub-children-main .hub-children-grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
  margin-top: 12px;
}

/* Card */
main.hub-children-main .hub-children-card{
  display: block;
  text-decoration: none;
}

main.hub-children-main .hub-children-card__media{
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255,255,255,0.06);
  box-shadow: 0 10px 28px rgba(0,0,0,.18);
  transition: transform .22s ease, box-shadow .22s ease;
}

main.hub-children-main .hub-children-card:hover .hub-children-card__media{
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0,0,0,.28);
}

/* Image */
main.hub-children-main .hub-children-card__img{
  width: 100%;
  aspect-ratio: 16 / 9;
  background-size: cover;
  background-position: center;
}

/* Overlay */
main.hub-children-main .hub-children-card__overlay{
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0,0,0,0.08) 0%,
    rgba(0,0,0,0.42) 55%,
    rgba(0,0,0,0.70) 100%
  );
}

/* Text */
main.hub-children-main .hub-children-card__content{
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 16px;
}

main.hub-children-main .hub-children-card__title{
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 6px 18px rgba(0,0,0,.55);
}

/* Responsive */
@media (max-width: 1024px){
  main.hub-children-main .hub-children-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }
}

@media (max-width: 640px){
  main.hub-children-main .hub-children-grid{
    grid-template-columns: 1fr;
  }
}

.home main > *:not([data-content="hero"]):not(.cl-header):not(header):not(.cl-hero),
.home main article > *:not([data-content="hero"]):not(.cl-header):not(header):not(.cl-hero) {
    max-width: var(--content-max-width, 940px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    box-sizing: border-box !important;
}

.home main iframe,
.home main article iframe {
    max-width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    transform: none !important;
    width: 100% !important;
}

/* ===== ХЛЕБНЫЕ КРОШКИ (BREADCRUMBS) - LIGHT & DARK ===== */

/* БАЗОВАЯ (СВЕТЛАЯ) ТЕМА */
#crumbs {
    padding: 10px 0;
    margin-bottom: 20px;
    font-size: 14px;
    color: #64748b; 
    text-align: center; 
}

#crumbs a {
    text-decoration: none;
    color: #475569; 
    transition: color 0.2s ease;
}

#crumbs a:hover {
    color: #2563eb; 
    text-decoration: underline;
}

#crumbs .current {
    font-weight: 600;
    color: #0f172a; 
}

/* ТЕМНАЯ ТЕМА (Автоматическое переключение) */
@media (prefers-color-scheme: dark) {
    #crumbs {
        color: rgba(255, 255, 255, 0.5); 
    }

    #crumbs a {
        color: rgba(255, 255, 255, 0.7); 
    }

    #crumbs a:hover {
        color: #ffffff; 
    }

    #crumbs .current {
        color: #ffffff; 
    }
}

/* =========================================
   СТИЛИ ДЛЯ ОГЛАВЛЕНИЯ (TOC) - LIGHT & DARK
   ========================================= */

/* БАЗОВАЯ (СВЕТЛАЯ) ТЕМА */
.toc-card {
    background: #f8fafc; 
    border: 1px solid #e2e8f0; 
    border-radius: 10px;
    padding: 25px 30px;
    margin: 40px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.toc-card h2 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 24px;
    color: #1e293b; 
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 15px;
}

.toc-columns {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toc-group a {
    color: #475569 !important; 
    text-decoration: none;
    font-size: 16px;
    line-height: 1.5;
    transition: color 0.2s ease, transform 0.2s ease;
    display: inline-block;
}

.toc-group a:hover {
    color: #2563eb !important; 
    transform: translateX(4px);
}

/* Две колонки на компьютерах */
@media (min-width: 768px) {
    .toc-columns {
        display: grid;
        grid-template-columns: 1fr 1fr;
        column-gap: 40px;
    }
}

/* ТЕМНАЯ ТЕМА */
@media (prefers-color-scheme: dark) {
    .toc-card {
        background: #1a1a1f;
        border-color: #2d2d35;
        box-shadow: none;
    }

    .toc-card h2 {
        color: #ffffff;
        border-bottom-color: #2d2d35;
    }

    .toc-group a {
        color: #a0a0b0 !important; 
    }

    .toc-group a:hover {
        color: #ffffff !important; 
    }
}


header,
.top-navigation-bar {
    background-color: #ffffff !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

.menu-desktop a,
.site-header a,
.top-navigation-bar a,
.site-title,
.site-logo {
    color: #111827 !important;
    font-weight: 500;
}

.menu-desktop a:hover,
.site-header a:hover {
    color: #dc2626 !important; 
}

.burger span {
    background-color: #111827 !important;
}

@media (max-width: 900px) {
    html, body {
        overflow-x: hidden !important; 
        width: 100% !important;
        max-width: 100vw !important;
    }

    main {
        display: block !important;
        width: 100% !important;
        overflow-x: hidden !important;
    }

    [data-content="hero"], 
    main:not(:has([data-content="toc"])) [data-content="hero"],
    .article-hero,
    .cl-hero {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 1rem !important; 
        padding-right: 1rem !important;
        box-sizing: border-box !important;
    }
    
    .tldr, [data-content], article {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        box-sizing: border-box !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}

.site-footer .footer-col h3 {
  color: #ffffff;
}