/* ---- CSS Reset-ish ---- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
img { max-width: 100%; display: block; }

/* ---- Theme ---- */
:root {
  --bg: #0b0e14;
  --panel: #111723;
  --elev: #161b26;
  --text: #e6edf3;
  --muted: #aab6c4;
  --brand: #6aa1ff;
  --brand-2: #8ad9ff;
  --accent: #b887ff;
  --border: #223045;

  --radius: 16px;
  --shadow: 0 10px 30px rgba(0,0,0,0.35);
}

body {
  background: radial-gradient(1200px 800px at 10% -10%, #0f1524 0%, var(--bg) 50%, #0a0c12 100%);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

/* ---- Containers & Layout ---- */
.container {
  width: min(1100px, 92vw);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: saturate(140%) blur(8px);
  background: rgba(11,14,20,0.75);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.3px;
}

.brand-mark {
  inline-size: 24px;
  block-size: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: #0b0e14;
  font-weight: 900;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  margin-left: 18px;
}
.nav a:hover { color: var(--brand-2); }

.site-main { padding: 32px 0 70px; }

.site-footer {
  border-top: 1px solid var(--border);
  background: #0a101a;
  color: var(--muted);
}
.footer-inner {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0;
}
.footer-links a {
  color: var(--muted);
  text-decoration: none;
  margin-left: 14px;
}
.footer-links a:hover { color: var(--brand-2); }

/* ---- Hero ---- */
.hero {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 24px;
  align-items: stretch;
}
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
}

.hero-copy {
  background: linear-gradient(180deg, rgba(22,27,38,0.9), rgba(17,23,35,0.9));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}

.hero-copy h1 {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.1;
  margin: 0 0 12px;
}
.subtitle { color: var(--muted); margin: 8px 0 20px; }

.cta-row { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 12px;
  text-decoration: none;
  transition: transform .05s ease, box-shadow .2s ease, background .2s ease;
  border: 1px solid transparent;
  font-weight: 600;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  color: #0b0e14;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  box-shadow: 0 10px 20px rgba(106,161,255,0.25);
}
.btn-ghost {
  color: var(--brand-2);
  border-color: #274162;
  background: rgba(20,26,38,0.5);
}

/* ---- Cards & Grid ---- */
.section-title {
  font-size: 22px;
  margin: 26px 0 14px;
  color: #e9f1ff;
  letter-spacing: 0.2px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .grid { grid-template-columns: 1fr; }
}

.card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: linear-gradient(180deg, var(--elev), var(--panel));
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .08s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover {
  transform: translateY(-2px);
  border-color: #2c4060;
  box-shadow: 0 14px 36px rgba(0,0,0,0.4);
}
.card-body { padding: 18px; }
.card-title { margin: 0 0 6px; font-weight: 700; }
.card-desc { margin: 0 0 10px; color: var(--muted); }
.card-date { font-size: 12px; color: #91a4bf; }

/* ---- Article ---- */
.article-header { margin-top: 10px; }
.article-title { font-size: clamp(26px, 4vw, 40px); margin: 0 0 6px; }
.article-meta { color: var(--muted); margin: 0 0 20px; }

.article-body {
  background: linear-gradient(180deg, var(--elev), var(--panel));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.article-body h2, .article-body h3 { margin-top: 22px; }
.article-body p { margin: 10px 0 14px; }
.article-body a { color: var(--brand-2); text-decoration: underline; }
.article-body ul, .article-body ol { padding-left: 20px; }

.back-nav { margin-top: 22px; }

/* ---- Legal pages ---- */
.legal {
  background: linear-gradient(180deg, var(--elev), var(--panel));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

/* ---- Ads ---- */
.ad-slot {
  border: 1px dashed #2b3f61;
  background: rgba(18,24,36,0.5);
  border-radius: 14px;
  padding: 18px;
  position: relative;
}
.ad-label {
  position: absolute;
  top: 8px; left: 10px;
  font-size: 11px;
  color: var(--muted);
  background: #0b0e14;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 6px;
}
.ad-placeholder {
  color: var(--muted);
  text-align: center;
  padding: 24px 0;
}

/* ---- Simple typography tweaks ---- */
h1, h2, h3 { letter-spacing: .2px; }
p { color: #cad5e3; }



/* ==== Article (LLM HTML: .article-doc) =================================== */

.article-body {
  background: linear-gradient(180deg, var(--elev), var(--panel));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}

/* Keep the reading column narrow & centered */
.article-body .article-doc {
  display: block;
  margin: 0 auto;
  max-width: 78ch;               /* ~optimal measure */
}

/* Header + byline */
.article-body .article-doc > header {
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.article-body .article-doc h1 {
  font-size: clamp(28px, 4.2vw, 42px);
  line-height: 1.15;
  margin: 0 0 6px;
  letter-spacing: .2px;
}
.article-body .article-doc header p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

/* Disclosure block */
.article-body .article-doc .affiliate-disclosure {
  margin: 14px 0 18px;
  padding: 12px 14px;
  border: 1px dashed #2b3f61;
  background: rgba(20, 26, 38, 0.55);
  color: #cfe1ff;
  border-radius: 12px;
}

/* Headings + rhythm */
.article-body .article-doc h2 {
  margin: 26px 0 10px;
  font-size: clamp(20px, 2.4vw, 26px);
  color: #e9f1ff;
}
.article-body .article-doc h3 {
  margin: 18px 0 6px;
  font-size: clamp(17px, 2vw, 20px);
  color: #d7e6ff;
}
.article-body .article-doc p {
  margin: 10px 0 14px;
  color: #cad5e3;
}
.article-body .article-doc ul,
.article-body .article-doc ol {
  padding-left: 22px;
}
.article-body .article-doc li { margin: 6px 0; }

/* Links */
.article-body .article-doc a {
  color: var(--brand-2);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.article-body .article-doc a:hover { text-decoration-thickness: 2px; }

/* Images / figures */
.article-body .article-doc img {
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
}
.article-body .article-doc figure {
  margin: 18px 0;
}
.article-body .article-doc figcaption {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  margin-top: 8px;
}

/* Code / pre (if any) */
.article-body .article-doc code {
  background: #101625;
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 8px;
}
.article-body .article-doc pre {
  background: #0e1421;
  border: 1px solid var(--border);
  padding: 14px;
  border-radius: 12px;
  overflow: auto;
}

/* Quick Picks — turn into compact cards */
.article-body .article-doc .quick-picks {
  list-style: none;
  padding-left: 0;
  margin: 10px 0 4px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 720px) {
  .article-body .article-doc .quick-picks { grid-template-columns: 1fr; }
}
.article-body .article-doc .quick-picks li {
  background: linear-gradient(180deg, var(--elev), var(--panel));
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
}
.article-body .article-doc .quick-picks a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  text-decoration: none; /* rely on button look if aff-btn is present */
}

/* Affiliate CTA buttons (your Python adds .btn .btn-primary .aff-btn) */
.article-body .article-doc .aff-btn {
  width: 100%;
  min-height: 42px;
  justify-content: center;
  border-radius: 10px;
  box-shadow: 0 10px 20px rgba(106,161,255,0.18);
}
.article-body .article-doc .aff-btn::after {
  content: "↗";
  font-size: 14px;
  margin-left: 6px;
  opacity: .85;
}

/* Ad slots inside article */
.article-body .article-doc .ad-slot {
  margin: 16px 0;
  border-radius: 12px;
}
.article-body .article-doc .ad-label {
  top: 6px; left: 8px;
}

/* Tables (if ever present) */
.article-body .article-doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 16px;
}
.article-body .article-doc th,
.article-body .article-doc td {
  border: 1px solid var(--border);
  padding: 8px 10px;
}
.article-body .article-doc th {
  background: #0e1524;
  color: #dce8ff;
  text-align: left;
}

/* FAQ spacing nicety: h3 question + answer */
.article-body .article-doc h3 + p { margin-top: 6px; }

/* simple styling for the hero stat card */
.hero .statbox {
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 22px 0;
}
.hero .statbox .stat-num {
  font-size: clamp(28px, 6vw, 48px);
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero .statbox .stat-caption {
  color: var(--muted);
  font-weight: 600;
  letter-spacing: .3px;
}