@font-face {
  font-family: "Outfit";
  src: url("/fonts/Outfit-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/fonts/Inter-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/fonts/GeistMono-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

/* Brand: night ink #0E1116, hawk amber #F2A33A, bone #F6F5F1, slate #5B6270, mist #A3AAB6 */
:root {
  color-scheme: light;
  --bg-primary: #f6f5f1;
  --bg-secondary: #efede7;
  --bg-elevated: #e7e4dc;
  --text-primary: #0e1116;
  --text-secondary: #3f4550;
  --text-muted: #5b6270;
  --border-default: #e0ddd4;
  --border-hover: #cbc7bb;
  --amber: #f2a33a;
  --accent-text: #9a5a06;
  --on-amber: #0e1116;
  --dot: rgba(14, 17, 22, 0.07);
  --ring: #9a5a06;
  --ok: #047857;
  --wip: #9a5a06;
  --shadow: 0 25px 80px rgba(14, 17, 22, 0.10);
  --radius: 16px;
}

.dark {
  color-scheme: dark;
  --bg-primary: #0e1116;
  --bg-secondary: #13171d;
  --bg-elevated: #1b2028;
  --text-primary: #f6f5f1;
  --text-secondary: #a3aab6;
  --text-muted: #868d99;
  --border-default: #1f252e;
  --border-hover: #2d3440;
  --accent-text: #f2a33a;
  --dot: rgba(246, 245, 241, 0.05);
  --ring: #f2a33a;
  --ok: #34d399;
  --wip: #f2a33a;
  --shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }
img, svg { display: block; }
code, pre { font-family: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace; }

:focus-visible { outline: 2px solid var(--ring); outline-offset: 3px; border-radius: 6px; }

.skip-link {
  position: absolute; left: 16px; top: -48px; z-index: 100;
  padding: 8px 14px; border-radius: 10px;
  background: var(--text-primary); color: var(--bg-primary);
  font-size: 14px; font-weight: 500; text-decoration: none;
}
.skip-link:focus { top: 12px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }
@media (min-width: 1024px) { .container { padding: 0 40px; } }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg-primary) 80%, transparent);
  -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border-default);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 56px; }

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo { height: 30px; width: auto; }
.logo-dark { display: none; }
.dark .logo-light { display: none; }
.dark .logo-dark { display: block; }

.nav { display: flex; align-items: center; gap: 4px; }
.nav a, .icon-btn {
  padding: 6px 12px; border-radius: 10px;
  font-size: 13px; font-weight: 500; color: var(--text-muted);
  text-decoration: none; background: none; border: 0; cursor: pointer;
  transition: color .2s, background-color .2s;
}
.nav a:hover, .icon-btn:hover { color: var(--text-primary); background: var(--bg-elevated); }
.nav .divider { width: 1px; height: 16px; background: var(--border-default); margin: 0 8px; }
.icon-btn { display: inline-flex; align-items: center; padding: 6px; color: var(--text-muted); }
.icon-btn svg { width: 16px; height: 16px; }
.nav a.nav-cta { background: var(--text-primary); color: var(--bg-primary); padding: 6px 14px; }
.nav a.nav-cta:hover { opacity: .9; background: var(--text-primary); color: var(--bg-primary); }
.theme-icon { display: none; }
[data-theme="system"] .theme-icon-system,
[data-theme="light"] .theme-icon-light,
[data-theme="dark"] .theme-icon-dark { display: block; }
html:not([data-theme]) .theme-icon-system { display: block; }
@media (max-width: 560px) { .nav .hide-sm { display: none; } }

/* Ambient background */
.ambient { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.orb { position: absolute; border-radius: 50%; animation: drift 45s ease-in-out infinite; }
.orb-1 { width: 700px; height: 700px; top: 5%; left: -10%; background: radial-gradient(circle, rgba(242,163,58,.07) 0%, transparent 65%); }
.orb-2 { width: 600px; height: 600px; top: 50%; right: -12%; background: radial-gradient(circle, rgba(91,98,112,.08) 0%, transparent 65%); animation-duration: 50s; animation-direction: reverse; }
.orb-3 { width: 500px; height: 500px; bottom: 5%; left: 30%; background: radial-gradient(circle, rgba(163,170,182,.05) 0%, transparent 65%); animation-duration: 55s; }
.dots {
  position: absolute; inset: 0;
  background-image: radial-gradient(var(--dot) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-mask: radial-gradient(ellipse at 50% 25%, #000 15%, transparent 60%);
  mask: radial-gradient(ellipse at 50% 25%, #000 15%, transparent 60%);
}
@keyframes drift { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(50px, 35px); } }

main { position: relative; z-index: 1; }

/* Hero */
.hero { padding: 112px 0 48px; text-align: center; }
.eyebrow { font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .15em; color: var(--text-muted); margin: 0 0 24px; }
h1, h2, h3, .eyebrow, .section-sub { font-family: "Outfit", "Inter", sans-serif; }
h1 {
  margin: 0; font-size: clamp(40px, 7vw, 64px); font-weight: 800;
  line-height: 1.05; letter-spacing: -0.04em;
}
.accent { color: var(--accent-text); }
.lead { max-width: 560px; margin: 24px auto 0; font-size: 16px; line-height: 1.75; color: var(--text-secondary); }
.actions { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; margin-top: 40px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 28px; border-radius: 12px;
  font-size: 14px; font-weight: 500; text-decoration: none;
  transition: filter .2s, color .2s, border-color .2s;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary {
  color: var(--on-amber); background: var(--amber);
  box-shadow: 0 0 30px rgba(242, 163, 58, .18);
}
.btn-primary:hover { filter: brightness(1.1); }
.btn-ghost { color: var(--text-secondary); border: 1px solid var(--border-default); }
.btn-ghost:hover { color: var(--text-primary); border-color: var(--text-muted); }

/* Terminal */
.terminal-wrap { padding: 32px 0 112px; }
.terminal {
  max-width: 760px; margin: 0 auto; overflow: hidden;
  border: 1px solid var(--border-default); border-radius: var(--radius);
  background: var(--bg-secondary); box-shadow: var(--shadow);
}
.terminal-bar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border-default); background: var(--bg-elevated); }
.lights { display: flex; gap: 6px; }
.lights span { width: 11px; height: 11px; border-radius: 50%; }
.lights span:nth-child(1) { background: #ff5f57; }
.lights span:nth-child(2) { background: #febc2e; }
.lights span:nth-child(3) { background: #28c840; }
.terminal-title { margin-left: 12px; font-family: "Geist Mono", monospace; font-size: 11px; color: var(--text-muted); }
.terminal pre { margin: 0; padding: 20px 24px; overflow-x: auto; font-size: 12.5px; line-height: 1.9; color: var(--text-secondary); }
.t-comment { color: var(--text-muted); }
.t-key { color: #9a5a06; }
.t-str { color: #15803d; }
.t-err { color: #e11d48; }
.dark .t-key { color: #f2a33a; }
.dark .t-str { color: #86efac; }
.dark .t-err { color: #fb7185; }

/* Sections */
section { scroll-margin-top: 72px; }
.section { padding: 96px 0; }
.section-head { margin-bottom: 48px; }
.section-sub { font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .15em; color: var(--text-muted); margin: 0 0 12px; }
h2 { margin: 0; font-size: clamp(28px, 4vw, 36px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.15; }
.section-head p { max-width: 640px; margin: 16px 0 0; color: var(--text-secondary); font-size: 15px; line-height: 1.8; }

/* Project cards */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.card {
  position: relative; display: flex; flex-direction: column; gap: 12px;
  padding: 24px; border-radius: var(--radius);
  border: 1px solid var(--border-default); background: var(--bg-secondary);
  transition: border-color .3s, transform .3s;
}
.card:hover { border-color: var(--border-hover); transform: translateY(-2px); }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card h3 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -0.02em; }
.card h3 a { text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.card p { margin: 0; font-size: 14px; line-height: 1.7; color: var(--text-secondary); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 8px; }
.tag { font-family: "Geist Mono", monospace; font-size: 11px; color: var(--text-muted); border: 1px solid var(--border-default); border-radius: 6px; padding: 2px 8px; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-live { color: var(--ok); }
.status-wip { color: var(--wip); }
.card-links { display: flex; gap: 16px; font-size: 13px; position: relative; z-index: 1; }
.card-links a { color: var(--text-muted); text-decoration: none; }
.card-links a:hover { color: var(--text-primary); text-decoration: underline; }

/* Principles */
.principles { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.principle { padding: 24px; border-radius: var(--radius); border: 1px solid var(--border-default); }
.principle h3 { margin: 0 0 8px; font-size: 15px; font-weight: 600; }
.principle p { margin: 0; font-size: 14px; line-height: 1.7; color: var(--text-secondary); }

/* Footer */
.site-footer { position: relative; z-index: 1; margin-top: 64px; border-top: 1px solid var(--border-default); }
.site-footer .container { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between; padding-top: 40px; padding-bottom: 40px; }
.site-footer .logo { height: 24px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 24px; font-size: 13px; }
.footer-links a { color: var(--text-muted); text-decoration: none; }
.footer-links a:hover { color: var(--text-primary); }
.copyright { width: 100%; margin: 0; font-size: 12px; color: var(--text-muted); }

/* 404 */
.not-found { padding: 160px 0 96px; text-align: center; }
.not-found p { color: var(--text-secondary); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .orb { animation: none; }
  .card, .btn { transition: none; }
  .card:hover { transform: none; }
}
