/* app.css — hand-written stylesheet for the cloud web binary.
 *
 * Layered on top of open-props.min.css (loaded first) for design
 * tokens. Slice 1 of issue #4: shell, topbar, hero, footer.
 * Subsequent slices extend with scenario cards, the loop diagram,
 * the without/with comparison, and the examples grid. See RFC 006.
 */

/* ── Tokens ─────────────────────────────────────────────────────── */

:root {
  color-scheme: dark;

  --bg: var(--gray-12);
  --bg-elev: var(--gray-11);
  --bg-code: #0a0a0a;
  --fg: var(--gray-1);
  --fg-muted: var(--gray-5);
  --fg-soft: var(--gray-3);
  --rule: var(--gray-9);
  --rule-soft: var(--gray-10);
  --accent: var(--lime-3);
  --accent-soft: var(--lime-7);
  --danger: var(--red-3);
  --warn: var(--orange-3);
  --ok: var(--lime-3);

  --max-page: 1080px;
  --max-prose: 64ch;

  --font-display: var(--font-mono);
  --font-body: var(--font-sans);
  --font-code: var(--font-mono);

  --radius: var(--radius-2);
  --rule-width: 1px;
}

/* ── Reset ──────────────────────────────────────────────────────── */

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

html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--font-size-2);
  line-height: var(--font-lineheight-3);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--rule);
}

a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0;
}

p {
  margin: 0;
}

code {
  font-family: var(--font-code);
  font-size: 0.95em;
}

main {
  display: block;
}

/* ── Topbar ─────────────────────────────────────────────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--size-4);
  max-width: var(--max-page);
  margin: 0 auto;
  padding: var(--size-3) var(--size-5);
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: var(--rule-width) solid var(--rule-soft);
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.topbar nav {
  display: flex;
  gap: var(--size-4);
  font-family: var(--font-display);
  font-size: var(--font-size-1);
  letter-spacing: 0.02em;
}

.topbar nav a {
  color: var(--fg-muted);
  text-decoration: none;
}

.topbar nav a:hover {
  color: var(--fg);
}

/* ── Hero ───────────────────────────────────────────────────────── */

.hero {
  max-width: var(--max-page);
  margin: 0 auto;
  padding: var(--size-10) var(--size-5) var(--size-9);
  border-bottom: var(--rule-width) solid var(--rule-soft);
}

.hero .eyebrow {
  font-family: var(--font-display);
  font-size: var(--font-size-0);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: var(--size-3);
}

.hero h1 {
  font-size: clamp(3rem, 7vw, 5.5rem);
  letter-spacing: -0.03em;
  margin-bottom: var(--size-2);
}

.hero .tagline {
  font-family: var(--font-display);
  font-size: var(--font-size-5);
  font-weight: 500;
  color: var(--fg);
  margin-bottom: var(--size-4);
  letter-spacing: -0.01em;
}

.hero .lede {
  max-width: var(--max-prose);
  font-size: var(--font-size-3);
  color: var(--fg-soft);
  margin-bottom: var(--size-6);
}

/* ── CTAs ───────────────────────────────────────────────────────── */

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--size-3);
  margin-bottom: var(--size-8);
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.65rem 1.1rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-size: var(--font-size-1);
  font-weight: 500;
  letter-spacing: 0.02em;
  text-decoration: none;
  background: transparent;
  color: var(--fg);
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
}

.btn:hover {
  border-color: var(--fg);
  color: var(--fg);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--gray-12);
}

.btn-primary:hover {
  background: var(--accent-soft);
  border-color: var(--accent-soft);
  color: var(--gray-12);
}

.btn-secondary {
  background: transparent;
  color: var(--fg);
}

.btn-ghost {
  border-color: var(--rule-soft);
  color: var(--fg-muted);
}

/* ── Terminal-style code panels ─────────────────────────────────── */

.hero-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--size-3);
  align-items: stretch;
}

.terminal {
  margin: 0;
  background: var(--bg-code);
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.terminal-out {
  border-color: color-mix(in oklab, var(--accent) 30%, var(--rule-soft));
}

.terminal-label {
  font-family: var(--font-display);
  font-size: var(--font-size-0);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
  padding: var(--size-2) var(--size-4);
  border-bottom: 1px solid var(--rule-soft);
  background: color-mix(in oklab, var(--bg-elev) 60%, transparent);
}

.terminal pre {
  margin: 0;
  padding: var(--size-4);
  font-family: var(--font-code);
  font-size: var(--font-size-1);
  line-height: 1.55;
  overflow-x: auto;
  color: var(--fg);
}

.terminal-out pre {
  color: var(--accent);
}

/* ── Footer ─────────────────────────────────────────────────────── */

footer {
  max-width: var(--max-page);
  margin: var(--size-8) auto 0;
  padding: var(--size-6) var(--size-5);
  border-top: var(--rule-width) solid var(--rule-soft);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--size-3);
  color: var(--fg-muted);
  font-size: var(--font-size-1);
}

.footer-mark {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--fg);
  margin-right: var(--size-3);
}

.footer-meta {
  font-family: var(--font-display);
  font-size: var(--font-size-0);
  letter-spacing: 0.04em;
}

.footer-links {
  display: flex;
  gap: var(--size-4);
  font-family: var(--font-display);
  font-size: var(--font-size-1);
}

.footer-links a {
  color: var(--fg-muted);
  text-decoration: none;
}

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

/* ── Responsive ─────────────────────────────────────────────────── */

@media (max-width: 720px) {
  .hero {
    padding: var(--size-8) var(--size-4) var(--size-7);
  }

  .hero-panels {
    grid-template-columns: 1fr;
  }

  .topbar nav {
    gap: var(--size-3);
  }

  .topbar nav a:nth-child(1) {
    display: none;
  }
}


/* ── Section headers (shared) ──────────────────────────────────── */

.section-head {
  max-width: var(--max-page);
  margin: 0 auto;
  padding: var(--size-9) var(--size-5) var(--size-5);
}

.section-head .eyebrow {
  font-family: var(--font-display);
  font-size: var(--font-size-0);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: var(--size-3);
}

.section-head h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  letter-spacing: -0.02em;
  margin-bottom: var(--size-3);
}

.section-head .section-lede {
  max-width: var(--max-prose);
  font-size: var(--font-size-3);
  color: var(--fg-soft);
}

/* ── Scenarios section ─────────────────────────────────────────── */

.scenarios {
  border-bottom: var(--rule-width) solid var(--rule-soft);
  padding-bottom: var(--size-9);
}

.scenario-grid {
  max-width: var(--max-page);
  margin: 0 auto;
  padding: var(--size-3) var(--size-5) 0;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: var(--size-5);
  align-items: start;
}

@media (max-width: 900px) {
  .scenario-grid {
    grid-template-columns: 1fr;
  }
}

/* Single-column list once all five scenarios land (slice 3+). */
.scenario-list {
  max-width: var(--max-page);
  margin: 0 auto;
  padding: var(--size-3) var(--size-5) 0;
  display: flex;
  flex-direction: column;
  gap: var(--size-5);
}

/* ── Scenario card ─────────────────────────────────────────────── */

.scenario {
  background: var(--bg-elev);
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius);
  padding: var(--size-5);
  display: flex;
  flex-direction: column;
  gap: var(--size-4);
  scroll-margin-top: 5rem;
}

.scenario-ok    { border-left: 3px solid var(--ok); }
.scenario-warn  { border-left: 3px solid var(--warn); }
.scenario-danger { border-left: 3px solid var(--danger); }

.scenario-head {
  display: flex;
  flex-direction: column;
  gap: var(--size-2);
}

.scenario-title {
  display: flex;
  align-items: center;
  gap: var(--size-3);
  flex-wrap: wrap;
}

.scenario-title h3 {
  font-family: var(--font-display);
  font-size: var(--font-size-4);
  letter-spacing: -0.01em;
  margin: 0;
}

.scenario-summary {
  color: var(--fg-soft);
  max-width: var(--max-prose);
}

/* Badges */

.badge {
  font-family: var(--font-display);
  font-size: var(--font-size-0);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  border: 1px solid currentColor;
  color: var(--fg-muted);
  white-space: nowrap;
}

.badge-ok     { color: var(--ok); }
.badge-warn   { color: var(--warn); }
.badge-danger { color: var(--danger); }

/* Side-by-side terminal panels inside cards */

.scenario-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--size-3);
}

@media (max-width: 720px) {
  .scenario-panels {
    grid-template-columns: 1fr;
  }
}

.terminal-out-ok     pre { color: var(--ok); }
.terminal-out-warn   pre { color: var(--warn); }
.terminal-out-danger pre { color: var(--danger); }

.terminal-out-warn   { border-color: color-mix(in oklab, var(--warn) 30%, var(--rule-soft)); }
.terminal-out-danger { border-color: color-mix(in oklab, var(--danger) 30%, var(--rule-soft)); }

/* Audit trail (collapsible) */

.scenario-trail {
  background: var(--bg-code);
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius);
  padding: var(--size-3) var(--size-4);
}

.scenario-trail > summary {
  font-family: var(--font-display);
  font-size: var(--font-size-1);
  color: var(--fg-muted);
  cursor: pointer;
  letter-spacing: 0.02em;
  list-style: none;
}

.scenario-trail > summary::-webkit-details-marker { display: none; }

.scenario-trail > summary::before {
  content: "▶";
  display: inline-block;
  margin-right: var(--size-2);
  color: var(--fg-muted);
  transition: transform 120ms ease;
}

.scenario-trail[open] > summary::before {
  transform: rotate(90deg);
}

.scenario-trail[open] > summary {
  color: var(--fg);
  margin-bottom: var(--size-3);
}

.timeline {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-code);
  font-size: var(--font-size-1);
}

.timeline th,
.timeline td {
  padding: 0.35rem 0.6rem;
  border-bottom: 1px solid var(--rule-soft);
  text-align: left;
  vertical-align: top;
}

.timeline th {
  font-family: var(--font-display);
  font-size: var(--font-size-0);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
  font-weight: 500;
  border-bottom-color: var(--rule);
}

.timeline tbody tr:last-child td {
  border-bottom: 0;
}

.t-time   { color: var(--fg-muted); white-space: nowrap; }
.t-kind   { color: var(--accent); white-space: nowrap; }
.t-actor  { color: var(--fg-soft); white-space: nowrap; }
.t-summary { color: var(--fg); }

.rebuild {
  margin: var(--size-3) 0 0;
  font-family: var(--font-code);
  font-size: var(--font-size-1);
  color: var(--fg-muted);
}

.rebuild-ok   { color: var(--ok); }
.rebuild-fail { color: var(--danger); }

.scenario-rationale {
  color: var(--fg-soft);
  max-width: var(--max-prose);
  font-size: var(--font-size-2);
  border-left: 2px solid var(--rule-soft);
  padding-left: var(--size-3);
}

/* Placeholder aside (removed when remaining cards land) */

.scenario-placeholder {
  position: sticky;
  top: 5rem;
  background: var(--bg-elev);
  border: 1px dashed var(--rule);
  border-radius: var(--radius);
  padding: var(--size-4);
  color: var(--fg-muted);
}

.scenario-placeholder .placeholder-label {
  font-family: var(--font-display);
  font-size: var(--font-size-0);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: var(--size-2);
}

.scenario-placeholder ul {
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--font-code);
  font-size: var(--font-size-1);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.scenario-placeholder li::before {
  content: "·  ";
  color: var(--rule);
}


/* ── Shape diagram ─────────────────────────────────────────────── */

.shape {
  border-bottom: var(--rule-width) solid var(--rule-soft);
  padding-bottom: var(--size-9);
}

.shape-figure {
  max-width: var(--max-page);
  margin: 0 auto;
  padding: var(--size-3) var(--size-5) 0;
}

.shape-svg {
  display: block;
  width: 100%;
  max-width: 960px;
  height: auto;
  color: var(--accent);
  margin: 0 auto;
}

.shape-svg .shape-input {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  fill: var(--fg-muted);
}

.shape-svg .shape-node rect {
  fill: var(--bg-elev);
  stroke: var(--rule);
  stroke-width: 1;
}

.shape-svg .shape-node-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  fill: var(--fg);
}

.shape-svg .shape-node-caption {
  font-family: var(--font-body);
  font-size: 11px;
  fill: var(--fg-muted);
}

.shape-caption {
  max-width: var(--max-prose);
  margin: var(--size-4) auto 0;
  color: var(--fg-soft);
  font-size: var(--font-size-2);
  text-align: left;
}


/* ── Why · without/with panels ─────────────────────────────────── */

.why {
  border-bottom: var(--rule-width) solid var(--rule-soft);
  padding-bottom: var(--size-9);
}

.why-panels {
  max-width: var(--max-page);
  margin: 0 auto;
  padding: var(--size-3) var(--size-5) 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--size-3);
}

@media (max-width: 900px) {
  .why-panels {
    grid-template-columns: 1fr;
  }
}

.why-note {
  max-width: var(--max-prose);
  margin: var(--size-5) auto 0;
  padding: 0 var(--size-5);
  color: var(--fg-soft);
  font-size: var(--font-size-2);
}

/* ── Examples grid ─────────────────────────────────────────────── */

.examples {
  border-bottom: var(--rule-width) solid var(--rule-soft);
  padding-bottom: var(--size-9);
}

/* The examples section is a single focused stage: pills on top,
   one example panel below. Dimensions and spacing match the rest of
   the page. */
.examples-stage {
  max-width: var(--max-page);
  margin: 0 auto;
  padding: var(--size-3) var(--size-5) 0;
  display: flex;
  flex-direction: column;
  gap: var(--size-4);
}

/* Tab strip: two pills with a name and a one-word claim label
   underneath. The active tab carries a green underline so the
   selected example is unambiguous. */
.example-tabs {
  display: flex;
  gap: var(--size-2);
  border-bottom: 1px solid var(--rule-soft);
  padding-bottom: var(--size-2);
  flex-wrap: wrap;
}

.example-tab {
  display: inline-flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  text-decoration: none;
  color: var(--fg-muted);
  font-family: var(--font-display);
  transition: color 120ms ease, background 120ms ease, border-color 120ms ease;
}

.example-tab:hover {
  color: var(--fg);
  background: var(--bg-elev);
}

.example-tab.is-active {
  color: var(--fg);
  background: var(--bg-elev);
  border-color: var(--rule);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.example-tab .tab-name {
  font-size: var(--font-size-2);
  letter-spacing: -0.005em;
}

.example-tab .tab-claim-label {
  font-size: var(--font-size-0);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.example-tab.is-active .tab-claim-label {
  color: var(--accent);
}

/* The single focused panel below the tabs: claim → proof → table → link. */
.example-panel {
  background: var(--bg-elev);
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius);
  padding: var(--size-5);
  display: flex;
  flex-direction: column;
  gap: var(--size-4);
  scroll-margin-top: 5rem;
}

.panel-head {
  display: flex;
  flex-direction: column;
  gap: var(--size-2);
}

.panel-head-text {
  display: flex;
  flex-direction: column;
  gap: var(--size-2);
}

.panel-hook {
  font-family: var(--font-display);
  font-size: var(--font-size-5);
  letter-spacing: -0.015em;
  margin: 0;
  color: var(--fg);
  max-width: var(--max-prose);
}

.panel-sub {
  margin: 0;
  color: var(--fg-soft);
  font-size: var(--font-size-2);
  max-width: var(--max-prose);
}

/* CTA row: three actions a visitor wants next. Primary action gets
   accent treatment; the others are quieter links. */
.panel-cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--size-3) var(--size-4);
  align-items: center;
  font-family: var(--font-display);
  font-size: var(--font-size-1);
}

.panel-cta-link {
  text-decoration: none;
  color: var(--fg);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.15rem;
}

.panel-cta-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.panel-cta-primary {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* The outcome table moves behind a <details> so the proof reads first.
   Visitors who want the receipt expand it; visitors who want the value
   skip it. */
.panel-table {
  background: var(--bg-code);
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius);
  padding: var(--size-3) var(--size-4);
}

.panel-table > summary {
  font-family: var(--font-display);
  font-size: var(--font-size-1);
  color: var(--fg-muted);
  cursor: pointer;
  letter-spacing: 0.02em;
  list-style: none;
}

.panel-table > summary::-webkit-details-marker { display: none; }

.panel-table > summary::before {
  content: "▶";
  display: inline-block;
  margin-right: var(--size-2);
  color: var(--fg-muted);
  transition: transform 120ms ease;
}

.panel-table[open] > summary::before {
  transform: rotate(90deg);
}

.panel-table[open] > summary {
  color: var(--fg);
  margin-bottom: var(--size-3);
}

/* ── Diff strip (refund-agno) ─────────────────────────────────── */

.diff-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--size-3);
}

@media (max-width: 720px) {
  .diff-strip { grid-template-columns: 1fr; }
}

.diff-side {
  margin: 0;
  padding: var(--size-3) var(--size-4);
  background: var(--bg-code);
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius);
}

.diff-without {
  border-color: color-mix(in oklab, var(--danger) 30%, var(--rule-soft));
}

.diff-with {
  border-color: color-mix(in oklab, var(--ok) 30%, var(--rule-soft));
}

.diff-side figcaption {
  font-family: var(--font-display);
  font-size: var(--font-size-1);
  color: var(--fg-soft);
  margin-bottom: var(--size-2);
  display: flex;
  align-items: center;
  gap: var(--size-2);
  flex-wrap: wrap;
}

.diff-label {
  font-family: var(--font-display);
  font-size: var(--font-size-0);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border: 1px solid currentColor;
  border-radius: 999px;
}

.diff-without .diff-label { color: var(--danger); }
.diff-with .diff-label    { color: var(--ok); }

.diff-side ul {
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--font-code);
  font-size: var(--font-size-1);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  color: var(--fg);
}

.diff-side li::before {
  content: "·  ";
  color: var(--fg-muted);
}

.diff-without li { color: var(--fg); }
.diff-with li    { color: var(--fg); }

/* ── Breadth strip (support-ops) ──────────────────────────────── */

/* The breadth strip is a numbered ticket list. Each row reads
   "ticket N · subject → outcome chip". It doubles as the receipt,
   so no <details> table follows for this variant. */
.breadth-strip {
  margin: 0;
  padding: var(--size-3) var(--size-4);
  background: var(--bg-code);
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius);
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.breadth-row {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) max-content max-content;
  align-items: center;
  gap: var(--size-3);
  font-family: var(--font-code);
  font-size: var(--font-size-1);
}

.breadth-n {
  color: var(--fg-muted);
  font-family: var(--font-display);
  font-size: var(--font-size-0);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.breadth-subject {
  color: var(--fg);
}

.breadth-arrow {
  color: var(--fg-muted);
  justify-self: end;
}

@media (max-width: 540px) {
  .breadth-row {
    grid-template-columns: max-content minmax(0, 1fr) max-content;
  }
  .breadth-arrow {
    display: none;
  }
}

.chip {
  font-family: var(--font-code);
  font-size: var(--font-size-0);
  letter-spacing: 0.04em;
  padding: 0.2rem 0.55rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  color: var(--fg-muted);
  white-space: nowrap;
}

.chip-ok     { color: var(--ok); }
.chip-warn   { color: var(--warn); }
.chip-danger { color: var(--danger); }

.example-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-family: var(--font-code);
  font-size: var(--font-size-1);
}

.example-table th,
.example-table td {
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid var(--rule-soft);
  text-align: left;
  vertical-align: top;
  word-break: normal;
  overflow-wrap: anywhere;
}

.example-table th {
  font-family: var(--font-display);
  font-size: var(--font-size-0);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
  font-weight: 500;
  border-bottom-color: var(--rule);
}

.example-table tbody tr:last-child td {
  border-bottom: 0;
}

/* Column widths: outcome is the predictable middle, input gets a
   readable share, note absorbs the rest. */
.example-table .ex-input   { width: 36%; color: var(--fg); }
.example-table .ex-outcome { width: 26%; color: var(--accent); white-space: nowrap; }
.example-table .ex-note    { width: 38%; color: var(--fg-soft); }

/* Below ~520px, drop the note column entirely so the table stays
   inside its panel. */
@media (max-width: 520px) {
  .example-table .ex-note,
  .example-table thead th:nth-child(3) {
    display: none;
  }
  .example-table .ex-input   { width: 60%; }
  .example-table .ex-outcome { width: 40%; }
}

/* ── What KIFF is not · pills ──────────────────────────────────── */

.not {
  border-bottom: var(--rule-width) solid var(--rule-soft);
  padding-bottom: var(--size-9);
}

.pill-row {
  max-width: var(--max-page);
  margin: 0 auto;
  padding: var(--size-3) var(--size-5) 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--size-3);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--size-2);
  padding: 0.55rem 0.9rem;
  background: var(--bg-elev);
  border: 1px solid var(--rule-soft);
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: var(--font-size-1);
  color: var(--fg);
  flex-wrap: wrap;
}

.pill-label {
  font-family: var(--font-display);
  font-size: var(--font-size-0);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
  padding: 0.1rem 0.45rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
}

.pill-aside {
  color: var(--fg-muted);
  font-size: var(--font-size-1);
}

/* ── Install · three commands ──────────────────────────────────── */

.install {
  padding-bottom: var(--size-9);
}

.install-block {
  max-width: var(--max-page);
  margin: 0 auto;
  padding: var(--size-3) var(--size-5) 0;
  display: flex;
  flex-direction: column;
  gap: var(--size-3);
}


/* ── Scenarios aside · cloud line under the five cards ────────── */

.scenarios-aside {
  max-width: var(--max-page);
  margin: var(--size-5) auto 0;
  padding: var(--size-3) var(--size-5);
  color: var(--fg-muted);
  font-size: var(--font-size-1);
  border-top: 1px solid var(--rule-soft);
}

.scenarios-aside code {
  font-family: var(--font-code);
  color: var(--fg);
  background: var(--bg-elev);
  padding: 0.05em 0.4em;
  border: 1px solid var(--rule-soft);
  border-radius: 3px;
  font-size: 0.95em;
}

/* ── Cloud card · the page's only cloud surface ────────────────── */

.cloud-card {
  max-width: var(--max-page);
  margin: var(--size-5) auto 0;
  padding: var(--size-5);
  background: var(--bg-elev);
  border: 1px solid var(--rule-soft);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: var(--size-3);
  scroll-margin-top: 5rem;
}

.cloud-head {
  display: flex;
  flex-direction: column;
  gap: var(--size-2);
}

.cloud-head .eyebrow {
  font-family: var(--font-display);
  font-size: var(--font-size-0);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0;
}

.cloud-head h2 {
  font-family: var(--font-display);
  font-size: var(--font-size-3);
  letter-spacing: -0.005em;
  margin: 0;
  color: var(--fg);
}

.cloud-body {
  margin: 0;
  color: var(--fg-soft);
  font-size: var(--font-size-2);
  max-width: var(--max-prose);
}

.cloud-body code {
  font-family: var(--font-code);
  color: var(--fg);
  background: var(--bg-code);
  padding: 0.05em 0.35em;
  border: 1px solid var(--rule-soft);
  border-radius: 3px;
  font-size: 0.95em;
}

.cloud-cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--size-3);
  margin-top: var(--size-2);
}

.cloud-cta-link {
  font-family: var(--font-display);
  font-size: var(--font-size-1);
  text-decoration: none;
  color: var(--fg);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.15rem;
}

.cloud-cta-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.cloud-cta-primary {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* The cloud-card sits between the examples section and the
   not-pills section. Push the not-pills border up so the card
   does not float on its own. */
.examples + .cloud-card {
  margin-top: var(--size-7);
}

.cloud-card + .not {
  margin-top: var(--size-7);
}



/* ── Whitepaper page (/whitepaper) ─────────────────────────────── */

/* The whitepaper wears the same Layout as the landing — same topbar,
   same footer — but the main column is constrained to a reading
   width and the typography is tuned for body prose. */
.whitepaper {
  max-width: 740px;
  margin: 0 auto;
  padding: var(--size-9) var(--size-5) var(--size-9);
}

.whitepaper-head {
  margin-bottom: var(--size-6);
  border-bottom: 1px solid var(--rule-soft);
  padding-bottom: var(--size-4);
}

.whitepaper-head .eyebrow {
  font-family: var(--font-display);
  font-size: var(--font-size-0);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 var(--size-2);
}

.whitepaper-source {
  margin: 0;
  color: var(--fg-muted);
  font-size: var(--font-size-1);
}

/* Typography scope for the rendered markdown. Kept minimal: dark
   reading column, generous line height, code blocks aligned with the
   rest of the design system. */
.prose {
  color: var(--fg-soft);
  font-size: 17px;
  line-height: 1.7;
}

.prose h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.75rem);
  letter-spacing: -0.02em;
  color: var(--fg);
  margin: var(--size-8) 0 var(--size-3);
}

.prose h1:first-child { margin-top: 0; }

.prose h2 {
  font-family: var(--font-display);
  font-size: var(--font-size-5);
  letter-spacing: -0.01em;
  color: var(--fg);
  margin: var(--size-7) 0 var(--size-3);
}

.prose h3 {
  font-family: var(--font-display);
  font-size: var(--font-size-4);
  color: var(--fg);
  margin: var(--size-6) 0 var(--size-3);
}

.prose h4,
.prose h5,
.prose h6 {
  font-family: var(--font-display);
  color: var(--fg);
  margin: var(--size-5) 0 var(--size-2);
}

.prose p { margin: 0 0 var(--size-4); }

.prose strong { color: var(--fg); }
.prose em { color: var(--fg); }

.prose a {
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--rule);
}

.prose a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

.prose ul,
.prose ol {
  margin: 0 0 var(--size-4) 0;
  padding-left: var(--size-5);
}

.prose li { margin-bottom: 0.4rem; }

.prose blockquote {
  margin: var(--size-4) 0;
  padding: var(--size-2) var(--size-4);
  border-left: 3px solid var(--rule);
  color: var(--fg-muted);
  font-style: normal;
}

.prose hr {
  margin: var(--size-7) 0;
  border: 0;
  border-top: 1px solid var(--rule-soft);
}

.prose code {
  font-family: var(--font-code);
  font-size: 0.95em;
  background: var(--bg-elev);
  padding: 0.05em 0.4em;
  border: 1px solid var(--rule-soft);
  border-radius: 3px;
  color: var(--fg);
}

.prose pre {
  margin: var(--size-4) 0;
  padding: var(--size-4);
  background: var(--bg-code);
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius);
  overflow-x: auto;
  font-family: var(--font-code);
  font-size: var(--font-size-1);
  line-height: 1.55;
  color: var(--fg);
}

.prose pre code {
  background: transparent;
  border: 0;
  padding: 0;
  font-size: inherit;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--size-4) 0;
  font-family: var(--font-code);
  font-size: var(--font-size-1);
}

.prose th,
.prose td {
  padding: 0.45rem 0.7rem;
  border-bottom: 1px solid var(--rule-soft);
  text-align: left;
  vertical-align: top;
}

.prose th {
  font-family: var(--font-display);
  font-size: var(--font-size-0);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
  font-weight: 500;
}

.prose tbody tr:last-child td { border-bottom: 0; }

/* gomarkdown emits <h*> ids when AutoHeadingIDs is enabled.
   Keep anchor jumps clear of the sticky topbar. */
.prose [id] { scroll-margin-top: 5rem; }


/* ── Security page (/security) ───────────────────────────────────── */

/* Same Layout as the landing/whitepaper. Reading-column constraint
   like the whitepaper, but with section blocks (h2 + content) and a
   grid layout for the operational practices. */
.security {
  max-width: 740px;
  margin: 0 auto;
  padding: var(--size-9) var(--size-5) var(--size-9);
  color: var(--fg-soft);
  line-height: 1.7;
}

.security-head {
  margin-bottom: var(--size-7);
  border-bottom: 1px solid var(--rule-soft);
  padding-bottom: var(--size-5);
}

.security-head .eyebrow {
  font-family: var(--font-display);
  font-size: var(--font-size-0);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 var(--size-2);
}

.security-head h1 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  letter-spacing: -0.02em;
  color: var(--fg);
  margin: 0 0 var(--size-3);
}

.security-lede {
  font-size: 17px;
  margin: 0;
}

.security-section {
  margin: var(--size-7) 0;
}

.security-section h2 {
  font-family: var(--font-display);
  font-size: var(--font-size-5);
  color: var(--fg);
  margin: 0 0 var(--size-3);
  letter-spacing: -0.01em;
}

.security-section .section-lede {
  margin: 0 0 var(--size-4);
  color: var(--fg-muted);
}

.security-section p {
  margin: 0 0 var(--size-3);
}

.security-section a {
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--rule);
}

.security-section a:hover {
  text-decoration-color: var(--accent);
}

.security-section code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--surface-soft);
  border: 1px solid var(--rule-soft);
  padding: 0.05em 0.35em;
  border-radius: var(--radius-2);
  color: var(--fg);
}

/* Operational-practices grid: <dl> with one <div class="security-row">
   per (term, definition) pair. Two columns on desktop, single column
   on narrow viewports. */
.security-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--size-5);
  margin: 0;
}

.security-row {
  border-top: 1px solid var(--rule-soft);
  padding-top: var(--size-3);
}

.security-row dt {
  font-family: var(--font-display);
  font-size: var(--font-size-1);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg);
  margin: 0 0 var(--size-2);
}

.security-row dd {
  margin: 0;
  color: var(--fg-soft);
}

@media (max-width: 640px) {
  .security-grid {
    grid-template-columns: 1fr;
    gap: var(--size-4);
  }
}

/* Sub-processor table. Same reading column, same border treatment
   as the whitepaper's tables. */
.security-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
}

.security-table th,
.security-table td {
  text-align: left;
  padding: var(--size-3) var(--size-2);
  border-bottom: 1px solid var(--rule-soft);
  vertical-align: top;
}

.security-table th {
  font-family: var(--font-display);
  font-size: var(--font-size-1);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg);
}

.security-table tbody tr:last-child td { border-bottom: 0; }

/* Roadmap section. Visually distinct so a reader scanning the page
   for "what is missing" finds it without scrolling past artifacts. */
.security-roadmap {
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius-3);
  padding: var(--size-5);
  background: var(--surface-soft);
}

.security-roadmap-list {
  margin: 0 0 var(--size-4);
  padding-left: var(--size-4);
  display: grid;
  gap: var(--size-3);
}

.security-roadmap-list li {
  color: var(--fg-soft);
}

.security-roadmap-list strong {
  color: var(--fg);
}

.security-roadmap-note {
  margin: 0;
  color: var(--fg-muted);
  font-size: var(--font-size-1);
  border-top: 1px solid var(--rule-soft);
  padding-top: var(--size-3);
}


/* ── Receipt dashboard (/dashboard/receipts/{trace_id}) ──────────── */

/* Same Layout as the rest of the site so the dashboard feels like
   one product. Reading column slightly wider than the whitepaper
   because the causal-chain table needs more room. */
.receipt {
  max-width: 880px;
  margin: 0 auto;
  padding: var(--size-9) var(--size-5) var(--size-9);
  color: var(--fg-soft);
  line-height: 1.65;
}

.receipt-empty .receipt-head {
  border-bottom: 0;
  padding-bottom: 0;
}

.receipt-head {
  margin-bottom: var(--size-7);
  border-bottom: 1px solid var(--rule-soft);
  padding-bottom: var(--size-5);
}

.receipt-head .eyebrow {
  font-family: var(--font-display);
  font-size: var(--font-size-0);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 var(--size-2);
}

.receipt-head h1 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  letter-spacing: -0.02em;
  color: var(--fg);
  margin: 0 0 var(--size-3);
}

.receipt-lede {
  font-size: 17px;
  margin: 0;
}

.receipt-section {
  margin: var(--size-7) 0;
}

.receipt-section h2 {
  font-family: var(--font-display);
  font-size: var(--font-size-5);
  color: var(--fg);
  margin: 0 0 var(--size-3);
  letter-spacing: -0.01em;
}

.receipt-section .section-lede {
  margin: 0 0 var(--size-4);
  color: var(--fg-muted);
}

.receipt-section p {
  margin: 0 0 var(--size-3);
}

.receipt-section code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--surface-soft);
  border: 1px solid var(--rule-soft);
  padding: 0.05em 0.35em;
  border-radius: var(--radius-2);
  color: var(--fg);
}

.receipt-section .muted { color: var(--fg-muted); }

/* Identity + attestation grids — same shape as the security page's
   operational-practices grid. Two columns on desktop, single column
   on narrow viewports. */
.receipt-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--size-5);
  margin: 0;
}

.receipt-row {
  border-top: 1px solid var(--rule-soft);
  padding-top: var(--size-3);
}

.receipt-row dt {
  font-family: var(--font-display);
  font-size: var(--font-size-1);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg);
  margin: 0 0 var(--size-2);
}

.receipt-row dd {
  margin: 0;
  color: var(--fg-soft);
  word-break: break-word;
}

@media (max-width: 640px) {
  .receipt-grid {
    grid-template-columns: 1fr;
    gap: var(--size-4);
  }
}

/* Causal-chain table. */
.receipt-chain,
.receipt-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  font-size: var(--font-size-1);
}

.receipt-chain th,
.receipt-chain td,
.receipt-table th,
.receipt-table td {
  text-align: left;
  padding: var(--size-3) var(--size-2);
  border-bottom: 1px solid var(--rule-soft);
  vertical-align: top;
}

.receipt-chain th,
.receipt-table th {
  font-family: var(--font-display);
  font-size: var(--font-size-1);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg);
}

.receipt-chain tbody tr:last-child td,
.receipt-table tbody tr:last-child td { border-bottom: 0; }

.receipt-chain code.hash,
.receipt-section code.hash {
  font-size: 0.85em;
  letter-spacing: 0.02em;
}

/* Roadmap section — same visual cue as the security page's roadmap
   so visitors recognize "this is what we don't yet have" without
   having to read the heading. */
.receipt-roadmap {
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius-3);
  padding: var(--size-5);
  background: var(--surface-soft);
}

.receipt-roadmap-list {
  margin: 0;
  padding-left: var(--size-4);
  display: grid;
  gap: var(--size-3);
}

.receipt-roadmap-list li {
  color: var(--fg-soft);
}

.receipt-roadmap-list strong {
  color: var(--fg);
}

.receipt-empty-row {
  color: var(--fg-muted);
  margin: 0;
}
