:root{
  --navy:#0e1e42;
  --navy-2:#16306b;
  --red:#b3261e;
  --red-2:#d12b1f;
  --ink:#1c2333;
  --mut:#56607a;
  --line:#dfe4ef;
  --surf:#f4f6fb;
  --bg:#ffffff;
}
*{box-sizing:border-box}
html,body{overflow-x:hidden;color-scheme:only light}
body{
  margin:0;
  background:var(--bg);
  color:var(--ink);
  font-family:'Source Sans 3',system-ui,sans-serif;
  font-size:18px;
  line-height:1.65;
}
h1,h2,h3,h4{font-family:Bitter,Georgia,serif;color:var(--navy);line-height:1.2;overflow-wrap:anywhere}
h1{font-size:2.15rem;margin:.2em 0 .35em}
h2{font-size:1.5rem;margin:1.8em 0 .5em;border-bottom:2px solid var(--line);padding-bottom:.25em}
h3{font-size:1.18rem;margin:1.4em 0 .35em}
a{color:var(--navy-2)}
img,svg,table,pre{max-width:100%}
.wrap{max-width:860px;margin:0 auto;padding:0 20px}

/* header */
.topbar{background:var(--navy);color:#fff}
.topbar .wrap{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:62px;flex-wrap:wrap}
.brand{display:flex;align-items:center;gap:10px;color:#fff;text-decoration:none;font-family:Bitter,serif;font-weight:600;font-size:1.12rem}
.brand img{width:30px;height:30px}
.topbar nav.nav{display:flex;gap:18px;flex-wrap:wrap;align-items:center;background:none;box-shadow:none;height:auto;position:static;padding:0;margin:0}
.topbar nav.nav a{color:#cfd8ec;text-decoration:none;font-size:.97rem;padding:0;background:none;border-radius:0}
.topbar nav.nav a:hover,.topbar nav.nav a[aria-current]{color:#fff;border-bottom:2px solid var(--red-2)}
.topbar nav.nav a.cta-btn{background:var(--red-2);color:#fff;padding:9px 17px;border-radius:8px;font-weight:700;white-space:nowrap;border-bottom:none}
.topbar nav.nav a.cta-btn:hover{filter:brightness(1.08);color:#fff;border-bottom:none}
@media (max-width:560px){.topbar .wrap{flex-direction:column;align-items:flex-start;padding:12px 20px}.topbar nav.nav{width:100%}.topbar nav.nav a.cta-btn{margin-left:auto}}

/* hero */
.hero{position:relative;background:var(--navy)}
.hero img{display:block;width:100%;height:auto;opacity:.55}
.hero .hero-cap{position:absolute;inset:0;display:flex;align-items:center}
.hero .hero-cap .wrap{color:#fff}
.hero h1{color:#fff;max-width:18ch}
.hero p{color:#e7ecf7;max-width:52ch;margin:.4em 0 0}

/* badges / answer box */
.answer{background:var(--surf);border:1px solid var(--line);border-left:4px solid var(--red);border-radius:8px;padding:16px 20px;margin:22px 0}
.answer strong{color:var(--navy)}
.tag{display:inline-block;background:var(--navy);color:#fff;font-size:.72rem;letter-spacing:.06em;text-transform:uppercase;padding:3px 9px;border-radius:999px}

/* cards */
.cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(0,1fr));gap:16px;margin:22px 0}
.card{display:flex;flex-direction:column;border:1px solid var(--line);border-radius:10px;padding:18px;background:#fff;text-decoration:none;color:var(--ink)}
.card h3{margin-top:0}
.card:hover{border-color:var(--navy-2);box-shadow:0 4px 16px rgba(14,30,66,.08)}
.card .more{color:var(--red);font-weight:600;margin-top:auto;font-size:.95rem}

/* figure */
figure{margin:24px 0;border:1px solid var(--line);border-radius:10px;padding:14px;background:#fff;overflow-x:auto}
figure img,figure svg{display:block;width:100%;height:auto}
figcaption{color:var(--mut);font-size:.9rem;margin-top:10px}

/* table */
.tbl-wrap{overflow-x:auto;margin:22px 0}
table{border-collapse:collapse;width:100%;background:#fff}
th,td{border:1px solid var(--line);padding:10px 12px;text-align:left;color:var(--ink);background:#fff}
th{background:var(--surf);color:var(--navy);font-family:Bitter,serif}

/* cta */
.cta{background:var(--navy);color:#fff;border-radius:12px;padding:26px 24px;margin:34px 0;text-align:center}
.cta h2{color:#fff;border:0;margin:0 0 .3em}
.cta p{color:#dde4f2;margin:.2em auto 1.1em;max-width:50ch}
.btn{display:inline-block;background:var(--red-2);color:#fff;text-decoration:none;font-weight:600;padding:12px 26px;border-radius:8px}
.btn:hover{background:#b3261e}

/* author */
.author{display:flex;gap:14px;align-items:center;border-top:1px solid var(--line);margin-top:36px;padding-top:20px}
.author img{width:58px;height:58px;border-radius:50%;object-fit:cover}
.author .role{color:var(--mut);font-size:.9rem}

/* code */
.prose code{background:var(--surf);padding:.1em .35em;border-radius:4px;font-size:.9em}
pre{background:var(--navy);color:#eef2fb;padding:14px 16px;border-radius:8px;overflow-x:auto}
pre code{background:transparent;color:inherit;padding:0}

footer.site{border-top:1px solid var(--line);color:var(--mut);font-size:.88rem;margin-top:40px}
footer.site .wrap{padding-top:22px;padding-bottom:30px}

.lead{font-size:1.12rem;color:var(--ink)}
.muted{color:var(--mut)}

@media (max-width:560px){
  body{font-size:17px}
  h1{font-size:1.7rem}
  .hero .hero-cap{position:static}
  .hero{background:var(--navy)}
  .hero .hero-cap .wrap{padding-top:18px;padding-bottom:22px}
}

/* Re-assert light palette under dark mode (macOS dark would flip surfaces) */
@media (prefers-color-scheme:dark){
  html,body{background:#fff;color:var(--ink)}
  h1,h2,h3,h4{color:var(--navy)}
  .answer{background:var(--surf);color:var(--ink)}
  .card{background:#fff;color:var(--ink)}
  th,td{background:#fff;color:var(--ink)}
  th{background:var(--surf);color:var(--navy)}
  figure{background:#fff}
  table{background:#fff}
  .prose code{background:var(--surf);color:var(--ink)}
  pre code{background:transparent;color:inherit}
}
