:root {
  color-scheme: dark;
  --bg: #0c0d10;
  --surface: #14161c;
  --surface-alt: #1b1e27;
  --ink: #f3f1ea;
  --muted: #9a9da8;
  --line: #292d3a;
  --accent: #e5a93c;
  --accent-soft: #f2c873;
  --signal: #4fd1a5;
  --font-sans: "Inter", system-ui, -apple-system, sans-serif;
  --font-display: "Space Grotesk", system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.65;
}
a { color: var(--accent-soft); text-underline-offset: 4px; }
a:hover { color: var(--ink); }
button, input, select, textarea { font: inherit; color: inherit; }
button, select { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.shell { width: min(1240px, calc(100% - 48px)); margin: 0 auto; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 68px;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.brand-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: var(--accent);
  box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 55%, transparent);
}
.topnav { display: flex; align-items: center; gap: 22px; font-size: 13px; }
.topnav a { color: var(--muted); text-decoration: none; font-weight: 500; }
.topnav a:hover { color: var(--ink); }

.hero-band {
  padding: 28px 0 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 8px;
}
.hero-band h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(28px, 3.8vw, 46px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  max-width: 780px;
}
.hero-lead {
  margin: 10px 0 0;
  color: var(--muted);
  max-width: 700px;
  font-size: 15px;
}
.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pill {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
}
.pill strong { color: var(--signal); font-weight: 600; }

.article-wrap {
  max-width: 860px;
  margin: 48px auto;
}
.article-wrap h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(22px, 2.5vw, 30px);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 36px 0 12px;
}
.article-wrap h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  margin: 22px 0 8px;
  color: var(--accent-soft);
}
.article-wrap p, .article-wrap li { color: color-mix(in srgb, var(--ink) 84%, var(--bg)); }
.article-wrap ul, .article-wrap ol { padding-left: 20px; }
.article-wrap li { margin: 6px 0; }
.article-wrap pre, .article-wrap code {
  font-family: var(--font-mono);
  font-size: 13px;
}
.article-wrap pre {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  overflow-x: auto;
}
.article-wrap table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  font-size: 14px;
}
.article-wrap th, .article-wrap td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.article-wrap th {
  background: var(--surface-alt);
  color: var(--accent-soft);
  font-family: var(--font-display);
  font-weight: 600;
}
.figure-card {
  margin: 24px 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
}
.figure-card img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}
.figure-card figcaption {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

.engage-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 24px 0 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.btn-ghost, .btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--line);
  background: var(--surface-alt);
  color: var(--ink);
  transition: border-color .15s, background .15s;
}
.btn-ghost:hover { border-color: var(--accent); }
.btn-ghost[data-gf-liked] {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--bg);
}
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}
.btn-primary:hover { background: var(--accent-soft); border-color: var(--accent-soft); }
.share-msg { font-size: 12px; color: var(--signal); }

details {
  border-top: 1px solid var(--line);
  padding: 14px 0;
}
details:last-of-type { border-bottom: 1px solid var(--line); }
summary {
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
}
details p { margin: 10px 0 0; color: var(--muted); }

.comments-section { margin-top: 40px; }
.comment-form {
  display: grid;
  gap: 10px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 18px;
}
.comment-form input, .comment-form textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}
.comment-form textarea { min-height: 84px; resize: vertical; }
.comment-card {
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 12px;
  margin-bottom: 10px;
}
.comment-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.comment-meta strong { color: var(--ink); font-size: 13px; }
.comment-card[data-gf-owner] { border-color: var(--accent); }
.owner-badge {
  background: var(--accent);
  color: var(--bg);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.comment-replies { margin: 10px 0 0 18px; padding-left: 12px; border-left: 2px solid var(--line); }
.empty-comments { color: var(--muted); font-size: 13px; }

.legal-page .article-wrap { margin: 40px auto 64px; }
.legal-page h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(28px, 3.6vw, 40px);
  line-height: 1.15;
  margin: 0 0 18px;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 24px 0 36px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--muted);
}
.footer-nav { display: flex; flex-wrap: wrap; gap: 18px; }
.footer-nav a { color: var(--muted); text-decoration: none; }
.footer-nav a:hover { color: var(--ink); text-decoration: underline; }

@media (max-width: 720px) {
  .shell { width: calc(100% - 28px); }
  .topbar { height: 60px; }
  .topnav { gap: 14px; }
  .hero-band { padding: 20px 0 14px; }
  .article-wrap { margin: 32px auto; }
}
