/* GoJumboGPT -- design system
   Paper-warm light mode, deep dark mode, system fonts only (no web font
   requests), one accent blue plus a warm highlight. */

:root {
  color-scheme: light dark;
  --bg: #f7f5f0;
  --bg-alt: #efeadf;
  --surface: #ffffff;
  --surface-2: #fbfaf7;
  --ink: #171a21;
  --ink-soft: #39404e;
  --muted: #5f6879;
  --line: #e3ddd0;
  --line-soft: #ece7dc;
  --accent: #1f4bd8;
  --accent-ink: #163ab0;
  --accent-soft: #e8edfd;
  --warm: #b96a06;
  --warm-soft: #fbf0dd;
  --shadow: 0 1px 2px rgba(23, 26, 33, .05), 0 8px 24px -16px rgba(23, 26, 33, .25);
  --radius: 14px;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Charter", Charter, Georgia, "Times New Roman", serif;
  --wrap: 1160px;
}

html[data-theme="dark"], :root:not([data-theme="light"]) {
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #11141a;
    --bg-alt: #161a22;
    --surface: #171b23;
    --surface-2: #1c212b;
    --ink: #e9edf6;
    --ink-soft: #c3cbdb;
    --muted: #97a1b5;
    --line: #272e3b;
    --line-soft: #202632;
    --accent: #89a7ff;
    --accent-ink: #b7c8ff;
    --accent-soft: #1b2440;
    --warm: #f0b458;
    --warm-soft: #2a2213;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px -18px rgba(0, 0, 0, .8);
  }
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #11141a;
  --bg-alt: #161a22;
  --surface: #171b23;
  --surface-2: #1c212b;
  --ink: #e9edf6;
  --ink-soft: #c3cbdb;
  --muted: #97a1b5;
  --line: #272e3b;
  --line-soft: #202632;
  --accent: #89a7ff;
  --accent-ink: #b7c8ff;
  --accent-soft: #1b2440;
  --warm: #f0b458;
  --warm-soft: #2a2213;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px -18px rgba(0, 0, 0, .8);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

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

h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -.015em; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: clamp(1.9rem, 1.3rem + 2.2vw, 3rem); letter-spacing: -.025em; }
h2 { font-size: clamp(1.35rem, 1.1rem + .9vw, 1.85rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }

a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent); }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: #fff; padding: 10px 16px; z-index: 50; }
.skip:focus { left: 8px; top: 8px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---------------------------------------------------------------- header */
.site-head {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(150%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.head-inner { display: flex; align-items: center; gap: 18px; min-height: 62px; }
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); flex: none; }
.brand-mark svg rect { fill: var(--accent); }
.brand-mark svg path, .brand-mark svg circle { stroke: #ffd166; }
.brand-text { font-size: 1.12rem; letter-spacing: -.03em; font-weight: 600; }
.brand-text b { font-weight: 800; }
.site-nav { display: flex; gap: 2px; margin-left: auto; flex-wrap: wrap; }
.site-nav a {
  color: var(--ink-soft); text-decoration: none; font-size: .93rem; font-weight: 550;
  padding: 7px 11px; border-radius: 8px;
}
.site-nav a:hover { background: var(--surface); color: var(--ink); }
.site-nav a.is-active { color: var(--accent-ink); background: var(--accent-soft); }
.head-tools { display: flex; align-items: center; gap: 6px; }
.head-search {
  display: inline-flex; align-items: center; gap: 6px; font-size: .9rem; font-weight: 550;
  text-decoration: none; color: var(--ink-soft); border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 13px 6px 11px; background: var(--surface);
}
.head-search svg { stroke: currentColor; }
.head-search:hover { border-color: var(--accent); color: var(--accent-ink); }
.theme-toggle, .nav-toggle {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft);
  width: 36px; height: 34px; border-radius: 9px; cursor: pointer; display: inline-flex;
  align-items: center; justify-content: center; padding: 0;
}
.theme-toggle svg { stroke: currentColor; }
.theme-toggle:hover, .nav-toggle:hover { border-color: var(--accent); color: var(--accent-ink); }
.nav-toggle { display: none; flex-direction: column; gap: 3px; }
.nav-toggle span { display: block; width: 16px; height: 2px; background: currentColor; border-radius: 2px; }

@media (max-width: 860px) {
  .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    background: var(--surface); border-bottom: 1px solid var(--line); padding: 10px 16px 16px;
    flex-direction: column; gap: 2px; box-shadow: var(--shadow);
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: 10px 12px; font-size: 1rem; }
  .nav-toggle { display: inline-flex; }
  .head-search span { display: none; }
  .head-search { padding: 7px 10px; }
  .head-inner { position: relative; }
  .head-tools { margin-left: auto; }
}

/* ------------------------------------------------------------------ hero */
.hero { padding: clamp(40px, 6vw, 84px) 0 clamp(26px, 3vw, 44px); }
.hero-inner { max-width: 820px; }
.hero-kicker, .kicker {
  text-transform: uppercase; letter-spacing: .12em; font-size: .74rem; font-weight: 700;
  color: var(--warm); margin: 0 0 12px;
}
.kicker a { color: inherit; text-decoration: none; }
.kicker a:hover { text-decoration: underline; }
.hero h1 { max-width: 16ch; }
.hero-lead, .lead {
  font-size: clamp(1.05rem, 1rem + .35vw, 1.22rem); color: var(--ink-soft); max-width: 62ch; line-height: 1.55;
}
.hero-search { display: flex; gap: 8px; margin: 26px 0 12px; max-width: 620px; }
.hero-search input {
  flex: 1; font: inherit; padding: 13px 16px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); min-width: 0;
}
.hero-search input::placeholder { color: var(--muted); }
.hero-search button {
  font: inherit; font-weight: 650; padding: 13px 20px; border-radius: 11px; border: 0;
  background: var(--accent); color: #fff; cursor: pointer;
}
.hero-search button:hover { background: var(--accent-ink); }
.hero-meta { color: var(--muted); font-size: .9rem; margin: 0; }

.block { padding: clamp(28px, 4vw, 52px) 0; }
.block-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; margin-bottom: 22px; }
.block-head h2 { margin: 0; }
.block-head p { margin: 0; }
.band { background: var(--bg-alt); border-block: 1px solid var(--line-soft); }

/* ----------------------------------------------------------------- cards */
.sec-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.sec-card {
  display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 18px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow);
  transition: transform .15s ease, border-color .15s ease;
}
.sec-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.sec-ico { display: inline-flex; padding: 8px; border-radius: 10px; background: var(--accent-soft); margin-bottom: 12px; }
.sec-ico svg { stroke: var(--accent-ink); }
.sec-card h3 { margin: 0 0 6px; font-size: 1.05rem; }
.sec-card p { color: var(--muted); font-size: .92rem; margin: 0 0 10px; }
.sec-count { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--warm); font-weight: 700; }

.card-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
.card {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; text-decoration: none; color: var(--ink);
  box-shadow: var(--shadow); transition: transform .15s ease, border-color .15s ease;
}
.card:hover { transform: translateY(-2px); border-color: var(--accent); }
.card-kicker { text-transform: uppercase; letter-spacing: .1em; font-size: .7rem; font-weight: 700; color: var(--warm); margin: 0 0 8px; }
.card h3 { font-size: 1.06rem; margin: 0 0 8px; }
.card p { color: var(--muted); font-size: .93rem; margin: 0 0 14px; }
.card-go { margin-top: auto; font-size: .85rem; font-weight: 650; color: var(--accent-ink); }
.card-go::after { content: " \2192"; }
.card-tool { background: linear-gradient(180deg, var(--surface-2), var(--surface)); }

/* ------------------------------------------------------------- row lists */
.row-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.row-list li { border-bottom: 1px solid var(--line); }
.row-list a {
  display: grid; gap: 2px 16px; padding: 16px 4px; text-decoration: none; color: var(--ink);
  grid-template-columns: 1fr auto; align-items: baseline;
}
.row-list a:hover { background: var(--surface); }
.row-kicker { grid-column: 1 / -1; text-transform: uppercase; letter-spacing: .1em; font-size: .68rem; font-weight: 700; color: var(--warm); }
.row-title { font-weight: 650; font-size: 1.02rem; }
.row-desc { grid-column: 1; color: var(--muted); font-size: .92rem; }
.row-meta { color: var(--muted); font-size: .8rem; white-space: nowrap; }

.link-list { list-style: none; margin: 0; padding: 0; }
.link-list li { padding: 7px 0; border-bottom: 1px dashed var(--line); }
.link-list li:last-child { border-bottom: 0; }
.link-list a { text-decoration: none; color: var(--ink-soft); font-size: .97rem; }
.link-list a:hover { color: var(--accent-ink); text-decoration: underline; }
.link-list .more a { color: var(--accent-ink); font-weight: 600; }

/* -------------------------------------------------------------- sections */
.crumbs { border-bottom: 1px solid var(--line-soft); background: var(--bg-alt); }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 10px 20px; font-size: .84rem; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--line); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent-ink); }

.sec-hero { padding: clamp(32px, 4vw, 56px) 20px clamp(12px, 2vw, 24px); }
.sec-hero h1 { max-width: 20ch; }
.hub-blocks { display: grid; gap: 28px; }
.hub-block {
  display: grid; grid-template-columns: minmax(240px, 340px) 1fr; gap: 10px 40px;
  padding: 24px 0; border-top: 1px solid var(--line);
}
.hub-block-head h2 { margin: 0 0 6px; font-size: 1.25rem; }
.hub-block-head h2 a { text-decoration: none; color: var(--ink); }
.hub-block-head h2 a:hover { color: var(--accent-ink); }
.hub-block-head p { color: var(--muted); font-size: .94rem; margin: 0; }
@media (max-width: 760px) { .hub-block { grid-template-columns: 1fr; } }

/* ----------------------------------------------------- hub + article page */
.hub-layout, .art-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 48px;
  padding-top: 28px; padding-bottom: 60px; align-items: start;
}
.art-layout.narrow { grid-template-columns: minmax(0, 1fr); max-width: 760px; }
@media (max-width: 960px) { .hub-layout, .art-layout { grid-template-columns: 1fr; gap: 28px; } }
.hub-main, .art { min-width: 0; }
.art-head h1 { max-width: 22ch; }
.art-meta { color: var(--muted); font-size: .87rem; }
.art-meta a { color: var(--muted); }
.hub-head { margin-bottom: 28px; }
.hub-list h2, .related h2, .faq h2, .takeaways h2 { font-size: 1.15rem; }

.aside-box {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; margin-bottom: 16px;
}
.art-aside, .hub-aside { position: sticky; top: 82px; }
@media (max-width: 960px) { .art-aside, .hub-aside { position: static; } }
.aside-box h2 { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 12px; }
.aside-list { list-style: none; margin: 0; padding: 0; }
.aside-list li { padding: 6px 0; }
.aside-list a { text-decoration: none; color: var(--ink-soft); font-size: .92rem; line-height: 1.4; display: block; }
.aside-list a:hover { color: var(--accent-ink); }
.aside-list li.is-current a { color: var(--accent-ink); font-weight: 650; border-left: 3px solid var(--accent); padding-left: 9px; margin-left: -12px; }
.aside-cta p { font-size: .92rem; color: var(--muted); }
.btn {
  display: inline-block; background: var(--accent); color: #fff; text-decoration: none;
  padding: 10px 18px; border-radius: 10px; font-weight: 650; font-size: .95rem;
}
.btn:hover { background: var(--accent-ink); color: #fff; }
.link-more { font-size: .9rem; font-weight: 650; text-decoration: none; }
.link-more::after { content: " \2192"; }

/* ----------------------------------------------------------------- prose */
.prose { font-family: var(--serif); font-size: 1.12rem; line-height: 1.72; color: var(--ink); max-width: 70ch; }
.prose h2 { font-family: var(--sans); margin-top: 1.9em; }
.prose h3 { font-family: var(--sans); margin-top: 1.5em; font-size: 1.1rem; }
.prose ul, .prose ol { padding-left: 1.25em; margin: 0 0 1.2em; }
.prose li { margin-bottom: .5em; }
.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88em;
  background: var(--bg-alt); border: 1px solid var(--line-soft); border-radius: 5px; padding: 1px 5px;
}
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.2em 0; }
.callout {
  background: var(--warm-soft); border-left: 3px solid var(--warm); border-radius: 0 10px 10px 0;
  padding: 16px 18px; margin: 1.6em 0; font-size: .98rem;
}
.callout p { margin: 0; }
.callout-label { font-family: var(--sans); font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--warm); margin-bottom: 4px !important; }
.table-wrap { overflow-x: auto; margin: 1.6em 0; }
.prose table { border-collapse: collapse; width: 100%; font-family: var(--sans); font-size: .93rem; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { background: var(--bg-alt); font-weight: 650; }

.takeaways {
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  border-radius: var(--radius); padding: 20px 22px; margin: 26px 0;
}
.takeaways h2 { margin: 0 0 10px; font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--accent-ink); }
.takeaways ul { margin: 0; padding-left: 1.15em; }
.takeaways li { margin-bottom: .45em; font-size: 1rem; }
.takeaways li:last-child { margin-bottom: 0; }

.toc { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; margin: 26px 0; background: var(--surface); }
.toc-title { font-size: .76rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; margin: 0 0 8px; }
.toc ol { margin: 0; padding-left: 1.2em; font-size: .95rem; }
.toc li { margin-bottom: .3em; }
.toc a { color: var(--ink-soft); text-decoration: none; }
.toc a:hover { color: var(--accent-ink); text-decoration: underline; }

.faq { margin: 44px 0 0; }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item summary { cursor: pointer; padding: 14px 0; font-weight: 650; list-style: none; display: flex; justify-content: space-between; gap: 14px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; color: var(--accent-ink); font-weight: 700; }
.faq-item[open] summary::after { content: "\2212"; }
.faq-body { padding: 0 0 16px; color: var(--ink-soft); font-family: var(--serif); }
.faq-body p { margin: 0; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 44px 0 0; }
.pager a {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; text-decoration: none;
  color: var(--ink); background: var(--surface); display: block;
}
.pager a:hover { border-color: var(--accent); }
.pager span { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 4px; }
.pager b { font-size: .95rem; font-weight: 650; line-height: 1.35; }
.pager-next { text-align: right; }
@media (max-width: 620px) { .pager { grid-template-columns: 1fr; } }
.related { margin: 48px 0 0; }

/* -------------------------------------------------------- tools + search */
.tool { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin: 24px 0 32px; }
.tool-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.tool-field { margin-bottom: 14px; }
.tool-field label { display: block; font-weight: 650; font-size: .92rem; margin-bottom: 6px; }
.tool-field input, .tool-field select, .tool-field textarea {
  width: 100%; font: inherit; padding: 11px 13px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); color: var(--ink);
}
.tool-note { color: var(--muted); font-size: .86rem; }
.tool-out { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 18px; }
.meter { height: 10px; border-radius: 999px; background: var(--bg-alt); overflow: hidden; margin-bottom: 14px; }
.meter span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s ease, background .2s ease; }
.verdict { font-size: 1.25rem; font-weight: 700; margin: 0 0 10px; }
.verdict .unit { font-size: .9rem; font-weight: 500; color: var(--muted); }
.tool-facts { list-style: none; margin: 0; padding: 0; font-size: .95rem; color: var(--ink-soft); }
.tool-facts li { padding: 7px 0; border-bottom: 1px dashed var(--line); }
.tool-facts li:last-child { border-bottom: 0; }
.quiz-msg { background: var(--bg-alt); border: 1px solid var(--line); border-radius: 12px; padding: 16px; font-family: var(--serif); margin-bottom: 16px; white-space: pre-wrap; }
.quiz-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.quiz-actions button { font: inherit; font-weight: 650; padding: 11px 20px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); cursor: pointer; }
.quiz-actions button:hover { border-color: var(--accent); color: var(--accent-ink); }
.quiz-answer { border-left: 3px solid var(--accent); padding: 12px 16px; background: var(--accent-soft); border-radius: 0 10px 10px 0; }
.quiz-answer.is-wrong { border-color: var(--warm); background: var(--warm-soft); }
.quiz-answer p:last-child { margin-bottom: 0; }

#search-results .row-list { margin-top: 10px; }
.search-count { color: var(--muted); font-size: .92rem; }
mark { background: var(--warm-soft); color: inherit; padding: 0 2px; border-radius: 3px; }

/* ------------------------------------------------------------- glossary  */
.alpha { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.alpha a {
  display: inline-flex; width: 32px; height: 32px; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 8px; text-decoration: none; font-size: .85rem;
  font-weight: 650; color: var(--ink-soft); background: var(--surface);
}
.alpha a:hover { border-color: var(--accent); color: var(--accent-ink); }
.term-group { margin-bottom: 36px; }
.term-group h2 { color: var(--warm); border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.term-group dl { margin: 0; display: grid; gap: 2px; }
.term { padding: 12px 0; border-bottom: 1px dashed var(--line); scroll-margin-top: 80px; }
.term dt { font-weight: 700; margin-bottom: 4px; }
.term dd { margin: 0; color: var(--ink-soft); font-size: .97rem; }
.term-link { font-size: .85rem; font-weight: 650; white-space: nowrap; }

/* ------------------------------------------------------------- site map  */
.map-sec { margin-bottom: 44px; }
.map-sec h2 a { text-decoration: none; color: var(--ink); }
.map-grid { display: grid; gap: 22px 32px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.map-hub h3 { font-size: 1rem; margin-bottom: 8px; }
.map-hub h3 a { text-decoration: none; color: var(--accent-ink); }

/* -------------------------------------------------------------- promise  */
.promise { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: clamp(22px, 3vw, 38px); }
.promise-grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.promise-grid h3 { font-size: 1rem; }
.promise-grid p { color: var(--muted); font-size: .95rem; margin: 0; }

/* --------------------------------------------------------------- footer  */
.site-foot { border-top: 1px solid var(--line); background: var(--bg-alt); margin-top: 40px; padding: 44px 0 26px; }
.foot-grid { display: grid; gap: 28px; grid-template-columns: 1.6fr 1fr 1fr 1fr; }
@media (max-width: 860px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .foot-grid { grid-template-columns: 1fr; } }
.foot-word { font-size: 1.15rem; letter-spacing: -.03em; margin-bottom: 8px; }
.foot-word b { font-weight: 800; }
.foot-brand p { font-size: .92rem; max-width: 40ch; }
.foot-h { font-size: .76rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 10px; }
.site-foot ul { list-style: none; margin: 0; padding: 0; }
.site-foot li { padding: 5px 0; }
.site-foot a { color: var(--ink-soft); text-decoration: none; font-size: .93rem; }
.site-foot a:hover { color: var(--accent-ink); text-decoration: underline; }
.foot-legal { border-top: 1px solid var(--line); margin-top: 32px; padding-top: 18px; }
.foot-legal p { font-size: .85rem; margin: 0; }

/* ======================================================================
   Section identity, mobile first UX, reading aids
   ====================================================================== */

/* --------------------------------------------------- per section accents */
.sec-ai       { --sec: #1f4bd8; --sec-soft: #e8edfd; }
.sec-security { --sec: #147a5c; --sec-soft: #e2f4ec; }
.sec-internet { --sec: #8a4bd8; --sec-soft: #f0e9fd; }
.sec-devices  { --sec: #b4560d; --sec-soft: #fcefe2; }
.sec-everyday { --sec: #0e6c92; --sec-soft: #e4f2f8; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sec-ai       { --sec: #93aaff; --sec-soft: #1b2440; }
  :root:not([data-theme="light"]) .sec-security { --sec: #5fc7a2; --sec-soft: #102a22; }
  :root:not([data-theme="light"]) .sec-internet { --sec: #c3a2ff; --sec-soft: #241a3a; }
  :root:not([data-theme="light"]) .sec-devices  { --sec: #f0a868; --sec-soft: #2c2014; }
  :root:not([data-theme="light"]) .sec-everyday { --sec: #74c2e3; --sec-soft: #10252f; }
}
html[data-theme="dark"] .sec-ai       { --sec: #93aaff; --sec-soft: #1b2440; }
html[data-theme="dark"] .sec-security { --sec: #5fc7a2; --sec-soft: #102a22; }
html[data-theme="dark"] .sec-internet { --sec: #c3a2ff; --sec-soft: #241a3a; }
html[data-theme="dark"] .sec-devices  { --sec: #f0a868; --sec-soft: #2c2014; }
html[data-theme="dark"] .sec-everyday { --sec: #74c2e3; --sec-soft: #10252f; }

.sec-card .sec-ico { background: var(--sec-soft); }
.sec-card .sec-ico svg { stroke: var(--sec); }
.sec-card .sec-count { color: var(--sec); }
.sec-card:hover { border-color: var(--sec); }
.sec-hero .kicker { color: var(--sec, var(--warm)); }
.sec-hero { border-bottom: 0; }
.sec-hero.sec-ai, .sec-hero.sec-security, .sec-hero.sec-internet,
.sec-hero.sec-devices, .sec-hero.sec-everyday {
  border-left: 3px solid var(--sec); border-radius: 0 var(--radius) var(--radius) 0;
  background: linear-gradient(100deg, var(--sec-soft), transparent 70%);
  margin-top: 18px; padding-top: clamp(24px, 3vw, 40px);
}

/* ------------------------------------------------------------- reading aids */
h1, h2, h3, .lead, .hero-lead { text-wrap: pretty; }
.prose h2, .prose h3, .faq-item, .gloss-anchor { scroll-margin-top: 84px; }
.hub-meta { color: var(--muted); font-size: .88rem; margin: 10px 0 0; }

.progress-bar {
  position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 40;
  background: var(--accent); transition: width .1s linear; pointer-events: none;
}
@media (prefers-reduced-motion: reduce) { .progress-bar { transition: none; } }

.to-top {
  position: fixed; right: max(14px, env(safe-area-inset-right)); z-index: 35;
  bottom: calc(14px + env(safe-area-inset-bottom));
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-soft); box-shadow: var(--shadow);
  display: none; align-items: center; justify-content: center; cursor: pointer; padding: 0;
}
.to-top.is-on { display: inline-flex; }
.to-top svg { stroke: currentColor; }

/* table of contents: collapsible on small screens, tracked on large ones */
.toc-toggle {
  display: none; font: inherit; font-size: .76rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--accent-ink); background: none; border: 0;
  padding: 0; cursor: pointer;
}
.toc.is-collapsible .toc-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0; }
.toc.is-collapsible .toc-toggle { display: inline-block; }
.toc.is-collapsible.is-closed ol { display: none; }
.toc.is-collapsible ol { margin-top: 10px; }
.toc a.is-current { color: var(--accent-ink); font-weight: 650; }

/* horizontal scroll affordance on wide tables */
.table-wrap { -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.table-wrap.is-scrollable { position: relative; border-right: 1px solid var(--line-soft); }
.table-wrap.is-scrollable::after {
  content: "scroll \2192"; position: sticky; right: 0; bottom: 0; float: right;
  font-family: var(--sans); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); background: var(--bg); padding: 2px 6px; border-radius: 6px;
}

/* reserved placements collapse entirely while empty */
.ad-slot { margin: 0; }
.ad-slot:empty { display: none; }
.ad-slot:not(:empty) { margin: 2em 0; min-height: 90px; text-align: center; }

/* ------------------------------------------------------------------ glossary */
.gloss-filter { margin-top: 18px; max-width: 420px; }
.gloss-filter input {
  width: 100%; font: inherit; padding: 12px 15px; border-radius: 11px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
.gloss-count { color: var(--muted); font-size: .88rem; margin: 10px 0 0; }
.term.is-hidden, .term-group.is-hidden { display: none; }
.term dt { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }

/* --------------------------------------------------------------- mobile UX */
@media (max-width: 860px) {
  .site-nav {
    padding: 8px 16px calc(16px + env(safe-area-inset-bottom));
    max-height: calc(100dvh - 62px); overflow-y: auto;
  }
  .site-nav a { padding: 13px 12px; border-radius: 10px; }
  .site-nav a + a { border-top: 1px solid var(--line-soft); }
  body.nav-open { overflow: hidden; }
  .nav-scrim {
    position: fixed; inset: 62px 0 0; background: rgba(10, 12, 18, .35);
    z-index: 25; border: 0; padding: 0; margin: 0;
  }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }
  .nav-toggle span { transition: transform .18s ease, opacity .18s ease; }
}
@media (prefers-reduced-motion: reduce) { .nav-toggle span { transition: none; } }

@media (max-width: 640px) {
  body { font-size: 16.5px; }
  .wrap { padding: 0 16px; }
  .crumbs ol { padding: 9px 16px; font-size: .8rem; }
  .prose { font-size: 1.08rem; line-height: 1.68; }
  .prose th, .prose td { padding: 9px 10px; }
  .takeaways { padding: 18px; margin: 22px 0; border-radius: 12px; }
  .takeaways li { font-size: .98rem; }
  .art-layout, .hub-layout { padding-top: 18px; padding-bottom: 40px; }
  .art-head h1 { max-width: none; }
  .card { padding: 17px; }
  .card-grid, .sec-grid { gap: 12px; }
  .row-list a { padding: 14px 2px; grid-template-columns: 1fr; }
  .row-meta { grid-column: 1; }
  .aside-box { padding: 16px; }
  .hero { padding: 30px 0 22px; }
  .hero-search { flex-direction: column; gap: 10px; }
  .hero-search button { padding: 14px 20px; }
  .faq-item summary { padding: 15px 0; }
  .pager a { padding: 14px 16px; }
  .site-foot { padding: 34px 0 calc(22px + env(safe-area-inset-bottom)); }
}

/* comfortable touch targets everywhere */
@media (pointer: coarse) {
  .link-list li { padding: 10px 0; }
  .aside-list li { padding: 9px 0; }
  .site-foot li { padding: 8px 0; }
  .alpha a { width: 40px; height: 40px; }
  a, button, summary { -webkit-tap-highlight-color: rgba(31, 75, 216, .12); }
  .card:hover, .sec-card:hover { transform: none; }
}

/* ------------------------------------------------------------------- print */
@media print {
  .site-head, .site-foot, .crumbs, .art-aside, .hub-aside, .pager, .related,
  .to-top, .progress-bar, .ad-slot, .toc { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .art-layout, .hub-layout { display: block; padding: 0; }
  .prose { max-width: none; font-size: 11pt; }
  .prose a::after { content: " (" attr(href) ")"; font-size: 9pt; color: #555; }
  .faq-item .faq-body { display: block !important; }
}

/* ------------------------------------------------------- urgent help block */
.urgent {
  background: var(--warm-soft); border: 1px solid color-mix(in srgb, var(--warm) 30%, transparent);
  border-radius: 18px; padding: clamp(20px, 3vw, 32px);
}
.urgent-head h2 { margin: 0 0 4px; font-size: 1.2rem; }
.urgent-head p { margin: 0 0 18px; font-size: .94rem; }
.urgent-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.urgent-link {
  display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px;
}
.urgent-link b { font-size: .98rem; line-height: 1.35; }
.urgent-link span { color: var(--muted); font-size: .86rem; line-height: 1.45; }
.urgent-link:hover { border-color: var(--warm); color: var(--ink); }

.sec-intro { padding-bottom: 0; }
.sec-intro .prose { font-size: 1.06rem; max-width: 74ch; }

.ad-aside:not(:empty) { position: sticky; top: 92px; margin: 0 0 16px; }
@media (max-width: 960px) { .ad-aside { display: none; } }
