:root {
  --bg: #0b0d12;
  --surface: #141821;
  --surface-2: #1b2130;
  --border: #262d3d;
  --text: #e8ecf4;
  --muted: #98a2b8;
  --accent: #3ee6a8;
  --accent-ink: #062018;
  --accent-2: #8b7bff;
  --danger: #ff6b7a;
  --radius: 14px;
  --maxw: 1120px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
}
a { color: inherit; }
img { max-width: 100%; display: block; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }

/* ---- header / footer ---- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }
.logo { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; text-decoration: none; letter-spacing: -0.02em; }
.logo span { color: var(--accent); }
.nav { display: flex; gap: 20px; font-size: 0.95rem; }
.nav a { text-decoration: none; color: var(--muted); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }

.site-footer { border-top: 1px solid var(--border); margin-top: 80px; padding: 32px 0; color: var(--muted); font-size: 0.9rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; }
.site-footer nav { display: flex; gap: 16px; flex-wrap: wrap; }
.site-footer a { color: var(--muted); }

/* ---- hero ---- */
.hero { padding: 64px 0 32px; }
.eyebrow { color: var(--accent); font-weight: 600; font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; margin: 0 0 12px; }
.hero h1 { font-family: var(--font-display); font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.1; letter-spacing: -0.03em; margin: 0 0 16px; max-width: 18ch; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p { color: var(--muted); font-size: 1.1rem; max-width: 60ch; margin: 0; }

.section-title { font-family: var(--font-display); font-size: 1.4rem; margin: 40px 0 16px; letter-spacing: -0.01em; }

/* ---- pills ---- */
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 24px; }
.pill {
  display: inline-block; padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--muted); text-decoration: none; font-size: 0.9rem;
}
.pill:hover { color: var(--text); border-color: var(--muted); }
.pill[aria-current="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }

/* ---- grid / cards ---- */
.grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; text-decoration: none; transition: transform .15s ease, border-color .15s ease;
}
.card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
.card .cover { aspect-ratio: 16 / 9; background: linear-gradient(135deg, var(--surface-2), #10131b); }
.card .cover img { width: 100%; height: 100%; object-fit: cover; }
.card .body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card h3 { font-family: var(--font-display); font-size: 1.15rem; line-height: 1.3; margin: 0; }
.card .excerpt { color: var(--muted); font-size: 0.95rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card .meta { color: var(--muted); font-size: 0.8rem; margin-top: auto; }
.card .cat { color: var(--accent); font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; }

.skeleton { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.skeleton .cover { aspect-ratio: 16/9; }
.skeleton .line { height: 14px; margin: 16px 20px; border-radius: 6px; }
.skeleton .cover, .skeleton .line { background: linear-gradient(90deg, var(--surface-2), #232a3b, var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
.skeleton .line.short { width: 50%; }
@keyframes shimmer { to { background-position: -200% 0; } }

.state { padding: 40px 24px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); }
.state.error { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); border-style: solid; }
.state h2 { color: var(--text); font-family: var(--font-display); margin: 0 0 8px; }

.btn {
  display: inline-block; padding: 12px 22px; border-radius: 10px; border: 0; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 0.95rem; text-decoration: none; font-family: inherit;
}
.btn:disabled { opacity: .6; cursor: wait; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.center { text-align: center; margin-top: 32px; }

/* ---- category header ---- */
.cat-header { padding: 48px 0 8px; }
.cat-header h1 { font-family: var(--font-display); font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0 0 8px; }
.cat-header p { color: var(--muted); margin: 0; max-width: 60ch; }

/* ---- post ---- */
.post { max-width: 760px; margin: 0 auto; padding: 40px 16px 0; }
.post .chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.post .chips a { color: var(--accent); font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; text-decoration: none; }
.post h1 { font-family: var(--font-display); font-size: clamp(1.9rem, 4.5vw, 2.8rem); line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 12px; }
.post .meta { color: var(--muted); font-size: 0.9rem; }
.post .cover { margin: 28px 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.post .cover img { width: 100%; max-height: 45vh; object-fit: cover; }
@media (min-width: 768px) { .post .cover img { max-height: none; } }

.disclosure {
  font-size: 0.85rem; color: var(--muted); background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--accent-2); border-radius: 10px; padding: 12px 16px; margin: 0 0 28px;
}

.content { font-size: 1.075rem; }
.content h2 { font-family: var(--font-display); font-size: 1.5rem; margin: 2em 0 0.5em; line-height: 1.25; }
.content h3 { font-family: var(--font-display); font-size: 1.25rem; margin: 1.6em 0 0.4em; }
.content p { margin: 0 0 1.1em; }
.content ul, .content ol { padding-left: 1.4em; margin: 0 0 1.2em; }
.content li { margin: 0.35em 0; }
.content li p { margin: 0; }
.content blockquote {
  margin: 1.6em 0; padding: 16px 20px; border-left: 3px solid var(--accent);
  background: var(--surface); border-radius: 0 10px 10px 0; color: var(--text); font-style: italic;
}
.content blockquote p { margin: 0; }
.content a { color: var(--accent); text-underline-offset: 3px; }
.content img { border-radius: 10px; margin: 1.4em 0; }
.content figure { margin: 0; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 32px 0 0; }
.tags a { font-size: 0.85rem; padding: 4px 12px; border-radius: 999px; background: var(--surface-2); color: var(--muted); text-decoration: none; }
.tags a:hover { color: var(--text); }

.related { max-width: var(--maxw); margin: 64px auto 0; padding: 0 16px; }

/* ---- static pages ---- */
.page { max-width: 760px; margin: 0 auto; padding: 48px 16px 0; }
.page h1 { font-family: var(--font-display); font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0 0 16px; }
.page h2 { font-family: var(--font-display); font-size: 1.3rem; margin: 1.8em 0 0.4em; }
.page p, .page li { color: var(--text); }
.page .muted { color: var(--muted); }

@media (max-width: 520px) {
  .nav { gap: 14px; font-size: 0.9rem; }
  .nav .hide-sm { display: none; }
  .hero { padding: 40px 0 16px; }
  .grid { grid-template-columns: 1fr; }
}
