:root {
  --bg: #ffffff;
  --bg-alt: #f6f6f4;
  --surface: #ffffff;
  --text: #121212;
  --muted: #5f6368;
  --border: #e6e6e3;
  --accent: #1f4fd8;
  --accent-contrast: #ffffff;
  --radius: 14px;
  --max: 1080px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0f11;
    --bg-alt: #15171a;
    --surface: #16181c;
    --text: #ececec;
    --muted: #9aa0a6;
    --border: #26292e;
    --accent: #7aa2ff;
    --accent-contrast: #0e0f11;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0e0f11;
  --bg-alt: #15171a;
  --surface: #16181c;
  --text: #ececec;
  --muted: #9aa0a6;
  --border: #26292e;
  --accent: #7aa2ff;
  --accent-contrast: #0e0f11;
  color-scheme: dark;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img { max-width: 100%; display: block; }

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0; }
h1 { font-size: clamp(2.3rem, 5.5vw, 4rem); font-weight: 700; max-width: 18ch; }
h1 em { font-style: normal; color: var(--accent); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); font-weight: 700; margin-bottom: 2rem; }
h3 { font-size: 1.1rem; font-weight: 600; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 24px; }

.skip {
  position: absolute; left: -999px; top: 8px;
  background: var(--text); color: var(--bg); padding: 8px 12px; border-radius: 8px;
}
.skip:focus { left: 8px; z-index: 100; }

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

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.site-header.scrolled { border-bottom-color: var(--border); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; }
.brand-mark {
  display: inline-grid; place-items: center;
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--text); color: var(--bg);
  font-size: 12px; font-weight: 700; letter-spacing: .02em;
}

.nav { display: flex; align-items: center; gap: 26px; font-size: 15px; }
.nav a { text-decoration: none; color: var(--muted); transition: color .15s; }
.nav a:hover { color: var(--text); }
.nav .nav-cta { color: var(--text); font-weight: 500; }

.theme-toggle {
  width: 36px; height: 36px; display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: 50%;
  background: transparent; color: var(--text); cursor: pointer;
}
.theme-toggle svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun { display: none; }
  :root:not([data-theme="light"]) .icon-moon { display: block; }
}
:root[data-theme="dark"] .icon-sun { display: none; }
:root[data-theme="dark"] .icon-moon { display: block; }

/* Hero */
.hero { padding: 120px 0 96px; }
.eyebrow, .section-label {
  font-family: var(--mono); font-size: 13px; letter-spacing: .04em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 20px;
}
.lede { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--muted); max-width: 58ch; margin: 28px 0 0; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 48px; padding: 0 22px; border-radius: 999px;
  font-weight: 500; font-size: 15px; text-decoration: none;
  border: 1px solid var(--border); transition: transform .15s, background .15s, border-color .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn-ghost:hover { border-color: var(--text); }

.stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
  margin: 80px 0 0; padding-top: 32px; border-top: 1px solid var(--border);
}
.stats dt { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; }
.stats dd { margin: 4px 0 0; color: var(--muted); font-size: 15px; }

/* Sections */
.section { padding: 104px 0; }
.section-alt { background: var(--bg-alt); }

.two-col { display: grid; grid-template-columns: 1fr 1.3fr; gap: 64px; }
.two-col h2 { margin-bottom: 0; max-width: 14ch; }
.prose p { margin: 0 0 1.2em; color: var(--muted); }
.prose p:first-child { color: var(--text); font-size: 1.15rem; }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px;
  transition: border-color .2s, transform .2s;
}
.card:hover { border-color: color-mix(in srgb, var(--text) 30%, var(--border)); transform: translateY(-2px); }
.card-num { font-family: var(--mono); font-size: 13px; color: var(--accent); }
.card h3 { margin: 18px 0 10px; }
.card p { margin: 0; color: var(--muted); font-size: 15.5px; }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline > li {
  display: grid; grid-template-columns: 200px 1fr; gap: 32px;
  padding: 32px 0; border-top: 1px solid var(--border);
}
.timeline > li:last-child { border-bottom: 1px solid var(--border); }
.tl-date { font-family: var(--mono); font-size: 14px; color: var(--muted); }
.tl-org { margin: 6px 0 14px; color: var(--muted); font-size: 15px; }
.tl-body ul { margin: 0; padding-left: 1.1em; }
.tl-body li { margin-bottom: 6px; }
.tl-body li::marker { color: var(--accent); }

.creds { margin-top: 64px; }
.creds-title { margin-bottom: 18px; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; }
.chips li {
  font-family: var(--mono); font-size: 13.5px;
  padding: 8px 14px; border: 1px solid var(--border); border-radius: 999px;
}

/* Posts */
.posts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.post {
  display: flex; flex-direction: column; text-decoration: none;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px;
  transition: border-color .2s, transform .2s;
}
.post:hover { border-color: color-mix(in srgb, var(--text) 30%, var(--border)); transform: translateY(-2px); }
.post-type { font-family: var(--mono); font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.post h3 { margin: 14px 0 10px; }
.post p { margin: 0 0 20px; color: var(--muted); font-size: 15.5px; flex: 1; }
.post-link { font-weight: 500; font-size: 15px; color: var(--accent); }

/* Contact */
.contact { padding: 128px 0; }
.contact-inner { text-align: center; display: flex; flex-direction: column; align-items: center; }
.contact h2 { margin-bottom: 0; }
.contact .lede { margin-left: auto; margin-right: auto; }
.contact .hero-actions { justify-content: center; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 28px 0; color: var(--muted); font-size: 14px; }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.mono { font-family: var(--mono); }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .card, .post { transition: none; }
}

/* Responsive */
@media (max-width: 900px) {
  .cards, .posts { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; gap: 24px; }
  .two-col h2 { max-width: none; }
}

@media (max-width: 720px) {
  .container { padding: 0 16px; }
  .nav a:not(.nav-cta) { display: none; }
  .nav { gap: 14px; }
  .hero { padding: 72px 0 64px; }
  .section { padding: 72px 0; }
  .contact { padding: 88px 0; }
  .stats { grid-template-columns: 1fr; gap: 20px; margin-top: 56px; }
  .cards, .posts { grid-template-columns: 1fr; }
  .timeline > li { grid-template-columns: 1fr; gap: 8px; padding: 24px 0; }
  .btn { width: 100%; }
  .hero-actions { flex-direction: column; }
}
