/* ============================================================
   Mands Computers — design system
   A restrained, readable, trustworthy computer-help site.
   ============================================================ */

:root {
  /* Canvas & ink */
  --bg: #f7f8f6;
  --surface: #ffffff;
  --surface-2: #f1f3f0;
  --ink: #14181c;
  --ink-2: #3a4148;
  --ink-3: #6a737b;
  --line: #e2e6e2;
  --line-2: #d3d8d3;

  /* Accent — a confident, slightly desaturated teal */
  --accent: #0e7c86;
  --accent-ink: #0a5b63;
  --accent-soft: #e3f2f3;
  --accent-contrast: #ffffff;

  /* Semantic */
  --ok: #1f7a4d;
  --ok-soft: #e4f3ec;
  --warn: #9a6a10;
  --warn-soft: #fbf1da;
  --danger: #a5322a;
  --danger-soft: #fbe9e7;
  --info: #2b5a8a;
  --info-soft: #e7f0f8;

  /* Type */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
          "Liberation Mono", monospace;
  --fs: clamp(16px, 1rem, 17px);
  --leading: 1.62;

  /* Layout */
  --wrap: 1120px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(20,24,28,.05), 0 8px 24px -12px rgba(20,24,28,.14);
  --shadow-lg: 0 2px 6px rgba(20,24,28,.06), 0 24px 48px -20px rgba(20,24,28,.22);

  --header-h: 68px;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 20px);
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs);
  line-height: var(--leading);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv11", "ss01", "kern";
}

/* ---------- Reset-ish ---------- */
h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 .6em; font-weight: 700; }
h1 { font-size: clamp(1.9rem, 3.4vw, 2.7rem); }
h2 { font-size: clamp(1.4rem, 2.4vw, 1.85rem); }
h3 { font-size: 1.18rem; }
p  { margin: 0 0 1em; }
a  { color: var(--accent-ink); text-decoration: none; }
a:hover { color: var(--accent); }
ul, ol { margin: 0 0 1em; padding-left: 1.25em; }
li { margin: .3em 0; }
img, svg { max-width: 100%; height: auto; }
code {
  font-family: var(--mono);
  font-size: .86em;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: .12em .4em;
  color: var(--accent-ink);
}
::selection { background: var(--accent-soft); color: var(--accent-ink); }

/* ---------- Utilities ---------- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 28px);
}
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--ink); color: #fff; padding: 10px 16px;
  border-radius: 8px; transition: top .2s ease;
}
.skip-link:focus { top: 12px; color: #fff; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.86);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: var(--header-h);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--accent); color: var(--accent-contrast);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.15);
}
.brand-mark svg { width: 24px; height: 24px; }
.brand-text { font-size: 1.06rem; letter-spacing: -.02em; }
.brand-light { color: var(--ink-3); font-weight: 600; }

.primary-nav { display: flex; align-items: center; gap: 8px; }
.nav-list { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-list a {
  display: inline-block; padding: 8px 12px; border-radius: 8px;
  color: var(--ink-2); font-weight: 550; font-size: .98rem;
  white-space: nowrap;
}
.nav-list a:hover { background: var(--surface-2); color: var(--ink); }
.nav-list a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-ink); font-weight: 650; }
.nav-cta {
  display: inline-block; margin-left: 6px; padding: 9px 16px;
  background: var(--accent); color: var(--accent-contrast) !important;
  border-radius: 9px; font-weight: 650; font-size: .95rem;
  white-space: nowrap;
  box-shadow: 0 1px 0 rgba(255,255,255,.2) inset, var(--shadow);
  transition: transform .12s ease, background .15s ease;
}
.nav-cta:hover { background: var(--accent-ink); transform: translateY(-1px); }

/* Dropdown (desktop) */
.nav-item { position: relative; }
.nav-item > a { display: inline-flex; align-items: center; gap: 5px; }
.caret {
  width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-1px); opacity: .6; transition: transform .15s ease, opacity .15s ease;
}
.nav-item:hover .caret, .nav-item:focus-within .caret { transform: rotate(-135deg) translateY(-1px); opacity: 1; }
.nav-sub {
  position: absolute; top: calc(100% + 4px); left: 0; min-width: 220px;
  list-style: none; margin: 0; padding: 6px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px;
  box-shadow: 0 12px 32px -12px rgba(20,20,40,.22), var(--shadow);
  opacity: 0; visibility: hidden; transform: translateY(4px);
  transition: opacity .14s ease, transform .14s ease, visibility .14s;
  z-index: 40;
}
.nav-item:hover > .nav-sub, .nav-item:focus-within > .nav-sub { opacity: 1; visibility: visible; transform: translateY(0); }
.nav-sub a { display: block; padding: 10px 12px; border-radius: 8px; font-size: .95rem; }
.nav-sub a:hover { background: var(--accent-soft); color: var(--accent-ink); }

.nav-toggle {
  display: none; align-items: center; gap: 8px;
  background: var(--surface-2); border: 1px solid var(--line-2);
  border-radius: 9px; padding: 9px 12px; cursor: pointer; color: var(--ink-2);
  font-weight: 600; font-size: .95rem; font-family: inherit;
}
.nav-toggle-icon, .nav-toggle-icon::before, .nav-toggle-icon::after {
  content: ""; display: block; width: 16px; height: 2px;
  background: currentColor; border-radius: 2px; position: relative;
}
.nav-toggle-icon { position: relative; }
.nav-toggle-icon::before { position: absolute; top: -5px; }
.nav-toggle-icon::after  { position: absolute; top: 5px; }

/* ---------- Hero ---------- */
.hero {
  display: grid; grid-template-columns: 1.5fr .9fr; gap: clamp(20px, 4vw, 56px);
  align-items: center;
  padding: clamp(40px, 7vw, 84px) 0 clamp(30px, 5vw, 56px);
}
.eyebrow {
  display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--accent-ink);
  background: var(--accent-soft); padding: 6px 12px; border-radius: 999px; margin-bottom: 18px;
}
.hero h1 { color: var(--ink); letter-spacing: -.03em; }
.lede { font-size: clamp(1.02rem, 1.5vw, 1.16rem); color: var(--ink-2); max-width: 46ch; }
.hero-search {
  display: flex; gap: 8px; margin: 22px 0 14px; max-width: 560px;
  background: var(--surface); border: 1px solid var(--line-2);
  border-radius: 12px; padding: 6px; box-shadow: var(--shadow);
}
.hero-search input {
  flex: 1; border: 0; outline: none; background: transparent;
  font-size: 1rem; font-family: inherit; padding: 10px 12px; color: var(--ink);
}
.hero-search input:focus { box-shadow: none; }
.hero-popular { font-size: .9rem; color: var(--ink-3); margin: 0; }
.hero-popular a { color: var(--accent-ink); font-weight: 550; }

.hero-stats {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; padding: 8px; box-shadow: var(--shadow);
}
.hero-stats dl { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 0; }
.hero-stats dl > div {
  padding: 18px 16px; border-radius: 10px;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.hero-stats dl > div:nth-child(even) { border-right: 0; }
.hero-stats dl > div:nth-last-child(-n+2) { border-bottom: 0; }
.hero-stats dt { font-size: 1.7rem; font-weight: 750; color: var(--accent-ink); letter-spacing: -.02em; }
.hero-stats dd { margin: 2px 0 0; font-size: .82rem; color: var(--ink-3); font-weight: 550; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; padding: 11px 20px; border-radius: 10px;
  background: var(--accent); color: var(--accent-contrast) !important;
  font-weight: 650; font-size: .98rem; border: 1px solid transparent;
  box-shadow: 0 1px 0 rgba(255,255,255,.2) inset, var(--shadow);
  transition: transform .12s ease, background .15s ease, box-shadow .15s ease;
}
.btn:hover { background: var(--accent-ink); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink) !important; border-color: var(--line-2); box-shadow: none; }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink) !important; }
button, .hero-search button, .search-box button {
  font-family: inherit; font-size: .98rem; font-weight: 650;
  padding: 10px 18px; border-radius: 9px; border: 0; cursor: pointer;
  background: var(--accent); color: var(--accent-contrast);
  transition: background .15s ease, transform .1s ease;
}
button:hover { background: var(--accent-ink); }

/* ---------- Section blocks ---------- */
.section-block { padding: clamp(30px, 5vw, 56px) 0; }
.section-block.alt { background: var(--surface); border-block: 1px solid var(--line); }
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  margin-bottom: 22px; flex-wrap: wrap;
}
.section-head h2 { margin: 0; }
.section-head p { color: var(--ink-3); margin: 4px 0 0; }
.section-more { font-weight: 600; color: var(--accent-ink); white-space: nowrap; }

/* ---------- Grids ---------- */
.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column;
  gap: 10px; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  position: relative;
}
.section-block.alt .card, .search-results .card { background: var(--surface); }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line-2); }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-kicker {
  font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent-ink); background: var(--accent-soft); padding: 4px 9px; border-radius: 999px;
}
.card-cat { font-size: .78rem; color: var(--ink-3); font-weight: 550; }
.card-title { margin: 0; font-size: 1.08rem; line-height: 1.35; }
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--accent-ink); }
.card-excerpt { color: var(--ink-3); font-size: .92rem; margin: 0; flex: 1; }
.card-link { font-size: .9rem; font-weight: 600; color: var(--accent-ink); }

/* ---------- Topic cards ---------- */
.topic-card {
  display: block; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.topic-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line-2); }
.topic-card h3 { margin: 0 0 6px; color: var(--ink); font-size: 1.05rem; }
.topic-card p { margin: 0; color: var(--ink-3); font-size: .92rem; }

/* ---------- Home: popular "fix a problem" list ---------- */
.popular-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
}
.popular-link {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 14px 16px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); color: var(--ink); font-weight: 550; font-size: .96rem;
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease, background .14s ease;
}
.popular-link span { color: var(--accent); font-weight: 700; }
.popular-link:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line-2); background: var(--surface-2); }

/* ---------- Home: popular error codes ---------- */
.err-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.err-link {
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px 16px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}
.err-link:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line-2); }
.err-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .8rem; font-weight: 700; letter-spacing: .02em;
  color: var(--accent-ink); background: var(--accent-soft);
  align-self: flex-start; padding: 3px 9px; border-radius: 999px;
}
.err-title { color: var(--ink); font-weight: 550; font-size: .95rem; line-height: 1.35; }
.section-more-wrap { margin: 18px 0 0; }

/* ---------- Home: dictionary preview / chips ---------- */
.dict-preview, .term-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.term-chip {
  display: inline-block; padding: 9px 15px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line-2);
  color: var(--ink-2); font-weight: 550; font-size: .95rem;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.term-chip:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }

/* ---------- About strip ---------- */
.about-strip { background: var(--ink); color: #fff; }
.about-strip-inner { padding: clamp(36px, 6vw, 64px) 0; max-width: 720px; }
.about-strip h2 { color: #fff; }
.about-strip p { color: rgba(255,255,255,.78); font-size: 1.05rem; }
.about-strip .btn { background: #fff; color: var(--accent-ink) !important; box-shadow: none; }
.about-strip .btn:hover { background: var(--accent-soft); }

/* ---------- Page head / body ---------- */
.page { padding: clamp(28px, 5vw, 56px) 0 clamp(40px, 6vw, 72px); }
.page-head { max-width: 760px; margin-bottom: 28px; }
.page-lede { color: var(--ink-2); font-size: clamp(1.02rem, 1.5vw, 1.14rem); }
.page-body { max-width: 900px; }
.prose { max-width: 72ch; }
.subhead { margin: 36px 0 16px; padding-top: 8px; }
.subhead:first-child { margin-top: 0; }

/* ---------- Breadcrumb ---------- */
.breadcrumb {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  font-size: .85rem; color: var(--ink-3); margin-bottom: 22px;
}
.breadcrumb a { color: var(--ink-3); }
.breadcrumb a:hover { color: var(--accent-ink); }
.breadcrumb span { color: var(--line-2); }

/* ---------- Article ---------- */
.article { max-width: 78ch; }
.article-head { margin-bottom: 12px; }
.article-summary { font-size: clamp(1.05rem, 1.6vw, 1.22rem); color: var(--ink-2); }
.article-meta { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: .9rem; margin: 0 0 8px; }
.meta-dot { opacity: .5; }
.article-section { margin: 34px 0; }
.article-section h2 { padding-bottom: 10px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.article-body h2 { margin-bottom: 16px; }
.article-body h3 { margin-top: 28px; }
.article-body p { color: var(--ink-2); }
.article-body strong { color: var(--ink); }
.article-body code { white-space: pre-wrap; }
.plain-list { padding-left: 1.1em; }
.plain-list li { padding-left: 4px; color: var(--ink-2); }

/* Callouts */
.callout {
  border-radius: var(--radius); padding: 18px 20px; margin: 24px 0;
  border: 1px solid var(--line); border-left-width: 4px; background: var(--surface);
}
.callout h2 { font-size: 1.02rem; margin: 0 0 6px; }
.callout p { margin: 0; color: var(--ink-2); }
.callout-quickfix { border-left-color: var(--ok); background: var(--ok-soft); }
.callout-quickfix h2 { color: var(--ok); }
.callout-warn { border-left-color: var(--warn); background: var(--warn-soft); }
.callout-privacy { border-left-color: var(--info); background: var(--info-soft); }

/* Steps (details) */
.step { border: 1px solid var(--line); border-radius: var(--radius-sm); margin: 10px 0; background: var(--surface); overflow: hidden; }
.step summary {
  list-style: none; cursor: pointer; padding: 14px 16px; display: flex; align-items: center; gap: 12px;
  font-weight: 650; color: var(--ink); user-select: none; position: relative;
}
.step summary::-webkit-details-marker { display: none; }
.step summary::after {
  content: "+"; margin-left: auto; font-size: 1.3rem; font-weight: 400; color: var(--ink-3);
  transition: transform .2s ease;
}
.step[open] summary::after { transform: rotate(45deg); }
.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%; flex: 0 0 auto;
  background: var(--accent-soft); color: var(--accent-ink); font-size: .85rem; font-weight: 700;
}
.step-body { padding: 4px 16px 16px 54px; color: var(--ink-2); }
.step-body p:last-child { margin-bottom: 0; }

/* FAQ (details) */
.faq-item { border: 1px solid var(--line); border-radius: var(--radius-sm); margin: 10px 0; background: var(--surface); overflow: hidden; }
.faq-item summary {
  list-style: none; cursor: pointer; padding: 14px 16px; display: flex; align-items: center; gap: 12px;
  font-weight: 650; color: var(--ink); user-select: none; position: relative;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; margin-left: auto; font-size: 1.3rem; font-weight: 400; color: var(--ink-3);
  transition: transform .2s ease;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-a { padding: 4px 16px 16px; color: var(--ink-2); }
.faq-a p:last-child { margin-bottom: 0; }

/* ---------- Search box ---------- */
.search-box {
  display: flex; gap: 8px; margin: 0 0 28px; max-width: 560px;
  background: var(--surface); border: 1px solid var(--line-2);
  border-radius: 12px; padding: 6px; box-shadow: var(--shadow);
}
.search-box input { flex: 1; border: 0; outline: none; background: transparent; font-size: 1rem; font-family: inherit; padding: 10px 12px; color: var(--ink); }
.search-results { display: grid; gap: 16px; }

/* ---------- Error article ---------- */
.error-code-badge {
  display: inline-block; font-family: var(--mono); font-size: 1.05rem; font-weight: 700;
  color: var(--accent-ink); background: var(--accent-soft); padding: 6px 14px; border-radius: 8px; margin-bottom: 14px;
  letter-spacing: .02em;
}
.term-phonetic { font-size: .9rem; color: var(--ink-3); letter-spacing: .04em; text-transform: uppercase; font-weight: 700; margin-bottom: 4px; }

/* ---------- Tool box ---------- */
.tool-box {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(18px, 3vw, 28px); box-shadow: var(--shadow); margin-bottom: 8px;
}
.tool-field { display: block; margin-bottom: 14px; }
.tool-field span { display: block; font-weight: 650; font-size: .92rem; margin-bottom: 6px; color: var(--ink-2); }
.tool-field input, .tool-field select, .tool-field textarea {
  width: 100%; font-family: inherit; font-size: 1rem; padding: 12px 14px;
  border: 1px solid var(--line-2); border-radius: 9px; background: var(--bg); color: var(--ink);
}
.tool-field input:focus, .tool-field select:focus, .tool-field textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--surface);
}
.tool-result {
  margin-top: 16px; padding: 18px; border-radius: 10px; background: var(--surface-2);
  border: 1px solid var(--line); font-size: 1.05rem;
}
.tool-result .big { font-size: 1.9rem; font-weight: 750; color: var(--accent-ink); letter-spacing: -.02em; display: block; margin-bottom: 4px; }
.tool-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* .tool-calc — the compact labelled-input calculator used by all tools */
.tool-calc { display: grid; gap: 14px; max-width: 620px; }
.tool-calc label, .tool-calc fieldset { font-family: inherit; }
.tool-calc label { display: block; font-weight: 650; font-size: .92rem; color: var(--ink-2); }
.tool-calc fieldset { border: 1px solid var(--line-2); border-radius: 9px; padding: 12px 14px; margin: 0; }
.tool-calc legend { font-weight: 700; font-size: .92rem; padding: 0 6px; color: var(--ink); }
.tool-calc input, .tool-calc select {
  width: 100%; font-family: inherit; font-size: 1rem; padding: 11px 13px; margin-top: 6px;
  border: 1px solid var(--line-2); border-radius: 9px; background: var(--bg); color: var(--ink);
}
.tool-calc input:focus, .tool-calc select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--surface);
}
.tool-calc .check { display: block; font-weight: 400; color: var(--ink-2); margin: 4px 0; }
.tool-calc .check input { width: auto; margin: 0 8px 0 0; vertical-align: middle; }
.tool-calc button {
  justify-self: start; cursor: pointer; font-family: inherit; font-size: 1rem; font-weight: 650;
  padding: 12px 22px; border: 0; border-radius: 9px; background: var(--accent); color: #fff;
}
.tool-calc button:hover { background: var(--accent-ink); }
.tool-calc [role="status"] { margin: 4px 0 0; color: var(--ink-2); line-height: 1.55; }
.tool-calc [role="status"] ul { margin: 8px 0; padding-left: 20px; }
.tool-warn {
  background: var(--warn-soft); border-left: 3px solid var(--warn); padding: 11px 14px;
  border-radius: var(--radius-sm); font-size: .92rem; color: var(--ink-2); line-height: 1.5;
}
.ping-line { font-variant-numeric: tabular-nums; margin: 2px 0; color: var(--ink-2); }
.howto { margin-top: 36px; }

/* ---------- Dictionary index ---------- */
.term-index { list-style: none; padding: 0; margin: 0; }
.term-index li { border-bottom: 1px solid var(--line); padding: 14px 0; }
.term-index a { color: var(--ink); display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: baseline; }
.term-index a:hover strong { color: var(--accent-ink); }
.term-def { color: var(--ink-3); font-size: .94rem; }

/* ---------- Empty states ---------- */
.empty { color: var(--ink-3); font-style: italic; }
.empty-state { text-align: center; padding: 40px 0; max-width: 520px; margin-inline: auto; }
.empty-code { font-size: 4rem; font-weight: 800; color: var(--line-2); letter-spacing: -.04em; line-height: 1; margin: 0 0 8px; }
.empty-links { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 20px; }
.center { text-align: center; }
.center .page-lede { margin-inline: auto; }
.center .search-box { margin-inline: auto; }

/* ---------- Footer ---------- */
.site-footer { background: var(--surface); border-top: 1px solid var(--line); margin-top: 40px; }
.footer-grid {
  display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 24px;
  padding: 40px 0 28px;
}
.footer-brand .footer-name { font-weight: 750; font-size: 1.05rem; margin: 0 0 8px; }
.footer-desc { color: var(--ink-3); font-size: .92rem; max-width: 36ch; }
.footer-col h3 { font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); margin-bottom: 12px; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin: 8px 0; }
.footer-col a { color: var(--ink-2); }
.footer-col a:hover { color: var(--accent-ink); }
.footer-bottom {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 18px 0; border-top: 1px solid var(--line); font-size: .85rem; color: var(--ink-3);
}
.footer-links a { color: var(--ink-3); }
.footer-links a:hover { color: var(--accent-ink); }

/* ---------- Responsive ---------- */
/* Compact band: 6-item row overflows by ~8px on a 1024px tablet — tighten link spacing */
@media (min-width: 1024px) and (max-width: 1099px) {
  .nav-list { gap: 0; }
  .nav-list a { padding: 8px 10px; }
  .nav-item a { padding-right: 8px; }
}
/* Collapse the top nav to a toggle at <1024px — the 6-item row needs ~1038px */
@media (max-width: 1023px) {
  .nav-toggle { display: inline-flex; }
  .primary-nav {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 6px;
    background: var(--surface); border-bottom: 1px solid var(--line);
    padding: 12px clamp(16px, 4vw, 28px) 18px; box-shadow: var(--shadow);
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: transform .18s ease, opacity .18s ease;
  }
  .primary-nav.is-open { transform: translateY(0); opacity: 1; visibility: visible; }
  .nav-list { flex-direction: column; align-items: stretch; gap: 2px; }
  .nav-list a { padding: 12px 14px; border-radius: 9px; font-size: 1.02rem; }
  .nav-sub {
    position: static; opacity: 1; visibility: visible; transform: none;
    min-width: 0; border: 0; box-shadow: none; background: var(--surface-2);
    margin: 2px 0 4px 8px; padding: 4px 0 4px 10px; border-left: 2px solid var(--line-2);
  }
  .nav-sub a { padding: 10px 12px; font-size: .98rem; }
  .caret { display: none; }
  .nav-cta { margin: 6px 0 0; text-align: center; }
}
@media (max-width: 880px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .hero { grid-template-columns: 1fr; }
  .hero-stats { order: -1; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .popular-grid { grid-template-columns: repeat(2, 1fr); }
  .err-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-search, .search-box { flex-wrap: wrap; }
  .hero-search button, .search-box button { flex: 1 1 100%; }
  .footer-bottom { flex-direction: column; text-align: center; }
}
@media (max-width: 640px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .popular-grid { grid-template-columns: 1fr; }
  .err-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 26px; }
  .footer-col a, .footer-desc { overflow-wrap: break-word; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
