:root {
  color-scheme: light dark;
  --bg: #f2f3ef;
  --surface: #fafbf8;
  --surface-strong: #e8eae5;
  --ink: #101417;
  --muted: #5d666b;
  --line: #cdd1cb;
  --accent: #ef6a45;
  --accent-ink: #17110f;
  --shadow: 0 24px 70px rgba(45, 54, 48, 0.14);
  --radius: 14px;
  --page: min(1240px, calc(100vw - 48px));
  --font: "Avenir Next", Avenir, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111417;
    --surface: #191d20;
    --surface-strong: #24292d;
    --ink: #f1f2ed;
    --muted: #a7afb2;
    --line: #343a3e;
    --accent: #ff7953;
    --accent-ink: #17110f;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.3);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
a { color: inherit; text-decoration: none; }
button, a { -webkit-tap-highlight-color: transparent; }

.site-header {
  width: var(--page);
  height: 72px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; letter-spacing: -0.02em; width: fit-content; }
.brand-mark { width: 24px; height: 21px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; align-items: end; }
.brand-mark i { display: block; background: var(--ink); border-radius: 2px 2px 0 0; }
.brand-mark i:nth-child(1) { height: 9px; }
.brand-mark i:nth-child(2) { height: 15px; }
.brand-mark i:nth-child(3) { height: 21px; background: var(--accent); }

nav { display: flex; gap: 32px; align-items: center; white-space: nowrap; }
nav a, footer > a, .text-link { color: var(--muted); font-size: 14px; font-weight: 600; }
nav a:hover, footer > a:hover, .text-link:hover { color: var(--ink); }
.site-header > .button { justify-self: end; }

.button {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 0 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  background: transparent;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease;
}
.button:active { transform: translateY(1px); }
.button:disabled { cursor: not-allowed; opacity: 0.48; transform: none; }
.button:focus-visible, a:focus-visible, .prompt:focus-visible, input:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 3px; }
.button-accent { background: var(--accent); color: var(--accent-ink); }
.button-accent:hover { background: color-mix(in srgb, var(--accent) 88%, var(--ink)); }
.button-dark { background: var(--ink); color: var(--bg); }
.button-dark:hover { background: color-mix(in srgb, var(--ink) 82%, var(--muted)); }
.button-quiet { border-color: var(--line); background: var(--surface); }
.button-quiet:hover { border-color: var(--muted); }

main { overflow: clip; }
.hero {
  width: var(--page);
  min-height: calc(100dvh - 72px);
  margin: 0 auto;
  padding: 64px 0 72px;
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(480px, 1.12fr);
  gap: clamp(50px, 8vw, 110px);
  align-items: center;
}
.eyebrow { margin: 0 0 22px; color: var(--accent); font: 700 12px/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; }
h1, h2, h3, p { text-wrap: pretty; }
h1 { max-width: 680px; margin: 0; font-size: clamp(52px, 6.2vw, 88px); line-height: 0.98; letter-spacing: -0.065em; font-weight: 640; }
.hero-summary { max-width: 520px; margin: 28px 0 0; color: var(--muted); font-size: clamp(18px, 1.6vw, 22px); line-height: 1.5; }
.hero-actions { display: flex; align-items: center; gap: 24px; margin-top: 32px; }
.text-link { display: inline-flex; align-items: center; gap: 8px; }

.receipt-shell { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; min-width: 0; }
.receipt-topline { display: flex; justify-content: space-between; align-items: center; padding-bottom: 18px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; }
.receipt-id { font-family: var(--mono); }
.conversation { margin: 24px 0; padding-left: 18px; border-left: 3px solid var(--accent); }
.conversation p { margin: 0; font-size: 17px; line-height: 1.5; }
.conversation .speaker { margin-bottom: 5px; color: var(--muted); font: 700 11px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.1em; }
.change-preview { background: var(--surface-strong); border-radius: 10px; padding: 18px; }
.change-preview > div:first-child { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 16px; }
.change-preview span { color: var(--muted); font-size: 13px; }
.change-preview strong { font-size: 14px; }
.change-row { display: grid; grid-template-columns: 1fr auto 16px auto; gap: 12px; align-items: center; min-height: 42px; border-top: 1px solid var(--line); }
.change-row .change-label { color: var(--ink); font-weight: 600; }
.change-row .value-old { text-decoration: line-through; }
.change-row .value-new { color: var(--ink); font-weight: 750; }
.warning { color: var(--muted); margin: 16px 0; font-size: 13px; }
.receipt-actions { display: flex; gap: 10px; }
.receipt-state { margin: 17px 0 0; color: var(--muted); font: 600 12px/1.2 var(--mono); }
.receipt-shell.is-approved { border-color: var(--accent); }
.receipt-shell.is-approved .receipt-state { color: var(--accent); }

.trust-rail { width: var(--page); margin: 0 auto; padding: 25px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, 1fr); }
.trust-rail span { padding: 0 20px; text-align: center; color: var(--muted); font: 600 12px/1.3 var(--mono); }
.trust-rail span + span { border-left: 1px solid var(--line); }

section:not(.hero, .trust-rail) { width: var(--page); margin: 0 auto; padding: 130px 0; }
h2 { max-width: 780px; margin: 0; font-size: clamp(40px, 5vw, 66px); line-height: 1.02; letter-spacing: -0.055em; font-weight: 620; }
h3 { margin: 0; font-size: 24px; letter-spacing: -0.035em; }
.section-heading > p { max-width: 620px; margin: 24px 0 0; color: var(--muted); font-size: 18px; line-height: 1.6; }

.workflow-list { margin-top: 70px; border-top: 1px solid var(--line); }
.workflow-list article { display: grid; grid-template-columns: 160px minmax(210px, 0.7fr) minmax(300px, 1fr) auto; align-items: center; gap: 34px; padding: 34px 0; border-bottom: 1px solid var(--line); }
.workflow-list p { margin: 0; color: var(--muted); line-height: 1.55; }
.workflow-list .workflow-index { color: var(--accent); font: 700 12px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.1em; }
code { padding: 7px 9px; border-radius: 6px; background: var(--surface-strong); font: 12px/1.2 var(--mono); color: var(--muted); white-space: nowrap; }

.material-section { display: grid; grid-template-columns: 1.12fr 0.88fr; gap: clamp(46px, 8vw, 110px); align-items: center; }
.material-section img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow); }
.material-section h2 { font-size: clamp(38px, 4.5vw, 58px); }
.material-section > div > p { color: var(--muted); line-height: 1.65; font-size: 18px; margin: 24px 0; }
.plain-list { margin: 0; padding: 0; list-style: none; }
.plain-list li { padding: 13px 0 13px 24px; position: relative; color: var(--muted); line-height: 1.45; }
.plain-list li::before { content: ""; position: absolute; left: 0; top: 20px; width: 10px; height: 2px; background: var(--accent); }

.diff-grid { margin-top: 65px; display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.diff-column { padding: 28px; background: var(--surface); }
.diff-column.proposed { background: color-mix(in srgb, var(--accent) 9%, var(--surface)); border-left: 1px solid var(--line); }
.diff-column > p { margin: 0 0 22px; color: var(--muted); font: 700 12px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.1em; }
dl { margin: 0; }
dl div { display: flex; justify-content: space-between; gap: 20px; padding: 14px 0; border-bottom: 1px solid var(--line); }
dl div:last-child { border: 0; }
dt { color: var(--muted); }
dd { margin: 0; font: 650 14px/1.4 var(--mono); }
.audit-line { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface-strong); }
.audit-line span { padding: 18px; color: var(--muted); font: 600 12px/1.35 var(--mono); text-align: center; }
.audit-line span + span { border-left: 1px solid var(--line); }

.prompts-section { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: clamp(60px, 10vw, 150px); align-items: start; }
.prompts-section h2 { font-size: clamp(40px, 4.5vw, 58px); position: sticky; top: 100px; }
.prompt-stack { border-top: 1px solid var(--line); }
.prompt { width: 100%; padding: 26px 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); display: grid; grid-template-columns: 1fr auto; gap: 20px; text-align: left; cursor: pointer; }
.prompt:hover span { color: var(--accent); }
.prompt span { font-size: 20px; line-height: 1.45; transition: color 180ms ease; }
.prompt small { color: var(--muted); font: 600 11px/1.4 var(--mono); }

.connect-section { border-top: 1px solid var(--line); display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 70px; align-items: start; }
.connect-section h2 { font-size: clamp(40px, 4.5vw, 58px); }
.connect-section > div > p { max-width: 540px; color: var(--muted); line-height: 1.65; font-size: 17px; }
.connect-section ol { margin: 0; padding: 0; list-style: none; counter-reset: setup; }
.connect-section li { counter-increment: setup; display: grid; grid-template-columns: 40px 1fr; gap: 4px 15px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.connect-section li::before { content: counter(setup); grid-row: 1 / 3; font: 650 13px/1.4 var(--mono); color: var(--accent); }
.connect-section li span { font-weight: 650; }
.connect-section li small { grid-column: 2; color: var(--muted); font-size: 14px; }
.connect-section > .button { grid-column: 2; width: fit-content; }

.security-grid { margin-top: 65px; display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.security-grid article { min-height: 210px; padding: 30px; background: var(--surface); display: flex; flex-direction: column; justify-content: space-between; }
.security-grid article:nth-child(2), .security-grid article:nth-child(3) { background: var(--surface-strong); }
.security-grid p { max-width: 430px; margin: 30px 0 0; color: var(--muted); line-height: 1.55; }

footer { width: var(--page); min-height: 150px; margin: 0 auto; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 30px; }
footer p { color: var(--muted); }
footer > a:last-child { justify-self: end; }

.setup-dialog { width: min(620px, calc(100vw - 32px)); padding: 34px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.setup-dialog::backdrop { background: rgba(7, 9, 10, 0.68); backdrop-filter: blur(5px); }
.setup-dialog form { position: absolute; right: 22px; top: 18px; }
.dialog-close { width: 40px; height: 40px; border: 0; border-radius: 8px; background: var(--surface-strong); color: var(--ink); font-size: 25px; cursor: pointer; }
.setup-dialog h2 { font-size: 42px; }
.setup-intro { color: var(--muted); line-height: 1.55; }
.setup-dialog label { display: block; margin: 26px 0 8px; font-size: 13px; font-weight: 700; }
.copy-field { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.copy-field input { min-width: 0; height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); font: 13px/1 var(--mono); }
.setup-status { margin: 22px 0; padding: 16px; border-radius: 9px; background: var(--surface-strong); }
.setup-status .status-label { font: 700 11px/1 var(--mono); color: var(--accent); text-transform: uppercase; letter-spacing: 0.1em; }
.setup-status p { margin: 8px 0 0; color: var(--muted); font-size: 14px; }

@media (max-width: 900px) {
  :root { --page: min(100% - 32px, 720px); }
  .site-header { grid-template-columns: 1fr auto; }
  nav { display: none; }
  .hero { grid-template-columns: 1fr; gap: 44px; padding: 56px 0 70px; }
  .receipt-shell { max-width: 640px; }
  .trust-rail { grid-template-columns: 1fr 1fr; }
  .trust-rail span { padding: 16px 8px; }
  .trust-rail span + span { border-left: 0; }
  .trust-rail span:nth-child(even) { border-left: 1px solid var(--line); }
  .trust-rail span:nth-child(n+3) { border-top: 1px solid var(--line); }
  section:not(.hero, .trust-rail) { padding: 92px 0; }
  .workflow-list article { grid-template-columns: 110px 1fr; gap: 12px 24px; }
  .workflow-list article > p:not(.workflow-index), .workflow-list article > code { grid-column: 2; }
  .material-section, .prompts-section, .connect-section { grid-template-columns: 1fr; gap: 46px; }
  .material-section img { order: 2; }
  .prompts-section h2 { position: static; }
  .connect-section > .button { grid-column: 1; }
}

@media (max-width: 620px) {
  .site-header { height: 64px; }
  .site-header .button { min-height: 40px; padding: 0 13px; }
  .hero { min-height: auto; padding-top: 46px; }
  h1 { font-size: clamp(48px, 15vw, 64px); }
  h2 { font-size: 42px; }
  .hero-actions, .receipt-actions { align-items: stretch; flex-direction: column; }
  .hero-actions .text-link { min-height: 42px; }
  .change-preview > div:first-child { flex-direction: column; gap: 5px; }
  .change-row { grid-template-columns: 1fr auto 12px auto; gap: 7px; }
  .workflow-list article { grid-template-columns: 1fr; padding: 28px 0; }
  .workflow-list article > p:not(.workflow-index), .workflow-list article > code { grid-column: 1; }
  .workflow-list article > code { width: fit-content; }
  .diff-grid, .security-grid { grid-template-columns: 1fr; }
  .diff-column.proposed { border-left: 0; border-top: 1px solid var(--line); }
  .audit-line { grid-template-columns: 1fr 1fr; }
  .audit-line span:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
  .audit-line span:nth-child(4) { border-top: 1px solid var(--line); }
  .security-grid article { min-height: 170px; }
  footer { grid-template-columns: 1fr; padding: 38px 0; gap: 12px; }
  footer p { margin: 0; }
  footer > a:last-child { justify-self: start; }
  .copy-field { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
