/* Tevanor — self-hosted stylesheet. No web fonts, no remote assets, no trackers. */

:root {
  color-scheme: light dark;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
               Arial, "Noto Sans", "Liberation Sans", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
               "Liberation Mono", monospace;

  --bg:          #f6f8fb;
  --bg-deep:     #eef2f8;
  --surface:     #ffffff;
  --surface-2:   #f3f6fb;
  --ink:         #0f172a;
  --ink-2:       #334155;
  --muted:       #5b6b82;
  --line:        #dfe6f0;
  --line-soft:   #eaeff7;

  --brand:       #1d4ed8;
  --brand-2:     #0ea5e9;
  --brand-ink:   #12327e;
  --brand-wash:  #eef4ff;
  --accent:      #f59e0b;
  --accent-wash: #fff7e8;
  --good:        #0f9d76;
  --good-wash:   #e9f8f2;
  --warn-line:   #f0c47a;

  --radius:      14px;
  --radius-lg:   22px;
  --shadow-sm:   0 1px 2px rgba(15,23,42,.05), 0 1px 3px rgba(15,23,42,.06);
  --shadow-md:   0 4px 10px rgba(15,23,42,.05), 0 12px 30px rgba(15,23,42,.07);
  --maxw:        1180px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:          #0b1220;
    --bg-deep:     #070d18;
    --surface:     #111a2b;
    --surface-2:   #162136;
    --ink:         #eef3fb;
    --ink-2:       #c7d3e4;
    --muted:       #96a6bd;
    --line:        #24324a;
    --line-soft:   #1b2740;

    --brand:       #6f9bff;
    --brand-2:     #4cc3f2;
    --brand-ink:   #bcd2ff;
    --brand-wash:  #16233d;
    --accent:      #fbbf24;
    --accent-wash: #2a2114;
    --good:        #35c79b;
    --good-wash:   #102a24;
    --warn-line:   #6a5327;

    --shadow-sm:   0 1px 2px rgba(0,0,0,.4);
    --shadow-md:   0 10px 30px rgba(0,0,0,.45);
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; }
img { height: auto; }

a { color: var(--brand); text-underline-offset: 2px; }
a:hover { color: var(--brand-ink); }

:focus-visible {
  outline: 3px solid var(--brand-2);
  outline-offset: 2px;
  border-radius: 6px;
}

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--brand); color: #fff; padding: .7rem 1rem;
  border-radius: 0 0 var(--radius) 0; z-index: 100; font-weight: 600;
}
.skip:focus { left: 0; color: #fff; }

/* ---------- top advertising disclosure bar ---------- */

.adbar {
  background: linear-gradient(90deg, var(--brand-ink), var(--brand));
  color: #fff;
  font-size: .86rem;
  line-height: 1.5;
  padding: .6rem 0;
}
@media (prefers-color-scheme: dark) {
  .adbar { background: linear-gradient(90deg, #16233d, #1d3a72); }
}
.adbar .shell { display: flex; gap: .6rem; align-items: baseline; flex-wrap: wrap; }
.adbar b { font-weight: 700; letter-spacing: .01em; }
.adbar a { color: #fff; }

/* ---------- shell ---------- */

.shell {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- site header ---------- */

.site-head {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
@supports not (backdrop-filter: blur(4px)) { .site-head { background: var(--surface); } }

.site-head .shell {
  display: flex; align-items: center; gap: 1rem;
  min-height: 66px;
}

.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); }
.brand svg { width: 30px; height: 30px; display: block; }
.brand-name { font-size: 1.22rem; font-weight: 750; letter-spacing: -.02em; }
.brand-name span { color: var(--brand); }
.brand-sub {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .14em;
  color: var(--muted); font-weight: 650; padding-left: .6rem;
  border-left: 1px solid var(--line); margin-left: .2rem;
}

.nav-toggle {
  margin-left: auto; display: none;
  background: var(--surface-2); color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px;
  padding: .5rem .7rem; font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer;
}

.site-nav { margin-left: auto; }
.site-nav ul { display: flex; gap: .25rem; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.site-nav a {
  display: block; padding: .45rem .7rem; border-radius: 9px;
  text-decoration: none; color: var(--ink-2); font-size: .93rem; font-weight: 600;
}
.site-nav a:hover { background: var(--brand-wash); color: var(--brand-ink); }
.site-nav a[aria-current="page"] { background: var(--brand-wash); color: var(--brand-ink); }

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .site-nav {
    flex-basis: 100%; margin-left: 0; order: 3;
    border-top: 1px solid var(--line-soft); padding: .5rem 0 .8rem;
  }
  .site-nav[hidden] { display: none; }
  .site-nav ul { flex-direction: column; gap: .1rem; }
  .site-head .shell { flex-wrap: wrap; padding-top: .4rem; padding-bottom: .2rem; }
}

/* ---------- hero ---------- */

.hero { padding: 2.6rem 0 1.4rem; }
.eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .74rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase;
  color: var(--brand-ink); background: var(--brand-wash);
  border: 1px solid color-mix(in srgb, var(--brand) 22%, transparent);
  padding: .32rem .7rem; border-radius: 999px;
}
h1 {
  font-size: clamp(1.95rem, 1.2rem + 2.6vw, 3.1rem);
  line-height: 1.12; letter-spacing: -.028em; font-weight: 800;
  margin: .85rem 0 .5rem; color: var(--ink);
  text-wrap: balance;
}
.standfirst {
  font-size: clamp(1.05rem, 1rem + .4vw, 1.22rem);
  color: var(--ink-2); max-width: 62ch; margin: 0 0 1.1rem;
}
.byline {
  display: flex; flex-wrap: wrap; gap: .5rem .9rem; align-items: center;
  font-size: .9rem; color: var(--muted);
  border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft);
  padding: .7rem 0; margin: 0 0 1.4rem;
}
.byline strong { color: var(--ink-2); font-weight: 650; }
.byline .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--line); }

/* ---------- layout ---------- */

.layout {
  display: grid; gap: 2.2rem;
  grid-template-columns: minmax(0, 1fr) 330px;
  align-items: start;
  padding-bottom: 3rem;
}
.layout > main { grid-column: 1; min-width: 0; }
.layout > .rail { grid-column: 2; position: sticky; top: 90px; }
@media (max-width: 1000px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .layout > .rail { grid-column: 1; position: static; }
}

.narrow { max-width: 78ch; margin: 0 auto; padding-bottom: 3rem; }

/* ---------- prose ---------- */

.prose h2 {
  font-size: clamp(1.4rem, 1.15rem + .8vw, 1.85rem);
  line-height: 1.24; letter-spacing: -.018em; font-weight: 750;
  margin: 2.6rem 0 .8rem; scroll-margin-top: 90px; text-wrap: balance;
}
.prose h2::after {
  content: ""; display: block; width: 54px; height: 3px; border-radius: 3px;
  margin-top: .55rem;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
}
.prose h3 {
  font-size: 1.12rem; font-weight: 700; margin: 1.8rem 0 .5rem;
  letter-spacing: -.01em; scroll-margin-top: 90px;
}
.prose p { margin: 0 0 1.05rem; }
.prose ul, .prose ol { margin: 0 0 1.15rem; padding-left: 1.25rem; }
.prose li { margin: .4rem 0; }
.prose li::marker { color: var(--brand); }
.prose strong { font-weight: 680; color: var(--ink); }
.prose > p:first-of-type { font-size: 1.06rem; }

hr.rule {
  border: 0; height: 1px; margin: 2.4rem 0;
  background: linear-gradient(90deg, var(--line), transparent);
}

/* ---------- callouts ---------- */

.callout {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  margin: 1.6rem 0;
  box-shadow: var(--shadow-sm);
}
.callout > :first-child { margin-top: 0; }
.callout > :last-child { margin-bottom: 0; }
.callout h3, .callout h2 { margin-top: 0; font-size: 1.02rem; }
.callout h2::after, .callout h3::after { display: none; }

.callout-ad {
  border-color: var(--warn-line);
  background: var(--accent-wash);
}
.callout-key { border-left: 4px solid var(--brand); background: var(--brand-wash); }
.callout-good { border-left: 4px solid var(--good); background: var(--good-wash); }
.callout-note { background: var(--surface-2); }

.callout-label {
  display: inline-block; font-size: .7rem; font-weight: 750;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--brand-ink); margin-bottom: .45rem;
}
.callout-ad .callout-label { color: #8a5d05; }
@media (prefers-color-scheme: dark) { .callout-ad .callout-label { color: var(--accent); } }

/* ---------- table of contents ---------- */

.toc {
  border: 1px solid var(--line); background: var(--surface);
  border-radius: var(--radius); padding: 1.1rem 1.2rem; margin: 1.8rem 0;
  box-shadow: var(--shadow-sm);
}
.toc h2 { font-size: .78rem !important; text-transform: uppercase; letter-spacing: .12em;
  color: var(--muted); margin: 0 0 .7rem !important; font-weight: 700; }
.toc h2::after { display: none; }
.toc ol { margin: 0; padding-left: 1.1rem; columns: 2; column-gap: 1.6rem; }
.toc li { margin: .25rem 0; break-inside: avoid; }
.toc a { text-decoration: none; font-size: .94rem; font-weight: 550; }
.toc a:hover { text-decoration: underline; }
@media (max-width: 620px) { .toc ol { columns: 1; } }

/* ---------- calls to action ---------- */

.cta { margin: 1.8rem 0; }
.cta-center { text-align: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .55rem; flex-wrap: wrap;
  font: inherit; font-weight: 700; line-height: 1.3;
  text-decoration: none; cursor: pointer;
  border-radius: 12px; padding: .85rem 1.4rem;
  border: 1px solid transparent;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; box-shadow: var(--shadow-md);
}
.btn-primary:hover { color: #fff; }
@media (prefers-color-scheme: dark) { .btn-primary { color: #06101f; } .btn-primary:hover { color: #06101f; } }

.btn-outline {
  background: var(--surface); color: var(--brand-ink);
  border-color: color-mix(in srgb, var(--brand) 38%, transparent);
}
.btn-outline:hover { background: var(--brand-wash); color: var(--brand-ink); }

.btn-block { display: flex; width: 100%; }

.btn-tag {
  font-size: .66rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  background: rgba(255,255,255,.22); border: 1px solid rgba(255,255,255,.4);
  padding: .16rem .45rem; border-radius: 999px; white-space: nowrap;
}
.btn-outline .btn-tag {
  background: var(--brand-wash);
  border-color: color-mix(in srgb, var(--brand) 32%, transparent);
  color: var(--brand-ink);
}
@media (prefers-color-scheme: dark) {
  .btn-primary .btn-tag { background: rgba(6,16,31,.2); border-color: rgba(6,16,31,.35); }
}

.cta-note {
  font-size: .84rem; color: var(--muted); margin: .6rem 0 0; line-height: 1.55;
  max-width: 58ch;
}
.cta-center .cta-note { margin-left: auto; margin-right: auto; }

/* ---------- rail ---------- */

.rail-card {
  border: 1px solid var(--line); background: var(--surface);
  border-radius: var(--radius-lg); padding: 1.25rem; box-shadow: var(--shadow-md);
}
.rail-card + .rail-card { margin-top: 1.2rem; }
.rail-card h2 { font-size: 1.05rem; margin: 0 0 .6rem; font-weight: 750; letter-spacing: -.01em; }
.rail-card h2::after { display: none; }
.rail-card p { font-size: .92rem; color: var(--ink-2); margin: 0 0 .9rem; }
.rail-card .cta { margin: 1rem 0 0; }
.rail-card .cta-note { font-size: .78rem; }

.ticks { list-style: none; margin: 0 0 1rem; padding: 0; font-size: .92rem; }
.ticks li { position: relative; padding-left: 1.6rem; margin: .5rem 0; color: var(--ink-2); }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: .42em;
  width: 15px; height: 9px; border-left: 2.5px solid var(--good);
  border-bottom: 2.5px solid var(--good); transform: rotate(-45deg);
}

/* ---------- figures ---------- */

figure.fig {
  margin: 2rem 0; padding: 1.1rem;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}
figure.fig img { display: block; width: 100%; border-radius: 8px; }
figure.fig figcaption {
  margin-top: .85rem; font-size: .86rem; color: var(--muted); line-height: 1.55;
}
figure.fig figcaption b { color: var(--ink-2); font-weight: 650; }

/* ---------- tables ---------- */

.table-wrap { overflow-x: auto; margin: 1.6rem 0; border-radius: var(--radius); border: 1px solid var(--line); }
table { border-collapse: collapse; width: 100%; min-width: 520px; background: var(--surface); font-size: .93rem; }
th, td { text-align: left; padding: .8rem .9rem; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
thead th { background: var(--surface-2); font-weight: 700; font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
tbody tr:last-child td { border-bottom: 0; }

/* ---------- FAQ ---------- */

details.faq {
  border: 1px solid var(--line); background: var(--surface);
  border-radius: var(--radius); padding: .2rem 1.1rem; margin: .7rem 0;
}
details.faq summary {
  cursor: pointer; font-weight: 650; padding: .85rem 0; list-style: none;
  display: flex; justify-content: space-between; gap: 1rem; align-items: center;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; color: var(--brand); font-weight: 700; font-size: 1.3rem; line-height: 1; }
details.faq[open] summary::after { content: "\2212"; }
details.faq[open] summary { border-bottom: 1px solid var(--line-soft); }
details.faq > p, details.faq > ul { margin: .85rem 0; font-size: .96rem; color: var(--ink-2); }

/* ---------- misc ---------- */

.pill-row { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.2rem 0 1.6rem; }
.pill {
  font-size: .82rem; font-weight: 600; color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: .3rem .8rem;
}

.sources { font-size: .92rem; }
.sources li { margin: .55rem 0; word-break: break-word; }

.updated { font-size: .86rem; color: var(--muted); }

dl.facts { margin: 1.2rem 0; }
dl.facts div {
  display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: .3rem 1rem;
  padding: .7rem 0; border-bottom: 1px solid var(--line-soft);
}
dl.facts dt { font-weight: 680; color: var(--ink); margin: 0; }
dl.facts dd { margin: 0; color: var(--ink-2); }
@media (max-width: 560px) { dl.facts div { grid-template-columns: minmax(0, 1fr); } }

.lede-404 { text-align: center; padding: 3.5rem 0 2rem; }
.lede-404 .code { font-size: clamp(3.5rem, 12vw, 6rem); font-weight: 800; letter-spacing: -.04em;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1; }

/* ---------- footer ---------- */

.site-foot {
  border-top: 1px solid var(--line);
  background: var(--bg-deep);
  padding: 2.4rem 0 2.6rem;
  font-size: .92rem;
}
.foot-grid {
  display: grid; gap: 1.8rem;
  grid-template-columns: minmax(0, 1.3fr) repeat(2, minmax(0, 1fr));
}
@media (max-width: 780px) { .foot-grid { grid-template-columns: minmax(0, 1fr); } }

.foot-grid h2 {
  font-size: .74rem; text-transform: uppercase; letter-spacing: .13em;
  color: var(--muted); font-weight: 750; margin: 0 0 .7rem;
}
.foot-grid ul { list-style: none; margin: 0; padding: 0; }
.foot-grid li { margin: .38rem 0; }
.foot-grid a { text-decoration: none; color: var(--ink-2); }
.foot-grid a:hover { color: var(--brand); text-decoration: underline; }
.foot-id { color: var(--muted); line-height: 1.7; font-size: .88rem; margin: 0; }
.foot-id strong { color: var(--ink-2); display: block; font-weight: 700; margin-bottom: .2rem; }

.foot-legal {
  margin-top: 2rem; padding-top: 1.4rem; border-top: 1px solid var(--line);
  color: var(--muted); font-size: .84rem; line-height: 1.65;
}
.foot-legal p { margin: .5rem 0; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap;
}
kbd {
  font-family: var(--font-mono); font-size: .85em;
  background: var(--surface-2); border: 1px solid var(--line);
  border-bottom-width: 2px; border-radius: 5px; padding: .1em .4em;
  color: var(--ink);
}
code {
  font-family: var(--font-mono); font-size: .88em;
  background: var(--surface-2); border: 1px solid var(--line-soft);
  border-radius: 5px; padding: .08em .35em; word-break: break-word;
}
