/* ============================================
   romp docs — light-mode theme
   Palette drawn from the romp logo & mascot:
   cream, deep navy ink, fox copper, cyan accent.
   ============================================ */

:root {
  --bg: #fcf6e9;
  --bg-soft: #f7edd9;
  --surface: #fffdf8;
  --ink: #1a2530;
  --ink-soft: #3d4b59;
  --ink-muted: #66737e;

  --border: #eaddc3;
  --border-strong: #dccba8;

  --fox: #c0662e;
  --fox-deep: #9a4b1c;
  --fox-tint: #f6e5cf;

  --cyan: #237a9e;
  --cyan-deep: #17597a;
  --cyan-tint: #dfeef5;

  --green: #2f7d4f;
  --red: #b3422f;

  --terminal-bg: #1a2530;
  --terminal-text: #ece4d3;
  --terminal-muted: #97a5b2;

  --code-bg: #f6ecd8;
  --code-text: #1a2530;
  --inline-code-bg: rgba(192, 102, 46, 0.10);
  --inline-code-text: #9a4b1c;

  --footer-bg: #16222e;
  --footer-text: #ece4d3;
  --footer-muted: #9fb0bd;

  --elevation-1: 0 0 0 1px rgb(26 37 48 / 0.05), 0 1px 3px rgb(26 37 48 / 0.06), 0 6px 16px -6px rgb(26 37 48 / 0.08);
  --elevation-2: 0 0 0 1px rgb(26 37 48 / 0.07), 0 2px 6px rgb(26 37 48 / 0.08), 0 16px 36px -10px rgb(26 37 48 / 0.16);
  --elevation-2-hover: 0 0 0 1px rgb(26 37 48 / 0.09), 0 4px 10px rgb(26 37 48 / 0.09), 0 22px 48px -12px rgb(26 37 48 / 0.20);
  /* Elevation-1 with the ring tinted copper, so a caution surface is marked by
     its edge rather than by an applied graphic. */
  --elevation-caution: 0 0 0 1px rgb(192 102 46 / 0.20), 0 1px 3px rgb(26 37 48 / 0.05), 0 6px 16px -6px rgb(26 37 48 / 0.08);
  --elevation-caution-hover: 0 0 0 1px rgb(192 102 46 / 0.34), 0 2px 6px rgb(26 37 48 / 0.07), 0 14px 32px -10px rgb(26 37 48 / 0.15);

  --img-outline: rgb(0 0 0 / 0.10);
  --border-hairline: 1px;
  --nav-bg: rgba(252, 246, 233, 0.82);
  --nav-border: #eaddc3;
  --nav-logo: #1a2530;
  --nav-link: #3d4b59;
  --nav-link-hover: #1a2530;
  --nav-link-hover-bg: #f6e5cf;
  --nav-panel-bg: #fcf6e9;
  --nav-toggle-bar: #1a2530;
  --table-stripe: rgba(192, 102, 46, 0.04);
  --table-border: rgba(220, 203, 168, 0.7);

  --z-nav: 100;
  --z-overlay: 200;

  /* Built-in CSS easings are too weak to read as intentional. */
  --ease-out: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
}

@media only screen and (min-device-pixel-ratio: 2), only screen and (min-resolution: 192dpi) {
  :root { --border-hairline: 0.5px; }
}

/* --- Reset & base --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: 16px; scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
}

a { color: var(--fox-deep); text-decoration: none; transition: color 150ms ease-out; }
a:hover { color: var(--cyan-deep); }

img { max-width: 100%; height: auto; }

code {
  font-family: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
  font-size: 0.875em;
  background: var(--inline-code-bg);
  color: var(--inline-code-text);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

h1, h2, h3, h4 { line-height: 1.15; letter-spacing: -0.02em; text-wrap: balance; }
h1, h2 { font-weight: 800; }

:focus-visible { outline: 2px solid #6b7680; outline-offset: 2px; border-radius: 4px; }

[id] { scroll-margin-top: 5.5rem; }

/* --- Animations --- */
@keyframes fadeIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes mascotIn { from { opacity: 0; transform: translateY(22px) scale(0.97); } to { opacity: 1; transform: none; } }

.fade-in { animation: fadeIn 0.55s var(--ease-out) both; }
.delay-1 { animation-delay: 0.06s; }
.delay-2 { animation-delay: 0.12s; }
.delay-3 { animation-delay: 0.18s; }

/* Scroll reveal. JS sets data-reveal-armed on <html> before observing, so
   without JS (or with reduced motion) every element stays in its resting state. */
[data-reveal-armed] [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 620ms var(--ease-out), transform 620ms var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}
[data-reveal-armed] [data-reveal].is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal-armed] [data-reveal] { opacity: 1; transform: none; }
}

/* --- Layout helpers --- */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.section-title { font-size: clamp(1.75rem, 3.2vw, 2.25rem); margin-bottom: 0.6rem; text-align: center; color: var(--ink); }
.section-subtitle { color: var(--ink-muted); text-align: center; margin: 0 auto 2.5rem; max-width: 40rem; text-wrap: balance; }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-weight: 600; font-size: 1rem; padding: 0.72rem 1.4rem;
  border-radius: 10px; border: 1px solid transparent; cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease, box-shadow 150ms ease, transform 150ms var(--ease-out);
}
.btn:active { transform: scale(0.96); }
.btn-primary { background: var(--fox); color: #fffdf8; box-shadow: 0 6px 18px rgba(192, 102, 46, 0.28); }
.btn-secondary { background: transparent; color: var(--ink); border-color: var(--border-strong); }
.btn-ghost-dark { background: transparent; color: var(--footer-text); border-color: rgba(255,255,255,0.18); }

@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover { background: var(--fox-deep); color: #fffdf8; }
  .btn-secondary:hover { border-color: var(--fox); color: var(--fox-deep); }
  .btn-ghost-dark:hover { border-color: #e0a06a; color: #e0a06a; }
}

/* ============================================
   Navigation
   ============================================ */
.nav {
  position: sticky; top: 0; z-index: var(--z-nav);
  background: var(--nav-bg);
  backdrop-filter: saturate(1.6) blur(12px);
  -webkit-backdrop-filter: saturate(1.6) blur(12px);
  border-bottom: var(--border-hairline) solid var(--nav-border);
  transition: background-color 260ms ease, border-color 260ms ease;
}
.nav-inner {
  max-width: 1160px; margin: 0 auto; padding: 0.7rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.nav-logo {
  font-family: 'Fredoka', 'Inter', system-ui, sans-serif;
  font-weight: 600; font-size: 1.72rem; line-height: 1;
  letter-spacing: -0.005em; color: var(--nav-logo);
  transition: color 260ms ease, opacity 150ms ease;
}
.nav-logo:hover { color: var(--nav-logo); opacity: 0.72; }
.nav-links { display: flex; align-items: center; gap: 0.25rem; }
.nav-link {
  color: var(--nav-link); font-weight: 500; font-size: 0.95rem;
  padding: 0.45rem 0.85rem; border-radius: 8px; display: inline-flex; align-items: center; gap: 0.4rem;
  transition: color 150ms ease-out, background-color 150ms ease-out;
}
.nav-link:hover { color: var(--nav-link-hover); background: var(--nav-link-hover-bg); }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 0.4rem; min-width: 44px; min-height: 44px; align-items: center; justify-content: center; }

/* Over the footer the nav inverts, so it never sits as a pale band on dark ground. */
.nav--dark {
  --nav-bg: rgba(19, 29, 40, 0.78);
  --nav-border: rgba(255, 255, 255, 0.10);
  --nav-logo: #fffdf8;
  --nav-link: #c9d2db;
  --nav-link-hover: #fffdf8;
  --nav-link-hover-bg: rgba(255, 255, 255, 0.09);
  --nav-panel-bg: var(--footer-bg);
  --nav-toggle-bar: #c9d2db;
}

/* --- Hero --- */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(1100px 520px at -12% -12%, var(--fox-tint) 0%, transparent 55%),
    radial-gradient(860px 420px at 108% 8%, var(--cyan-tint) 0%, transparent 50%),
    var(--bg);
}
.hero-inner {
  max-width: 1080px; margin: 0 auto;
  /* Fill the fold under the sticky nav so the next section never peeks into
     the first screen — the two share a background and read as one block. */
  min-height: calc(100vh - 4rem);
  min-height: calc(100svh - 4rem);
  padding: clamp(3.5rem, 7vw, 5.5rem) 1.5rem;
  display: grid; grid-template-columns: minmax(0, 0.92fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 3vw, 2.75rem); align-items: center; align-content: center;
  justify-content: center;
}
.hero-copy { min-width: 0; }
.hero-eyebrow {
  display: inline-block; font-size: 0.82rem; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--cyan-deep); background: var(--cyan-tint);
  padding: 0.3rem 0.8rem; border-radius: 999px; margin-bottom: 1.25rem;
}
.hero-title { font-size: clamp(2.5rem, 5.5vw, 4rem); letter-spacing: -0.03em; line-height: 1.04; color: var(--ink); }
.hero-accent { color: var(--fox); }
.hero-sub { color: var(--ink-soft); font-size: clamp(1.05rem, 1.4vw, 1.2rem); line-height: 1.6; margin: 1.5rem 0 1.9rem; max-width: 32rem; }
.hero-actions { display: flex; gap: 0.9rem; flex-wrap: wrap; margin-bottom: 1.9rem; }
.hero-chips { display: flex; flex-wrap: wrap; gap: 0.6rem 0.75rem; }
.hero-chip {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--surface); box-shadow: var(--elevation-1);
  color: var(--ink-soft); font-size: 0.9rem; font-weight: 500;
  padding: 0.45rem 0.9rem; border-radius: 999px;
}
.hero-chip svg { color: var(--fox); }
.hero-art { position: relative; display: flex; justify-content: center; min-width: 0; }
.hero-halo {
  position: absolute; inset: -12% -10%; z-index: 0; pointer-events: none;
  background:
    radial-gradient(closest-side, rgba(192, 102, 46, 0.18), transparent 70%),
    radial-gradient(closest-side at 28% 32%, rgba(35, 122, 158, 0.14), transparent 70%);
  filter: blur(6px);
}
.hero-mascot {
  position: relative; z-index: 1;
  width: min(100%, 540px); height: auto;
  user-select: none; -webkit-user-drag: none;
  animation: mascotIn 0.7s var(--ease-out) 0.12s both;
}

/* --- Pipeline --- */
.pipeline { padding: 4.5rem 1.5rem; }
.pipeline-inner { max-width: 1160px; margin: 0 auto; }
.pipeline-steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; margin-top: 2rem; }
.step {
  background: var(--surface); box-shadow: var(--elevation-1); border-radius: 14px;
  padding: 1.4rem 1.2rem; position: relative;
  transition: box-shadow 150ms ease-out, transform 150ms ease-out;
}
@media (hover: hover) and (pointer: fine) {
  .step:hover { box-shadow: var(--elevation-2-hover); transform: translateY(-2px); }
}
.step-num {
  width: 30px; height: 30px; border-radius: 999px;
  background: var(--fox); color: #fffdf8; font-weight: 700; font-size: 0.9rem;
  display: flex; align-items: center; justify-content: center; margin-bottom: 0.85rem;
}
.step h3 { font-size: 1.05rem; margin-bottom: 0.4rem; }
.step p { font-size: 0.9rem; color: var(--ink-muted); }

/* --- Terminal --- */
.terminal-section { padding: clamp(3.5rem, 6vw, 5rem) 1.5rem clamp(4.5rem, 8vw, 6.5rem); }
.terminal-inner { max-width: 1160px; margin: 0 auto; }
.terminal {
  max-width: 720px; margin: 2rem auto 0; border-radius: 14px; overflow: hidden;
  background: var(--terminal-bg); box-shadow: var(--elevation-2);
}
.terminal-header {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.8rem 1.1rem;
  background: rgba(0,0,0,0.22); border-bottom: var(--border-hairline) solid rgba(255,255,255,0.07);
}
.terminal-dots { display: flex; gap: 0.45rem; pointer-events: none; }
.dot { width: 12px; height: 12px; border-radius: 999px; }
.dot-red { background: #e26d5a; } .dot-yellow { background: #e6b455; } .dot-green { background: #5fb36b; }
.terminal-title { color: var(--terminal-muted); font-size: 0.82rem; font-family: 'JetBrains Mono', monospace; }
.terminal-body { padding: 1.2rem 1.3rem 1.4rem; font-family: 'JetBrains Mono', 'SF Mono', monospace; font-size: 0.88rem; line-height: 1.75; font-variant-numeric: tabular-nums; }

/* Fixed viewport height so the tail loop can never reflow the page. */
.terminal-view { height: 15.4rem; overflow: hidden; position: relative; }
.terminal-stream { will-change: transform; }
.terminal-stream[data-scrolling] { transition: transform 420ms var(--ease-out); }

/* Older lines dissolve at the top edge instead of being sliced off. */
.terminal-view[data-live] {
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 2.4rem);
  mask-image: linear-gradient(to bottom, transparent 0, #000 2.4rem);
}

.terminal-line { color: var(--terminal-text); white-space: pre; overflow: hidden; text-overflow: ellipsis; }
.terminal-line[data-enter] { opacity: 0; transform: translateY(5px); }
.terminal-line[data-enter-ready] { opacity: 1; transform: none; transition: opacity 260ms ease-out, transform 260ms var(--ease-out); }
.terminal-caret {
  display: inline-block; width: 0.55em; height: 1.05em; vertical-align: -0.18em;
  background: var(--terminal-muted); margin-left: 0.1em;
  animation: caretBlink 1.1s steps(1, end) infinite;
}
@keyframes caretBlink { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }

.t-time { color: #6d7d8c; }
.t-muted { color: var(--terminal-muted); }
.t-prompt { color: #5fb36b; font-weight: 600; }
.t-cmd { color: var(--terminal-text); font-weight: 600; }
.t-codename { color: #5fc1d8; }
/* One colour per concurrency slot so interleaved jobs stay followable. */
.t-slot-0 { color: #5fc1d8; }
.t-slot-1 { color: #c2a3e8; }
.t-slot-2 { color: #e59aa5; }
.t-link { color: #e0a06a; }
.t-done { color: #5fb36b; font-weight: 600; }
.t-blocked { color: #e6b455; font-weight: 600; }

/* --- Why romp (editorial list) --- */
.why { padding: clamp(4.5rem, 8vw, 6.5rem) 1.5rem; background: var(--bg-soft); border-block: var(--border-hairline) solid var(--border); }
.why-inner { max-width: 940px; margin: 0 auto; }
.why-list { border-top: var(--border-hairline) solid var(--border-strong); }
.why-row {
  display: grid; grid-template-columns: 5.5rem 1fr; gap: 1.75rem; align-items: baseline;
  padding: 2.1rem 0; border-bottom: var(--border-hairline) solid var(--border);
}
.why-num {
  font-weight: 800; font-size: 2.4rem; letter-spacing: -0.04em; line-height: 1;
  color: var(--fox); font-variant-numeric: tabular-nums;
  /* The rule sits behind the numeral so the column reads as a spine, not a gutter. */
  position: relative;
}
.why-num::after {
  content: ""; position: absolute; left: 0; right: 1.1rem; bottom: -0.55rem;
  height: 2px; background: var(--fox); opacity: 0.22; border-radius: 2px;
}
.why-body h3 { font-size: 1.4rem; letter-spacing: -0.02em; margin-bottom: 0.5rem; }
.why-body p { color: var(--ink-soft); font-size: 1.02rem; line-height: 1.62; margin: 0; max-width: 46rem; }
.why-body strong { font-weight: 700; color: var(--ink); }

@media (max-width: 640px) {
  .why-row { grid-template-columns: 3.25rem 1fr; gap: 1rem; padding: 1.6rem 0; }
  .why-num { font-size: 1.9rem; }
  .why-num::after { right: 0.6rem; bottom: -0.4rem; }
  .why-body h3 { font-size: 1.2rem; }
}

/* --- Outcomes --- */
.outcomes-section { padding: 4.5rem 1.5rem; background: var(--bg-soft); border-block: var(--border-hairline) solid var(--border); }
.outcomes-inner { max-width: 1160px; margin: 0 auto; }
.outcomes-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; margin-top: 1rem; }
.outcome {
  display: flex; align-items: center; gap: 0.9rem;
  background: var(--surface); box-shadow: var(--elevation-1); border-radius: 10px; padding: 0.85rem 1.1rem;
}
.outcome-name {
  font-family: 'JetBrains Mono', monospace; font-weight: 600; font-size: 0.85rem;
  padding: 0.2rem 0.65rem; border-radius: 999px; white-space: nowrap; flex-shrink: 0;
}
.outcome-done { background: #e3f1e7; color: var(--green); }
.outcome-blocked { background: var(--fox-tint); color: var(--fox-deep); }
.outcome-red { background: #f5e0dc; color: var(--red); }
.outcome-error { background: #f5e0dc; color: var(--red); }
.outcome-neutral { background: #e8ecf0; color: var(--ink-muted); }
.outcome-desc { font-size: 0.92rem; color: var(--ink-soft); }
.outcomes-note { margin-top: 1rem; text-align: center; color: var(--ink-muted); }

/* --- Install --- */
.install-section { padding: clamp(4.5rem, 8vw, 6.5rem) 1.5rem; }
.install-inner { max-width: 780px; margin: 0 auto; }
.install-card { display: flex; flex-direction: column; align-items: center; gap: 1.5rem; }

/* Segmented control, not a tab strip: the moving pill is the only thing that
   changes, so nothing under it reflows when the selection moves. */
.install-tabs {
  position: relative; display: inline-flex; align-items: stretch; isolation: isolate;
  background: var(--bg-soft); border: var(--border-hairline) solid var(--border-strong);
  border-radius: 999px; padding: 4px; max-width: 100%;
}
.install-tab-glide {
  position: absolute; z-index: 0; top: 0; left: 0; width: 0; height: 0;
  background: var(--surface); border-radius: 999px; box-shadow: var(--elevation-1);
  transition: transform 260ms var(--ease-out), width 260ms var(--ease-out);
}
.install-tabs:not([data-glide-ready]) .install-tab-glide { opacity: 0; }
.install-tab {
  position: relative; z-index: 1; flex: 0 1 auto; min-height: 40px;
  display: inline-flex; align-items: center; justify-content: center; white-space: nowrap;
  padding: 0.5rem 1.15rem; background: none; border: none; border-radius: 999px; cursor: pointer;
  font: inherit; font-weight: 600; font-size: 0.9rem; color: var(--ink-muted);
  transition: color 150ms ease;
}
.install-tab.active { color: var(--ink); }
@media (hover: hover) and (pointer: fine) {
  .install-tab:not(.active):hover { color: var(--ink-soft); }
}

/* All panels share one grid cell, so the container is always as tall as the
   tallest route and switching tabs never shifts the page. */
/* The terminal is one persistent object: switching routes changes what is
   inside it, so the card itself never fades out. Only its height moves, and
   only the command lines swap. */
.install-panels { display: grid; align-items: start; width: 100%; }
.install-panels[data-measured] {
  overflow: hidden;
  transition: height 300ms var(--ease-out);
}
.install-panel {
  grid-area: 1 / 1; min-width: 0;
  opacity: 0; visibility: hidden;
  transition: opacity 140ms ease-out, visibility 140ms;
}
.install-panel.active { opacity: 1; visibility: visible; }

.install-term {
  width: 100%; background: var(--terminal-bg); border-radius: 14px; overflow: hidden;
  box-shadow: var(--elevation-2);
}
.install-term-head {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.7rem 0.7rem 0.7rem 1.1rem;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.install-term-head .terminal-title { margin-right: auto; }
.install-term-body {
  padding: 1.15rem 1.25rem;
  font-family: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
  font-size: 0.85rem; line-height: 1.95;
  overflow-x: auto; overscroll-behavior-x: contain;
}
.install-term-line { color: var(--terminal-text); white-space: pre; }
.install-term-line .t-cmd { font-weight: 500; }
.t-comment { color: #6d7d8c; }

/* Scoped scrollbar — the page's own stays native. */
.install-term-body::-webkit-scrollbar { height: 8px; }
.install-term-body::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.18); border-radius: 4px; }

.copy-btn {
  position: relative; flex-shrink: 0;
  background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px; width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  color: var(--terminal-muted);
  transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease, scale 150ms var(--ease-out);
}
.copy-btn::before { content: ""; position: absolute; inset: -6px; }
.copy-btn:active { scale: 0.96; }
.copy-btn.copied { color: #5fb36b; border-color: rgba(95, 179, 107, 0.5); background: rgba(95, 179, 107, 0.14); }
@media (hover: hover) and (pointer: fine) {
  .copy-btn:hover { color: var(--terminal-text); background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.2); }
}

.install-notes { display: grid; align-items: start; width: 100%; }
.install-note {
  grid-area: 1 / 1; margin: 0; font-size: 0.9rem; color: var(--ink-muted);
  text-align: center; text-wrap: balance;
  opacity: 0; visibility: hidden; transition: opacity 140ms ease-out, visibility 140ms;
}
.install-note.active { opacity: 1; visibility: visible; }

@media (max-width: 560px) {
  .install-tabs { display: grid; grid-template-columns: 1fr; width: 100%; border-radius: 14px; }
  .install-tab-glide { border-radius: 10px; }
  .install-term-body { font-size: 0.78rem; }
}

/* --- Safety --- */
.safety-section { padding: clamp(4.5rem, 8vw, 6.5rem) 1.5rem; background: var(--bg-soft); border-block: var(--border-hairline) solid var(--border); }
.safety-inner { max-width: 940px; margin: 0 auto; }
.safety-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
/* The copper hairline is the caution mark. It rides the shadow ring rather than
   a drawn bar, so it traces the corner radius instead of cutting across it. */
.safety-card {
  display: grid; grid-template-columns: 34px 1fr; gap: 0.4rem 0.9rem; align-content: start;
  background: var(--surface); border-radius: 16px; padding: 1.5rem;
  box-shadow: var(--elevation-caution);
  transition: box-shadow 150ms ease-out, transform 150ms ease-out;
}
@media (hover: hover) and (pointer: fine) {
  .safety-card:hover { box-shadow: var(--elevation-caution-hover); transform: translateY(-2px); }
}
.safety-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--fox-tint); color: var(--fox-deep);
}
.safety-card h3 {
  align-self: center; font-size: 1.05rem; letter-spacing: -0.015em;
  text-wrap: balance; min-width: 0;
}
/* The copy runs the full card width; only the heading is indented by the icon. */
.safety-card p {
  grid-column: 1 / -1; font-size: 0.93rem; line-height: 1.6;
  color: var(--ink-muted); margin: 0; text-wrap: pretty;
}
.safety-note { margin-top: 2rem; text-align: center; }

@media (max-width: 720px) {
  .safety-grid { grid-template-columns: 1fr; }
  .safety-card { padding: 1.25rem; border-radius: 14px; }
}

/* --- FAQ --- */
.faq-section { padding: clamp(4.5rem, 8vw, 6.5rem) 1.5rem clamp(5rem, 9vw, 7rem); }
.faq-inner { max-width: 820px; margin: 0 auto; }
.faq-list { display: flex; flex-direction: column; gap: 0.7rem; }
.faq-item {
  background: var(--surface); box-shadow: var(--elevation-1); border-radius: 12px;
  transition: box-shadow 150ms ease;
}
.faq-item[open] { box-shadow: var(--elevation-2); }
.faq-question {
  cursor: pointer; padding: 1.1rem 1.3rem; font-weight: 600; font-size: 1.02rem;
  list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  border-radius: 12px; color: var(--ink);
  transition: color 150ms ease, background-color 150ms ease;
}
.faq-question::-webkit-details-marker { display: none; }
.faq-chevron {
  flex-shrink: 0; color: var(--fox);
  transition: transform 240ms var(--ease-out);
}
.faq-item[open] .faq-chevron { transform: rotate(180deg); }
@media (hover: hover) and (pointer: fine) {
  .faq-question:hover { background: var(--fox-tint); }
  .faq-question:hover .faq-chevron { color: var(--fox-deep); }
}
.faq-answer { padding: 0 1.3rem 1.25rem; color: var(--ink-soft); font-size: 0.95rem; }

/* Height interpolation on <details>; browsers without it simply snap open. */
@supports (interpolate-size: allow-keywords) {
  :root { interpolate-size: allow-keywords; }
  .faq-item::details-content {
    block-size: 0; overflow: hidden;
    transition: block-size 260ms var(--ease-out), content-visibility 260ms allow-discrete;
  }
  .faq-item[open]::details-content { block-size: auto; }
}

/* ============================================
   Docs layout
   ============================================ */
.docs-layout {
  max-width: 1160px; margin: 0 auto; padding: 2.5rem 1.5rem 4rem;
  display: grid; grid-template-columns: 240px 1fr; gap: 2.5rem; align-items: start;
}
.docs-sidebar { position: sticky; top: 84px; }
.sidebar-nav { display: flex; flex-direction: column; gap: 1.5rem; }
.sidebar-section h4 {
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ink-muted); margin-bottom: 0.6rem; font-weight: 700;
}
.sidebar-link {
  display: block; padding: 0.4rem 0.7rem; border-radius: 8px; color: var(--ink-soft);
  font-size: 0.94rem; font-weight: 500; margin-bottom: 0.15rem;
  transition: color 150ms ease-out, background-color 150ms ease-out;
}
.sidebar-link:hover { color: var(--ink); background: var(--fox-tint); }
.sidebar-link.active { background: var(--fox-tint); color: var(--fox-deep); font-weight: 600; }

.docs-content { min-width: 0; }
.docs-header { margin-bottom: 1.75rem; padding-bottom: 1.5rem; border-bottom: var(--border-hairline) solid var(--border); }
.docs-header h1 { font-size: 2.2rem; letter-spacing: -0.03em; }
.docs-description { color: var(--ink-muted); font-size: 1.1rem; margin-top: 0.5rem; }

.docs-body h2 { font-size: 1.5rem; margin: 2.4rem 0 0.9rem; }
.docs-body h3 { font-size: 1.18rem; margin: 1.8rem 0 0.7rem; }
.docs-body h4 { font-size: 1.02rem; margin: 1.4rem 0 0.5rem; }
.docs-body p { margin-bottom: 1rem; color: var(--ink-soft); }
.docs-body ul, .docs-body ol { margin: 0 0 1rem 1.4rem; color: var(--ink-soft); }
.docs-body li { margin-bottom: 0.4rem; }
.docs-body a { font-weight: 500; }

.docs-body pre {
  background: var(--terminal-bg); color: var(--terminal-text);
  border-radius: 12px; padding: 1.15rem 1.3rem; overflow-x: auto;
  margin: 1.1rem 0; font-size: 0.88rem; line-height: 1.65;
}
.docs-body pre code { background: none; color: inherit; padding: 0; font-size: inherit; }
.docs-body pre::-webkit-scrollbar { height: 8px; }
.docs-body pre::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.18); border-radius: 4px; }
.docs-body :not(pre) > code { font-weight: 500; }

.docs-body blockquote {
  border-left: 4px solid var(--fox); background: var(--fox-tint);
  padding: 0.9rem 1.2rem; border-radius: 0 10px 10px 0; margin: 1.25rem 0; color: var(--ink-soft);
}
.docs-body blockquote p { margin: 0; }

.docs-body table { width: 100%; border-collapse: collapse; margin: 1.25rem 0; font-size: 0.92rem; }
.docs-body th, .docs-body td { text-align: left; padding: 0.7rem 0.9rem; border-bottom: var(--border-hairline) solid var(--table-border); }
.docs-body th { font-weight: 700; color: var(--ink); background: var(--bg-soft); }
.docs-body tbody tr:nth-child(even) { background: var(--table-stripe); }
.docs-body td code { white-space: nowrap; }

.docs-footer { display: flex; justify-content: space-between; gap: 1rem; margin-top: 3rem; padding-top: 1.5rem; border-top: var(--border-hairline) solid var(--border); }
.docs-nav-link { display: flex; flex-direction: column; max-width: 46%; }
.docs-nav-label { font-size: 0.78rem; color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.docs-nav-title { font-weight: 600; color: var(--fox-deep); }
.docs-nav-next { text-align: right; margin-left: auto; }
.docs-nav-prev { text-align: left; }

/* ============================================
   Footer — fullscreen, katagami-inspired
   ============================================ */
.site-footer { background: var(--footer-bg); color: var(--footer-text); overflow: hidden; margin-top: 2rem; }
.footer-inner { max-width: 1160px; margin: 0 auto; padding: clamp(3.75rem, 8.5vw, 6.5rem) clamp(1.5rem, 5vw, 3rem) 0; }

.footer-cta {
  border-bottom: var(--border-hairline) solid rgba(255,255,255,0.09);
  padding-bottom: clamp(2.5rem, 5vw, 4rem); margin-bottom: clamp(2.5rem, 5vw, 4rem);
}
.footer-cta h2 {
  font-size: clamp(1.9rem, 4vw, 3.1rem); font-weight: 800; letter-spacing: -0.03em;
  line-height: 1.06; margin: 0 0 1.5rem; max-width: 16ch; text-wrap: balance;
}
.footer-cta__actions { display: flex; flex-wrap: wrap; gap: 0.8rem; }

.footer-top { display: grid; grid-template-columns: 1.1fr 1.9fr; gap: clamp(2.5rem, 6vw, 6rem); }
.footer-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 1rem; max-width: 34ch; }
.footer-brand-name { font-family: 'Fredoka', 'Inter', system-ui, sans-serif; font-size: 1.5rem; font-weight: 600; letter-spacing: -0.005em; color: var(--footer-text); }
.footer-tagline { color: var(--footer-muted); font-size: 0.95rem; line-height: 1.6; margin: 0; }
.footer-nav { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.footer-col { display: flex; flex-direction: column; align-items: flex-start; gap: 0.8rem; }
.footer-col h4 {
  color: var(--footer-muted); font-family: 'JetBrains Mono', monospace; font-size: 0.72rem;
  font-weight: 600; letter-spacing: 0.13em; text-transform: uppercase; margin: 0 0 0.2rem;
}
.footer-col a { color: #c9d2db; font-size: 0.93rem; transition: color 150ms ease-out; }
.footer-col a:hover { color: #e0a06a; }

.footer-word {
  font-family: 'Fredoka', 'Inter', system-ui, sans-serif;
  font-weight: 600; font-size: clamp(4rem, 17vw, 15rem);
  letter-spacing: -0.02em; line-height: 0.82; text-align: center;
  user-select: none; white-space: nowrap; margin: clamp(3.5rem, 9vw, 7rem) 0 0;
  background: linear-gradient(180deg, #4c5f74 0%, #2c3a48 55%, var(--footer-bg) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.footer-bottom {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.25rem 1.75rem; flex-wrap: wrap;
  border-top: var(--border-hairline) solid rgba(255,255,255,0.09);
  margin-top: clamp(2rem, 4.5vw, 3.1rem); padding: 1.7rem 0 2.5rem;
}
.footer-bottom p { color: var(--footer-muted); font-size: 0.82rem; margin: 0; }
.footer-bottom a { color: #c9d2db; font-size: 0.82rem; transition: color 150ms ease-out; }
.footer-bottom a:hover { color: #e0a06a; }
.footer-bottom__links { display: flex; gap: 1.4rem; }

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 2.5rem; padding: 3rem 1.5rem 3.5rem; min-height: auto; }
  .hero-art { justify-content: center; }
  .hero-mascot { width: min(100%, 460px); }
  .pipeline-steps { grid-template-columns: repeat(2, 1fr); }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .contract-grid { grid-template-columns: repeat(2, 1fr); }
  .safety-cards { grid-template-columns: 1fr; }
  .docs-layout { grid-template-columns: 1fr; }
  .docs-sidebar { position: static; }
  .sidebar-nav { flex-direction: row; flex-wrap: wrap; gap: 0.25rem 0.5rem; }
  .sidebar-section h4 { display: none; }
  .sidebar-link { display: inline-block; }
  .footer-top { grid-template-columns: 1fr; gap: 2.75rem; }
  .footer-nav { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .pipeline-steps { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
  .contract-grid { grid-template-columns: 1fr; }
  .outcomes-grid { grid-template-columns: 1fr; }
  .footer-nav { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .section-title { font-size: 1.6rem; }

  .nav-toggle { display: flex; flex-direction: column; gap: 5px; }
  .nav-toggle span { display: block; width: 22px; height: 2px; background: var(--nav-toggle-bar); border-radius: 2px; transition: background-color 260ms ease; }
  .nav-links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; background: var(--nav-panel-bg);
    border-bottom: var(--border-hairline) solid var(--nav-border); padding: 0.75rem 1.5rem 1rem; gap: 0.2rem;
  }
  .nav-links.open { display: flex; }
  .nav-inner { position: relative; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .fade-in, .hero-mascot, .terminal-caret { animation: none !important; }
  .terminal-view { height: auto; }
}
