/* ════════════════════════════════════════════════════════════════════════════
   SHARED STYLES — Common across all pages
   ════════════════════════════════════════════════════════════════════════════ */

/* ── Reset & Variables ─────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Light mode colors */
  --bg:            #f7f5f1;
  --bg-raised:     #efece6;
  --bg-terminal:   #151512;
  --bg-code:       #eae7e1;
  --text:          #1a1917;
  --text-muted:    #706e69;
  --text-faint:    #b0ada6;
  --border:        #dedad3;
  --border-strong: #c8c4bc;
  
  /* Terminal colors */
  --term-green:    #6fcf7c;
  --term-dim:      #4a8f54;
  --term-cmd:      #d4d0c8;
  --term-link:     #78b89c;
  --term-data:     #a8c5d8;
  --term-cursor:   #6fcf7c;
  
  /* Fonts */
  --font-display:  'Cormorant Garamond', Georgia, serif;
  --font-body:     'DM Sans', system-ui, sans-serif;
  --font-mono:     'JetBrains Mono', 'Fira Code', monospace;
  
  /* Layout */
  --radius:        4px;
  --transition:    200ms ease;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Dark mode colors */
    --bg:            #111110;
    --bg-raised:     #1b1a18;
    --bg-terminal:   #0c0c0b;
    --bg-code:       #1f1e1b;
    --text:          #e6e3dc;
    --text-muted:    #9a9790;
    --text-faint:    #5a5854;
    --border:        #2a2926;
    --border-strong: #3d3c38;
    
    /* Terminal colors */
    --term-green:    #72d980;
    --term-dim:      #4a9456;
    --term-cmd:      #c8c4bc;
    --term-link:     #7ac4a2;
    --term-data:     #90b8cc;
    --term-cursor:   #72d980;
  }
}

/* ── Base ──────────────────────────────────────────────────────────────────── */
html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  font-weight: 300;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  transition: background var(--transition), color var(--transition);
}

/* Grain overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  opacity: 0.45;
}

/* ── Navigation ────────────────────────────────────────────────────────────── */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition), border-color var(--transition);
}

.nav-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 28px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 400;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
  opacity: 0.9;
  transition: opacity var(--transition);
}
.nav-logo:hover {
  opacity: 1;
}
.nav-logo span {
  color: var(--text-muted);
}

.nav-links {
  display: flex;
  gap: 2px;
  list-style: none;
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 400;
  color: var(--text-muted);
  text-decoration: none;
  padding: 5px 10px;
  border-radius: var(--radius);
  letter-spacing: 0.02em;
  transition: color var(--transition), background var(--transition);
}

.nav-links a:hover {
  color: var(--text);
  background: var(--bg-raised);
}

.nav-links a.active {
  color: var(--text);
}

/* ── Layout ────────────────────────────────────────────────────────────────── */
main {
  padding-top: 54px;
}

.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ── Footer ────────────────────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
}

.footer-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-left {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.03em;
}

.footer-right {
  display: flex;
  gap: 18px;
}

.footer-right a {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  text-decoration: none;
  transition: color var(--transition);
}
.footer-right a:hover {
  color: var(--text-muted);
}

/* ── Animations ────────────────────────────────────────────────────────────── */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes blink {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .nav-links a {
    padding: 5px 7px;
  }
}
