/* ========================================
   1. CSS VARIABLES & RESET
   ======================================== */
:root {
  /* Colors — Light */
  --color-bg: #FAFAFA;
  --color-text: #1A1A2E;
  --color-text-secondary: #6B7280;
  --color-accent: #E8524A;
  --color-surface: #F3F4F6;
  --color-border: #E5E7EB;
  --color-success: #059669;
  --color-danger: #DC2626;
  --color-bg-dark-block: #1A1A2E;
  --color-text-on-dark: #FAFAFA;

  /* Typography */
  --font-display: 'Oswald', sans-serif;
  --font-body: 'Source Sans 3', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Sizes */
  --body-size: 18px;
  --body-lh: 1.7;
  --h1-size: clamp(32px, 5vw, 56px);
  --h2-size: clamp(26px, 3vw, 36px);
  --h3-size: clamp(20px, 2.2vw, 24px);
  --content-width: 780px;
  --component-width: 720px;
  --section-gap: 80px;

  /* Misc */
  --radius-sm: 0px;
  --shadow-component: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --transition-base: 0.25s ease;

    /* --- AUTO-FORCED DARK THEME --- */
    --color-bg: #0F0F1A;
    --color-text: #E8E8EC;
    --color-text-secondary: #9CA3AF;
    --color-accent: #E8524A;
    --color-surface: #1A1A2E;
    --color-border: #2D2D44;
    --color-success: #34D399;
    --color-danger: #F87171;
    --color-bg-dark-block: #1A1A2E;
    --color-text-on-dark: #E8E8EC;
    --shadow-component: 0 1px 3px rgba(0,0,0,0.2), 0 1px 2px rgba(0,0,0,0.15);
}



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

html {
  font-size: 100%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  interpolate-size: allow-keywords;
}

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

img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-accent); text-decoration: underline; text-underline-offset: 3px; transition: opacity var(--transition-base); }
a:hover { opacity: 0.8; }
a:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; border-radius: 2px; }

/* ========================================
   2. GENERAL TYPOGRAPHY
   ======================================== */
p {
  text-align: left;
  margin-bottom: 1.25em;
  color: var(--color-text);
}

h1 {
  font-family: var(--font-display);
  font-size: var(--h1-size);
  font-weight: 700;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text);
}

h2 {
  font-family: var(--font-display);
  font-size: var(--h2-size);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--color-text);
  text-align: left;
  margin-bottom: 24px;
  scroll-margin-top: 2rem;
}

h3 {
  font-family: var(--font-body);
  font-size: var(--h3-size);
  font-weight: 600;
  line-height: 1.3;
  color: var(--color-text);
  text-align: left;
  margin-bottom: 16px;
  scroll-margin-top: 2rem;
}

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: 20px;
  margin: 1.5em 0;
  color: var(--color-text-secondary);
  font-style: italic;
}

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);
  color: var(--color-text);
}

th {
  font-weight: 600;
  font-family: var(--font-body);
  background-color: var(--color-surface);
}

figure {
  margin: 1.5em auto;
  max-width: 100%;
}

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

hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 2em 0;
}

/* ========================================
   3. LAYOUT — SECTIONS
   ======================================== */
header {
  padding: 0;
  margin: 0;
}

main {
  width: 100%;
}

[data-content] {
  max-width: var(--content-width);
  padding: 0 20px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: var(--section-gap);
  grid-column: 2;
}

[data-content="hero"] {
  max-width: 100%;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  padding: 0;
  grid-column: 1 / -1;
}

[data-content="toc"] {
  grid-column: 1;
  grid-row: 2 / span 100;
  /* max-width: 220px; */
  padding: 0 0 0 20px;
  margin: 2rem auto;
  top: 2rem;
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
  align-self: start;
  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; }

/* ========================================
   4. VISUAL COMPONENTS
   ======================================== */

/* --- info-box --- */
.info-box {
  background-color: var(--color-surface);
  border-left: 4px solid var(--color-accent);
  padding: 24px 28px;
  margin: 1.5em 0;
  box-shadow: var(--shadow-component);
}

.info-box::before {
  content: 'INFO';
  display: block;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-accent);
  margin-bottom: 10px;
}

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

/* --- calc-example --- */
.calc-example {
  background-color: var(--color-bg-dark-block);
  color: var(--color-text-on-dark);
  padding: 32px;
  margin: 1.5em 0;
  box-shadow: var(--shadow-component);
}

@media (prefers-color-scheme: dark) {
  .calc-example {
    background-color: #12121E;
    color: #E8E8EC;
    border: 1px solid var(--color-border);
  }
  .calc-example p,
  .calc-example td,
  .calc-example th,
  .calc-example strong {
    color: #E8E8EC;
  }
}

.calc-example::before {
  content: 'CALCULATION';
  display: block;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-accent);
  margin-bottom: 16px;
}

.calc-example p {
  text-align: left;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--color-text-on-dark);
  margin-bottom: 1em;
}

.calc-example table {
  width: 100%;
  margin: 0;
}

.calc-example th,
.calc-example td {
  color: var(--color-text-on-dark);
  border-bottom-color: rgba(255,255,255,0.15);
  background-color: transparent;
  font-family: var(--font-mono);
  font-size: 15px;
  padding: 10px 14px;
}

.calc-example th {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-on-dark);
}

/* --- callout --- */
.callout {
  background-color: transparent;
  border: 2px solid var(--color-accent);
  padding: 24px 28px;
  margin: 1.5em 0;
}

.callout p {
  text-align: left;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0;
}

/* --- card-grid --- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin: 1.5em 0;
}

.card-grid > div {
  background-color: var(--color-surface);
  padding: 24px;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-component);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

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

.card-grid > div p {
  text-align: left;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--color-text);
  margin-bottom: 0;
}

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

.comparison > div {
  background-color: var(--color-surface);
  padding: 24px;
  border-top: 3px solid var(--color-accent);
  box-shadow: var(--shadow-component);
}

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

.comparison > div strong {
  display: block;
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--color-text);
  margin-bottom: 8px;
}

/* --- key-takeaway --- */
.key-takeaway {
  border-top: 3px solid var(--color-text);
  padding-top: 16px;
  margin: 2em 0;
}

.key-takeaway p {
  text-align: left;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--color-text);
  margin-bottom: 0;
}

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

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

.fun-fact p {
  text-align: left;
  font-family: var(--font-body);
  font-size: 16px;
  font-style: italic;
  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;
}

.glossary-term strong,
.glossary-term a {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--color-text);
  text-decoration: underline;
  text-underline-offset: 4px;
}

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

/* --- dos-donts --- */
.dos-donts {
  display: flex;
  gap: 24px;
  margin: 1.5em 0;
}

.dos-donts > div {
  flex: 1;
  background-color: var(--color-surface);
  padding: 24px;
  box-shadow: var(--shadow-component);
}

.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 strong {
  display: block;
  font-family: var(--font-display);
  font-size: 18px;
  margin-bottom: 12px;
}

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

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

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

.dos-donts li {
  text-align: left;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--color-text);
  padding: 8px 0;
  padding-left: 24px;
  position: relative;
}

.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.06em;
  color: var(--color-accent);
  margin-bottom: 16px;
  text-align: left;
}

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

.pre-game-checklist li {
  text-align: left;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--color-text);
  padding: 12px 0;
  position: relative;
}

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

/* --- at-a-glance --- */
.at-a-glance {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin: 1.5em 0;
  border: 1px solid var(--color-border);
}

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

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

.at-a-glance > div strong {
  display: block;
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--color-text);
  margin-bottom: 8px;
}

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

/* --- worked-example --- */
.worked-example {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: 32px;
  margin: 1.5em 0;
  box-shadow: var(--shadow-component);
}

.worked-example::before {
  content: 'WORKED EXAMPLE';
  display: block;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-accent);
  margin-bottom: 16px;
}

.worked-example p {
  text-align: left;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--color-text);
  margin-bottom: 0.8em;
}

.worked-example p + p::before {
  content: '\2192  ';
  color: var(--color-accent);
  font-size: 20px;
}

.worked-example p:last-child {
  font-weight: 600;
  font-size: 18px;
  color: var(--color-accent);
  margin-bottom: 0;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
}

.worked-example p:last-child::before {
  content: none;
}

/* --- section-bridge --- */
.section-bridge {
  text-align: center;
  padding: 16px 0;
  margin: 2em 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.section-bridge p {
  text-align: center;
  font-family: var(--font-body);
  font-size: 16px;
  font-style: italic;
  color: var(--color-text-secondary);
  margin-bottom: 0;
}

/* ========================================
   5. HERO SECTION
   ======================================== */
[data-content="hero"] {
  position: relative;
  background-color: var(--color-bg);
  padding: 80px 20px 60px;
  text-align: center;
  overflow: hidden;
}

[data-content="hero"]::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 60% at 50% 40%, rgba(232,82,74,0.08), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

[data-content="hero"]::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200' viewBox='0 0 200 200'%3E%3Ccircle cx='30' cy='40' r='6' fill='none' stroke='%23E8524A' stroke-width='1' opacity='0.06'/%3E%3Ccircle cx='120' cy='25' r='4' fill='none' stroke='%23E8524A' stroke-width='1' opacity='0.06'/%3E%3Ccircle cx='170' cy='80' r='3' fill='none' stroke='%23E8524A' stroke-width='1' opacity='0.06'/%3E%3Ccircle cx='55' cy='130' r='5' fill='none' stroke='%23E8524A' stroke-width='1' opacity='0.06'/%3E%3Ccircle cx='145' cy='160' r='4' fill='none' stroke='%23E8524A' stroke-width='1' opacity='0.06'/%3E%3Ccircle cx='90' cy='90' r='6' fill='none' stroke='%23E8524A' stroke-width='1' opacity='0.06'/%3E%3Ccircle cx='20' cy='180' r='3' fill='none' stroke='%23E8524A' stroke-width='1' opacity='0.06'/%3E%3Ccircle cx='180' cy='140' r='5' fill='none' stroke='%23E8524A' stroke-width='1' opacity='0.06'/%3E%3C/svg%3E");
  background-repeat: repeat;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 20%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 20%, transparent 80%);
  pointer-events: none;
  z-index: 0;
  opacity: 1;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
}

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

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

.hero-subtitle {
  font-family: var(--font-body);
  font-size: clamp(17px, 2vw, 20px);
  font-weight: 400;
  color: var(--color-text-secondary);
  max-width: 600px;
  margin: 0 auto 28px;
  text-align: center;
  line-height: 1.5;
}

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

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

.hero-meta .badge {
  display: inline-block;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-left: 12px;
}

[data-content="hero"] figure {
  max-width: 960px;
  margin: 0 auto;
}

[data-content="hero"] figure img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

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

/* ========================================
   5b. TOC — Sticky Sidebar
   ======================================== */
[data-content="toc"] nav {
  font-family: var(--font-body);
}

.toc-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-secondary);
  margin-bottom: 16px;
}

[data-content="toc"] ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

[data-content="toc"] > nav > ul > li {
  margin-bottom: 12px;
}

[data-content="toc"] > nav > ul > li > a {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
  line-height: 1.4;
  display: block;
  transition: color var(--transition-base);
}

[data-content="toc"] > nav > ul > li > a:hover {
  color: var(--color-accent);
  opacity: 1;
}

[data-content="toc"] ul ul {
  padding-left: 12px;
  margin-top: 6px;
}

[data-content="toc"] ul ul li {
  margin-bottom: 6px;
}

[data-content="toc"] ul ul a {
  font-size: 13px;
  font-weight: 400;
  color: var(--color-text-secondary);
  text-decoration: none;
  line-height: 1.4;
  display: block;
  transition: color var(--transition-base);
}

[data-content="toc"] ul ul a:hover {
  color: var(--color-accent);
  opacity: 1;
}

/* ========================================
   6. FAQ ACCORDION
   ======================================== */
details {
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 0;
  overflow-anchor: none;
  overflow-x: hidden;
}

summary {
  text-align: left;
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
  padding: 20px 40px 20px 0;
  position: relative;
  list-style: none;
  transition: color var(--transition-base);
  box-sizing: border-box;
  max-width: 100%;
}

summary::-webkit-details-marker { display: none; }
summary::marker { content: ''; }

summary::after {
  content: '+';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 24px;
  font-weight: 300;
  color: var(--color-text-secondary);
  transition: transform var(--transition-base);
}

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

summary:hover { color: var(--color-accent); }
summary:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }

/* Modern details animation */
::details-content {
  transition: opacity 0.3s ease, block-size 0.3s ease, content-visibility 0.3s ease allow-discrete;
  opacity: 0;
  block-size: 0;
  overflow: clip;
  will-change: block-size, opacity;
  overflow-wrap: break-word;
  word-break: break-word;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

details[open]::details-content {
  opacity: 1;
  block-size: auto;
}

[data-content="faq"] {
  width: 100%;
  max-width: var(--content-width);
  box-sizing: border-box;
}

[data-content="faq"] details {
  width: 100%;
  box-sizing: border-box;
}

[data-content="faq"] summary {
  width: 100%;
  box-sizing: border-box;
}

[data-content="faq"] div[itemscope] {
  width: 100%;
  box-sizing: border-box;
}

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

details div p {
  text-align: left;
  padding: 0 0 20px 0;
  color: var(--color-text);
  font-size: 16px;
  line-height: 1.7;
  overflow-wrap: break-word;
  word-break: break-word;
}

/* ========================================
   7. IMAGES
   ======================================== */
.hero-image {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.article-image {
  max-width: 100%;
  height: auto;
  display: block;
  loading: lazy;
}

/* ========================================
   8. BACK TO TOP
   ======================================== */
.back-to-top {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-decoration: none;
  letter-spacing: 0.04em;
  padding: 10px 20px;
  border: 1px solid var(--color-border);
  transition: color var(--transition-base), border-color var(--transition-base), transform var(--transition-base);
  text-align: center;
}

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


/* ========================================
   10. MEDIA QUERIES
   ======================================== */
@media (max-width: 900px) {
  main {
    display: block;
  }

  [data-content="toc"] {
    position: static;
    max-width: var(--content-width);
    max-height: none;
    overflow-y: visible;
    padding: 0 20px;
    margin: 0 auto var(--section-gap);
    grid-column: unset;
    grid-row: unset;
  }

  [data-content] {
    grid-column: unset;
  }

  [data-content="hero"] {
    width: 100%;
    margin-left: 0;
    padding: 60px 20px 40px;
  }

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

  .dos-donts {
    flex-direction: column;
  }

  .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);
  }

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

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

  table {
    font-size: 14px;
  }

  th, td {
    padding: 8px 10px;
  }
}

@media (max-width: 600px) {
  :root {
    --section-gap: 48px;
    --body-size: 16px;
  }

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

  .calc-example,
  .worked-example {
    padding: 20px;
  }

  .info-box {
    padding: 20px;
  }
}

/* =========================================
   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;
}

/* =========================================
   FOOTER STYLES (Dark Navy & Deep Red Accent)
   ========================================= */
.site-footer {
    background-color: #0d0f17; /* Very dark navy/indigo background */
    color: #9ba0a8; /* Muted text color */
    padding: 60px 20px 20px;
    font-family: inherit;
    border-top: 1px solid #1a1c26;
}

.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: #e5e7eb;
    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 red links */
.footer-list.custom-bullets li {
    padding-left: 15px;
}
.footer-list.custom-bullets li::before {
    content: "•";
    color: #c93b3b; /* Deep red accent color matching the screenshot */
    position: absolute;
    left: 0;
    top: 0;
    font-weight: bold;
}

.footer-list a {
    color: #c93b3b; /* Red links */
    text-decoration: none;
    transition: color 0.2s ease, transform 0.2s ease;
    display: inline-block;
}

.footer-list a:hover {
    color: #f25555; /* Brighter red 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 #1a1c26;
    padding-top: 25px;
    text-align: center;
    font-size: 0.85rem;
    color: #6b7280;
}

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