/* Steward — marketing site. Palette + type mirror the app's design tokens
   (docs/steward-tokens.toml): terracotta/amber on cream, mono for machine data. */

:root {
  /* light ground — the app's paper/surface/ink */
  --paper: #f4f0e8;
  --surface: #fbf8f2;
  --surface-2: #f1eadc;
  --inset: #ede4d3;
  --ink: #2e2926;
  --muted: #6e655b;
  --faint: #9a8f80;
  --line: #e4dac9;
  --line-strong: #d5c8b3;

  --primary: #b95a3c;      /* terracotta */
  --primary-hover: #a44e33;
  --accent: #d79b2e;       /* amber */
  --accent-ink: #8a5a12;

  /* process states — used with meaning, never decoration */
  --running: #348985;
  --running-soft: #d8ecea;
  --completed: #5e8c4e;
  --completed-soft: #e5ebd6;
  --failed: #c4462f;
  --suspended: #8a7e6c;

  /* dark ground — the app's dark theme, for the kernel section */
  --d-paper: #1d1916;
  --d-surface: #272220;
  --d-inset: #221e1b;
  --d-ink: #f4f0e8;
  --d-muted: #b4a897;
  --d-faint: #867c6e;
  --d-line: #39322c;
  --d-primary: #d06b49;
  --d-accent: #e0a63e;
  --d-running: #54aba6;

  --font-display: "Poppins", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --wrap: 1120px;
  --pad: clamp(20px, 5vw, 48px);
  --r: 14px;
  --r-sm: 10px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

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

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.08; letter-spacing: -0.02em; margin: 0; }
a { color: inherit; }
img { max-width: 100%; display: block; }

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

/* utility bits ---------------------------------------------------------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
  font-weight: 500;
  margin: 0 0 14px;
}
.mono { font-family: var(--font-mono); }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-body); font-weight: 600; font-size: 15px;
  padding: 12px 20px; border-radius: 999px;
  text-decoration: none; border: 1px solid transparent; cursor: pointer;
  transition: transform .12s ease, background .15s ease, border-color .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: var(--surface); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--ink); }

/* nav ------------------------------------------------------------------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--font-display); font-weight: 700; font-size: 19px; letter-spacing: -0.01em; }
.brand img { width: 30px; height: 30px; border-radius: 7px; }
.nav-links { display: flex; gap: 26px; margin-left: auto; }
.nav-links a { text-decoration: none; color: var(--muted); font-size: 15px; font-weight: 500; }
.nav-links a:hover { color: var(--ink); }
.nav-cta { margin-left: 6px; }
@media (max-width: 760px) { .nav-links { display: none; } .nav-cta { margin-left: auto; } }

/* hero ------------------------------------------------------------------ */
.hero { padding: clamp(48px, 8vw, 96px) 0 clamp(40px, 6vw, 72px); }
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(32px, 5vw, 64px); align-items: center; }
@media (max-width: 940px) { .hero-grid { grid-template-columns: 1fr; } }

.hero h1 { font-size: clamp(40px, 6.4vw, 68px); font-weight: 700; }
.hero h1 .accent { color: var(--primary); }
.hero-sub { font-size: clamp(17px, 2.2vw, 20px); color: var(--muted); margin: 22px 0 30px; max-width: 30ch; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-meta { margin-top: 28px; display: flex; gap: 20px; flex-wrap: wrap; font-family: var(--font-mono); font-size: 13px; color: var(--faint); }
.hero-meta b { color: var(--ink); font-weight: 600; }

/* Agent Control Block inspector — the signature element */
.acb {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  box-shadow: 0 24px 60px -30px rgba(46,41,38,0.45), 0 2px 0 rgba(255,255,255,0.6) inset;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 13px;
}
.acb-bar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.acb-dot { width: 10px; height: 10px; border-radius: 50%; }
.acb-title { margin-left: 6px; color: var(--muted); font-size: 12px; letter-spacing: 0.02em; }
.acb-title b { color: var(--ink); }
.pill {
  margin-left: auto; display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
  background: var(--running-soft); color: var(--running);
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.running::before { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .pill.running::before { animation: none; } }

.acb-body { padding: 16px; display: grid; gap: 12px; }
.acb-row { display: grid; grid-template-columns: 128px 1fr; gap: 12px; align-items: baseline; }
.acb-key { color: var(--faint); }
.acb-val { color: var(--ink); }
.acb-val .amber { color: var(--accent-ink); }
.gauge { height: 7px; border-radius: 999px; background: var(--inset); overflow: hidden; margin-top: 6px; }
.gauge > span { display: block; height: 100%; width: 62%; background: linear-gradient(90deg, var(--accent), var(--primary)); border-radius: 999px; }
.acb-log { border-top: 1px solid var(--line); background: var(--inset); padding: 14px 16px; display: grid; gap: 5px; }
.acb-log .ln { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; transform: translateY(4px); animation: logIn .4s ease forwards; }
.acb-log .ln .sc { color: var(--primary); font-weight: 600; }
.acb-log .ln .ok { color: var(--completed); }
.acb-log .ln .t { color: var(--faint); }
@keyframes logIn { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .acb-log .ln { opacity: 1; transform: none; animation: none; } }

/* syscall strip --------------------------------------------------------- */
.syscalls { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); }
.syscalls-inner { display: flex; align-items: center; gap: 10px 26px; flex-wrap: wrap; padding: 20px 0; font-family: var(--font-mono); font-size: 14px; }
.syscalls-inner .lead { color: var(--muted); font-size: 12.5px; letter-spacing: 0.08em; text-transform: uppercase; }
.syscalls-inner .sc { color: var(--ink); font-weight: 500; }
.syscalls-inner .sc b { color: var(--primary); font-weight: 600; }
.syscalls-inner .sep { color: var(--line-strong); }

/* generic section ------------------------------------------------------- */
section { padding: clamp(56px, 9vw, 104px) 0; }
.section-head { max-width: 62ch; margin-bottom: clamp(32px, 5vw, 52px); }
.section-head h2 { font-size: clamp(28px, 4vw, 42px); }
.section-head p { color: var(--muted); font-size: 18px; margin: 16px 0 0; }

/* thesis: three columns ------------------------------------------------- */
.thesis h2 { font-size: clamp(30px, 4.4vw, 46px); max-width: 20ch; }
.thesis .lede { color: var(--muted); font-size: 19px; max-width: 54ch; margin: 18px 0 0; }
.cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin-top: clamp(36px, 5vw, 56px); }
@media (max-width: 820px) { .cols { grid-template-columns: 1fr; gap: 22px; } }
.col h3 { font-size: 19px; margin-bottom: 8px; }
.col .k { font-family: var(--font-mono); font-size: 12px; color: var(--primary); letter-spacing: 0.06em; display: block; margin-bottom: 12px; }
.col p { color: var(--muted); font-size: 15.5px; margin: 0; }

/* feature rows with screenshots ---------------------------------------- */
.feature { display: grid; grid-template-columns: 1fr 1.25fr; gap: clamp(28px, 5vw, 60px); align-items: center; }
.feature + .feature { margin-top: clamp(56px, 8vw, 96px); }
.feature.flip .feature-text { order: 2; }
@media (max-width: 900px) { .feature, .feature.flip { grid-template-columns: 1fr; } .feature.flip .feature-text { order: 0; } }
.feature-text h3 { font-size: clamp(23px, 3vw, 30px); }
.feature-text p { color: var(--muted); margin: 14px 0 0; }
.feature-text .tag { font-family: var(--font-mono); font-size: 12px; color: var(--primary); letter-spacing: 0.08em; text-transform: uppercase; display: block; margin-bottom: 12px; }
.feature-list { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 8px; }
.feature-list li { position: relative; padding-left: 22px; color: var(--muted); font-size: 15.5px; }
.feature-list li::before { content: ""; position: absolute; left: 2px; top: 9px; width: 8px; height: 8px; border-radius: 2px; background: var(--accent); }
.shot { border-radius: var(--r); border: 1px solid var(--line-strong); overflow: hidden; box-shadow: 0 30px 70px -40px rgba(46,41,38,0.5); background: var(--surface); }
.shot img { width: 100%; }

/* kernel section (dark) ------------------------------------------------- */
.kernel { background: var(--d-paper); color: var(--d-ink); }
.kernel .eyebrow { color: var(--d-accent); }
.kernel .section-head p { color: var(--d-muted); }
.kernel-grid { display: grid; grid-template-columns: 1fr; gap: clamp(24px, 3vw, 36px); align-items: start; }
.diagram { font-family: var(--font-mono); font-size: 13px; line-height: 1.5; color: var(--d-muted); background: var(--d-surface); border: 1px solid var(--d-line); border-radius: var(--r); padding: clamp(20px, 3vw, 32px); overflow-x: auto; white-space: pre; width: fit-content; max-width: 100%; margin-inline: auto; }
.diagram b { color: var(--d-accent); font-weight: 500; }
.diagram .p { color: var(--d-primary); }
.principles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--d-line); border: 1px solid var(--d-line); border-radius: var(--r); overflow: hidden; }
@media (max-width: 820px) { .principles { grid-template-columns: 1fr; } }
.principle { background: var(--d-surface); padding: 18px 20px; }
.principle h4 { margin: 0 0 5px; font-family: var(--font-display); font-weight: 600; font-size: 16px; color: var(--d-ink); }
.principle h4 span { font-family: var(--font-mono); font-size: 12px; color: var(--d-accent); margin-right: 10px; }
.principle p { margin: 0; color: var(--d-muted); font-size: 14px; }

/* crate table ----------------------------------------------------------- */
.crates-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); }
table.crates { border-collapse: collapse; width: 100%; font-size: 14.5px; min-width: 640px; }
table.crates th, table.crates td { text-align: left; padding: 13px 18px; border-bottom: 1px solid var(--line); }
table.crates thead th { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); font-weight: 500; background: var(--surface-2); }
table.crates tbody tr:last-child td { border-bottom: none; }
table.crates tbody tr:hover { background: var(--surface); }
table.crates td.name { font-family: var(--font-mono); font-weight: 600; color: var(--primary); white-space: nowrap; }
table.crates td.role { color: var(--muted); }

/* stats band ------------------------------------------------------------ */
.stats { background: var(--surface-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; text-align: center; }
@media (max-width: 720px) { .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 36px 24px; } }
.stat .n { font-family: var(--font-display); font-weight: 700; font-size: clamp(34px, 5vw, 52px); color: var(--primary); letter-spacing: -0.02em; }
.stat .l { color: var(--muted); font-size: 14px; margin-top: 4px; }

/* CTA + footer ---------------------------------------------------------- */
.cta { text-align: center; }
.cta h2 { font-size: clamp(30px, 5vw, 50px); max-width: 18ch; margin: 0 auto; }
.cta p { color: var(--muted); font-size: 18px; max-width: 48ch; margin: 18px auto 30px; }
.cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

footer { border-top: 1px solid var(--line); padding: 40px 0; }
.foot-inner { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; color: var(--faint); font-size: 14px; }
.foot-inner .brand { font-size: 16px; }
.foot-inner .spacer { margin-left: auto; }
.foot-inner a { color: var(--muted); text-decoration: none; }
.foot-inner a:hover { color: var(--ink); }

/* scroll reveal --------------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

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

/* mobile: keep wide, non-reflowable blocks inside their cards ------------ */
@media (max-width: 620px) {
  /* crate table: let it fit the screen instead of forcing a 640px scroll */
  table.crates { min-width: 0; font-size: 13.5px; }
  table.crates th, table.crates td { padding: 11px 13px; }
  table.crates td.name { white-space: nowrap; }
  table.crates td.role { white-space: normal; }
  /* ASCII diagram can't reflow — scale it to the viewport so it fits whole
     (rather than getting cut off mid-line inside a scroll box) */
  .diagram { font-size: min(11px, 2.15vw); padding: 14px; }
}
