/* ─── 1. CSS VARIABLES & RESET ─────────────────────────────────────────── */
:root {
  /* Colors — light mode */
  --color-bg:           #f5f7fa;
  --color-surface:      #ffffff;
  --color-surface-2:    #eef1f6;
  --color-border:       #d4dae6;
  --color-text:         #0d1120;
  --color-text-2:       #4a5568;
  --color-text-muted:   #8892a7;

  /* Brand / accent (same in both modes — they're strong enough) */
  --color-primary:      #0A0E27;
  --color-accent:       #F7931A;
  --color-accent-dim:   rgba(247,147,26,0.12);
  --color-teal:         #00D4AA;
  --color-teal-dim:     rgba(0,212,170,0.10);
  --color-slate:        #1A1F3A;
  --color-success:      #10B981;
  --color-success-dim:  rgba(16,185,129,0.10);
  --color-warning:      #FBBF24;
  --color-warning-dim:  rgba(251,191,36,0.10);
  --color-danger:       #ef4444;
  --color-danger-dim:   rgba(239,68,68,0.10);

  /* Typography */
  --font-display:  'Space Grotesk', 'Inter', sans-serif;
  --font-body:     'Inter', sans-serif;
  --font-mono:     'JetBrains Mono', monospace;

  /* Sizing */
  --max-text:      840px;
  --section-gap:   5rem;
  --component-radius: 8px;

    /* --- AUTO-FORCED DARK THEME --- */
    --color-bg:         #070a1a;
    --color-surface:    #0f1430;
    --color-surface-2:  #1A1F3A;
    --color-border:     #2a3152;
    --color-text:       #E8ECF1;
    --color-text-2:     #a8b3c8;
    --color-text-muted: #8892a7;
}



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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  font-size: clamp(0.95rem, 1.5vw, 1.125rem);
  line-height: 1.7;
  background: var(--color-bg);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
}

/* ─── 2. GLOBAL TYPOGRAPHY ─────────────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.2;
  text-align: left;
  color: var(--color-text);
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 700;
  scroll-margin-top: 2rem;
}

h3 {
  font-size: clamp(1.15rem, 2vw, 1.5rem);
  font-weight: 600;
  scroll-margin-top: 2rem;
}

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

p:last-child { margin-bottom: 0; }

ul, ol {
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
}

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

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

blockquote {
  border-left: 3px solid var(--color-teal);
  padding: 0.75rem 1.25rem;
  margin: 1.5rem 0;
  color: var(--color-text-2);
  font-style: italic;
  text-align: left;
}

a {
  color: var(--color-teal);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: opacity 0.2s;
}
a:hover { opacity: 0.75; }
a:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 3px; border-radius: 2px; }

figure {
  margin: 2rem auto;
  max-width: 100%;
}
figcaption {
  text-align: center;
  font-size: clamp(0.75rem, 1vw, 0.875rem);
  color: var(--color-text-muted);
  margin-top: 0.5rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 1.5rem 0;
}
th {
  background: var(--color-surface-2);
  color: var(--color-text);
  font-weight: 600;
  padding: 0.65rem 0.875rem;
  text-align: left;
  border-bottom: 2px solid var(--color-border);
}
td {
  padding: 0.6rem 0.875rem;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  color: var(--color-text);
}
tr:nth-child(even) td { background: var(--color-surface-2); }
tr:hover td { background: var(--color-teal-dim); transition: background 0.2s; }

details { margin: 1rem 0; }
summary {
  cursor: pointer;
  list-style: none;
  user-select: none;
}
summary::-webkit-details-marker { display: none; }

code {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  background: var(--color-surface-2);
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

/* ─── 3. LAYOUT — SECTIONS ─────────────────────────────────────────────── */
.site-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 2rem;
  background: var(--color-primary);
  position: relative;
  z-index: 10;
  min-height: 0;
}
header:empty { display: none; }

main {
  width: 100%;
  max-width: none;
}


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

[data-content]:last-of-type {
  padding-bottom: var(--section-gap);
}

[data-content] > h2 {
  margin-bottom: 1.75rem;
  margin-top: 0;
}
[data-content] > h3 {
  margin-top: 2rem;
  margin-bottom: 1rem;
}

/* Images */
.hero-image {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}
.article-image {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  loading: lazy;
}

/* ─── 4. COMPONENTS ─────────────────────────────────────────────────────── */

/* .info-box */
.info-box {
  background: var(--color-surface);
  border-left: 4px solid var(--color-teal);
  border-radius: var(--component-radius);
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.info-box p {
  color: var(--color-text);
  text-align: left;
  margin-bottom: 0.75rem;
}
.info-box p:last-child { margin-bottom: 0; }
.info-box strong { color: var(--color-teal); }

/* .callout — generic */
.callout {
  border-radius: var(--component-radius);
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.callout p { text-align: left; margin-bottom: 0.75rem; }
.callout p:last-child { margin-bottom: 0; }

/* .callout-warning */
.callout-warning {
  background: var(--color-warning-dim);
  border: 1px solid var(--color-warning);
}
.callout-warning p { color: var(--color-text); }

/* .callout-legal */
.callout-legal {
  background: var(--color-success-dim);
  border: 1px solid var(--color-success);
}
.callout-legal p { color: var(--color-text); }

/* .key-takeaway */
.key-takeaway {
  border-top: 2px solid var(--color-accent);
  padding-top: 1rem;
  margin: 2.5rem 0 1.5rem;
}
.key-takeaway p {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  font-weight: 600;
  color: var(--color-text);
  text-align: left;
  line-height: 1.4;
  margin-bottom: 0;
}

/* .fun-fact */
.fun-fact {
  position: relative;
  padding-left: 1.5rem;
  margin: 1.5rem 0;
}
.fun-fact::before {
  content: '—';
  position: absolute;
  left: 0;
  top: 0;
  color: var(--color-accent);
  font-weight: 700;
}
.fun-fact p {
  font-style: italic;
  color: var(--color-text-2);
  text-align: left;
  margin-bottom: 0;
}

/* .glossary-term */
.glossary-term {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0.75rem 0;
}
.glossary-term .term {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
  flex-shrink: 0;
}
.glossary-term .definition {
  color: var(--color-text-2);
  font-size: 0.9rem;
  text-align: left;
}

/* .dos-donts */
.dos-donts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--color-border);
  border-radius: var(--component-radius);
  overflow: hidden;
  margin: 2rem 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}
.dos-donts .dos,
.dos-donts .donts {
  padding: 1.25rem 1.5rem;
  background: var(--color-surface);
}
.dos-donts .dos h4 {
  color: var(--color-success);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.875rem;
}
.dos-donts .donts h4 {
  color: var(--color-danger);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.875rem;
}
.dos-donts ul { padding-left: 1.1rem; margin-bottom: 0; }
.dos-donts li { font-size: 0.9rem; color: var(--color-text); margin-bottom: 0.35rem; text-align: left; }
.dos-donts .dos li::marker { color: var(--color-success); }
.dos-donts .donts li::marker { color: var(--color-danger); }

/* .pre-bet-checklist */
.pre-bet-checklist {
  margin: 2rem 0;
  padding-left: 0;
}
.pre-bet-checklist > p:first-child,
.pre-bet-checklist > strong:first-child {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 1rem;
  display: block;
  text-align: left;
}
.pre-bet-checklist ul {
  list-style: none;
  padding-left: 0;
  border-left: 2px solid var(--color-border);
  padding-left: 1.5rem;
  margin-bottom: 0;
}
.pre-bet-checklist li {
  position: relative;
  padding-left: 1.75rem;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  color: var(--color-text);
  text-align: left;
}
.pre-bet-checklist li::before {
  content: '☐';
  position: absolute;
  left: -0.1rem;
  top: 0;
  color: var(--color-accent);
  font-size: 1rem;
  background: var(--color-bg);
  line-height: 1.5;
}

/* .at-a-glance */
.at-a-glance {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  background: var(--color-border);
  border-radius: var(--component-radius);
  overflow: hidden;
  margin: 2rem 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}
.at-a-glance .cell {
  background: var(--color-surface);
  padding: 1.25rem 1.5rem;
  border-right: 1px solid var(--color-border);
}
.at-a-glance .cell:last-child { border-right: none; }
.at-a-glance .cell-value {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.5vw, 1.75rem);
  font-weight: 700;
  color: var(--color-accent);
  line-height: 1.1;
  margin-bottom: 0.375rem;
}
.at-a-glance .cell-label {
  font-size: 0.8rem;
  color: var(--color-text-2);
  text-align: left;
}

/* .worked-example */
.worked-example {
  background: var(--color-surface);
  border-radius: var(--component-radius);
  padding: 1.75rem;
  margin: 2rem 0;
  box-shadow: 0 2px 12px rgba(0,0,0,0.09);
}
.worked-example p { color: var(--color-text); text-align: left; margin-bottom: 0.75rem; }
.worked-example p:last-child { margin-bottom: 0; }
.worked-example .step {
  border-top: 1px dashed var(--color-border);
  padding-top: 0.875rem;
  margin-top: 0.875rem;
}
.worked-example .step-num {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--color-teal);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}
.worked-example .result {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--color-accent);
  font-weight: 700;
}

/* .section-bridge */
.section-bridge {
  text-align: center;
  margin: 2.5rem 0 1rem;
}
.section-bridge p {
  font-style: italic;
  color: var(--color-text-2);
  font-size: 0.95rem;
  text-align: center;
  display: inline-block;
  position: relative;
}
.section-bridge p::before,
.section-bridge p::after {
  content: '—';
  color: var(--color-accent);
  margin: 0 0.5em;
}

/* .tldr */
.tldr {
  background: var(--color-surface);
  border-left: 4px solid var(--color-accent);
  border-radius: var(--component-radius);
  padding: 1.5rem 2rem;
  margin-top: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}
.tldr h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 1rem;
}
.tldr ul { margin-bottom: 0; }
.tldr li { font-size: 0.95rem; color: var(--color-text-2); margin-bottom: 0.5rem; text-align: left; }

/* .card-grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
  margin: 1.75rem 0;
}
.card-grid .card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--component-radius);
  padding: 1.25rem;
  transition: transform 0.2s, box-shadow 0.2s;
}
.card-grid .card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}
.card-grid .card h3 { font-size: 1rem; margin-bottom: 0.5rem; margin-top: 0; }
.card-grid .card p { font-size: 0.875rem; color: var(--color-text-2); margin-bottom: 0; text-align: left; }

/* .comparison */
.comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--color-border);
  border-radius: var(--component-radius);
  overflow: hidden;
  margin: 2rem 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}
.comparison .col {
  background: var(--color-surface);
  padding: 1.25rem 1.5rem;
}
.comparison .col h4 {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.875rem;
  color: var(--color-text-2);
}
.comparison .col:first-child h4 { color: var(--color-teal); }
.comparison .col:last-child h4  { color: var(--color-accent); }
.comparison .col p { font-size: 0.9rem; color: var(--color-text); text-align: left; margin-bottom: 0.5rem; }
.comparison .col p:last-child { margin-bottom: 0; }

/* .odds-example */
.odds-example {
  background: var(--color-slate);
  border-radius: var(--component-radius);
  padding: 1.5rem;
  margin: 2rem 0;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
.odds-example p {
  text-align: center;
  color: #E8ECF1;
  margin-bottom: 0.5rem;
}
.odds-example p:last-child { margin-bottom: 0; }
.odds-example .odds-value {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  color: var(--color-accent);
  text-align: center;
  display: block;
  line-height: 1.1;
}
.odds-example .odds-label {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #8892a7;
  text-align: center;
  display: block;
  margin-bottom: 1rem;
}

@media (prefers-color-scheme: dark) {
  .odds-example {
    background: #10172e;
  }
  .odds-example p { color: #E8ECF1; }
  .comparison .col,
  .dos-donts .dos,
  .dos-donts .donts,
  .at-a-glance .cell,
  .card-grid .card,
  .worked-example {
    background: var(--color-surface);
  }
}

/* ─── 5. HERO SECTION ────────────────────────────────────────────────────── */
[data-content="hero"] {
  max-width: none;
  margin: 0;
  padding: 0;
  width: 100%;
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, #0A0E27 0%, #0e1535 50%, #111838 100%);
}

/* Blockchain grid pattern */
[data-content="hero"]::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,212,170,0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,212,170,0.08) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 70% at 50% 40%, black 0%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 40%, black 0%, transparent 80%);
  pointer-events: none;
}

/* Glow */
[data-content="hero"]::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 55% at 50% 35%, rgba(247,147,26,0.05) 0%, transparent 70%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: var(--max-text);
  margin: 0 auto;
  padding: 4.5rem 2rem 3.5rem;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.hero-date-badge {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #8892a7;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 0.35rem 0.875rem;
  border-radius: 999px;
}

.hero-trust {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-teal);
}

[data-content="hero"] h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 800;
  color: #ffffff;
  text-align: center;
  line-height: 1.15;
  margin-bottom: 1.25rem;
}

.hero-subtitle {
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8892a7;
  text-align: center;
  margin-bottom: 2.5rem;
}

.hero-cta {
  display: inline-block;
  background: var(--color-accent);
  color: #0A0E27;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.75rem 1.75rem;
  border-radius: 6px;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
  box-shadow: 0 4px 16px rgba(247,147,26,0.3);
}
.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(247,147,26,0.4);
  opacity: 1;
  color: #0A0E27;
}
.hero-cta:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

[data-content="hero"] figure {
  margin: 3rem auto 0;
  max-width: 900px;
  padding: 0 2rem;
}
[data-content="hero"] figure img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
[data-content="hero"] figure figcaption {
  color: #8892a7;
  font-size: 0.75rem;
  margin-top: 0.75rem;
  text-align: center;
}

/* ─── 6. SPECIFIC SECTIONS ───────────────────────────────────────────────── */

/* TL;DR */
[data-content="tldr"] {
  padding-top: 3rem;
}

/* TOC — 2-column grid */
[data-content="toc"] {
  padding-top: 3rem;
}
[data-content="toc"] h2 {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 1.25rem;
}
.toc-grid {
  column-count: 2;
  column-gap: 2.5rem;
}
.toc-section {
  break-inside: avoid;
  margin-bottom: 1.25rem;
}
.toc-section > a {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--color-text);
  text-decoration: none;
  margin-bottom: 0.35rem;
  transition: color 0.2s;
}
.toc-section > a:hover { color: var(--color-teal); }
.toc-subsections {
  list-style: none;
  padding: 0;
  margin: 0 0 0 0.75rem;
}
.toc-subsections li { margin-bottom: 0.2rem; }
.toc-subsections a {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.toc-subsections a:hover { color: var(--color-teal); }

/* FAQ accordion */
[data-content="faq"] details {
  border-bottom: 1px solid var(--color-border);
  padding: 0;
}
[data-content="faq"] details:first-of-type {
  border-top: 1px solid var(--color-border);
}
[data-content="faq"] summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.125rem 0;
  font-weight: 600;
  font-size: 0.975rem;
  color: var(--color-text);
  transition: color 0.2s;
  gap: 1rem;
}
[data-content="faq"] summary:hover { color: var(--color-teal); }
[data-content="faq"] summary::after {
  content: '+';
  font-size: 1.25rem;
  font-weight: 300;
  color: var(--color-teal);
  flex-shrink: 0;
  transition: transform 0.3s;
  line-height: 1;
}
[data-content="faq"] details[open] > summary::after {
  transform: rotate(45deg);
}
[data-content="faq"] details > div {
  padding: 0 0 1.25rem;
}
[data-content="faq"] details > div p {
  font-size: 0.925rem;
  color: var(--color-text-2);
  text-align: left;
  margin-bottom: 0;
}

/* Modern details animation */
@supports selector(::details-content) {
  [data-content="faq"] details {
    interpolate-size: allow-keywords;
  }
  [data-content="faq"] details::details-content {
    overflow: hidden;
    block-size: 0;
    opacity: 0;
    transition:
      block-size 0.35s ease,
      opacity 0.3s ease,
      content-visibility 0.35s ease allow-discrete;
  }
  [data-content="faq"] details[open]::details-content {
    block-size: auto;
    opacity: 1;
  }
}
/* Fallback */
@supports not selector(::details-content) {
  @keyframes faq-fade-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  [data-content="faq"] details[open] > *:not(summary) {
    animation: faq-fade-in 0.3s ease forwards;
  }
}

/* conclusion-cta button */
.btn-back-top {
  display: inline-block;
  margin-top: 2rem;
  background: transparent;
  color: var(--color-accent);
  border: 1px solid var(--color-accent);
  font-family: var(--font-display);
  font-size: 0.825rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.6rem 1.25rem;
  border-radius: 5px;
  text-decoration: none;
  transition: background 0.2s, color 0.2s, transform 0.2s;
}
.btn-back-top:hover {
  background: var(--color-accent);
  color: #0A0E27;
  transform: translateY(-1px);
}

/* ─── 7. MEDIA QUERIES ───────────────────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --section-gap: 3.5rem; }

  [data-content] { padding-left: 1.25rem; padding-right: 1.25rem; }

  .hero-inner { padding: 3rem 1.25rem 2.5rem; }

  .toc-grid {
    column-count: 1;
  }

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

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

  table { font-size: 0.8rem; }
  th, td { padding: 0.5rem 0.625rem; }
}

@media (max-width: 480px) {
  .at-a-glance { grid-template-columns: 1fr; }
  .at-a-glance .cell { border-right: none; border-bottom: 1px solid var(--color-border); }
  .at-a-glance .cell:last-child { border-bottom: none; }
}

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

/* Header Base */
.site-header {
    background-color: var(--color-bg);
    border-bottom: 1px solid var(--color-border, #333);
    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 img {
    max-height: 75px; /* Optimal height for most logos */
    width: auto !important; /* Prevents squishing */
    display: block;
    transition: transform 0.2s ease;
}

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

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

/* Desktop Grid Layout: Logo left, Menu center */
@media (min-width: 1024px) {
    .top-navigation-bar {
        max-width: 100%;
        padding: 15px 40px; /* Safe padding from screen edges */
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        align-items: center;
    }
    
    .site-logo {
        grid-column: 1;
        justify-self: start; /* Locks logo to the left edge */
        margin: 0;
    }

    .site-nav--desktop {
        display: block;
        grid-column: 2;
        justify-self: center; /* Locks menu perfectly in the center */
    }

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

/* =========================================
   4-COLUMN FOOTER (Apostar Bitcoin PT)
   ========================================= */
.site-footer-4col {
    background-color: #0b1120; /* Deep dark blue background */
    color: #94a3b8;
    padding: 60px 20px 30px;
    margin-top: 80px;
    font-family: var(--font-body, sans-serif);
    border-top: 3px solid var(--color-accent, #06b6d4); /* Cyan accent border */
}

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

/* Legal Disclaimers Block */
.footer-disclaimers {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-disclaimers p {
    margin-bottom: 0.8rem;
    line-height: 1.6;
    text-align: left;
}

.footer-disclaimers a {
    color: var(--color-accent, #06b6d4);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.footer-disclaimers a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* Grid Layout */
.footer-4col-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

@media (min-width: 768px) {
    .footer-4col-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

/* Cyan Titles */
.widget-title {
    color: var(--color-accent, #06b6d4); 
    font-family: var(--font-display, sans-serif); 
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.2rem;
    margin-top: 0;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

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

.widget-list li {
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #94a3b8;
    line-height: 1.5;
}

.widget-list a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.2s ease;
}

.widget-list a:hover {
    color: var(--color-accent, #06b6d4);
}

/* Bullets */
.bullet-list li {
    position: relative;
    padding-left: 16px;
}

.bullet-list li::before {
    content: '•';
    color: var(--color-accent, #06b6d4); 
    position: absolute;
    left: 0;
    top: -2px;
    font-size: 1.5rem;
    line-height: 1;
}

.clean-list li {
    padding-left: 0;
    padding-bottom: 0.8rem;
}

.clean-list li::before {
    display: none;
}

.footer-4col-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 25px;
    text-align: center;
}

.footer-4col-bottom p {
    margin: 0;
    font-size: 0.85rem;
    color: #a4adba;
    text-align: center;
}

/* Back to Top Button */
.back-to-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: var(--color-accent, #06b6d4);
    color: #0b1120;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 99;
}

.back-to-top-btn.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top-btn:hover {
    background-color: #22d3ee;
    transform: translateY(-5px);
}

/* --- Fix horizontal scroll (empty space on the right) for mobile --- */

@media (max-width: 900px) {
    /* Strictly prevent horizontal overflow on the entire page */
    html, body {
        overflow-x: hidden !important; 
        width: 100% !important;
        max-width: 100vw !important;
    }

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

    /* Tame the Hero section to stay strictly within the viewport boundaries */
    [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;
    }
    
    /* Center and constrain all other text and content blocks */
    .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;
    }
}