/* ============================================
   1. CSS VARIABLES & RESET
   ============================================ */
:root {
  --font-display: 'Oswald', sans-serif;
  --font-body: 'Source Serif 4', serif;
  --font-mono: 'JetBrains Mono', monospace;

  --color-bg: #FFFFFF;
  --color-text: #1A1A1A;
  --color-text-secondary: #4A4A4A;
  --color-accent: #00875A;
  --color-accent-hover: #006644;
  --color-surface: #F5F5F5;
  --color-border: #D4D4D4;
  --color-danger: #C4372C;
  --color-success: #00875A;

  --content-width: 800px;
  --breakout-width: 900px;
  --section-gap: 80px;
  --sidebar-width: 220px;

    /* --- AUTO-FORCED DARK THEME --- */
    --color-bg: #121212;
    --color-text: #E0E0E0;
    --color-text-secondary: #A0A0A0;
    --color-accent: #34D399;
    --color-accent-hover: #6EE7B7;
    --color-surface: #1E1E1E;
    --color-border: #333333;
    --color-danger: #F87171;
    --color-success: #34D399;
}



*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.75;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   2. GENERAL TYPOGRAPHY
   ============================================ */
h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(32px, 5vw, 48px);
  line-height: 1.1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-align: center;
  color: var(--color-text);
}

h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(24px, 3.5vw, 32px);
  line-height: 1.2;
  text-align: left;
  color: var(--color-text);
  margin-bottom: 24px;
  scroll-margin-top: 2rem;
}

h3 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: clamp(18px, 2.5vw, 22px);
  line-height: 1.4;
  text-align: left;
  color: var(--color-text);
  margin-top: 40px;
  margin-bottom: 16px;
  scroll-margin-top: 2rem;
}

p {
  text-align: left;
  margin-bottom: 1.25em;
  color: var(--color-text);
}

ul, ol {
  text-align: left;
  padding-left: 1.5em;
  margin-bottom: 1.25em;
}

li {
  text-align: left;
  margin-bottom: 0.5em;
}

strong {
  font-weight: 600;
}

em {
  font-style: italic;
}

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

a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--color-accent-hover);
}

a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 2px;
}

figure {
  margin: 2em 0;
}

figcaption {
  text-align: center;
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-top: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 16px;
}

th, td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
}

th {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background-color: var(--color-surface);
}

/* ============================================
   3. LAYOUT — MAIN GRID (SIDEBAR TOC)
   ============================================ */
header {
  padding: 0;
  margin: 0;
  line-height: 0;
  font-size: 0;
}

main {
  width: 100%;
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  gap: 0 40px;
}

/* ============================================
   4. DATA-CONTENT SECTIONS
   ============================================ */
[data-content] {
  grid-column: 2;
  max-width: var(--content-width);
  padding: 0 24px;
  margin-bottom: var(--section-gap);
  margin-left: auto;
  margin-right: auto;
}

[data-content="hero"] {
  grid-column: 1 / -1;
  max-width: none;
  width: 100%;
  padding: 0;
  margin-bottom: 0;
}

[data-content="toc"] {
  grid-column: 1;
  grid-row: 2 / 50;
  position: sticky;
  top: 2rem;
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
  padding: 0 16px 0 24px;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}

[data-content="toc"]::-webkit-scrollbar {
  width: 4px;
}

[data-content="toc"]::-webkit-scrollbar-track {
  background: transparent;
}

[data-content="toc"]::-webkit-scrollbar-thumb {
  background-color: var(--color-border);
  border-radius: 2px;
}

/* ============================================
   5. VISUAL COMPONENTS
   ============================================ */

/* --- info-box --- */
.info-box {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-accent);
  border-radius: 6px;
  padding: 24px 28px;
  margin: 2em 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.info-box p {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  text-align: left;
  color: var(--color-text);
  margin-bottom: 0;
}

.info-box p:first-child::before {
  content: 'KEY FACT';
  display: block;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 12px;
}

/* --- calc-example --- */
.calc-example {
  background-color: var(--color-surface);
  border-radius: 6px;
  padding: 32px;
  margin: 2em auto;
  max-width: var(--breakout-width);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.calc-example p {
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1.8;
  text-align: left;
  color: var(--color-text);
  margin-bottom: 8px;
}

.calc-example p:first-child {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-accent);
  text-align: left;
  margin-bottom: 16px;
}

.calc-example p:first-child strong {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.calc-example p:last-child {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--color-text-secondary);
  border-top: 1px solid var(--color-border);
  padding-top: 16px;
  margin-top: 12px;
  margin-bottom: 0;
}

/* --- callout --- */
.callout {
  border-left: 4px solid var(--color-accent);
  background-color: #FAFAFA;
  padding: 20px 24px;
  margin: 2em 0;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

@media (prefers-color-scheme: dark) {
  .callout {
    background-color: var(--color-surface);
  }
}

.callout p {
  font-family: var(--font-body);
  font-size: 16px;
  font-style: italic;
  line-height: 1.7;
  text-align: left;
  color: var(--color-text);
  margin-bottom: 0;
}

/* --- card-grid --- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin: 2em 0;
  max-width: var(--breakout-width);
}

.card-grid > div {
  background-color: var(--color-surface);
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-grid > div:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.card-grid > div p:first-child {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text);
  text-align: left;
  margin-bottom: 8px;
}

.card-grid > div p:first-child strong {
  font-family: var(--font-display);
  font-weight: 600;
}

.card-grid > div p {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.65;
  text-align: left;
  color: var(--color-text);
}

.card-grid > div p:last-child {
  margin-bottom: 0;
}

/* --- comparison --- */
.comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 2em 0;
}

.comparison > div {
  background-color: var(--color-surface);
  border-radius: 6px;
  padding: 24px;
  border-top: 3px solid var(--color-accent);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.comparison > div:last-child {
  border-top-color: var(--color-border);
}

.comparison > div p {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.65;
  text-align: left;
  color: var(--color-text);
}

.comparison > div p:first-child {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text);
  text-align: left;
  margin-bottom: 12px;
}

/* --- key-takeaway --- */
.key-takeaway {
  border-top: 2px solid var(--color-accent);
  padding-top: 20px;
  margin: 2.5em 0;
}

.key-takeaway p {
  font-family: var(--font-display);
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 400;
  line-height: 1.35;
  text-align: left;
  color: var(--color-text);
  margin-bottom: 0;
}

/* --- fun-fact --- */
.fun-fact {
  position: relative;
  padding-left: 24px;
  margin: 2em 0;
}

.fun-fact::before {
  content: '\2014';
  position: absolute;
  left: 0;
  top: 0;
  color: var(--color-accent);
  font-weight: 700;
}

.fun-fact p {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 16px;
  line-height: 1.7;
  text-align: left;
  color: var(--color-text-secondary);
  margin-bottom: 0;
}

/* --- glossary-term --- */
.glossary-term {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 1.5em 0;
}

.glossary-term p {
  margin-bottom: 0;
  text-align: left;
}

.glossary-term p:first-child {
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--color-accent);
  text-decoration: underline;
  text-decoration-style: dashed;
  text-underline-offset: 4px;
  text-decoration-color: var(--color-accent);
  white-space: nowrap;
  flex-shrink: 0;
}

.glossary-term p:first-child strong {
  font-family: var(--font-mono);
  font-weight: 400;
  color: var(--color-accent);
}

.glossary-term p:last-child {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--color-text-secondary);
}

/* --- dos-donts --- */
.dos-donts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 2em 0;
}

.dos-donts > div {
  background-color: #FAFAFA;
  padding: 24px;
  border-radius: 6px;
}

@media (prefers-color-scheme: dark) {
  .dos-donts > div {
    background-color: var(--color-surface);
  }
}

.dos-donts > div:first-child {
  border-top: 3px solid var(--color-success);
}

.dos-donts > div:last-child {
  border-top: 3px solid var(--color-danger);
}

.dos-donts > div p {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-align: left;
  margin-bottom: 12px;
}

.dos-donts > div p strong {
  font-family: var(--font-display);
  font-weight: 600;
}

.dos-donts > div:first-child p {
  color: var(--color-success);
}

.dos-donts > div:last-child p {
  color: var(--color-danger);
}

.dos-donts > div ul {
  list-style: none;
  padding-left: 0;
}

.dos-donts > div li {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.65;
  text-align: left;
  color: var(--color-text);
  padding-left: 1.5em;
  position: relative;
  margin-bottom: 10px;
}

.dos-donts > div:first-child li::before {
  content: '\2713';
  position: absolute;
  left: 0;
  color: var(--color-success);
  font-weight: 700;
}

.dos-donts > div:last-child li::before {
  content: '\2717';
  position: absolute;
  left: 0;
  color: var(--color-danger);
  font-weight: 700;
}

/* --- pre-game-checklist --- */
.pre-game-checklist {
  margin: 2em 0;
}

.pre-game-checklist p {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-accent);
  text-align: left;
  margin-bottom: 16px;
}

.pre-game-checklist p strong {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--color-accent);
}

.pre-game-checklist ul {
  list-style: none;
  padding-left: 32px;
  border-left: 2px solid var(--color-border);
}

.pre-game-checklist li {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  text-align: left;
  color: var(--color-text);
  position: relative;
  padding-left: 28px;
  margin-bottom: 14px;
}

.pre-game-checklist li::before {
  content: '\2610';
  position: absolute;
  left: -16px;
  top: 0;
  font-size: 18px;
  color: var(--color-accent);
  background-color: var(--color-bg);
  padding: 0 4px;
}

/* --- at-a-glance --- */
.at-a-glance {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin: 2em 0;
}

.at-a-glance > div {
  padding: 20px 24px;
  border-right: 1px solid var(--color-border);
}

.at-a-glance > div:last-child {
  border-right: none;
}

.at-a-glance > div p:first-child {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  text-align: center;
  color: var(--color-text);
  margin-bottom: 8px;
}

.at-a-glance > div p {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  text-align: center;
  color: var(--color-text-secondary);
  margin-bottom: 0;
}

/* --- worked-example --- */
.worked-example {
  background-color: var(--color-surface);
  padding: 36px 32px;
  border-radius: 6px;
  margin: 2em 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.worked-example p {
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1.8;
  text-align: left;
  color: var(--color-text);
  margin-bottom: 12px;
}

.worked-example p:first-child {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-accent);
  text-align: left;
  margin-bottom: 16px;
}

.worked-example hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 16px 0;
}

.worked-example p:last-child {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--color-accent);
  text-align: left;
  margin-bottom: 0;
}

/* --- section-bridge --- */
.section-bridge {
  text-align: center;
  margin: 48px 0;
  position: relative;
  display: flex;
  align-items: center;
  gap: 20px;
}

.section-bridge::before,
.section-bridge::after {
  content: '';
  flex: 1;
  height: 1px;
  background-color: var(--color-border);
}

.section-bridge p {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 17px;
  text-align: center;
  color: var(--color-text-secondary);
  margin-bottom: 0;
  white-space: nowrap;
  flex-shrink: 0;
  max-width: 80%;
}

/* ============================================
   6. HERO SECTION
   ============================================ */
[data-content="hero"] {
  background: radial-gradient(ellipse at 50% 30%, rgba(0,135,90,0.10) 0%, transparent 70%);
  padding: clamp(48px, 8vw, 100px) 24px clamp(32px, 5vw, 60px);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

@media (prefers-color-scheme: dark) {
  [data-content="hero"] {
    background: radial-gradient(ellipse at 50% 30%, rgba(52,211,153,0.08) 0%, transparent 70%);
  }
}

.hero-rubric {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 20px;
}

[data-content="hero"] h1 {
  max-width: 800px;
  margin-bottom: 20px;
}

.hero-subtitle {
  font-family: var(--font-body);
  font-style: italic;
  font-size: clamp(16px, 2.2vw, 20px);
  line-height: 1.5;
  color: var(--color-text-secondary);
  max-width: 600px;
  text-align: center;
  margin-bottom: 24px;
}

.hero-divider {
  width: 60px;
  height: 3px;
  background-color: var(--color-accent);
  border: none;
  margin: 0 auto 24px;
}

.hero-meta {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-bottom: 32px;
}

.hero-meta .updated-badge {
  display: inline-block;
  border: 1px solid var(--color-border);
  border-radius: 3px;
  padding: 2px 10px;
  font-size: 12px;
  letter-spacing: 0.03em;
  margin-left: 8px;
}

[data-content="hero"] figure {
  max-width: var(--content-width);
  width: 100%;
  margin: 0 auto;
}

.hero-image {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 4px;
}

[data-content="hero"] figcaption {
  text-align: center;
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-top: 8px;
}

/* ============================================
   7. TOC SIDEBAR
   ============================================ */
.toc-nav {
  font-family: var(--font-display);
}

.toc-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-secondary);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
}

.toc-nav > ul {
  list-style: none;
  padding-left: 0;
  margin-bottom: 0;
}

.toc-nav > ul > li {
  margin-bottom: 6px;
}

.toc-nav > ul > li > a {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
  line-height: 1.4;
  display: block;
  padding: 4px 0;
  transition: color 0.2s ease;
}

.toc-nav > ul > li > a:hover {
  color: var(--color-accent);
}

.toc-nav > ul > li > a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.toc-nav ul ul {
  list-style: none;
  padding-left: 14px;
  margin-top: 4px;
  margin-bottom: 8px;
}

.toc-nav ul ul li {
  margin-bottom: 3px;
}

.toc-nav ul ul a {
  font-size: 13px;
  font-weight: 400;
  color: var(--color-text-secondary);
  text-decoration: none;
  display: block;
  padding: 2px 0;
  transition: color 0.2s ease;
}

.toc-nav ul ul a:hover {
  color: var(--color-accent);
}

/* ============================================
   8. FAQ ACCORDION
   ============================================ */
[data-content="faq"] details {
  border-bottom: 1px solid var(--color-border);
  interpolate-size: allow-keywords;
}

[data-content="faq"] summary {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 18px;
  line-height: 1.5;
  padding: 20px 40px 20px 0;
  cursor: pointer;
  list-style: none;
  position: relative;
  color: var(--color-text);
  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: 50%;
  transform: translateY(-50%);
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
  color: var(--color-accent);
  transition: transform 0.3s ease;
}

[data-content="faq"] details[open] summary::after {
  transform: translateY(-50%) rotate(45deg);
}

[data-content="faq"] summary:hover {
  color: var(--color-accent);
}

[data-content="faq"] summary:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 2px;
}

[data-content="faq"] details::details-content {
  opacity: 0;
  block-size: 0;
  overflow: hidden;
  transition: opacity 0.3s ease, block-size 0.3s ease, content-visibility 0.3s ease allow-discrete;
}

[data-content="faq"] details[open]::details-content {
  opacity: 1;
  block-size: auto;
}

[data-content="faq"] details div p {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  text-align: left;
  color: var(--color-text);
  padding-bottom: 20px;
}

@supports not selector(::details-content) {
  [data-content="faq"] details[open] > *:not(summary) {
    animation: faq-fade-in 0.3s ease forwards;
  }
  @keyframes faq-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
  }
}

/* ============================================
   9. NAV BUTTONS
   ============================================ */
.nav-btn {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--color-bg);
  background-color: var(--color-accent);
  padding: 10px 24px;
  border-radius: 4px;
  transition: background-color 0.2s ease, transform 0.15s ease;
}

.nav-btn:hover {
  background-color: var(--color-accent-hover);
  color: var(--color-bg);
  transform: translateY(-1px);
}

.nav-btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 100;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--color-text-secondary);
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  padding: 8px 14px;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: opacity 0.2s ease, transform 0.15s ease;
  opacity: 0.85;
}

.back-to-top:hover {
  opacity: 1;
  transform: translateY(-2px);
  color: var(--color-accent);
}

/* ============================================
   10. ARTICLE IMAGES
   ============================================ */
.article-image {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
}

[data-content] figure {
  margin: 2em auto;
  max-width: 100%;
}


/* ============================================
   12. RESPONSIVE
   ============================================ */
@media (max-width: 1100px) {
  main {
    grid-template-columns: 200px 1fr;
    gap: 0 24px;
  }
  :root {
    --sidebar-width: 200px;
  }
}

@media (max-width: 900px) {
  main {
    display: block;
  }

  [data-content] {
    max-width: 100%;
    padding: 0 20px;
  }

  [data-content="toc"] {
    position: static;
    max-height: none;
    overflow-y: visible;
    padding: 20px;
    margin-bottom: 40px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background-color: var(--color-surface);
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .dos-donts {
    grid-template-columns: 1fr;
  }

  .comparison {
    grid-template-columns: 1fr;
  }

  .at-a-glance {
    grid-template-columns: 1fr;
  }

  .at-a-glance > div {
    border-right: none;
    border-bottom: 1px solid var(--color-border);
    padding: 16px 0;
  }

  .at-a-glance > div:last-child {
    border-bottom: none;
  }

  .glossary-term {
    flex-direction: column;
    gap: 4px;
  }

  .section-bridge p {
    white-space: normal;
    max-width: 100%;
  }

  .back-to-top {
    bottom: 16px;
    right: 16px;
  }

  :root {
    --section-gap: 56px;
  }
}

@media (max-width: 500px) {
  :root {
    --section-gap: 40px;
  }

  [data-content="hero"] {
    padding: 32px 16px 24px;
  }

  .hero-subtitle {
    font-size: 16px;
  }
}

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

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

.top-navigation-bar {
    max-width: var(--wide-width, 1100px);
    margin: 0 auto;
    padding: 15px var(--component-padding, 24px);
    display: flex;
    align-items: center;
    justify-content: flex-end; /* Keep mobile burger on the right */
}

/* --- DESKTOP MENU --- */
.site-nav--desktop {
    display: none; /* Hidden on mobile by default */
}

@media (min-width: 769px) {
    .top-navigation-bar {
        justify-content: center; /* Center the desktop menu */
    }

    .site-nav--desktop {
        display: block;
    }
    .mobile-controls {
        display: none; /* Hide burger on desktop */
    }
    
    .menu-desktop {
        display: flex;
        gap: 30px;
        list-style: none;
        margin: 0;
        padding: 0;
    }
    
    .menu-desktop a {
        text-decoration: none;
        color: var(--color-text);
        font-family: var(--font-body, sans-serif);
        font-weight: 500;
        font-size: 16px;
        transition: color 0.2s ease;
    }
    
    .menu-desktop a:hover {
        color: var(--color-accent);
    }
}

/* --- 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);
    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%; /* Hidden off-screen */
    width: 85%;
    max-width: 400px;
    height: 100vh;
    background-color: var(--color-bg);
    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; /* Slide in */
}

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

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

.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);
    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);
    padding-left: 10px; /* Nice slide effect on hover */
}

/* --- 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); /* Beautiful blur effect */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s;
    z-index: 998;
}

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


/* Center content globally on pages without the TOC sidebar */
main:not(:has([data-content="toc"])) {
  display: block;
}

/* Ensure content blocks are centered and no longer forced into the second grid column */
main:not(:has([data-content="toc"])) [data-content] {
  margin-left: auto;
  margin-right: auto;
  grid-column: auto; 
}


/* =========================================
   FOOTER STYLES (Dark Theme & Green Accent)
   ========================================= */
.site-footer {
    background-color: #111111; /* Very dark background */
    color: #a3a3a3; /* Neutral gray text */
    padding: 60px 20px 20px;
    font-family: inherit;
    border-top: 1px solid #222222;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    margin-bottom: 50px;
}

/* Tablet layout */
@media (min-width: 768px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop layout */
@media (min-width: 1024px) {
    .footer-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 30px;
    }
}

.footer-title {
    color: #eaeaea;
    font-size: 1.05rem;
    margin-bottom: 20px;
    margin-top: 0;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-list li {
    margin-bottom: 12px;
    font-size: 0.9rem;
    line-height: 1.6;
    position: relative;
}

/* Bullets matching the green links */
.footer-list.custom-bullets li {
    padding-left: 15px;
}
.footer-list.custom-bullets li::before {
    content: "•";
    color: #00a859; /* Green accent color matching the screenshot */
    position: absolute;
    left: 0;
    top: 0;
    font-weight: bold;
}

.footer-list a {
    color: #00a859; /* Green links by default to match the sidebar */
    text-decoration: none;
    transition: color 0.2s ease, transform 0.2s ease;
    display: inline-block;
}

.footer-list a:hover {
    color: #00ff88; /* Brighter green on hover */
    text-decoration: underline;
}

/* Subtle slide-right effect for navigation links on hover */
.footer-list.links-list a:hover {
    transform: translateX(4px);
    text-decoration: none;
}

.footer-bottom {
    border-top: 1px solid #222222;
    padding-top: 25px;
    text-align: center;
    font-size: 0.85rem;
    color: #666666;
}

.footer-bottom p {
    margin: 0;
    text-align: center;
}