/* =========================================
   1. CSS Variables & Reset
   ========================================= */
:root {
  --color-primary: #1B2A4A;
  --color-accent: #10B981;
  --color-neutral: #F3F4F6;
  --color-amber: #F59E0B;
  --color-text: #1F2937;
  --color-text-secondary: #6B7280;
  --color-bg: #FFFFFF;
  --color-surface: #F9FAFB;
  --color-border: #E5E7EB;
  --color-success: #059669;
  --color-danger: #DC2626;

  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --h1-size: clamp(2rem, 4vw, 3.25rem);
  --h2-size: clamp(1.5rem, 3vw, 2.25rem);
  --h3-size: clamp(1.125rem, 2vw, 1.5rem);
  --body-size: clamp(0.938rem, 1.5vw, 1.063rem);
  --caption-size: clamp(0.75rem, 1.2vw, 0.875rem);
  --data-size: clamp(0.875rem, 1.4vw, 1rem);

  --content-width: 740px;
  --section-gap: clamp(3rem, 6vw, 5rem);
  --component-radius: 6px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.04);

  --hero-bg-start: #1B2A4A;
  --hero-bg-end: #0F172A;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-primary: #93AEDB;
    --color-accent: #34D399;
    --color-neutral: #1E293B;
    --color-amber: #FBBF24;
    --color-text: #E5E7EB;
    --color-text-secondary: #9CA3AF;
    --color-bg: #0F172A;
    --color-surface: #1E293B;
    --color-border: #334155;
    --color-success: #34D399;
    --color-danger: #F87171;
  }
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  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: 1.7;
  color: var(--color-text);
  background-color: var(--color-bg);
}

/* =========================================
   2. General Typography
   ========================================= */
p {
  text-align: left;
  margin-bottom: 1.25em;
}

h2, .toc-wrap__title {
  font-family: var(--font-body);
  font-size: var(--h2-size);
  font-weight: 700;
  line-height: 1.25;
  color: var(--color-primary);
  text-align: left;
  margin-bottom: 0.75em;
  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-primary);
  text-align: left;
  margin-top: 1.75em;
  margin-bottom: 0.6em;
  scroll-margin-top: 2rem;
}

main ul, ol {
  text-align: left;
  margin-bottom: 1.25em;
  padding-left: 1.5em;
}

li {
  text-align: left;
  margin-bottom: 0.4em;
}

strong {
  font-weight: 600;
}

em {
  font-style: italic;
}

blockquote {
  text-align: left;
  border-left: 3px solid var(--color-accent);
  padding-left: 1.25em;
  margin: 1.5em 0;
  color: var(--color-text-secondary);
  font-style: italic;
}

a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: opacity 0.2s ease;
}

a:hover {
  opacity: 0.8;
}

a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 2px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: var(--body-size);
}

th {
  text-align: left;
  font-weight: 600;
  padding: 0.75em 1em;
  border-bottom: 2px solid var(--color-border);
  color: var(--color-primary);
  font-size: var(--caption-size);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

td {
  text-align: left;
  padding: 0.65em 1em;
  border-bottom: 1px solid var(--color-border);
}

tr:last-child td {
  border-bottom: none;
}

hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 1.5rem 0;
}

/* =========================================
   3. Layout — Sections
   ========================================= */
header {
  position: relative;
  z-index: 10;
}

main {
  width: 100%;
  margin-bottom: 5rem;
}

main article {
  width: 95%;
  max-width: 950px;
  margin: 0 auto;
}

.breadcrumbs {
  width: 95%;
  max-width: 950px;
  margin: 0 auto;
  padding-left: 5px;
}

[data-content] {
  max-width: var(--content-width);
  margin-left: auto;
  margin-right: auto;
  padding: 0 1.25rem;
  margin-bottom: var(--section-gap);
}

figure {
  margin: 1.5em auto;
  max-width: 100%;
}

figcaption {
  text-align: center;
  font-size: var(--caption-size);
  color: var(--color-text-secondary);
  margin-top: 0.5em;
}

img.hero-image {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: var(--component-radius);
}

img.article-image {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: var(--component-radius);
}

/* =========================================
   4. Components
   ========================================= */

/* --- info-box --- */
.info-box {
  border: 1px solid var(--color-accent);
  border-left: 4px solid var(--color-accent);
  border-radius: var(--component-radius);
  padding: 1.25em 1.5em;
  margin: 1.75em 0;
  background-color: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.info-box p {
  text-align: left;
  color: var(--color-text);
  background-color: transparent;
  margin-bottom: 0.5em;
}

.info-box p:last-child {
  margin-bottom: 0;
}

.info-box strong {
  color: var(--color-primary);
}

/* --- odds-example --- */
.odds-example {
  background-color: var(--color-primary);
  color: var(--color-neutral);
  border-radius: var(--component-radius);
  padding: 1.5em 2em;
  margin: 1.75em 0;
  box-shadow: var(--shadow-md);
}

.odds-example p {
  text-align: center;
  color: var(--color-neutral);
  background-color: transparent;
  margin-bottom: 0.5em;
}

.odds-example p:last-child {
  margin-bottom: 0;
}

.odds-example strong {
  color: var(--color-accent);
  font-family: var(--font-mono);
  font-size: 1.15em;
}

@media (prefers-color-scheme: dark) {
  .odds-example {
    background-color: #1B2A4A;
    color: #F3F4F6;
  }
  .odds-example p {
    color: #F3F4F6;
  }
  .odds-example strong {
    color: #34D399;
  }
}

/* --- callout --- */
.callout {
  border-left: 4px solid var(--color-amber);
  padding: 1em 1.25em;
  margin: 1.75em 0;
  background-color: var(--color-surface);
  border-radius: 0 var(--component-radius) var(--component-radius) 0;
  box-shadow: var(--shadow-sm);
}

.callout p {
  text-align: left;
  color: var(--color-text);
  background-color: transparent;
  margin-bottom: 0.5em;
}

.callout p:last-child {
  margin-bottom: 0;
}

.callout strong {
  color: var(--color-amber);
}

/* --- card-grid --- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1em;
  margin: 1.75em 0;
}

.card-grid > div {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--component-radius);
  padding: 1.25em;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-grid > div:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.card-grid > div p {
  text-align: center;
  color: var(--color-text);
  background-color: transparent;
  margin-bottom: 0.25em;
}

.card-grid > div p:first-child {
  font-family: var(--font-mono);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.2;
}

.card-grid > div p:last-child {
  font-size: var(--caption-size);
  color: var(--color-text-secondary);
  margin-bottom: 0;
}

/* --- comparison --- */
.comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1em;
  margin: 1.75em 0;
}

.comparison > div {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--component-radius);
  padding: 1.25em;
  box-shadow: var(--shadow-sm);
}

.comparison > div p {
  text-align: left;
  color: var(--color-text);
  background-color: transparent;
  margin-bottom: 0.5em;
}

.comparison > div p:last-child {
  margin-bottom: 0;
}

.comparison > div strong {
  color: var(--color-primary);
}

@media (max-width: 600px) {
  .comparison {
    grid-template-columns: 1fr;
  }
}

/* --- tldr --- */
.tldr {
  background-color: var(--color-surface);
  border-left: 4px solid var(--color-accent);
  border-radius: 0 var(--component-radius) var(--component-radius) 0;
  padding: 1.5em 1.75em;
}

.tldr h2 {
  font-family: var(--font-display);
  font-size: clamp(1.125rem, 2vw, 1.25rem);
  font-weight: 700;
  margin-bottom: 0.6em;
  color: var(--color-primary);
}

.tldr ul {
  margin-bottom: 0;
}

.tldr li {
  margin-bottom: 0.35em;
  color: var(--color-text);
}

/* --- key-takeaway --- */
.key-takeaway {
  border-top: 2px solid var(--color-accent);
  padding-top: 1em;
  margin: 2em 0;
}

.key-takeaway p {
  text-align: left;
  font-family: var(--font-display);
  font-size: clamp(1.125rem, 2vw, 1.375rem);
  font-weight: 600;
  line-height: 1.5;
  color: var(--color-text);
  background-color: transparent;
  margin-bottom: 0;
}

/* --- fun-fact --- */
.fun-fact {
  position: relative;
  padding-left: 1.5em;
  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-style: italic;
  color: var(--color-text-secondary);
  background-color: transparent;
  margin-bottom: 0;
}

/* --- glossary-term --- */
.glossary-term {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 1em 0;
}

.glossary-term strong {
  font-family: var(--font-mono);
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  flex-shrink: 0;
}

.glossary-term span {
  color: var(--color-text-secondary);
}

@media (max-width: 600px) {
  .glossary-term {
    flex-direction: column;
    gap: 4px;
  }
}

/* --- dos-donts --- */
.dos-donts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5em;
  margin: 1.75em 0;
}

.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 {
  padding-top: 1em;
}

.dos-donts > div p {
  text-align: left;
  color: var(--color-text);
  background-color: transparent;
}

.dos-donts > div p:first-child {
  font-weight: 700;
  font-size: var(--h3-size);
  margin-bottom: 0.5em;
}

.dos-donts > div:first-child p:first-child {
  color: var(--color-success);
}

.dos-donts > div:last-child p:first-child {
  color: var(--color-danger);
}

.dos-donts ul {
  padding-left: 1.25em;
}

.dos-donts li {
  text-align: left;
  color: var(--color-text);
  margin-bottom: 0.35em;
}

@media (max-width: 600px) {
  .dos-donts {
    grid-template-columns: 1fr;
  }
}

/* --- pre-bet-checklist --- */
.pre-bet-checklist {
  margin: 1.75em 0;
}

.pre-bet-checklist p:first-child {
  text-align: left;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-accent);
  font-size: var(--caption-size);
  font-weight: 700;
  margin-bottom: 0.75em;
  background-color: transparent;
}

.pre-bet-checklist ul {
  list-style: none;
  padding-left: 1.5em;
  border-left: 2px solid var(--color-border);
}

.pre-bet-checklist li {
  position: relative;
  padding-left: 0.25em;
  margin-bottom: 0.6em;
  text-align: left;
  color: var(--color-text);
}

.pre-bet-checklist li::before {
  content: '\2610';
  position: absolute;
  left: -1.65em;
  color: var(--color-accent);
  background-color: var(--color-bg);
  padding: 0 2px;
  font-size: 0.9em;
}

/* --- at-a-glance --- */
.at-a-glance {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin: 1.75em 0;
  border: 1px solid var(--color-border);
  border-radius: var(--component-radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.at-a-glance > div {
  padding: 1.25em;
  border-right: 1px solid var(--color-border);
  background-color: var(--color-surface);
}

.at-a-glance > div:last-child {
  border-right: none;
}

.at-a-glance > div p:first-child {
  text-align: center;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  font-weight: 700;
  color: var(--color-primary);
  background-color: transparent;
  line-height: 1.3;
  margin-bottom: 0.35em;
}

.at-a-glance > div p:last-child {
  text-align: center;
  font-size: var(--caption-size);
  color: var(--color-text-secondary);
  background-color: transparent;
  line-height: 1.45;
  margin-bottom: 0;
}

@media (max-width: 600px) {
  .at-a-glance {
    grid-template-columns: 1fr 1fr;
  }
  .at-a-glance > div {
    border-right: none;
    border-bottom: 1px solid var(--color-border);
  }
  .at-a-glance > div:nth-child(odd) {
    border-right: 1px solid var(--color-border);
  }
}

/* --- worked-example --- */
.worked-example {
  background-color: var(--color-surface);
  border-radius: var(--component-radius);
  padding: 1.75em 2em;
  margin: 1.75em 0;
  box-shadow: var(--shadow-sm);
}

.worked-example p {
  text-align: left;
  color: var(--color-text);
  background-color: transparent;
  margin-bottom: 0.75em;
  font-family: var(--font-mono);
  font-size: var(--data-size);
}

.worked-example p:last-child {
  margin-bottom: 0;
  font-weight: 700;
  color: var(--color-accent);
  font-size: 1.1em;
}

.worked-example hr {
  border-top: 1px dashed var(--color-border);
  margin: 0.75em 0;
}

/* --- section-bridge --- */
.section-bridge {
  text-align: center;
  font-style: italic;
  color: var(--color-accent);
  font-family: var(--font-display);
  font-size: var(--body-size);
  margin: 1.5em 0;
  position: relative;
  padding: 0 2em;
}

.section-bridge::before,
.section-bridge::after {
  content: '\2014\2014';
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-border);
  font-style: normal;
}

.section-bridge::before {
  left: 0;
}

.section-bridge::after {
  right: 0;
}

.section-bridge p {
  text-align: center;
  color: var(--color-accent);
  background-color: transparent;
  margin-bottom: 0;
}

/* =========================================
   5. Hero Section
   ========================================= */
[data-content="hero"] {
  max-width: none;
  padding: 0;
  margin-bottom: 0;
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  background: linear-gradient(165deg, var(--hero-bg-start) 0%, var(--hero-bg-end) 100%);
  overflow: hidden;
}

[data-content="hero"]::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 18px,
      rgba(255,255,255,0.025) 18px,
      rgba(255,255,255,0.025) 19px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 60px,
      rgba(255,255,255,0.015) 60px,
      rgba(255,255,255,0.015) 61px
    );
  pointer-events: none;
  mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, black 30%, transparent 80%);
}

[data-content="hero"]::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(to bottom, transparent, var(--color-bg));
  pointer-events: none;
}

.hero-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: clamp(3rem, 8vw, 5.5rem) 1.25rem clamp(3.5rem, 9vw, 6rem);
  position: relative;
  z-index: 1;
}

[data-content="hero"] h1 {
  font-family: var(--font-display);
  font-size: var(--h1-size);
  font-weight: 800;
  line-height: 1.1;
  color: #FFFFFF;
  text-align: left;
  margin-bottom: 0.6em;
}

article h1 {
  font-family: var(--font-display);
  font-size: var(--h1-size);
  font-weight: 800;
  line-height: 1.1;
  color: inherit;
  text-align: left;
  margin-top: 0.5rem;
  margin-bottom: 0.6em;
}

.hero-subtitle {
  font-family: var(--font-body);
  font-size: var(--caption-size);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-accent);
  display: block;
  margin-bottom: 1.75em;
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 1em;
  flex-wrap: wrap;
}

.hero-badge {
  font-size: var(--caption-size);
  color: rgba(255,255,255,0.7);
  font-weight: 400;
}

.hero-badge time {
  font-weight: 500;
}

.hero-trust {
  font-size: var(--caption-size);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.5);
  font-weight: 400;
}

[data-content="hero"] figure {
  margin: 2em auto 0;
  max-width: 100%;
}

[data-content="hero"] figcaption {
  text-align: center;
  color: rgba(255,255,255,0.5);
  font-size: var(--caption-size);
}

[data-content="hero"] img.hero-image {
  border-radius: var(--component-radius);
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}

/* =========================================
   6. TOC — Grid 2-column
   ========================================= */
[data-content="toc"] {
  margin-bottom: var(--section-gap);
}

.toc-nav {
  column-count: 2;
  column-gap: 2.5em;
}

.toc-nav > ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-nav > ul > li {
  break-inside: avoid;
  margin-bottom: 1em;
}

.toc-nav > ul > li > a {
  font-weight: 600;
  font-size: var(--body-size);
  color: var(--color-text);
  text-decoration: none;
  display: block;
  padding: 0.25em 0;
  transition: color 0.2s ease;
}

.toc-nav > ul > li > a:hover {
  color: var(--color-accent);
  opacity: 1;
}

.toc-nav > ul > li > a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.toc-nav ul ul {
  list-style: none;
  padding-left: 1em;
  margin-top: 0.25em;
  margin-bottom: 0;
}

.toc-nav ul ul li {
  margin-bottom: 0.2em;
}

.toc-nav ul ul a {
  font-size: var(--caption-size);
  font-weight: 400;
  color: var(--color-text-secondary);
  text-decoration: none;
  display: block;
  padding: 0.15em 0;
  transition: color 0.2s ease;
}

.toc-nav ul ul a:hover {
  color: var(--color-accent);
  opacity: 1;
}

.toc-nav ul ul a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

@media (max-width: 600px) {
  .toc-nav {
    column-count: 1;
  }
}

/* =========================================
   7. FAQ Accordion
   ========================================= */
details {
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 0;
}

summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding: 1em 0;
  font-weight: 600;
  font-size: var(--body-size);
  color: var(--color-text);
  list-style: none;
  transition: color 0.2s ease;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: '+';
  font-size: 1.25em;
  font-weight: 400;
  color: var(--color-text-secondary);
  transition: transform 0.3s ease;
  flex-shrink: 0;
  margin-left: 1em;
}

details[open] summary::after {
  transform: rotate(45deg);
}

summary:hover {
  color: var(--color-accent);
}

summary:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

::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;
}

details[open]::details-content {
  opacity: 1;
  block-size: auto;
}

@supports not selector(::details-content) {
  @keyframes faq-fade-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
  }
  details[open] > *:not(summary) {
    animation: faq-fade-in 0.3s ease forwards;
  }
}

details div p {
  text-align: left;
  padding-bottom: 1em;
  color: var(--color-text-secondary);
  line-height: 1.7;
}



/* =========================================
   9. Media Queries
   ========================================= */
@media (max-width: 768px) {
  [data-content] {
    padding: 0 1rem;
  }

  .hero-inner {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .card-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .card-grid {
    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:nth-child(odd) {
    border-right: none;
  }
}