/* Redact landing. Tokens come from the app (Sources/RedactApp/Theme.swift): OKLCH, neutrals tinted
   toward hue 128, one lime signal used as a fill with its dark ink on top, mono for names and values,
   and the app's signature, the redaction bar. Light paper, one dark band for the agents section. */

@font-face { font-family: "Rethink Sans"; src: url("/fonts/rethink-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Rethink Sans"; src: url("/fonts/rethink-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Fragment Mono"; src: url("/fonts/fragment-mono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Rethink Fallback"; src: local("Arial"); size-adjust: 100%; ascent-override: 94%; descent-override: 24%; }

:root {
  /* paper and ink (Palette.canvas / sunken / surface / ink / ink2 / ink3 / rule) */
  --paper: oklch(0.985 0.004 128);
  --paper-2: oklch(0.958 0.005 128);
  --surface: oklch(0.997 0.002 128);
  --ink: oklch(0.22 0.01 128);
  --ink-2: oklch(0.46 0.012 128);
  --ink-3: oklch(0.6 0.01 128);
  --rule: oklch(0.91 0.006 128);
  --rule-2: oklch(0.86 0.007 128);
  /* the lime signal (Palette.accent / accentInk / accentText) */
  --accent: oklch(0.88 0.19 128);
  --accent-2: oklch(0.84 0.19 128);
  --accent-ink: oklch(0.27 0.07 128);
  --accent-text: oklch(0.5 0.14 135);
  --warning: oklch(0.56 0.12 65);
  /* redaction bar (Palette.markInk) */
  --bar: oklch(0.13 0.02 128);
  /* the dark band and the terminal (dark canvas / surface / sunken) */
  --night: oklch(0.225 0.006 128);
  --night-2: oklch(0.258 0.007 128);
  --night-3: oklch(0.195 0.006 128);
  --night-ink: oklch(0.95 0.006 128);
  --night-ink-2: oklch(0.75 0.008 128);
  --night-ink-3: oklch(0.6 0.008 128);
  --night-rule: oklch(0.32 0.007 128);
  --night-accent: oklch(0.86 0.17 128);

  --font: "Rethink Sans", "Rethink Fallback", system-ui, sans-serif;
  --mono: "Fragment Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --text-display: clamp(2.75rem, 5vw + 1rem, 5.25rem);
  --text-section: clamp(2rem, 2.5vw + 1rem, 3.5rem);
  --text-title: clamp(1.25rem, 0.75vw + 0.875rem, 1.625rem);
  --text-lead: clamp(1.125rem, 0.35vw + 1rem, 1.375rem);
  --text-md: 1rem;
  --text-sm: 0.875rem;

  --radius-card: 16px;
  --radius-control: 12px;
  --radius-chip: 6px;
  --gutter: 64px;
  --max: 1312px;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --shadow-ring: 0 0 0 1px oklch(0.22 0.01 128 / 0.06), 0 1px 2px -1px oklch(0.22 0.01 128 / 0.06), 0 2px 4px oklch(0.22 0.01 128 / 0.04);
  --shadow-hero: 0 0 0 1px oklch(0.22 0.01 128 / 0.08), 0 24px 64px -24px oklch(0.22 0.01 128 / 0.28);
  --shadow-satellite: 0 0 0 1px oklch(0.13 0.02 128 / 0.5), 0 16px 32px -12px oklch(0.13 0.02 128 / 0.45);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font); font-size: var(--text-md); line-height: 1.55; font-synthesis: none; -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; }
h1, h2, h3 { font-weight: 600; text-wrap: balance; }
p, li, dd { text-wrap: pretty; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }
code, kbd, .mono { font-family: var(--mono); font-size: 0.92em; }
h1 code, h2 code, .hero-lead code { font-size: 0.86em; letter-spacing: -0.06em; margin-left: -0.12em; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 3px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -64px; padding: 8px 12px; background: var(--ink); color: var(--paper); border-radius: 8px; z-index: 400; }
.skip:focus { top: 12px; }
.wrap { width: 100%; max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto; padding-inline: var(--gutter); }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 24px; border-radius: var(--radius-control); border: 1px solid transparent;
  font: 600 var(--text-md)/1 var(--font); text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: transform 150ms var(--ease-out), background-color 150ms ease, border-color 150ms ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:not(:disabled):active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: inset 0 -1px 0 oklch(0.27 0.07 128 / 0.18); }
.btn-quiet { background: var(--surface); color: var(--ink); border-color: var(--rule-2); }
.btn-sm { height: 40px; padding: 0 16px; border-radius: 10px; font-size: var(--text-sm); }
.link { font-weight: 600; text-decoration: underline; text-decoration-color: var(--rule-2); text-underline-offset: 4px; transition: text-decoration-color 150ms ease; }
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover { background: var(--accent-2); }
  .btn-quiet:hover { border-color: var(--ink-3); }
  .link:hover { text-decoration-color: currentColor; }
}

/* ---------- nav ---------- */
.nav { position: sticky; top: 0; z-index: 300; background: oklch(0.985 0.004 128 / 0.86); backdrop-filter: blur(16px) saturate(160%); -webkit-backdrop-filter: blur(16px) saturate(160%); border-bottom: 1px solid transparent; transition: border-color 200ms ease; }
.nav[data-scrolled="true"] { border-bottom-color: var(--rule); }
.nav-in { display: flex; align-items: center; gap: 32px; height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 600; font-size: 1.125rem; letter-spacing: -0.01em; }
.brand img { width: 32px; height: 32px; flex-shrink: 0; }
.nav-links { display: flex; gap: 4px; margin-left: 8px; }
.nav-links a { padding: 8px 12px; border-radius: 8px; font-size: var(--text-sm); color: var(--ink-2); text-decoration: none; transition: color 150ms ease, background-color 150ms ease; }
.nav-end { margin-left: auto; display: flex; align-items: center; gap: 8px; }
@media (hover: hover) and (pointer: fine) { .nav-links a:hover { color: var(--ink); background: var(--paper-2); } }

/* ---------- hero (Stage: text 5 cols, capture 7 cols bleeding right) ---------- */
.hero { position: relative; overflow: clip; padding-block: 80px 96px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); gap: 48px; align-items: center; }
.hero-copy { position: relative; z-index: 10; }
.hero h1 { font-size: var(--text-display); line-height: 1.02; letter-spacing: -0.02em; max-width: 13ch; }
.hero-lead { margin-top: 24px; font-size: var(--text-lead); line-height: 1.45; color: var(--ink-2); max-width: 30ch; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; margin-top: 40px; }
.hero-note { margin-top: 24px; font-size: var(--text-sm); color: var(--ink-2); max-width: 40ch; }

.hero-stage { position: relative; min-height: 560px; }
.capture { width: 1000px; max-width: none; border-radius: 12px; box-shadow: var(--shadow-hero); outline: 1px solid oklch(0.22 0.01 128 / 0.1); outline-offset: -1px; }
.hero-stage .capture { position: absolute; left: 0; top: 0; }

/* terminal satellite: straddles the capture's lower-left edge */
.term {
  position: absolute; left: -96px; bottom: 0; width: 520px; z-index: 20;
  background: var(--night-3); color: var(--night-ink); border-radius: 14px; box-shadow: var(--shadow-satellite);
  font: 400 13.5px/1.6 var(--mono); padding: 12px 16px 16px;
}
.term-bar { display: flex; align-items: center; gap: 8px; height: 24px; margin-bottom: 8px; color: var(--night-ink-3); font: 400 12px/1 var(--font); }
.term-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--night-rule); flex-shrink: 0; }
.term-bar span { margin-left: 8px; }
.term-lines { min-height: calc(7 * 1.6em); }
.term-line { white-space: pre; overflow: hidden; text-overflow: clip; }
.term-line .p { color: var(--night-ink-3); }
.term-line .ok { color: var(--night-accent); }
.term-line .dim { color: var(--night-ink-2); }
.term-line .warn { color: oklch(0.82 0.14 78); }
.caret { display: inline-block; width: 0.6em; height: 1.1em; margin-left: 1px; vertical-align: -0.2em; background: var(--night-ink); }
.term[data-typing="true"] .caret { animation: none; }
.spin { display: inline-block; width: 1ch; }

/* the signature: a value printed as a redaction bar carrying its name */
.redacted {
  display: inline-block; padding: 0 8px; border-radius: 4px; background: var(--bar); color: var(--night-accent);
  box-shadow: 0 0 0 1px var(--night-rule); clip-path: inset(0 0 0 0);
}
.redacted.enter { animation: wipe 320ms var(--ease-out); }
@keyframes wipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

/* ---------- sections ---------- */
.section { padding-block: 120px; }
.section + .section { border-top: 1px solid var(--rule); }
.head h2, .head-split h2 { max-width: 20ch; }
.head h2, .head-split h2 { font-size: var(--text-section); line-height: 1.06; letter-spacing: -0.02em; }
.head p { margin-top: 24px; font-size: var(--text-lead); line-height: 1.45; color: var(--ink-2); max-width: 46ch; }
.head-split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 64px; align-items: end; }
.head-split > p { font-size: var(--text-lead); line-height: 1.45; color: var(--ink-2); max-width: 46ch; }

/* steps: from .env to nothing on disk */
.flow { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 64px; margin-top: 64px; align-items: start; }
.steps { counter-reset: step; display: grid; gap: 40px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 16px; }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--paper-2); box-shadow: inset 0 0 0 1px var(--rule-2); font-size: var(--text-sm); font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.steps h3 { font-size: var(--text-title); line-height: 1.2; letter-spacing: -0.01em; }
.steps p { margin-top: 8px; color: var(--ink-2); max-width: 44ch; }
.cmd { margin-top: 12px; display: block; width: fit-content; max-width: 100%; padding: 8px 12px; border-radius: 8px; background: var(--paper-2); font: 400 14px/1.5 var(--mono); color: var(--ink); white-space: pre; overflow-x: auto; }

/* faux import sheet (Stageshow still: one real surface, 3–7 real strings, bars for the rest) */
.sheet { background: var(--surface); border-radius: var(--radius-card); box-shadow: var(--shadow-hero); padding: 24px; position: sticky; top: 112px; }
.sheet-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.sheet-title { font-size: 1.125rem; font-weight: 600; }
.sheet-path { font: 400 13px/1.4 var(--mono); color: var(--ink-2); }
.sheet-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.chip { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 12px; border-radius: var(--radius-chip); background: var(--paper-2); font: 400 13px/1 var(--mono); color: var(--ink-2); }
.chip-warn { color: var(--warning); }
.rows { margin-top: 16px; border-top: 1px solid var(--rule); }
.row { display: grid; grid-template-columns: 20px minmax(0, 13rem) minmax(0, 1fr) auto; gap: 12px; align-items: center; min-height: 48px; border-bottom: 1px solid var(--rule); font-size: 14px; }
.row .box { width: 16px; height: 16px; border-radius: 4px; background: var(--accent); box-shadow: inset 0 0 0 1px oklch(0.27 0.07 128 / 0.3); display: grid; place-items: center; }
.row .box svg { width: 10px; height: 10px; color: var(--accent-ink); }
.row .name { font: 400 13.5px/1.3 var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .val { height: 28px; padding: 0 8px; display: flex; align-items: center; border-radius: var(--radius-chip); background: var(--paper-2); font: 400 13px/1 var(--mono); color: var(--ink-2); overflow: hidden; white-space: nowrap; }
.row .val-ph .ph { background: var(--rule-2); }
.row .tag { font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.row .tag.new { color: var(--accent-text); font-weight: 600; }
.ph { display: block; height: 8px; border-radius: 4px; background: var(--paper-2); }
.sheet-foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 24px; }
.sheet-foot .note { font-size: 13px; color: var(--ink-2); }
.fake-btn { white-space: nowrap; flex-shrink: 0; display: inline-flex; align-items: center; height: 32px; padding: 0 16px; border-radius: 8px; font-size: 13px; font-weight: 600; background: var(--accent); color: var(--accent-ink); }

/* ---------- agents: the dark band ---------- */
.band { background: var(--night); color: var(--night-ink); }
.band .head p, .band .head-split > p { color: var(--night-ink-2); }
.band + .section { border-top: 0; }
.agents { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); gap: 64px; align-items: center; margin-top: 64px; }
.agents figure { position: relative; }
.agents figure img { width: 100%; border-radius: 16px; outline: 1px solid oklch(1 0 0 / 0.1); outline-offset: -1px; box-shadow: 0 32px 64px -24px oklch(0.1 0.01 128 / 0.8); }
.facts { display: grid; gap: 0; }
.facts div { padding-block: 24px; border-top: 1px solid var(--night-rule); }
.facts div:last-child { border-bottom: 1px solid var(--night-rule); }
.facts dt { font-weight: 600; font-size: 1.0625rem; }
.facts dd { margin-top: 4px; color: var(--night-ink-2); }
.facts code { color: var(--night-accent); }
.agent-list { margin-top: 24px; color: var(--night-ink-2); font-size: var(--text-sm); }

/* ---------- accounts per folder ---------- */
.accounts { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 64px; margin-top: 64px; align-items: start; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 16px 16px 16px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-size: var(--text-sm); font-weight: 600; color: var(--ink-2); white-space: nowrap; }
td:first-child { font-weight: 600; white-space: nowrap; }
td code { font-size: 14px; }
td small { display: block; margin-top: 2px; font-size: var(--text-sm); color: var(--ink-2); }
.term-static { position: static; width: 100%; left: auto; bottom: auto; }
.term-static .term-lines { min-height: 0; }

/* ---------- the rest of the vault: switcher ---------- */
.switch { margin-top: 48px; }
.seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--paper-2); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { height: 40px; padding: 0 16px; border: 0; border-radius: 10px; background: transparent; color: var(--ink-2); font: 600 var(--text-sm)/1 var(--font); white-space: nowrap; cursor: pointer; transition: color 150ms ease, background-color 150ms ease; }
.seg button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-ring); }
@media (hover: hover) and (pointer: fine) { .seg button:hover { color: var(--ink); } }
.panes { position: relative; margin-top: 32px; }
.pane { display: grid; gap: 24px; }
.pane[hidden] { display: none; }
.pane p { color: var(--ink-2); max-width: 60ch; font-size: var(--text-lead); line-height: 1.45; min-height: 2.9em; }
.crop { overflow: hidden; border-radius: 12px; box-shadow: var(--shadow-hero); aspect-ratio: 5 / 2; }
.crop .capture { width: 100%; box-shadow: none; border-radius: 0; }
.js .pane.enter { animation: pane-in 300ms var(--ease-out) both; }
@keyframes pane-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- security spec ---------- */
.spec { margin-top: 64px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 64px; }
.spec div { padding-block: 24px; border-top: 1px solid var(--rule); }
.spec dt { font-weight: 600; }
.spec dd { margin-top: 8px; color: var(--ink-2); max-width: 52ch; }

/* ---------- faq ---------- */
.faq-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 64px; align-items: start; }
.faq details { border-top: 1px solid var(--rule); }
.faq details:last-child { border-bottom: 1px solid var(--rule); }
.faq summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 64px; padding-block: 16px; font-size: 1.0625rem; font-weight: 600; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary svg { flex-shrink: 0; width: 16px; height: 16px; color: var(--ink-3); transition: transform 200ms var(--ease-out); }
.faq details[open] summary svg { transform: rotate(45deg); }
.faq details p { padding-bottom: 24px; color: var(--ink-2); max-width: 60ch; }

/* ---------- close + footer ---------- */
.close { text-align: left; }
.close h2 { font-size: var(--text-display); line-height: 1.02; letter-spacing: -0.02em; max-width: 18ch; }
.close .hero-actions { margin-top: 40px; }
.foot { border-top: 1px solid var(--rule); padding-block: 40px 48px; font-size: var(--text-sm); color: var(--ink-2); }
.foot-in { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 24px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 24px; }
.foot a { text-decoration: none; }
@media (hover: hover) and (pointer: fine) { .foot a:hover { color: var(--ink); } }

/* ---------- responsive ---------- */
@media (max-width: 80rem) {
  .term { left: -48px; width: 480px; }
}
@media (max-width: 60rem) {
  :root { --gutter: 24px; }
  .nav-links { display: none; }
  .hero { padding-block: 48px 64px; }
  .hero-grid, .flow, .agents, .accounts, .faq-grid, .head-split { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .hero h1 { max-width: 14ch; }
  .hero-stage { min-height: 0; display: grid; gap: 16px; }
  .hero-stage .capture { position: static; width: 140%; }
  .term { position: relative; left: auto; bottom: auto; width: 100%; margin-top: -96px; }
  .sheet { position: static; }
  .section { padding-block: 80px; }
  .spec { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 40rem) {
  :root { --gutter: 16px; }
  .nav-in { height: 64px; }
  .brand span { font-size: 1rem; }
  .hero-actions .btn { flex: 1 1 100%; }
  .section { padding-block: 64px; }
  .term { font-size: 12px; padding: 12px; margin-top: -64px; }
  .term-line { white-space: pre-wrap; }
  .redacted { white-space: nowrap; }
  .term-lines { min-height: calc(9 * 1.6em); }
  .row { grid-template-columns: 20px minmax(0, 1fr) auto; }
  .row .val { display: none; }
  .head-split > p, .head p { font-size: 1.0625rem; }
  .sheet-foot { flex-direction: column; align-items: stretch; }
  .fake-btn { justify-content: center; }
  .seg { -webkit-mask-image: linear-gradient(to right, #000 85%, transparent); mask-image: linear-gradient(to right, #000 85%, transparent); }
  .crop { aspect-ratio: 4 / 3; }
  .crop .capture { width: 210%; max-width: none; margin-left: -32%; }
  .term-static { margin-top: 0; }
  .close h2 { font-size: clamp(2.25rem, 9vw, 3rem); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .redacted.enter, .js .pane.enter { animation: none; }
  .faq summary svg, .btn { transition: none; }
}
