/* The public site speaks the dashboard's language: tokens are copied from
   ui/src/index.css, which in turn follows docs/ui/design-system.md and the
   approved A2 cut. The rule that matters is the same here as there — status
   hues express instance lifecycle and nothing else. A "live" green on a
   marketing button would teach visitors the wrong meaning before they ever
   open the dashboard. */

@font-face {
  font-family: 'Inter Variable';
  src: url('../fonts/inter-latin-wght-normal.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono Variable';
  src: url('../fonts/jetbrains-mono-latin-wght-normal.woff2') format('woff2-variations');
  font-weight: 100 800;
  font-display: swap;
}
@font-face {
  font-family: 'Space Grotesk';
  src: url('../fonts/space-grotesk-latin-500-normal.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Space Grotesk';
  src: url('../fonts/space-grotesk-latin-700-normal.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

:root {
  --bg: #04060a;
  --surface: #070a10;
  --raised: #0b1018;
  --border: #141b26;
  --border-strong: #233040;
  --fg: #dce6f4;
  --fg-muted: #7c8ba1;
  --fg-subtle: #495668;

  --live: #3ddc84;
  --pending: #ffb224;
  --draining: #5d6a7d;
  --failed: #ff5c5c;
  --stopped: #3a4454;

  --accent: #8fb8ff;
  --accent-hover: #aeceff;
  --accent-quiet: #16243c;
  --focus: #aeceff;

  --font-display: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
  --font-sans: 'Inter Variable', Inter, ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono Variable', ui-monospace, 'SF Mono', monospace;

  --motion-fast: 120ms;
  --motion-base: 180ms;
  --motion-slow: 280ms;
  --motion-flip: 600ms;
  --ease-enter: cubic-bezier(0.16, 1, 0.3, 1);

  --gutter: 24px;
  --max: 1180px;

  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* The A2 cut's scanline. Faint enough to be texture, not effect. */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 200;
  background: repeating-linear-gradient(to bottom, rgba(143, 184, 255, 0.02) 0 1px, transparent 1px 3px);
}

a { color: var(--accent); text-decoration: none; transition: color var(--motion-fast); }
a:hover { color: var(--accent-hover); }

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

::selection { background: var(--accent-quiet); color: var(--fg); }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* --- the three tiers from the dashboard --------------------------------- */
.t3 { font-size: 10px; letter-spacing: 0.19em; text-transform: uppercase; color: var(--fg-subtle); }
.t2 { font-size: 12px; color: var(--fg-muted); }
.prose { font-family: var(--font-sans); line-height: 1.6; }
.display { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.02em; }

.c-live { color: var(--live); }
.c-pending { color: var(--pending); }
.c-failed { color: var(--failed); }
.c-draining { color: var(--draining); }
.c-subtle { color: var(--fg-subtle); }
.c-muted { color: var(--fg-muted); }
.c-accent { color: var(--accent); }

/* --- top bar ------------------------------------------------------------- */
.bar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(7, 10, 16, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-strong);
}
.bar .wrap { display: flex; align-items: stretch; height: 52px; }
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-right: 20px;
  margin-right: 8px;
  border-right: 1px solid var(--border-strong);
  color: var(--fg);
}
.brand:hover { color: var(--fg); }
.brand b { font-size: 14px; font-weight: 700; letter-spacing: 0.06em; }
.brand .dot { width: 7px; height: 7px; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.nav { display: flex; align-items: stretch; }
.nav a {
  display: flex;
  align-items: center;
  padding: 0 14px;
  font-size: 10.5px;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--fg-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}
.nav a:hover { color: var(--fg); }
.nav a[aria-current='page'] { color: var(--fg); border-bottom-color: var(--accent); }
.bar .end { margin-left: auto; display: flex; align-items: center; gap: 14px; }

/* --- buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  border: 1px solid var(--border-strong);
  color: var(--fg-muted);
  background: transparent;
  cursor: pointer;
  transition: color var(--motion-fast), border-color var(--motion-fast), background var(--motion-fast);
}
.btn:hover { color: var(--fg); border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #04060a; font-weight: 500; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #04060a; }
.btn.small { padding: 7px 12px; font-size: 11.5px; }
.btn .arrow { transition: transform var(--motion-base) var(--ease-enter); }
.btn:hover .arrow { transform: translateX(3px); }

/* --- panels -------------------------------------------------------------- */
.panel { border: 1px solid var(--border-strong); background: var(--surface); }
.ph {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

/* --- terminal blocks ----------------------------------------------------- */
.term { border: 1px solid var(--border-strong); background: var(--surface); position: relative; }
.term pre {
  padding: 14px 16px;
  overflow-x: auto;
  font-size: 12px;
  line-height: 1.75;
  color: var(--fg);
}
.term .p { color: var(--fg-subtle); user-select: none; }
.term .k { color: var(--fg-subtle); }
.copy {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--fg-subtle);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 0;
  transition: color var(--motion-fast);
}
.copy:hover { color: var(--accent); }

code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  color: var(--fg);
  background: var(--raised);
  border: 1px solid var(--border);
  padding: 1px 5px;
  white-space: nowrap;
}
pre code { background: none; border: none; padding: 0; font-size: inherit; }

kbd {
  font-family: var(--font-mono);
  border: 1px solid var(--border-strong);
  padding: 0 5px;
  font-size: 10px;
  color: var(--fg-muted);
}

/* --- footer -------------------------------------------------------------- */
.foot { border-top: 1px solid var(--border-strong); background: var(--surface); margin-top: 96px; }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; padding-top: 16px; padding-bottom: 16px; }
.foot .end { margin-left: auto; }

@media (max-width: 720px) {
  :root { --gutter: 16px; }
  .nav a.hide-sm, .bar .end .hide-sm { display: none; }
  .brand { padding-right: 12px; }
  .brand .t3 { display: none; }
  code { white-space: normal; overflow-wrap: anywhere; }
  .nav a { padding: 0 10px; }
  .foot .end { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; }
}
