:root {
  --ink: #12282b;
  --ink-soft: #3d5356;
  --muted: #6b7d80;
  --paper: #f7f4ee;
  --card: #ffffff;
  --line: #e4ded3;
  --deep: #0f2a2e;
  --accent: #e2643f;
  --accent-ink: #b8461f;
  --tone: #1f8a86;
  --tone-soft: #dff1ef;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(15, 42, 46, .05), 0 8px 28px -12px rgba(15, 42, 46, .18);
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.tone-wifi    { --tone: #1f8a86; --tone-soft: #dcf0ee; }
.tone-privacy { --tone: #6a55c9; --tone-soft: #ebe7fa; }
.tone-blocked { --tone: #d0573a; --tone-soft: #fbe6de; }
.tone-calls   { --tone: #2f8a4f; --tone-soft: #e0f1e5; }
.tone-gear    { --tone: #b07a12; --tone-soft: #f6ecd6; }

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e8efee; --ink-soft: #bccac9; --muted: #8fa3a2; --paper: #0d1a1c; --card: #13252a;
    --line: #22383d; --deep: #071214; --accent: #f08a68; --accent-ink: #f5a588;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px -14px rgba(0,0,0,.6);
  }
  .tone-wifi    { --tone: #4fc2bc; --tone-soft: #133336; }
  .tone-privacy { --tone: #a596f0; --tone-soft: #221f3a; }
  .tone-blocked { --tone: #f08a68; --tone-soft: #3a2119; }
  .tone-calls   { --tone: #6cc98d; --tone-soft: #16301f; }
  .tone-gear    { --tone: #e2b552; --tone-soft: #33280f; }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 17px/1.65 var(--sans); -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img, svg { display: block; }
.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 12px; z-index: 50; background: var(--card); padding: 8px 12px; border-radius: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: var(--deep); color: #fff;
}
.brand-mark svg { color: #7fd8d2; }
.brand-name { font: 600 18px/1 var(--serif); letter-spacing: -.01em; white-space: nowrap; }
.brand-name em, .footer-brand em { font-style: italic; color: var(--accent); }
.top-nav { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 500; }
.top-nav > a, .topic-menu summary {
  padding: 8px 12px; border-radius: 999px; text-decoration: none; cursor: pointer; list-style: none;
}
.top-nav > a:hover, .topic-menu summary:hover { background: var(--card); }
.topic-menu { position: relative; }
.topic-menu summary::-webkit-details-marker { display: none; }
.topic-menu summary::after { content: ""; display: inline-block; margin-left: 6px; width: 6px; height: 6px; border: solid currentColor; border-width: 0 1.6px 1.6px 0; transform: translateY(-3px) rotate(45deg); }
.topic-menu[open] summary { background: var(--card); }
.topic-menu ul {
  position: absolute; right: 0; top: calc(100% + 8px); width: min(320px, 92vw); max-height: 70vh; overflow: auto;
  margin: 0; padding: 8px; list-style: none; background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow);
}
.topic-menu li a { display: block; padding: 8px 12px; border-radius: 8px; text-decoration: none; font-weight: 400; }
.topic-menu li a:hover { background: var(--paper); }
@media (max-width: 560px) {
  .brand-name { font-size: 16px; }
  .top-nav > a { display: none; }
}

/* ---------- Shared ---------- */
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -.02em; line-height: 1.15; margin: 0; }
.lede { font-size: 19px; color: var(--ink-soft); max-width: 62ch; margin: 14px 0 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line); font-size: 14px; font-weight: 500; text-decoration: none;
  transition: border-color .15s, transform .15s;
}
.chip:hover { border-color: var(--accent); transform: translateY(-1px); }
.crumbs { font-size: 14px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 22px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.crumbs .sep { opacity: .5; }
.crumbs [aria-current] { color: var(--ink-soft); }

/* ---------- Home ---------- */
.home-hero {
  position: relative; overflow: hidden; color: #f2f7f6;
  background: linear-gradient(160deg, #0f2a2e 0%, #143b3f 55%, #1d4a48 100%);
  padding: 84px 0 72px;
}
.hero-glow {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(600px 300px at 85% 10%, rgba(226, 100, 63, .35), transparent 70%),
    radial-gradient(500px 340px at 5% 100%, rgba(79, 194, 188, .25), transparent 70%);
}
.home-hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .12;
  background-image: radial-gradient(rgba(255,255,255,.7) 1px, transparent 1px); background-size: 22px 22px;
  mask-image: linear-gradient(to bottom, black, transparent 85%);
}
.hero-inner { position: relative; z-index: 1; }
.home-hero h1 { font-size: clamp(38px, 6.4vw, 68px); max-width: 17ch; }
.home-hero h1 span { font-style: italic; color: #7fd8d2; font-weight: 500; }
.home-hero .lede { color: #c6d8d6; }
.search { position: relative; margin-top: 32px; max-width: 620px; }
.search > svg { position: absolute; left: 18px; top: 18px; color: var(--muted); }
.search input {
  width: 100%; padding: 17px 20px 17px 50px; border-radius: 14px; border: 0; font: 500 17px var(--sans);
  background: #fff; color: #12282b; box-shadow: 0 12px 40px -12px rgba(0,0,0,.45);
}
.search input::placeholder { color: #8a9a9c; }
.search input:focus { outline: 3px solid rgba(226,100,63,.55); outline-offset: 2px; }
.results {
  position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 8px); margin: 0; padding: 6px; list-style: none;
  background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
  max-height: 420px; overflow: auto;
}
.results a { display: block; padding: 10px 12px; border-radius: 10px; text-decoration: none; }
.results a:hover, .results a.active { background: var(--paper); }
.results .r-t { display: block; font-weight: 600; }
.results .r-c { display: block; font-size: 13px; color: var(--muted); }
.results .empty { padding: 12px; color: var(--muted); }
.hero-chips { margin-top: 26px; }
.hero-chips .chip { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.16); color: #e6efee; }
.hero-chips .chip:hover { border-color: #f3a184; }

.group { padding: 64px 0 8px; scroll-margin-top: 70px; }
.group + .group { border-top: 1px solid var(--line); margin-top: 48px; }
.group-head { display: flex; align-items: center; gap: 16px; margin-bottom: 26px; }
.group-icon, .cat-icon {
  flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px;
  background: var(--tone-soft); color: var(--tone);
}
.group-head h2 { font-size: clamp(26px, 3.4vw, 34px); }
.group-head p { margin: 2px 0 0; color: var(--muted); }
.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.topic-card {
  display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px 22px 18px; box-shadow: var(--shadow);
  border-top: 3px solid var(--tone); transition: transform .2s, box-shadow .2s;
}
.topic-card:hover { transform: translateY(-3px); }
.topic-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; text-decoration: none; }
.topic-head h3 { font-size: 21px; }
.topic-head:hover h3 { color: var(--tone); }
.count {
  flex: none; min-width: 28px; height: 28px; padding: 0 8px; display: grid; place-items: center; border-radius: 999px;
  background: var(--tone-soft); color: var(--tone); font-size: 13px; font-weight: 600;
}
.topic-qs { list-style: none; margin: 14px 0 16px; padding: 0; display: grid; gap: 2px; flex: 1; align-content: start; }
.topic-qs a {
  display: block; padding: 7px 0 7px 16px; position: relative; font-size: 15px; line-height: 1.4;
  color: var(--ink-soft); text-decoration: none;
}
.topic-qs a::before { content: ""; position: absolute; left: 0; top: 14px; width: 6px; height: 6px; border-radius: 50%; background: var(--tone); opacity: .6; }
.topic-qs a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.more { font-size: 14px; font-weight: 600; color: var(--tone); text-decoration: none; }
.more:hover { text-decoration: underline; }

/* ---------- Category page ---------- */
.cat-hero { background: linear-gradient(180deg, var(--tone-soft), var(--paper)); padding: 40px 0 44px; }
.cat-hero-row { display: flex; gap: 22px; align-items: flex-start; }
.cat-icon { width: 64px; height: 64px; border-radius: 18px; background: var(--card); box-shadow: var(--shadow); }
.cat-hero h1 { font-size: clamp(34px, 5vw, 52px); }
.cat-body { padding: 8px 0 72px; }
.q-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; max-width: 900px; }
.q-card {
  display: grid; grid-template-columns: auto 1fr auto; gap: 20px; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px;
  text-decoration: none; box-shadow: var(--shadow); transition: border-color .15s, transform .2s;
}
.q-card:hover { border-color: var(--tone); transform: translateX(4px); }
.q-num { font: 600 15px/1 var(--serif); color: var(--tone); background: var(--tone-soft); width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; }
.q-title { display: block; font: 600 21px/1.25 var(--serif); letter-spacing: -.01em; }
.q-lead { display: block; margin-top: 6px; font-size: 15px; color: var(--muted); line-height: 1.5; }
.q-arrow { font-size: 22px; color: var(--tone); transition: transform .2s; }
.q-card:hover .q-arrow { transform: translateX(4px); }
.related { margin-top: 44px; max-width: 900px; }
.related-h { font-size: 22px; margin: 0 0 14px; }
@media (max-width: 600px) {
  .cat-hero-row { flex-direction: column; gap: 16px; }
  .q-card { grid-template-columns: 1fr; gap: 10px; padding: 20px; }
  .q-arrow { display: none; }
}

/* ---------- Article ---------- */
.article-hero { background: linear-gradient(180deg, var(--tone-soft), var(--paper)); padding: 36px 0 30px; }
.narrow-hero { max-width: 1160px; }
.article-hero h1 { font-size: clamp(32px, 4.8vw, 50px); max-width: 22ch; }
.meta { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; margin: 16px 0 0; }
.dot { width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 56px; padding: 24px 0 80px; align-items: start; }
.article { max-width: 720px; }
.answer-box {
  position: relative; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--tone);
  border-radius: 14px; padding: 22px 24px; box-shadow: var(--shadow); margin-bottom: 34px;
}
.answer-box p:last-child { margin: 0; font-size: 18.5px; line-height: 1.6; }
.article .related { margin-top: 40px; }
.prose h2 { font-size: 27px; margin: 42px 0 12px; }
.prose h3 { font-size: 21px; margin: 30px 0 10px; }
.prose p { margin: 0 0 18px; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 20px; }
.prose li { margin: 0 0 10px; padding-left: 4px; }
.prose li::marker { color: var(--tone); font-weight: 600; }
.prose strong { font-weight: 600; color: var(--ink); }
.prose a, .answer-box a {
  color: var(--accent-ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent);
}
.prose a:hover, .answer-box a:hover { text-decoration-color: currentColor; }
.table-wrap { overflow-x: auto; margin: 6px 0 24px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.prose table { width: 100%; border-collapse: collapse; font-size: 15.5px; }
.prose th, .prose td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { background: var(--tone-soft); font-weight: 600; }
.prose tr:last-child td { border-bottom: 0; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--line); }
.pager a {
  display: block; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--card);
  text-decoration: none; font: 600 16px/1.35 var(--serif); transition: border-color .15s;
}
.pager a:hover { border-color: var(--tone); }
.pager .next { text-align: right; }
.sidebar { position: sticky; top: 88px; }
.side-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.side-h { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-weight: 600; font-size: 14px; color: var(--tone); }
.side-list { margin: 0; padding: 0; list-style: none; counter-reset: q; }
.side-list li { counter-increment: q; }
.side-list a {
  display: grid; grid-template-columns: 26px 1fr; gap: 6px; padding: 9px 8px; border-radius: 10px;
  font-size: 14.5px; line-height: 1.4; text-decoration: none; color: var(--ink-soft);
}
.side-list a::before { content: counter(q, decimal-leading-zero); font-weight: 600; font-size: 12px; color: var(--muted); padding-top: 2px; }
.side-list a:hover { background: var(--paper); color: var(--ink); }
.side-list a[aria-current] { background: var(--tone-soft); color: var(--ink); font-weight: 600; }
.side-all { display: block; margin-top: 10px; padding: 0 8px; font-size: 14px; font-weight: 600; color: var(--tone); text-decoration: none; }
.side-all:hover { text-decoration: underline; }
@media (max-width: 920px) {
  .article-layout { grid-template-columns: 1fr; gap: 32px; }
  .sidebar { position: static; }
}
@media (max-width: 560px) {
  body { font-size: 16.5px; }
  .pager { grid-template-columns: 1fr; }
  .pager .next { text-align: left; }
  .answer-box { padding: 18px 18px; }
}

/* ---------- Footer ---------- */
.site-footer { background: var(--deep); color: #b9cbc9; padding: 56px 0 28px; margin-top: 40px; font-size: 15px; }
.page-cat .site-footer, .page-article .site-footer { margin-top: 0; }
.footer-inner { display: grid; grid-template-columns: 1fr 2.2fr; gap: 48px; }
.footer-brand { font: 600 20px var(--serif); color: #fff; margin: 0 0 10px; }
.footer-note { margin: 0; max-width: 36ch; font-size: 14px; line-height: 1.6; }
.footer-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 24px; }
.footer-h { color: #fff; font-weight: 600; font-size: 14px; margin: 0 0 8px; }
.footer-links ul { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin: 0 0 6px; }
.footer-links a { text-decoration: none; font-size: 14px; }
.footer-links a:hover { color: #fff; text-decoration: underline; }
.footer-base { margin-top: 40px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.1); font-size: 13px; color: #7f9694; }
@media (max-width: 820px) { .footer-inner { grid-template-columns: 1fr; } }

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