:root {
  color-scheme: dark;
  --bg: #0f172a;
  --card: #111827;
  --card-2: #0b1220;
  --line: #1f2937;
  --line-2: #172036;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --accent: #93c5fd;
  --radius: 20px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(1200px 600px at 70% -10%, #1f2937 0%, var(--bg) 60%) fixed;
  background-color: var(--bg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Inter, sans-serif;
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* ---------- Header / nav ---------- */
.site-header {
  width: min(840px, 92vw);
  margin: 0 auto;
  padding: 22px 0 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.brand { color: var(--text); font-weight: 700; letter-spacing: .01em; font-size: 1.05rem; }
.brand:hover { text-decoration: none; color: var(--accent); }
.nav { display: flex; gap: 18px; flex-wrap: wrap; font-size: .95rem; }
.nav a { color: var(--muted); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); text-decoration: none; }

/* ---------- Layout ---------- */

main.wrap {
  width: min(840px, 92vw);
  margin: 14px auto 0;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .45);
}
.card + .card { margin-top: 18px; }

h1 { margin: 0 0 6px; font-size: clamp(1.6rem, 2.5vw, 2.2rem); line-height: 1.2; }
h2 { margin: 1.8em 0 .4em; font-size: 1.3rem; line-height: 1.3; }
h3 { margin: 1.4em 0 .3em; font-size: 1.08rem; }
.tag { color: var(--accent); font-weight: 600; letter-spacing: .02em; }
.lead { color: var(--muted); font-size: 1.08rem; margin: .2em 0 1em; }
p { margin: .8em 0; }
ul, ol { padding-left: 1.3em; }
li { margin: .3em 0; }

pre, code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
pre {
  margin: 14px 0;
  padding: 14px;
  background: var(--card-2);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  overflow: auto;
  font-size: .93rem;
  line-height: 1.5;
}
code { font-size: .92em; background: var(--card-2); border: 1px solid var(--line-2); padding: .08em .35em; border-radius: 6px; }
pre code { background: none; border: 0; padding: 0; }

table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: .95rem; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; }
.table-wrap { overflow-x: auto; }

/* ---------- Guide cards on the home page ---------- */
.guide-list { display: grid; gap: 12px; margin-top: 14px; padding: 0; list-style: none; }
.guide-list li { margin: 0; }
.guide-list a {
  display: block;
  padding: 16px 18px;
  background: var(--card-2);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  color: var(--text);
  transition: border-color .2s ease, transform .2s ease;
}
.guide-list a:hover { border-color: #334155; transform: translateY(-1px); text-decoration: none; }
.guide-list strong { display: block; color: var(--accent); }
.guide-list span { color: var(--muted); font-size: .94rem; }

/* ---------- Article ---------- */
.meta { color: var(--muted); font-size: .9rem; margin-bottom: 1.2em; }
.article { max-width: 68ch; margin-inline: auto; }
.callout {
  border-left: 3px solid var(--accent);
  background: var(--card-2);
  padding: 12px 16px;
  border-radius: 0 12px 12px 0;
  margin: 1.2em 0;
}
.related { margin-top: 2em; padding-top: 1em; border-top: 1px solid var(--line); }

/* ---------- Ads: quiet, labelled, never sticky ---------- */
.ad-wrap {
  margin: 2.2em auto;
  padding: 10px 12px 12px;
  max-width: 100%;
  min-height: 140px;
  background: rgba(11, 18, 32, .55);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  text-align: center;
  opacity: 0;
  transition: opacity .45s ease;
  overflow: hidden;
}
.ad-wrap.is-ready { opacity: 1; }
.ad-wrap[hidden],
.ad-wrap:has(ins[data-ad-status="unfilled"]) { display: none; }
.ad-label {
  display: block;
  margin-bottom: 6px;
  font-size: .68rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #6b7280;
}
.ad-wrap ins { min-height: 100px; }

/* ---------- Footer ---------- */
.site-footer {
  width: min(840px, 92vw);
  margin: 22px auto 40px;
  padding-top: 14px;
  color: var(--muted);
  opacity: .85;
  font-size: .9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  justify-content: space-between;
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); cursor: pointer; }
.linklike:hover { color: var(--text); text-decoration: underline; }

@media (max-width: 560px) {
  .card { padding: 20px 18px; border-radius: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ad-wrap, .guide-list a { transition: none; }
}
