/* settings.help — design system. No build step, ~20KB, dark/light via [data-theme]. */

:root {
  --bg: #f8fafc;
  --bg-alt: #eef2f7;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-soft: #475569;
  --text-faint: #94a3b8;
  --accent: #0284c7;
  --accent-strong: #0369a1;
  --accent-soft: #e0f2fe;
  --grad-a: #0284c7;
  --grad-b: #7c3aed;
  --ok-bg: #dcfce7;
  --ok-text: #166534;
  --shadow: 0 1px 3px rgb(15 23 42 / .06), 0 8px 24px rgb(15 23 42 / .06);
  --shadow-lg: 0 4px 12px rgb(15 23 42 / .08), 0 16px 40px rgb(15 23 42 / .12);
  --radius: 14px;
}
[data-theme="dark"] {
  --bg: #0b1220;
  --bg-alt: #0f172a;
  --surface: #131c2e;
  --border: #263349;
  --text: #e2e8f0;
  --text-soft: #94a3b8;
  --text-faint: #64748b;
  --accent: #38bdf8;
  --accent-strong: #7dd3fc;
  --accent-soft: #0c2a3d;
  --ok-bg: #14532d;
  --ok-text: #bbf7d0;
  --shadow: 0 1px 3px rgb(0 0 0 / .4), 0 8px 24px rgb(0 0 0 / .35);
  --shadow-lg: 0 4px 12px rgb(0 0 0 / .45), 0 16px 40px rgb(0 0 0 / .5);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background .25s, color .25s;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); }

.container { max-width: 1120px; margin: 0 auto; padding: 0 1.25rem; }
.container-narrow { max-width: 760px; }
.center { text-align: center; }

.skip-link { position: absolute; left: -999px; top: 0; background: var(--accent); color: #fff; padding: .5rem 1rem; z-index: 100; }
.skip-link:focus { left: 0; }

/* ---------------------------------------------------------------- header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 1.25rem; height: 64px; }
.brand { display: flex; align-items: center; gap: .5rem; font-weight: 800; font-size: 1.1rem; color: var(--text); letter-spacing: -.02em; }
.brand-icon { width: 22px; height: 22px; color: var(--accent); }
.main-nav { display: none; gap: .25rem; flex: 1; }
.main-nav a { padding: .4rem .7rem; border-radius: 8px; color: var(--text-soft); font-size: .92rem; font-weight: 500; white-space: nowrap; }
.main-nav a:hover { background: var(--bg-alt); color: var(--text); }
@media (min-width: 900px) { .main-nav { display: flex; } }
.header-actions { display: flex; align-items: center; gap: .6rem; margin-left: auto; }
.search-form input {
  width: 150px; padding: .45rem .8rem; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-size: .9rem; transition: width .25s, border-color .2s;
}
.search-form input:focus { width: 210px; outline: none; border-color: var(--accent); }
@media (max-width: 520px) { .search-form { display: none; } }
.theme-toggle {
  display: grid; place-items: center; width: 38px; height: 38px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text-soft); cursor: pointer;
}
.theme-toggle:hover { color: var(--text); border-color: var(--text-faint); }
.theme-toggle svg { width: 18px; height: 18px; }
[data-theme="light"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: none; }

/* ---------------------------------------------------------------- hero */
.hero { padding: 4.5rem 0 3.5rem; text-align: center; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -40% -20% auto; height: 130%;
  background: radial-gradient(600px 300px at 30% 20%, color-mix(in srgb, var(--grad-a) 16%, transparent), transparent 70%),
              radial-gradient(600px 300px at 70% 10%, color-mix(in srgb, var(--grad-b) 14%, transparent), transparent 70%);
  pointer-events: none;
}
.hero > .container { position: relative; }
.hero-kicker { color: var(--accent); font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .12em; margin: 0 0 .8rem; }
.hero h1 { font-size: clamp(2rem, 5.5vw, 3.4rem); line-height: 1.12; letter-spacing: -.03em; margin: 0 0 1rem; font-weight: 800; }
.grad { background: linear-gradient(90deg, var(--grad-a), var(--grad-b)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { color: var(--text-soft); font-size: 1.1rem; max-width: 560px; margin: 0 auto 1.8rem; }
.hero-search { display: flex; gap: .5rem; max-width: 540px; margin: 0 auto; }
.hero-search input {
  flex: 1; padding: .85rem 1.1rem; border-radius: 12px; font-size: 1rem;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); box-shadow: var(--shadow);
}
.hero-search input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.hero-search button {
  padding: .85rem 1.4rem; border: 0; border-radius: 12px; font-size: 1rem; font-weight: 700;
  background: linear-gradient(90deg, var(--grad-a), var(--grad-b)); color: #fff; cursor: pointer;
  transition: transform .15s, filter .15s;
}
.hero-search button:hover { transform: translateY(-1px); filter: brightness(1.08); }

/* ---------------------------------------------------------------- sections & cards */
.section { padding: 3rem 0; }
.section-alt { background: var(--bg-alt); }
.section-title { font-size: 1.5rem; letter-spacing: -.02em; margin: 0 0 1.4rem; }
.section-sub { color: var(--text-soft); margin: -.4rem 0 1.6rem; }
.grid { display: grid; gap: 1.1rem; }
.cat-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.post-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.35rem; box-shadow: var(--shadow);
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.cat-card { display: block; color: var(--text); }
.cat-card h3 { margin: 0 0 .4rem; font-size: 1.05rem; }
.cat-card p { margin: 0 0 .8rem; color: var(--text-soft); font-size: .88rem; line-height: 1.5; }
.cat-count { color: var(--accent); font-weight: 600; font-size: .85rem; }
.post-card h3, .post-card .h3 { margin: .5rem 0; font-size: 1.06rem; line-height: 1.4; }
.post-card h3 a, .post-card .h3 a { color: var(--text); }
.post-card h3 a:hover, .post-card .h3 a:hover { color: var(--accent); }
.post-card p { color: var(--text-soft); font-size: .9rem; margin: 0 0 .8rem; }
.post-meta { color: var(--text-faint); font-size: .8rem; display: flex; gap: .4rem; }
.badge {
  display: inline-block; padding: .18rem .6rem; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font-size: .75rem; font-weight: 700;
}
.trust-strip { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.trust-strip div { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.3rem; }
.trust-strip strong { display: block; margin-bottom: .2rem; }
.trust-strip span { color: var(--text-soft); font-size: .88rem; }

/* ---------------------------------------------------------------- article */
.article { padding: 2.5rem 0 3.5rem; }
.breadcrumbs { display: flex; gap: .5rem; flex-wrap: wrap; color: var(--text-faint); font-size: .85rem; margin-bottom: 1rem; }
.article h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); line-height: 1.2; letter-spacing: -.02em; margin: 0 0 .8rem; }
.article-meta { display: flex; flex-wrap: wrap; gap: .45rem; color: var(--text-faint); font-size: .88rem; margin-bottom: 2rem; padding-bottom: 1.2rem; border-bottom: 1px solid var(--border); }
.prose { font-size: 1.04rem; }
.prose h2 { font-size: 1.4rem; margin: 2.2rem 0 .7rem; letter-spacing: -.01em; }
.prose h3 { font-size: 1.15rem; margin: 1.8rem 0 .5rem; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.1rem; color: var(--text); }
.prose li { margin-bottom: .45rem; }
.prose code { background: var(--bg-alt); border: 1px solid var(--border); border-radius: 6px; padding: .12rem .4rem; font-size: .9em; }
.prose strong { font-weight: 700; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.2rem 0; font-size: .95rem; }
.prose th, .prose td { border: 1px solid var(--border); padding: .55rem .8rem; text-align: left; }
.prose th { background: var(--bg-alt); }
.ad-slot { margin: 1.6rem 0; min-height: 90px; display: grid; place-items: center; }

.faq-block { margin-top: 2.5rem; }
.faq-block h2 { font-size: 1.4rem; margin-bottom: 1rem; }
.faq-item { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); margin-bottom: .6rem; padding: 0 1.1rem; }
.faq-item summary { padding: .9rem 0; font-weight: 600; cursor: pointer; list-style: none; position: relative; padding-right: 1.6rem; }
.faq-item summary::after { content: "+"; position: absolute; right: .2rem; color: var(--accent); font-size: 1.2rem; }
.faq-item[open] summary::after { content: "–"; }
.faq-item p { margin: 0 0 1rem; color: var(--text-soft); }

.author-box { margin-top: 2.5rem; padding: 1.2rem 1.4rem; border-left: 3px solid var(--accent); background: var(--bg-alt); border-radius: 0 var(--radius) var(--radius) 0; }
.author-box .author-name { font-weight: 700; margin: 0 0 .3rem; }
.author-box p { margin: 0; color: var(--text-soft); font-size: .92rem; }
.related { margin-top: 3rem; }
.related h2 { font-size: 1.3rem; margin-bottom: 1rem; }

/* ---------------------------------------------------------------- forms / misc */
.contact-form label { display: block; margin-bottom: 1rem; font-weight: 600; font-size: .92rem; }
.contact-form input, .contact-form textarea {
  display: block; width: 100%; margin-top: .35rem; padding: .7rem .9rem; font: inherit;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text);
}
.contact-form input:focus, .contact-form textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }
.hp-field { position: absolute; left: -9999px; }
.btn {
  display: inline-block; padding: .7rem 1.4rem; border: 0; border-radius: 10px; cursor: pointer;
  background: var(--accent); color: #fff; font-weight: 700; font-size: .95rem;
}
.btn:hover { background: var(--accent-strong); }
.flash-ok { background: var(--ok-bg); color: var(--ok-text); border-radius: 10px; padding: .8rem 1rem; margin-bottom: 1rem; }
.pagination { display: flex; gap: .4rem; justify-content: center; margin-top: 2rem; }
.pagination a, .page-current { padding: .45rem .85rem; border-radius: 8px; border: 1px solid var(--border); }
.page-current { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.empty-note { color: var(--text-soft); background: var(--bg-alt); border-radius: 10px; padding: 1rem 1.2rem; }
.err-code { font-size: 4.5rem; font-weight: 800; margin: 1rem 0 0; background: linear-gradient(90deg, var(--grad-a), var(--grad-b)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.search-results { display: grid; gap: 1rem; margin-top: 1.2rem; }

/* ---------------------------------------------------------------- footer */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-alt); margin-top: 2rem; }
.footer-inner { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); padding: 2.5rem 1.25rem; }
.footer-brand { font-weight: 800; margin: 0 0 .4rem; }
.footer-tag { color: var(--text-soft); font-size: .88rem; margin: 0; }
.footer-col h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-faint); margin: 0 0 .7rem; }
.footer-col a { display: block; color: var(--text-soft); font-size: .92rem; padding: .18rem 0; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom { border-top: 1px solid var(--border); padding: 1.1rem 1.25rem; }
.footer-bottom p { color: var(--text-faint); font-size: .82rem; margin: 0; }

/* ---------------------------------------------------------------- images */
.cover-img { width: 100%; height: auto; border-radius: var(--radius); margin: 0 0 1.6rem; box-shadow: var(--shadow); }
.card-img { width: calc(100% + 2.7rem); margin: -1.35rem -1.35rem .9rem; border-radius: var(--radius) var(--radius) 0 0; display: block; }

/* ---------------------------------------------------------------- glossary */
.az-nav { display: flex; flex-wrap: wrap; gap: .35rem; margin: 1.2rem 0 2rem; }
.az-nav a { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); font-weight: 700; font-size: .85rem; }
.az-nav a:hover { border-color: var(--accent); }
.az-letter { font-size: 1.2rem; color: var(--accent); border-bottom: 1px solid var(--border); padding-bottom: .3rem; margin: 2rem 0 .9rem; }
.term-grid { display: flex; flex-wrap: wrap; gap: .5rem; }
.term-chip {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .45rem .85rem; border-radius: 999px; font-size: .88rem; font-weight: 600;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  transition: border-color .15s, transform .15s;
}
.term-chip:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.term-cat { font-size: .7rem; font-weight: 700; color: var(--text-faint); text-transform: uppercase; letter-spacing: .06em; }

/* ---------------------------------------------------------------- hubs */
.hub-head { display: grid; gap: 1.6rem; align-items: center; margin-bottom: 2.2rem; }
@media (min-width: 800px) { .hub-head { grid-template-columns: 380px 1fr; } }
.hub-cover { width: 100%; height: auto; border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.hub-head h1 { margin: 0 0 .5rem; font-size: clamp(1.5rem, 3.5vw, 2.2rem); letter-spacing: -.02em; }
.coming-soon { columns: 2; gap: 2rem; color: var(--text-soft); }
@media (max-width: 640px) { .coming-soon { columns: 1; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card, .hero-search button { transition: none; }
}
