/* Shared across all pages: variables, resets, nav, footer, and the
   handful of primitives (.wrap, .label) every page builds on. Each
   page's <style> block only holds what's unique to that page. */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root,
[data-theme="dark"] {
  --bg: #0D0D10;
  --bg-raised: #131316;
  --text: #F2F2F0;
  --text-muted: #8A8A90;
  --text-faint: #55555C;
  --accent: #9B8FFF;
  --accent-dim: #4A4470;
  --border: #212126;
  --border-soft: #1A1A1F;
  --nav-bg: rgba(13, 13, 16, 0.85);
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', Menlo, monospace;
  --max-w: 960px;
  color-scheme: dark;

  /* Retro-dashboard system: panels, bevels, and the accent trio used
     across the beveled cards/widgets rolled out from the landing. */
  --panel: #101614;
  --panel-raised: #151C19;
  --line-lo: #060907;
  --line-hi: #2A3833;
  --good: #39FF88;
  --amber: #FFB020;
  --accent2: #5EC8FF;
  --grotesk: 'Space Grotesk', system-ui, sans-serif;
  --mono2: 'IBM Plex Mono', 'SF Mono', Menlo, monospace;
}

[data-theme="light"] {
  --bg: #F7F7F5;
  --bg-raised: #FFFFFF;
  --text: #1A1A1E;
  --text-muted: #5C5C64;
  --text-faint: #8A8A92;
  --accent: #5B4FDB;
  --accent-dim: #C8C2F0;
  --border: #E4E4E8;
  --border-soft: #ECECEF;
  --nav-bg: rgba(247, 247, 245, 0.85);
  color-scheme: light;

  --panel: #ECE8DA;
  --panel-raised: #FFFFFF;
  --line-lo: #D6D0BC;
  --line-hi: #FFFFFF;
  --good: #1B7A45;
  --amber: #9A6208;
  --accent2: #2F6FE0;
}

/* Retro-dashboard primitives — beveled (raised) / inset (recessed)
   panels, the mono label style, and the chunky flat-bordered button
   used for every widget, card, and CTA across the new site look. */
.grotesk { font-family: var(--grotesk); }
.mono2 { font-family: var(--mono2); }
.pg-label {
  font-family: var(--mono2);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.bevel {
  border-top: 1px solid var(--line-hi); border-left: 1px solid var(--line-hi);
  border-bottom: 1px solid var(--line-lo); border-right: 1px solid var(--line-lo);
  background: var(--panel-raised);
}
.inset {
  border-top: 1px solid var(--line-lo); border-left: 1px solid var(--line-lo);
  border-bottom: 1px solid var(--line-hi); border-right: 1px solid var(--line-hi);
  background: var(--panel);
}
.btn3d {
  font-family: var(--mono2);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 12px 22px;
  cursor: pointer;
  display: inline-block;
  background: none;
  border: none;
  color: inherit;
}
.btn3d:hover { text-decoration: none; }

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

.label {
  font-family: var(--mono2);
  font-size: 11px;
  font-weight: 600;
  color: var(--accent2);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.label::before { content: '# '; color: var(--text-faint); }

/* Section headings sitewide pick up the new display face; body copy
   stays on Inter so long-form text (posts, lifecycle defs) stays readable. */
h1, h2, h3 { font-family: var(--grotesk); }

/* Nav */
nav {
  position: sticky;
  top: 0;
  background: var(--nav-bg);
  backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--line-lo);
  z-index: 10;
}
nav .wrap {
  display: flex;
  align-items: center;
  height: 60px;
  gap: 22px;
}
nav .brand {
  font-family: var(--grotesk);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-right: auto;
}
nav .brand .dot { color: var(--accent2); }
nav .links {
  display: flex;
  gap: 20px;
  font-family: var(--mono2);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
nav .links a { color: var(--text-muted); }
nav .links a:hover { color: var(--accent2); text-decoration: none; }

nav .nav-auth {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: 13px;
}
nav .nav-auth a,
nav .nav-auth button {
  font-family: inherit;
  font-size: inherit;
  color: var(--text-muted);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
nav .nav-auth a:hover,
nav .nav-auth button:hover {
  color: var(--text);
  text-decoration: none;
}
nav .nav-auth .nav-login {
  color: var(--accent);
}
nav .nav-auth .nav-user {
  color: var(--text-faint);
  max-width: 10rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

nav .theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: none;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
}
nav .theme-toggle:hover {
  color: var(--text);
  border-color: var(--border);
}
nav .theme-toggle svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
nav .theme-toggle .icon-moon {
  fill: currentColor;
  stroke: none;
}
nav .theme-toggle .icon-sun { display: block; }
nav .theme-toggle .icon-moon { display: none; }
[data-theme="light"] nav .theme-toggle .icon-sun { display: none; }
[data-theme="light"] nav .theme-toggle .icon-moon { display: block; }

nav .nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 32px;
  height: 32px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
}
nav .nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-muted);
  border-radius: 1px;
  transition: background 0.15s ease;
}
nav .nav-toggle:hover span { background: var(--text); }

@media (max-width: 640px) {
  nav .nav-toggle { display: flex; }
  nav .links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border-soft);
    padding: 8px 0;
  }
  nav .links.open { display: flex; }
  nav .links a { padding: 12px 24px; }
}

/* Tags — same look wherever they appear (blog list, post detail, news) */
.tag {
  font-family: var(--mono2);
  font-size: 10.5px;
  letter-spacing: 0.02em;
  color: var(--accent2);
  border: 1px solid var(--line-lo);
  padding: 2px 8px;
}
.tags { display: flex; gap: 8px; flex-wrap: wrap; }

/* Footer */
footer {
  padding: 32px 0;
  text-align: center;
  border-top: 2px solid var(--line-lo);
  background: var(--panel);
}
footer p {
  font-family: var(--mono2);
  font-size: 11.5px;
  letter-spacing: 0.03em;
  color: var(--text-faint);
}
footer p.tagline { margin-bottom: 6px; color: var(--text-muted); }
