/* zumbra-site — tokens from docs/BRAND.md, dark only */

@font-face {
  font-family: 'Inter';
  src: url('/fonts/Inter-var.woff2') format('woff2');
  font-weight: 500 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/fonts/JetBrainsMono-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
/* Metric-matched fallback so the swap to Inter does not shift layout. */
@font-face {
  font-family: 'Inter Fallback';
  src: local('Arial');
  ascent-override: 90.49%;
  descent-override: 22.56%;
  line-gap-override: 0%;
  size-adjust: 107.06%;
}

:root {
  --void: #0B0D12;
  --gold: #F2C14E;
  --pale: #F4F1EA;
  --mist: #9AA3B2;
  --moon: #1A1F2B;

  /* mist at 18% and 40% for hairlines on void */
  --line: rgba(154, 163, 178, 0.18);
  --line-strong: rgba(154, 163, 178, 0.4);
  /* moon with alpha for surfaces that sit over the canvas */
  --surface: rgba(26, 31, 43, 0.62);
  --surface-solid: rgba(26, 31, 43, 0.9);

  --sans: 'Inter', 'Inter Fallback', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Menlo, Consolas, monospace;
  --max: 680px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  background: var(--void);
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.5;
  color: var(--pale);
  background: var(--void);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.ask-input:focus-visible { outline: none; }

.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;
}

[data-mode="agent"] .human-only { display: none !important; }
[data-mode="human"] .agent-only { display: none !important; }

/* ---------- background layers ---------- */

.bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.scanlines {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: none;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(244, 241, 234, 0.06) 0 1px,
    transparent 1px 3px
  );
}
[data-mode="agent"] .scanlines { display: block; }

/* ---------- mode toggle ---------- */

.mode {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 3;
  display: flex;
  gap: 2px;
  padding: 4px;
  border-radius: 999px;
  background: var(--surface-solid);
  border: 1px solid var(--line);
}
.mode-btn {
  font: 500 11px/1 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mist);
  padding: 11px 14px;
  border-radius: 999px;
  transition: color 0.15s, background-color 0.15s;
}
.mode-btn:hover { color: var(--pale); }
.mode-btn[aria-pressed="true"] { color: var(--void); background: var(--pale); }

/* ---------- layout ---------- */

.site {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 96px 20px 56px;
}

/* ---------- lockup ---------- */

.lockup {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.mark {
  display: block;
  width: 72px;
  height: 72px;
}

.wordmark {
  margin-top: 28px;
  padding-left: 0.16em; /* balances the trailing letter-spacing so the word centres */
  font-weight: 800;
  font-size: 36px;
  line-height: 1;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--pale);
}
.wordmark .z { color: var(--gold); }

.tagline {
  margin-top: 14px;
  font-size: 17px;
  color: var(--mist);
}

/* ---------- ask ---------- */

.ask {
  width: 100%;
  max-width: var(--max);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.eyebrow {
  margin-top: 44px;
  font: 500 11px/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mist);
}

.ask-shell {
  position: relative;
  width: 100%;
  margin-top: 18px;
  display: flex;
  align-items: center;
  height: 60px;
  padding: 0 8px 0 22px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.ask-shell:focus-within {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px rgba(242, 193, 78, 0.16);
}

.ask-icon {
  flex: none;
  width: 18px;
  height: 18px;
  color: var(--mist);
}
.ask-prefix {
  flex: none;
  font: 500 16px/1 var(--mono);
  color: var(--mist);
}

.ask-field {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 100%;
}
.ask-input {
  width: 100%;
  height: 100%;
  padding: 0 12px;
  border: 0;
  outline: 0;
  background: none;
  font-size: 17px;
  color: var(--pale);
}
[data-mode="agent"] .ask-input { font-family: var(--mono); font-size: 15px; }

.ask-ph {
  position: absolute;
  inset: 0;
  padding: 0 12px;
  display: flex;
  align-items: center;
  font-size: 17px;
  color: var(--mist);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  transition: opacity 0.3s;
}
.ask-ph > span { overflow: hidden; text-overflow: ellipsis; }
[data-mode="agent"] .ask-ph { font-family: var(--mono); font-size: 15px; }
.ask-ph.is-out, .ask-ph.is-hidden { opacity: 0; }

.ask-submit {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--gold);
  color: var(--void);
  transition: transform 0.15s;
}
.ask-submit:hover { transform: scale(1.05); }
.ask-submit:active { transform: scale(0.97); }
.ask-submit svg { width: 20px; height: 20px; }
.ask-submit .agent-only { font: 500 18px/1 var(--mono); }

/* ---------- chips ---------- */

.chips {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.chip {
  font-size: 13px;
  line-height: 1;
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--pale);
  background: var(--surface);
  border: 1px solid var(--line);
  transition: border-color 0.15s, background-color 0.15s;
  animation: rise 0.4s ease-out both;
}
.chip:hover { border-color: var(--line-strong); background: var(--surface-solid); }
.chip:nth-child(1) { animation-delay: 0.05s; }
.chip:nth-child(2) { animation-delay: 0.1s; }
.chip:nth-child(3) { animation-delay: 0.15s; }
.chip:nth-child(4) { animation-delay: 0.2s; }
.chip:nth-child(5) { animation-delay: 0.25s; }
[data-mode="agent"] .chip { font-family: var(--mono); font-size: 12.5px; }

/* ---------- answer ---------- */

.answer {
  width: 100%;
  margin-top: 24px;
  display: none;
}
.answer.is-open { display: block; animation: rise 0.32s ease-out both; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px 26px 24px;
}

.answer-label {
  font: 500 11px/1.4 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mist);
  overflow-wrap: anywhere;
}
[data-mode="agent"] .answer-label {
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
}

.answer-body {
  margin-top: 12px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--pale);
}
.answer-body p { white-space: pre-line; }
.answer-body p + p { margin-top: 12px; }

.term {
  font: 500 13.5px/1.6 var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--pale);
  background: rgba(11, 13, 18, 0.7);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 18px;
}
.term-note, .term-line { color: var(--mist); }

/* The untyped remainder keeps its place in the layout; only its paint is withheld. */
.rest { visibility: hidden; }

/* The cursor is an empty inline; the visible bar is out of flow so it takes no space. */
.cursor { position: relative; }
.cursor::after {
  content: '';
  position: absolute;
  left: 1px;
  top: 0.08em;
  width: 2px;
  height: 1em;
  background: var(--pale);
  animation: blink 1s steps(1, end) infinite;
}
.term-cursor::after { left: 2px; top: 0; width: 0.6em; height: 1.1em; }

.ctas {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ctas[hidden] { display: none; }
.cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  line-height: 1;
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--pale);
  text-decoration: none;
  background: var(--surface-solid);
  border: 1px solid var(--line);
  transition: border-color 0.15s;
}
.cta:hover { border-color: var(--line-strong); }
[data-mode="agent"] .cta { font-family: var(--mono); font-size: 12.5px; }

/* ---------- footer ---------- */

.footer {
  border-top: 1px solid var(--moon);
  padding: 28px 20px 32px;
  text-align: center;
}
.footer-links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
  margin-bottom: 14px;
}
.footer-links[hidden] { display: none; }
.footer-links a {
  font-size: 14px;
  color: var(--mist);
  text-decoration: none;
  transition: color 0.15s;
}
.footer-links a:hover { color: var(--pale); }
.footer-copy {
  font: inherit;
  font-size: 14px;
  font-family: var(--mono);
  color: var(--mist);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  transition: color 0.15s;
}
.footer-copy:hover { color: var(--pale); }
.footer-copy.is-copied { color: var(--gold); }
.footer-copy.is-full { user-select: all; word-break: break-all; max-width: min(90vw, 60ch); }
.footer-tagline {
  font-size: 14px;
  color: var(--mist);
}
[data-mode="agent"] .footer-tagline { font-family: var(--mono); font-size: 13px; }
.footer-credit {
  margin-top: 10px;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--mist);
  opacity: 0.6;
}
.footer-credit a { color: inherit; text-decoration: none; }
.footer-credit a:hover { color: var(--pale); opacity: 1; }
[data-mode="agent"] .footer-credit { font-family: var(--mono); }

/* ---------- motion ---------- */

@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
@keyframes blink {
  50% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }
  .cursor::after { animation: none; opacity: 1; }
}

/* ---------- small screens ---------- */

@media (max-width: 480px) {
  .mode { top: 14px; right: 14px; }
  .mode-btn { padding: 10px 12px; }

  .hero { padding: 84px 16px 40px; }
  .mark { width: 60px; height: 60px; }
  .wordmark { margin-top: 22px; font-size: 28px; }
  .tagline { font-size: 15px; }

  .eyebrow { margin-top: 36px; }
  .ask-shell { height: 54px; padding-left: 18px; }
  .ask-input, .ask-ph { font-size: 16px; } /* 16px stops iOS zooming the field */
  [data-mode="agent"] .ask-input, [data-mode="agent"] .ask-ph { font-size: 15px; }
  .ask-submit { width: 40px; height: 40px; }

  .card { padding: 18px 18px 20px; border-radius: 14px; }
  .answer-body { font-size: 15.5px; }
  .term { padding: 14px; font-size: 12.5px; }

  .footer { padding: 24px 16px 28px; }
  .footer-links { gap: 18px; }
}

/* ---------- agent mode: amber phosphor terminal ---------- */

/* Retint the whole page in agent mode by overriding the tokens on <html>.
   Amber, not green: gold is the brand accent, and amber terminals are their own classic. */
[data-mode="agent"] {
  --pale: #F2C14E;
  --mist: rgba(242, 193, 78, 0.66);
  --moon: #1F1A0E;
  --line: rgba(242, 193, 78, 0.22);
  --line-strong: rgba(242, 193, 78, 0.48);
  --surface: rgba(22, 18, 9, 0.66);
  --surface-solid: rgba(22, 18, 9, 0.92);
}
[data-mode="agent"] body { color: var(--pale); }

.rain {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;            /* same layer as the sky, painted after it */
  display: none;
  pointer-events: none;
}
[data-mode="agent"] .rain { display: block; }
[data-mode="agent"] .scanlines {
  background: repeating-linear-gradient(to bottom, rgba(242, 193, 78, 0.05) 0 1px, transparent 1px 3px);
}

/* lockup: keep the mark, swap the wordmark and tagline for the CLI box */
[data-mode="agent"] .tagline { display: none; }
[data-mode="agent"] .wordmark { font-size: 26px; margin-top: 20px; }
[data-mode="agent"] .mark { width: 52px; height: 52px; opacity: 0.92; }
.cli-box {
  display: none;
  margin-top: 14px;
  padding: 8px 16px;
  border: 1px solid var(--line-strong);
  background: var(--surface-solid); /* keeps the rain out of the box on narrow screens */
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  line-height: 1.7;
  color: var(--mist);
  text-align: center;
  text-transform: lowercase;
}
[data-mode="agent"] .cli-box { display: inline-block; }
.cli-name { color: var(--gold); font-weight: 700; text-transform: uppercase; }
.cli-ver { color: var(--mist); }

/* chips read as [command] */
[data-mode="agent"] .chip { color: var(--mist); border-color: var(--line); background: transparent; }
[data-mode="agent"] .chip::before { content: '['; opacity: 0.55; margin-right: 2px; }
[data-mode="agent"] .chip::after  { content: ']'; opacity: 0.55; margin-left: 2px; }
[data-mode="agent"] .chip:hover { color: var(--gold); border-color: var(--line-strong); }

/* input and answer surfaces */
[data-mode="agent"] .ask-shell { border-color: var(--line); background: var(--surface); }
[data-mode="agent"] .ask-shell:focus-within { border-color: var(--line-strong); box-shadow: 0 0 0 4px rgba(242, 193, 78, 0.08); }
[data-mode="agent"] .ask-prefix { color: var(--gold); }
[data-mode="agent"] .ask-input, [data-mode="agent"] .ask-ph { color: var(--pale); }
[data-mode="agent"] .card { border-color: transparent; background: transparent; padding: 0; } /* the terminal block is the card */
[data-mode="agent"] .term { color: var(--pale); }
[data-mode="agent"] .term-code { color: var(--gold); }
[data-mode="agent"] .term-note, [data-mode="agent"] .term-line { color: var(--mist); }
[data-mode="agent"] .mode-btn[aria-pressed="true"] { background: var(--gold); color: var(--void); }
[data-mode="agent"] .footer { border-top-color: var(--line); }
[data-mode="agent"] .footer-links a, [data-mode="agent"] .footer-copy { color: var(--mist); }
[data-mode="agent"] .footer-links a:hover, [data-mode="agent"] .footer-copy:hover { color: var(--gold); }

@media (prefers-reduced-motion: reduce) {
  .rain { display: none !important; }
}
