/* ===========================================================================
   CoinCompare Hub — theme
   Tokens: ledger-inspired. Editorial copy in Inter, headings in Archivo,
   every number on the site set in IBM Plex Mono (the "ledger" signature).
   ======================================================================== */

:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-2: #eef1f6;
  --ink: #16202e;
  --ink-dim: #5a6678;
  --line: #d9dfe8;
  --accent: #0f6b5c;        /* deep verdigris — actions & links */
  --accent-ink: #ffffff;
  --score: #b97412;         /* amber — ratings only */
  --yes: #1f7a4d;
  --no: #b3372f;
  --warn-bg: #fdf3e3;
  --warn-line: #ecd9b4;
  --shadow: 0 1px 2px rgba(22, 32, 46, .06), 0 8px 24px rgba(22, 32, 46, .07);
  --radius: 14px;
  --font-body: "Inter", system-ui, sans-serif;
  --font-display: "Archivo", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

[data-theme="dark"] {
  --bg: #10151d;
  --surface: #171e29;
  --surface-2: #1f2937;
  --ink: #e8ecf2;
  --ink-dim: #98a3b3;
  --line: #2b3545;
  --accent: #3ec9a7;
  --accent-ink: #0c1310;
  --score: #e3a83f;
  --yes: #4cc585;
  --no: #e07a72;
  --warn-bg: #2a2417;
  --warn-line: #4a3d22;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
}

/* Base ------------------------------------------------------------------- */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
}

h1, h2, h3, h4, .display-font {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--ink);
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); opacity: .85; }

.num, .score-chip, td.num, .fee-cell {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.text-dim { color: var(--ink-dim); }
.skip-link { position: absolute; left: 1rem; top: 1rem; z-index: 2000; background: var(--surface); padding: .5rem 1rem; border-radius: 8px; }

/* Risk strip -------------------------------------------------------------- */
.risk-strip {
  background: var(--warn-bg);
  border-bottom: 1px solid var(--warn-line);
  font-size: .85rem;
  padding: .45rem 0;
  color: var(--ink);
}
.risk-strip a { color: inherit; font-weight: 600; }

/* Header ------------------------------------------------------------------ */
.site-header {
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { font-family: var(--font-display); font-weight: 800; font-size: 1.2rem; color: var(--ink) !important; text-decoration: none; }
.brand-mark { color: var(--accent); }
.navbar-nav .nav-link { color: var(--ink-dim); font-weight: 500; }
.navbar-nav .nav-link.active, .navbar-nav .nav-link:hover { color: var(--ink); }
[data-theme="dark"] .navbar-toggler { filter: invert(1); }

.theme-toggle {
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink);
  border-radius: 999px; width: 38px; height: 38px; line-height: 1;
}
.theme-icon-dark { display: none; }
[data-theme="dark"] .theme-icon-dark { display: inline; }
[data-theme="dark"] .theme-icon-light { display: none; }

/* Ads --------------------------------------------------------------------- */
.ad-container { margin: 1.25rem auto; text-align: center; }
.ad-label {
  display: block; font-size: .65rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-dim); margin-bottom: .25rem;
}
.ad-slot {
  min-height: 90px; border: 1px dashed var(--line); border-radius: 10px;
  background: var(--surface-2); display: flex; align-items: center; justify-content: center;
  color: var(--ink-dim); font-size: .8rem;
}
.ad-slot:empty::after { content: "Ad placement (90px min height reserved to limit layout shift)"; }
.ad-inline { max-width: 728px; }

/* Hero -------------------------------------------------------------------- */
.hero { padding: 4rem 0 3rem; }
.hero h1 {
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  font-weight: 800;
  font-stretch: 90%;
  max-width: 18ch;
}
.hero .lede { font-size: 1.12rem; color: var(--ink-dim); max-width: 56ch; }
.hero-kicker {
  font-family: var(--font-mono); font-size: .78rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--accent);
}

/* Cards ------------------------------------------------------------------- */
.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.platform-card { padding: 1.5rem; height: 100%; display: flex; flex-direction: column; gap: .75rem; }
.platform-card h3 { font-size: 1.25rem; margin: 0; }
.platform-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; margin-right: .5rem; }

.score-chip {
  display: inline-flex; align-items: baseline; gap: .3rem;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 10px; padding: .35rem .7rem; font-size: 1.3rem; font-weight: 500;
  color: var(--score);
}
.score-chip .of { font-size: .72rem; color: var(--ink-dim); }

.score-bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.score-bar > span { display: block; height: 100%; border-radius: 99px; background: var(--score); }

/* Buttons ----------------------------------------------------------------- */
.btn-accent {
  background: var(--accent); color: var(--accent-ink); border: none;
  border-radius: 10px; padding: .6rem 1.2rem; font-weight: 600;
}
.btn-accent:hover { background: var(--accent); color: var(--accent-ink); filter: brightness(1.08); }
.btn-quiet {
  background: transparent; color: var(--ink); border: 1px solid var(--line);
  border-radius: 10px; padding: .6rem 1.2rem; font-weight: 600;
}
.btn-quiet:hover { background: var(--surface-2); color: var(--ink); }

/* Sections & ledger tables ------------------------------------------------- */
.section { padding: 3rem 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-kicker {
  font-family: var(--font-mono); font-size: .75rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-dim);
}
.section h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }

.table-ledger { width: 100%; border-collapse: collapse; font-size: .95rem; color: var(--ink); }
.table-ledger th, .table-ledger td {
  padding: .7rem .85rem; vertical-align: top;
  border-bottom: 1px dotted var(--line); /* ledger rule */
  background: transparent; color: inherit;
}
.table-ledger thead th {
  border-bottom: 2px solid var(--ink); font-family: var(--font-display);
  font-size: .85rem; text-transform: uppercase; letter-spacing: .06em;
}
.table-ledger tbody th[scope="row"] { font-weight: 600; width: 220px; }
.table-wrap { overflow-x: auto; }

.badge-yes { color: var(--yes); font-weight: 600; }
.badge-no { color: var(--no); font-weight: 600; }
.badge-partial { color: var(--ink-dim); font-size: .9em; }

/* Pros & cons -------------------------------------------------------------- */
.pros-cons ul { list-style: none; padding-left: 0; margin: 0; }
.pros-cons li { padding: .35rem 0 .35rem 1.5rem; position: relative; }
.pros-cons .pros li::before { content: "+"; color: var(--yes); position: absolute; left: 0; font-family: var(--font-mono); font-weight: 600; }
.pros-cons .cons li::before { content: "\2212"; color: var(--no); position: absolute; left: 0; font-family: var(--font-mono); font-weight: 600; }

/* Callouts ------------------------------------------------------------------ */
.callout {
  border-left: 3px solid var(--accent); background: var(--surface-2);
  border-radius: 0 10px 10px 0; padding: 1rem 1.25rem; font-size: .92rem;
}
.callout-risk { border-left-color: var(--no); }
.callout-data { border-left-color: var(--score); }

/* EEAT boxes ----------------------------------------------------------------- */
.author-box { display: flex; gap: 1rem; align-items: flex-start; padding: 1.25rem; }
.author-avatar {
  width: 56px; height: 56px; border-radius: 50%; background: var(--surface-2);
  border: 1px solid var(--line); display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; color: var(--ink-dim); flex: none;
}
.meta-row { font-size: .85rem; color: var(--ink-dim); display: flex; flex-wrap: wrap; gap: 1rem; }

/* Sticky in-page nav ---------------------------------------------------------- */
.toc-strip {
  position: sticky; top: 64px; z-index: 100; background: var(--surface);
  border-block: 1px solid var(--line); overflow-x: auto; white-space: nowrap;
}
.toc-strip a {
  display: inline-block; padding: .65rem .9rem; color: var(--ink-dim);
  text-decoration: none; font-size: .88rem; font-weight: 500;
}
.toc-strip a:hover, .toc-strip a.active { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); }

/* Charts ----------------------------------------------------------------------- */
.chart-box { padding: 1.5rem; }
.chart-box canvas { max-height: 380px; }

/* Forms -------------------------------------------------------------------------- */
.form-control, .form-select {
  background: var(--surface); border-color: var(--line); color: var(--ink);
}
.form-control:focus, .form-select:focus {
  background: var(--surface); color: var(--ink);
  border-color: var(--accent); box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--accent) 25%, transparent);
}
.form-label { font-weight: 600; }

/* Footer ---------------------------------------------------------------------------- */
.site-footer { background: var(--surface); border-top: 1px solid var(--line); padding: 3rem 0 2rem; margin-top: 3rem; }
.footer-heading { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-dim); font-family: var(--font-mono); }
.footer-links { list-style: none; padding: 0; }
.footer-links a { color: var(--ink); text-decoration: none; display: inline-block; padding: .18rem 0; font-size: .92rem; }
.footer-links a:hover { color: var(--accent); }
.footer-blurb { color: var(--ink-dim); }
.footer-disclaimer {
  margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px dotted var(--line);
  font-size: .8rem; color: var(--ink-dim);
}
.footer-disclaimer a { color: inherit; }

/* Long-form legal pages -------------------------------------------------------------- */
.prose { max-width: 76ch; }
.prose h2 { margin-top: 2.25rem; font-size: 1.45rem; }
.prose h3 { margin-top: 1.5rem; font-size: 1.1rem; }

/* Focus visibility -------------------------------------------------------------------- */
a:focus-visible, button:focus-visible, .form-control:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

@media (max-width: 575px) {
  .hero { padding: 2.5rem 0 2rem; }
  .table-ledger tbody th[scope="row"] { width: auto; }
}
