/* ---------------------------------------------------------------
   Tokens
   --------------------------------------------------------------- */
:root {
  --ink: #0a0e12;
  --panel: #121820;
  --panel-2: #171f29;
  --hairline: #232d38;
  --hairline-soft: #1a222b;
  --fog: #8b97a3;
  --fog-dim: #5c6672;
  --paper: #e9edef;

  --amber: #f5b448;
  --amber-dim: #a97e34;
  --green: #4fd68c;
  --red: #f2545b;

  --font-display: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --font-body: "IBM Plex Sans", system-ui, sans-serif;

  --radius-sm: 2px;
  --radius-md: 8px;

  --container: 1180px;
  --edge: clamp(20px, 5vw, 64px);
}

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

html {
  background: var(--ink);
  color-scheme: dark;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ol, ul, table {
  margin: 0;
}

a {
  color: inherit;
}

code {
  font-family: var(--font-mono);
}

img, svg {
  display: block;
  max-width: 100%;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--amber);
  color: var(--ink);
  padding: 10px 16px;
  font-family: var(--font-mono);
  font-weight: 600;
  z-index: 100;
}

.skip-link:focus {
  left: var(--edge);
  top: 12px;
}

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}

.fog {
  color: var(--fog);
}

/* ---------------------------------------------------------------
   Layout helpers
   --------------------------------------------------------------- */
.section {
  padding: clamp(64px, 10vw, 112px) 0;
  border-top: 1px solid var(--hairline-soft);
}

.section.alt {
  background: var(--panel);
}

.section-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--edge);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber);
  margin: 0 0 14px;
}

.section h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  letter-spacing: -0.01em;
  line-height: 1.2;
  max-width: 20ch;
}

.section-lede {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--fog);
  max-width: 62ch;
  margin-top: 18px;
}

/* status dots — semantic, reused across the page */
.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
  flex: none;
}

.dot-ok { background: var(--green); }
.dot-warn { background: var(--amber); }
.dot-fail { background: var(--red); }

/* ---------------------------------------------------------------
   Header
   --------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(10, 14, 18, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hairline-soft);
}

.header-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 18px var(--edge);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.wordmark {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 1.0625rem;
  letter-spacing: 0.08em;
  text-decoration: none;
  color: var(--paper);
  white-space: nowrap;
}

.wordmark .cursor {
  color: var(--amber);
}

@media (prefers-reduced-motion: no-preference) {
  .cursor {
    animation: blink 1.1s step-end infinite;
  }
}

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

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-family: var(--font-mono);
  font-size: 0.875rem;
}

.site-nav a {
  text-decoration: none;
  color: var(--fog);
  transition: color 0.15s ease;
}

.site-nav a:hover {
  color: var(--paper);
}

.nav-github {
  color: var(--paper) !important;
  border: 1px solid var(--hairline);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
}

.nav-github:hover {
  border-color: var(--amber-dim);
}

.clock {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--fog-dim);
  text-align: right;
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

#epoch-clock {
  color: var(--fog);
  font-variant-numeric: tabular-nums;
}

.clock-label {
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.6875rem;
}

/* ---------------------------------------------------------------
   Hero
   --------------------------------------------------------------- */
.hero {
  padding: clamp(56px, 8vw, 96px) 0 clamp(48px, 8vw, 88px);
}

.hero-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--edge);
  display: grid;
  gap: clamp(40px, 6vw, 72px);
}

.hero-copy,
.board-wrap {
  min-width: 0;
}

.hero-copy h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 6.2vw, 4.75rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 26px;
  overflow-wrap: break-word;
}

.hero-copy .lede {
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--fog);
  max-width: 58ch;
  margin-bottom: 34px;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  padding: 14px 26px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.btn-primary {
  background: var(--amber);
  color: var(--ink);
}

.btn-primary:hover {
  background: #ffc766;
}

.btn-ghost {
  border-color: var(--hairline);
  color: var(--paper);
}

.btn-ghost:hover {
  border-color: var(--amber-dim);
  color: var(--amber);
}

@media (prefers-reduced-motion: no-preference) {
  .hero-copy .eyebrow,
  .hero-copy h1,
  .hero-copy .lede,
  .hero-copy .cta-row,
  .board-wrap {
    opacity: 0;
    animation: fadeUp 0.7s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
  }
  .hero-copy .eyebrow { animation-delay: 0.05s; }
  .hero-copy h1 { animation-delay: 0.15s; }
  .hero-copy .lede { animation-delay: 0.32s; }
  .hero-copy .cta-row { animation-delay: 0.46s; }
  .board-wrap { animation-delay: 0.56s; }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

/* ---------------------------------------------------------------
   Signature: live status board
   --------------------------------------------------------------- */
.board-frame {
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.7);
}

.board-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px 20px;
  border-bottom: 1px solid var(--hairline);
}

.board-title {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.8125rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
}

.board-sub {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--fog-dim);
}

.board-scroll {
  overflow-x: auto;
}

.board {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  white-space: nowrap;
}

.board th {
  text-align: left;
  font-weight: 500;
  color: var(--fog-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.6875rem;
  padding: 10px 14px;
  border-bottom: 1px solid var(--hairline);
}

.board td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--hairline-soft);
  color: var(--paper);
}

.board th:first-child,
.board td:first-child {
  padding-left: 20px;
}

.board th:last-child,
.board td:last-child {
  padding-right: 20px;
}

.board tbody tr:last-child td {
  border-bottom: none;
}

.c-host {
  display: flex;
  align-items: center;
  font-weight: 600;
}

.c-seen {
  color: var(--fog);
  font-variant-numeric: tabular-nums;
}

.c-disk.warn, .c-cpu.warn { color: var(--amber); }
.c-disk.fail, .c-cpu.fail { color: var(--red); }

.c-git.ok { color: var(--green); }
.c-git.fail { color: var(--red); }

/* ---------------------------------------------------------------
   Tradeoffs strip
   --------------------------------------------------------------- */
.tradeoffs-strip {
  border-top: 1px solid var(--hairline-soft);
  border-bottom: 1px solid var(--hairline-soft);
  background: var(--panel);
}

.strip-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 20px var(--edge);
  display: flex;
  flex-wrap: wrap;
  gap: 12px 36px;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--paper);
}

.strip-inner p {
  display: flex;
  align-items: center;
  white-space: nowrap;
}

/* ---------------------------------------------------------------
   Steps (how it works)
   --------------------------------------------------------------- */
.steps {
  list-style: none;
  padding: 0;
  margin: 44px 0 0;
  display: grid;
  gap: 0;
}

.step {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 24px;
  padding: 28px 0;
  border-top: 1px solid var(--hairline-soft);
}

.step:first-child {
  border-top: none;
}

.step-index {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--amber-dim);
}

.step-body h3 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.125rem;
  margin-bottom: 8px;
}

.step-body p {
  color: var(--fog);
  line-height: 1.65;
  max-width: 60ch;
  margin-bottom: 14px;
}

.step-body code {
  display: inline-block;
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.8125rem;
  color: var(--paper);
}

/* ---------------------------------------------------------------
   Checks grid
   --------------------------------------------------------------- */
.checks-grid {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.check-card {
  background: var(--ink);
  padding: 26px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.check-card h3 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
}

.check-card p {
  color: var(--fog);
  font-size: 0.9375rem;
  line-height: 1.6;
  flex: 1;
}

.check-card code {
  font-size: 0.8125rem;
  color: var(--fog);
}

.check-key {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--amber);
  letter-spacing: 0.04em;
}

/* ---------------------------------------------------------------
   Security diagram
   --------------------------------------------------------------- */
.diagram {
  margin-top: 44px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
}

.diagram-node {
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  background: var(--panel);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 120px;
}

.diagram-node.port {
  border-color: var(--amber-dim);
}

.diagram-label {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.9375rem;
}

.diagram-sub {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--fog-dim);
  letter-spacing: 0.02em;
}

.diagram-flow {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

.diagram-arrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--fog-dim);
}

.diagram-arrow::after {
  content: " \2193"; /* ↓ — the layout stacks vertically below this width */
}

@media (min-width: 700px) {
  .diagram-arrow {
    white-space: nowrap;
  }
  .diagram-arrow::after {
    content: " \2192"; /* → — the layout flows left-to-right above this width */
  }
}

/* ---------------------------------------------------------------
   API grid
   --------------------------------------------------------------- */
.api-grid {
  margin-top: 40px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.api-row {
  display: grid;
  grid-template-columns: minmax(180px, 260px) 1fr;
  gap: 20px;
  padding: 16px 22px;
  border-top: 1px solid var(--hairline);
  align-items: baseline;
}

.api-row:first-child {
  border-top: none;
}

.api-row code {
  font-size: 0.875rem;
  color: var(--amber);
}

.api-row span {
  color: var(--fog);
  font-size: 0.9375rem;
  line-height: 1.6;
}

/* ---------------------------------------------------------------
   Quickstart / code blocks
   --------------------------------------------------------------- */
.code-block {
  margin-top: 28px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--panel);
}

.code-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  border-bottom: 1px solid var(--hairline);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fog-dim);
}

.copy-btn {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: transparent;
  border: 1px solid var(--hairline);
  color: var(--fog);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.copy-btn:hover {
  border-color: var(--amber-dim);
  color: var(--amber);
}

.copy-btn.copied {
  color: var(--green);
  border-color: var(--green);
}

.code-block pre {
  margin: 0;
  padding: 20px 22px;
  overflow-x: auto;
}

.code-block code {
  font-size: 0.9375rem;
  line-height: 1.8;
  color: var(--paper);
}

.quickstart-note {
  margin-top: 24px;
  color: var(--fog);
  font-size: 0.9375rem;
}

.quickstart-note a {
  color: var(--amber);
  text-decoration: underline;
  text-decoration-color: var(--amber-dim);
  text-underline-offset: 3px;
}

/* ---------------------------------------------------------------
   Reveal-on-scroll (section headings)
   --------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.6s ease, transform 0.6s ease;
  }
  .reveal.in-view {
    opacity: 1;
    transform: none;
  }
}

/* ---------------------------------------------------------------
   Docs page
   --------------------------------------------------------------- */
.docs-hero {
  padding: clamp(48px, 7vw, 72px) 0 8px;
  border-bottom: 1px solid var(--hairline-soft);
}

.docs-hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 18px;
}

.docs-hero .lede {
  color: var(--fog);
  font-size: 1.0625rem;
  line-height: 1.7;
  max-width: 70ch;
  margin-bottom: 40px;
}

.docs-hero .lede a {
  color: var(--amber);
  text-decoration: underline;
  text-decoration-color: var(--amber-dim);
  text-underline-offset: 3px;
}

.docs-layout {
  max-width: var(--container);
  margin: 0 auto;
  padding: 40px var(--edge) 100px;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}

.docs-sidebar {
  position: sticky;
  top: 84px;
  min-width: 0;
}

.docs-sidebar-title {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fog-dim);
  margin-bottom: 14px;
}

.docs-sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.docs-sidebar a {
  display: block;
  padding: 7px 10px;
  margin-left: -10px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--fog);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.docs-sidebar a:hover {
  color: var(--paper);
}

.docs-sidebar a.active {
  color: var(--amber);
  border-left-color: var(--amber);
  background: var(--panel);
}

.docs-content {
  min-width: 0;
}

.docs-section {
  scroll-margin-top: 84px;
  padding-top: 4px;
  margin-bottom: 60px;
}

.docs-section:last-child {
  margin-bottom: 0;
}

.docs-content h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.375rem, 2.4vw, 1.75rem);
  letter-spacing: -0.01em;
  margin: 0 0 18px;
}

.docs-content h3 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.0625rem;
  margin: 34px 0 12px;
}

.docs-content h3:first-of-type {
  margin-top: 8px;
}

.docs-content p {
  color: var(--fog);
  line-height: 1.7;
  max-width: 72ch;
  margin: 0 0 16px;
}

.docs-content p strong {
  color: var(--paper);
  font-weight: 600;
}

.docs-content ul,
.docs-content ol {
  color: var(--fog);
  line-height: 1.7;
  max-width: 72ch;
  margin: 0 0 16px;
  padding-left: 1.3em;
}

.docs-content li {
  margin-bottom: 8px;
}

.docs-content li strong {
  color: var(--paper);
}

.docs-content a {
  color: var(--amber);
  text-decoration: underline;
  text-decoration-color: var(--amber-dim);
  text-underline-offset: 3px;
}

.docs-content > .docs-section > code,
.docs-content p code,
.docs-content li code,
.docs-content h3 code {
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  padding: 2px 6px;
  font-size: 0.875em;
  color: var(--paper);
}

.docs-content .code-block {
  margin: 0 0 20px;
}

.docs-content .code-block code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.875rem;
}

.docs-content .diagram {
  margin: 32px 0 8px;
}

.docs-table-scroll {
  overflow-x: auto;
  margin: 8px 0 28px;
}

.docs-table {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
  margin: 0;
  font-size: 0.9375rem;
}

.docs-table th {
  text-align: left;
  font-family: var(--font-mono);
  color: var(--fog-dim);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
  padding: 10px 14px;
  border-bottom: 1px solid var(--hairline);
  white-space: nowrap;
}

.docs-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--hairline-soft);
  color: var(--fog);
  vertical-align: top;
  line-height: 1.6;
}

.docs-table td:first-child {
  white-space: nowrap;
}

.docs-table tr:last-child td {
  border-bottom: none;
}

.docs-table code {
  color: var(--paper);
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  padding: 2px 6px;
  font-size: 0.8125em;
}

/* ---------------------------------------------------------------
   Footer
   --------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--hairline-soft);
  background: var(--panel);
}

.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 40px var(--edge);
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
}

.footer-brand .wordmark.small {
  font-size: 0.9375rem;
  margin-bottom: 6px;
}

.footer-status {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--fog-dim);
  font-variant-numeric: tabular-nums;
}

.footer-links {
  display: flex;
  gap: 22px;
  font-family: var(--font-mono);
  font-size: 0.875rem;
}

.footer-links a {
  text-decoration: none;
  color: var(--fog);
  transition: color 0.15s ease;
}

.footer-links a:hover {
  color: var(--paper);
}

/* ---------------------------------------------------------------
   Responsive
   --------------------------------------------------------------- */
@media (min-width: 880px) {
  .hero-inner {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
    align-items: center;
  }
}

@media (max-width: 880px) {
  .docs-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .docs-sidebar {
    position: static;
    margin-bottom: 36px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--hairline-soft);
  }

  .docs-sidebar ul {
    flex-direction: row;
    overflow-x: auto;
    gap: 4px;
    padding-bottom: 2px;
  }

  .docs-sidebar a {
    white-space: nowrap;
    border-left: none;
    border-bottom: 2px solid transparent;
    margin-left: 0;
  }

  .docs-sidebar a.active {
    border-left: none;
    border-bottom-color: var(--amber);
    background: none;
  }
}

@media (max-width: 640px) {
  .site-nav {
    display: none;
  }

  .clock {
    display: none;
  }

  .step {
    grid-template-columns: 40px 1fr;
    gap: 16px;
  }

  .step-index {
    font-size: 1.125rem;
  }

  .api-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}
