@font-face {
    font-family: 'Space Grotesk';
    src: url('/assets/fonts/SpaceGrotesk.ttf');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'IBM Plex Sans';
    src: url('/assets/fonts/IBMPlexSans.ttf');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'JetBrains Mono';
    src: url('/assets/fonts/JetBrainsMono.ttf');
    font-weight: normal;
    font-style: normal;
}

:root {
  --paper: #FAF9F5;
  --paper-alt: #F1F4F8;
  --white: #FFFFFF;
  --ink: #1C2530;
  --ink-soft: #55606E;
  --ink-faint: #8B94A1;
  --blue: #1F4E8C;
  --blue-deep: #123258;
  --blue-tint: #E9EFF7;
  --amber: #D98A1F;
  --amber-tint: #FBF0DD;
  --line: #D8DFE8;
  --line-strong: #B9C4D1;

  --font-display: 'Space Grotesk', 'Segoe UI', sans-serif;
  --font-body: 'JetBrains Mono', 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;

  --container: 1240px;
  --radius: 3px;
  --gap-section: clamp(4rem, 8vw, 8rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

.logo {
    width: 50px;
    height: 50px;
    border-radius: 5px;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; margin: 0 0 0.5em; letter-spacing: -0.01em; }
p { margin: 0 0 1em; color: var(--ink-soft); }
ul { padding-left: 0; list-style: none; margin: 0; }
code { font-family: var(--font-mono); font-size: 0.9em; background: var(--blue-tint); color: var(--blue-deep); padding: 0.1em 0.4em; border-radius: 2px; }
button { font-family: inherit; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 2.5rem);
}


:focus-visible { outline: 2.5px solid var(--blue); outline-offset: 3px; }

.btn {
  display: inline-flex; align-items: center; gap: 0.5em;
  font-family: var(--font-display); font-weight: 500; font-size: 0.95rem;
  padding: 0.85em 1.5em; border-radius: var(--radius);
  text-decoration: none; border: 1.5px solid transparent; transition: all .15s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn-primary:hover { background: var(--blue-deep); border-color: var(--blue-deep); }
.btn-secondary { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-secondary:hover { border-color: var(--ink); background: var(--white); }
.btn-ghost { background: transparent; color: var(--ink-soft); border-color: transparent; padding: 0.5em 0.9em; font-size: 0.9rem; }
.btn-ghost:hover { color: var(--ink); }

.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250, 249, 245, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px; gap: 1.5rem;
}
.brand { display: flex; align-items: center; gap: 0.6em; text-decoration: none; color: var(--ink); }
.brand-mark { color: var(--blue); flex-shrink: 0; }
.brand-word { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; letter-spacing: -0.01em; }

.main-nav { display: flex; gap: 2rem; margin-left: auto; }
.main-nav a { text-decoration: none; color: var(--ink-soft); font-size: 0.95rem; font-weight: 500; position: relative; padding: 0.25em 0; }
.main-nav a:hover, .main-nav a.is-current { color: var(--ink); }
.main-nav a::after {
  content: ""; position: absolute; left: 0; bottom: -2px; width: 0; height: 1.5px;
  background: var(--amber); transition: width .2s ease;
}
.main-nav a:hover::after { width: 100%; }

.header-actions { display: flex; align-items: center; }
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 0.5em; }
.nav-toggle span { width: 22px; height: 2px; background: var(--ink); display: block; transition: transform .2s ease, opacity .2s ease; }

.hero { padding: clamp(3rem, 8vw, 6rem) 0 clamp(4rem, 8vw, 6rem); }
.hero-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2.5rem, 6vw, 4rem);
  align-items: center;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.6em;
  font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.04em;
  color: var(--blue); text-transform: uppercase; margin-bottom: 1.25em;
}
.eyebrow-tick { color: var(--amber); font-weight: 600; }

.hero h1 {
  font-size: clamp(2.6rem, 6vw, 4.5rem);
  line-height: 1.02;
  margin-bottom: 0.35em;
}
.hero-lede { font-size: clamp(1.05rem, 1.6vw, 1.25rem); max-width: 46ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin: 1.75rem 0 2.5rem; }

.hero-stats { display: flex; gap: clamp(1.5rem, 4vw, 3rem); flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 1.5rem; }
.hero-stats li { display: flex; flex-direction: column; }
.stat-num { font-family: var(--font-display); font-size: 2rem; font-weight: 600; color: var(--ink); }
.stat-label { font-size: 0.82rem; color: var(--ink-faint); }

.hero-diagram-wrap { width: 100%; }
.diagram-frame {
  position: relative;
  background: var(--white);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 3vw, 2.5rem) clamp(1.25rem, 3vw, 2rem);
}
.diagram-frame::before, .diagram-frame::after {
  content: ""; position: absolute; width: 14px; height: 14px;
  border-color: var(--blue); border-style: solid;
}
.diagram-frame::before { top: -1px; left: -1px; border-width: 2px 0 0 2px; }
.diagram-frame::after { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; }
.diagram-label {
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em;
  color: var(--ink-faint); text-transform: uppercase; margin-bottom: 1.5rem;
}

.lifecycle { display: flex; flex-direction: column; gap: 0; list-style-type: none; }
.lc-node {
  display: flex; flex-direction: column; gap: 0.15rem;
  padding: 0.9rem 1rem; border-radius: var(--radius);
  border: 1px dashed var(--line-strong);
  background: var(--paper-alt);
}
.lc-node-final { background: var(--amber-tint); border-color: var(--amber); }
.lc-index { font-family: var(--font-mono); font-size: 0.75rem; color: var(--blue); font-weight: 600; }
.lc-title { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; }
.lc-sub { font-size: 0.85rem; color: var(--ink-soft); }
.lc-arrow {
  align-self: center; width: 1.5px; height: 22px; background: var(--line-strong);
  position: relative;
}
.lc-arrow::after {
  content: ""; position: absolute; bottom: -1px; left: 50%; transform: translateX(-50%);
  width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent;
  border-top: 6px solid var(--line-strong);
}

@media (min-width: 720px) {
  .lifecycle { flex-direction: row; align-items: stretch; }
  .lc-node { flex: 1; }
  .lc-arrow { width: 26px; height: 1.5px; align-self: center; margin-top: 0; }
  .lc-arrow::after {
    bottom: 50%; left: auto; right: -1px; transform: translateY(50%);
    border-left: 6px solid var(--line-strong); border-top: 5px solid transparent; border-bottom: 5px solid transparent; border-right: none;
  }
}

@media (min-width: 1024px) {
  .hero-inner { grid-template-columns: 1.05fr 1fr; }
}

section { padding: var(--gap-section) 0; }

main > section { border-top: 1px solid var(--line); }
.hero { border-top: none; background: var(--paper); }
.features { background: var(--paper); }
.docs { background: var(--paper); }
.get-started { background: var(--paper); }

.section-eyebrow {
  font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.06em;
  color: var(--blue); text-transform: uppercase; margin-bottom: 0.75em;
}
section h2 { font-size: clamp(1.9rem, 4vw, 2.75rem); }
.section-lede { max-width: 56ch; font-size: 1.05rem; }

.philosophy { background: var(--paper-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.philosophy-inner { position: relative; max-width: 780px; text-align: center; padding-top: 2rem; padding-bottom: 2rem; }
.margin-tag { font-family: var(--font-mono); font-size: 0.8rem; color: var(--amber); margin-bottom: 1rem; }
.philosophy blockquote { margin: 0 0 1.25rem; }
.philosophy blockquote p {
  font-family: var(--font-display); font-size: clamp(1.4rem, 3.2vw, 2.1rem);
  font-weight: 500; color: var(--ink); line-height: 1.3; margin: 0;
}
.philosophy-body { max-width: 52ch; margin: 0 auto; }
.corner { position: absolute; width: 20px; height: 20px; border-color: var(--blue); border-style: solid; opacity: 0.6; }
.corner-tl { top: 0; left: 0; border-width: 2px 0 0 2px; }
.corner-br { bottom: 0; right: 0; border-width: 0 2px 2px 0; }

.feature-grid {
  display: grid; grid-template-columns: 1fr; gap: 1.25rem; margin-top: 2.5rem;
}
.feature-card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.75rem;
}
.feature-icon { color: var(--blue); width: 36px; height: 36px; margin-bottom: 1rem; }
.feature-card h3 { font-size: 1.15rem; margin-bottom: 0.4em; }
.feature-card p { margin: 0; font-size: 0.95rem; }

@media (min-width: 640px) { .feature-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .feature-grid { grid-template-columns: repeat(4, 1fr); } }

.how { background: var(--paper-alt); }
.how-inner { display: grid; grid-template-columns: 1fr; gap: 2.5rem; align-items: start; }
.how-list { display: flex; flex-direction: column; gap: 0.9rem; margin: 1.5rem 0; }
.how-list li { font-size: 0.95rem; color: var(--ink-soft); padding-left: 1.1rem; border-left: 2px solid var(--line-strong); }
.how-list strong { font-family: var(--font-mono); color: var(--blue-deep); font-weight: 600; }
.how-note { font-size: 0.9rem; color: var(--ink-faint); }
@media (min-width: 960px) { .how-inner { grid-template-columns: 1fr 1.1fr; } }

.code-panel {
  background: var(--white); border: 1px solid var(--line-strong); border-radius: var(--radius);
  overflow: hidden; box-shadow: 0 1px 0 rgba(28,37,48,0.03);
  height: fit-content;
}
.code-panel-head {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.65rem 1rem; background: var(--paper-alt); border-bottom: 1px solid var(--line);
}
.code-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--amber); }
.code-filename { font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink-faint); }
.copy-btn {
  margin-left: auto; background: transparent; border: 1px solid var(--line-strong); color: var(--ink-soft);
  font-size: 0.72rem; padding: 0.3em 0.7em; border-radius: 2px; cursor: pointer; font-family: var(--font-mono);
  transition: all .15s ease;
}
.copy-btn:hover { border-color: var(--blue); color: var(--blue); }
.code-panel pre { margin: 0; padding: 1.25rem 1.4rem; overflow-x: auto; }
.code-panel code { background: none; padding: 0; color: var(--ink); font-size: 0.85rem; line-height: 1.7; }
.c-com { color: var(--ink-faint); font-style: italic; }
.c-kw { color: var(--blue); }
.c-cls { color: var(--blue-deep); font-weight: 600; }
.c-fn { color: var(--amber); }
.c-str { color: #3E7A3E; }
.c-var { color: var(--ink); }
.c-num { color: var(--amber); }

.doc-tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 2.5rem 0 2rem; border-bottom: 1px solid var(--line); }
a.doc-tab {text-decoration: none;}
.doc-tab {
  background: none; border: none; cursor: pointer; padding: 0.85em 0.25em; margin-right: 1.75rem;
  font-family: var(--font-display); font-size: 0.98rem; font-weight: 500; color: var(--ink-faint);
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s ease;
}
.doc-tab-num { font-family: var(--font-mono); font-size: 0.78rem; color: var(--amber); margin-right: 0.35em; }
.doc-tab:hover { color: var(--ink); }
.doc-tab.is-active { color: var(--ink); border-bottom-color: var(--blue); }

.doc-panel { display: grid; grid-template-columns: 1fr; gap: 2rem; }
.doc-panel[hidden] { display: none; }
.doc-panel-text ul { display: flex; flex-direction: column; gap: 0.6rem; margin: 1.25rem 0; }
.doc-panel-text li { font-size: 0.94rem; color: var(--ink-soft); padding-left: 1rem; position: relative; }
.doc-panel-text li::before { content: "·"; position: absolute; left: 0; color: var(--amber); }
.doc-link { display: inline-block; margin-top: 0.5rem; color: var(--blue); text-decoration: none; font-weight: 500; font-size: 0.92rem; }
.doc-link:hover { text-decoration: underline; }
.doc-code pre { font-size: 0.82rem; }

@media (min-width: 960px) { .doc-panel { grid-template-columns: 1fr 1fr; } }

.history { background: var(--paper-alt); }
.rev-table { margin-top: 2.5rem; border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; background: var(--white); }
.rev-row {
  display: grid; grid-template-columns: 44px 1fr; gap: 0.75rem 1rem;
  padding: 1rem 1.25rem; border-bottom: 1px solid var(--line);
  text-decoration: none; color: inherit; align-items: start;
}
.rev-row:last-child { border-bottom: none; }
a.rev-row { transition: background .15s ease; }
a.rev-row:hover { background: var(--paper-alt); }
.rev-head { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-faint); background: var(--paper-alt); grid-template-columns: 44px 1fr; }
.rev-head span:nth-child(2) { grid-column: span 1; }
.rev-letter { font-family: var(--font-mono); font-weight: 600; color: var(--blue); font-size: 1.1rem; }
.rev-name { font-family: var(--font-display); font-weight: 600; }
.rev-status { font-size: 0.85rem; color: var(--ink-faint); }
.rev-note { font-size: 0.9rem; color: var(--ink-soft); grid-column: 2; }
.rev-current { background: var(--amber-tint); }
.rev-current:hover { background: var(--amber-tint); filter: brightness(0.98); }
.rev-badge {
  display: inline-block; font-family: var(--font-mono); font-size: 0.7rem; font-weight: 600;
  color: var(--amber); border: 1px solid var(--amber); border-radius: 2px; padding: 0.15em 0.5em;
}

@media (min-width: 720px) {
  .rev-row { grid-template-columns: 60px 160px 120px 1fr; align-items: center; }
  .rev-head { grid-template-columns: 60px 160px 120px 1fr; }
  .rev-note { grid-column: auto; }
}

.get-started-inner { position: relative; max-width: 760px; text-align: center; }
.get-started h2 { margin-bottom: 1.75rem; }
.gs-code { text-align: left; margin: 0 auto 2rem; }
.gs-actions { justify-content: center; margin: 0; }

.site-footer { border-top: 1px solid var(--line); padding: 2.5rem 0; }
.footer-inner { display: flex; flex-direction: column; gap: 1.5rem; align-items: center; text-align: center; }
.footer-brand { display: flex; align-items: center; gap: 0.5em; color: var(--blue); font-family: var(--font-display); font-weight: 600; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1.5rem; justify-content: center; }
.footer-links a { text-decoration: none; color: var(--ink-soft); font-size: 0.9rem; }
.footer-links a:hover { color: var(--ink); }
.footer-meta { font-size: 0.82rem; color: var(--ink-faint); margin: 0; }
.footer-meta a { color: var(--ink-faint); text-decoration: underline; }

@media (min-width: 720px) {
  .footer-inner { flex-direction: row; justify-content: space-between; text-align: left; }
}

@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .main-nav {
    position: fixed; top: 72px; left: 0; right: 0; bottom: 0;
    background: var(--paper); flex-direction: column; gap: 0;
    padding: 1rem clamp(1.25rem, 4vw, 2.5rem);
    transform: translateY(-8px); opacity: 0; pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
    border-top: 1px solid var(--line);
    height: calc(100svh - 72px);
  }
  .main-nav.is-open { opacity: 1; transform: translateY(0); pointer-events: auto; }
  .main-nav a { padding: 1rem 0; border-bottom: 1px solid var(--line); font-size: 1.05rem; }
  .header-actions { display: none; }
  .main-nav::after {
    content: ""; display: block; padding-top: 1.25rem;
  }
  .rev-status {
    display: none;
  }
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (min-width: 1800px) {
  :root { --container: 1400px; }
  body { font-size: 17px; }
}

.reveal { opacity: 0; transform: translateY(16px); transition: opacity .5s ease, transform .5s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }