:root {
  color-scheme: dark;
  --ink: #e8f2ff;
  --muted: #8ea4bd;
  --paper: #0d1829;
  --paper-strong: #111f34;
  --ground: #050811;
  --line: rgba(142, 164, 189, 0.22);
  --amber: #f59e0b;
  --amber-soft: #fbbf24;
  --cyan: #38bdf8;
  --emerald: #10b981;
  --danger: #fb7185;
  --display: "Palatino Linotype", "Book Antiqua", Palatino, serif;
  --body: Aptos, "Segoe UI", sans-serif;
  --mono: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.38);
}

:root[data-theme="light"] {
  color-scheme: light;
  --ink: #102139;
  --muted: #586c82;
  --paper: #f6f0e4;
  --paper-strong: #fffaf0;
  --ground: #e8dfcf;
  --line: rgba(35, 57, 82, 0.22);
  --shadow: 0 30px 80px rgba(73, 56, 31, 0.16);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--body);
  line-height: 1.55;
}
button, textarea, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
[hidden] { display: none !important; }

.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(rgba(56, 189, 248, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.045) 1px, transparent 1px),
    radial-gradient(circle at 82% 10%, rgba(56, 189, 248, 0.12), transparent 30%),
    radial-gradient(circle at 12% 28%, rgba(245, 158, 11, 0.1), transparent 28%);
  background-size: 42px 42px, 42px 42px, auto, auto;
  mask-image: linear-gradient(to bottom, black 0 70%, transparent 100%);
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 20;
  padding: .8rem 1rem;
  background: var(--amber);
  color: #111827;
  font-weight: 800;
}
.skip-link:focus { top: 1rem; }

.site-header {
  width: min(1480px, calc(100% - 3rem));
  margin: 0 auto;
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  border-bottom: 1px solid var(--line);
}
.brand img { display: block; width: clamp(180px, 19vw, 270px); height: auto; }
.header-actions { display: flex; align-items: center; gap: .75rem; }
.segmented { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: color-mix(in srgb, var(--paper) 76%, transparent); }
.segmented button { min-height: 30px; border: 0; border-radius: 999px; padding: .25rem .65rem; background: transparent; color: var(--muted); cursor: pointer; font-family: var(--mono); font-size: .7rem; text-transform: uppercase; }
.segmented button[aria-pressed="true"] { background: var(--ink); color: var(--ground); }
.repo-link { border-left: 1px solid var(--line); padding-left: 1rem; font-family: var(--mono); font-size: .78rem; text-decoration: none; }

main { overflow: clip; }
.hero {
  width: min(1360px, calc(100% - 3rem));
  min-height: 760px;
  margin: 0 auto;
  padding: 7.5rem 0 6rem;
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(420px, .8fr);
  gap: clamp(4rem, 8vw, 9rem);
  align-items: center;
}
.eyebrow { margin: 0 0 1.1rem; color: var(--cyan); font-family: var(--mono); font-size: .72rem; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 820px; margin-bottom: 1.6rem; font-family: var(--display); font-size: clamp(3.8rem, 7.1vw, 7.3rem); font-weight: 500; letter-spacing: -.055em; line-height: .91; }
h1 em { display: block; margin-left: clamp(1rem, 7vw, 8rem); color: var(--amber-soft); font-weight: 500; }
.hero-lead { max-width: 700px; margin-bottom: 2rem; color: var(--muted); font-size: clamp(1.05rem, 1.4vw, 1.3rem); }
.proof-row { display: flex; flex-wrap: wrap; gap: .8rem 1.5rem; margin-bottom: 2rem; color: var(--muted); font-family: var(--mono); font-size: .7rem; text-transform: uppercase; }
.proof-row span { display: flex; align-items: center; gap: .55rem; }
.proof-row b { color: var(--ink); font-weight: 650; }
.dot { width: 7px; height: 7px; border-radius: 50%; box-shadow: 0 0 12px currentColor; }
.emerald { color: var(--emerald); background: currentColor; }
.cyan { color: var(--cyan); background: currentColor; }
.amber { color: var(--amber); background: currentColor; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .8rem; }
.button { display: inline-flex; min-height: 48px; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 8px; padding: .75rem 1rem; text-decoration: none; font-weight: 750; }
.button.primary { border-color: var(--amber); background: var(--amber); color: #111827; }
.button.secondary { background: color-mix(in srgb, var(--paper) 76%, transparent); }

.case-file { position: relative; transform: rotate(1.2deg); }
.folder-tab { position: absolute; top: -37px; left: 30px; z-index: 0; min-width: 180px; height: 52px; padding: .75rem 1.2rem; border-radius: 10px 10px 0 0; background: var(--amber); color: #111827; font-family: var(--mono); font-size: .72rem; font-weight: 800; letter-spacing: .1em; }
.paper-stack { position: absolute; inset: 12px -14px -14px 18px; border: 1px solid var(--line); border-radius: 5px; background: color-mix(in srgb, var(--paper) 88%, var(--cyan)); transform: rotate(2.4deg); }
.case-paper { position: relative; z-index: 1; min-height: 520px; padding: clamp(2rem, 4vw, 3.3rem); border: 1px solid var(--line); border-radius: 5px; background: var(--paper-strong); box-shadow: var(--shadow); }
.case-paper::after { content: "SYNTHETIC"; position: absolute; right: -2.6rem; bottom: 6rem; color: color-mix(in srgb, var(--amber) 18%, transparent); font-family: var(--mono); font-size: 4rem; font-weight: 900; letter-spacing: .1em; transform: rotate(-90deg); }
.case-head { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1rem; padding-bottom: 1.6rem; border-bottom: 2px solid var(--ink); }
.case-mark { display: grid; width: 48px; height: 48px; place-items: center; border: 2px solid var(--amber); color: var(--amber); font-family: var(--display); font-size: 1.2rem; }
.case-head small, .case-head strong { display: block; }
.case-head small, .case-paper dt { color: var(--muted); font-family: var(--mono); font-size: .63rem; letter-spacing: .12em; text-transform: uppercase; }
.case-head strong { font-family: var(--display); font-size: 1.45rem; }
.stamp { border: 2px solid var(--emerald); padding: .3rem .55rem; color: var(--emerald); font-family: var(--mono); font-size: .65rem; font-weight: 900; transform: rotate(-4deg); }
.case-paper dl { margin: 2rem 0; }
.case-paper dl div { display: grid; grid-template-columns: 140px 1fr; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.case-paper dd { margin: 0; font-weight: 700; }
.route-line { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: 2.5rem; color: var(--muted); font-family: var(--mono); font-size: .65rem; text-transform: uppercase; }
.route-line b { color: var(--amber); }

.demo-section { padding: 7rem max(1.5rem, calc((100vw - 1480px) / 2)); background: color-mix(in srgb, var(--paper) 58%, transparent); border-block: 1px solid var(--line); }
.section-heading { display: flex; justify-content: space-between; gap: 4rem; max-width: 1360px; margin: 0 auto 2.5rem; align-items: end; }
h2 { max-width: 850px; margin-bottom: 0; font-family: var(--display); font-size: clamp(2.4rem, 4.5vw, 4.6rem); font-weight: 500; letter-spacing: -.045em; line-height: 1; }
.disclosure { display: grid; max-width: 430px; margin-bottom: 0; padding-left: 1rem; border-left: 3px solid var(--amber); color: var(--muted); font-size: .88rem; }
.disclosure strong { color: var(--amber-soft); font-family: var(--mono); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; }
.demo-shell { display: grid; grid-template-columns: 300px minmax(0, 1fr); max-width: 1480px; min-height: 690px; margin: 0 auto; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--ground); box-shadow: var(--shadow); }
.case-index { padding: 1.4rem; border-right: 1px solid var(--line); background: color-mix(in srgb, var(--paper) 82%, transparent); }
.index-title { display: grid; padding: .2rem .2rem 1.4rem; border-bottom: 1px solid var(--line); }
.index-title span, .case-index li > span, .result-grid small, .plan-card small, .speaker, .message small { font-family: var(--mono); font-size: .62rem; letter-spacing: .09em; }
.index-title span { color: var(--cyan); }
.index-title b { margin-top: .25rem; font-family: var(--display); font-size: 1.25rem; }
.case-index ol { display: grid; gap: .4rem; margin: 1.2rem 0; padding: 0; list-style: none; }
.case-index li { display: grid; grid-template-columns: 32px 1fr; gap: .7rem; align-items: center; padding: .75rem; border: 1px solid transparent; border-radius: 7px; color: var(--muted); transition: border-color .2s ease, background .2s ease; }
.case-index li > span { display: grid; width: 28px; height: 28px; place-items: center; border: 1px solid var(--line); border-radius: 50%; }
.case-index li b, .case-index li small { display: block; }
.case-index li b { color: var(--ink); font-size: .85rem; }
.case-index li small { font-size: .7rem; }
.case-index li[data-state="active"] { border-color: var(--cyan); background: rgba(56, 189, 248, .08); }
.case-index li[data-state="done"] > span { border-color: var(--emerald); background: var(--emerald); color: #052e24; }
.boundary-note { display: flex; gap: .8rem; margin-top: 2rem; padding: 1rem; border: 1px dashed var(--line); border-radius: 7px; }
.boundary-note p, .boundary-note small { display: grid; margin: 0; }
.boundary-note small { color: var(--muted); font-size: .7rem; }
.shield { color: var(--emerald); }
.chat-panel { min-width: 0; }
.chat-topbar { min-height: 58px; padding: 0 1.3rem; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); color: var(--muted); font-family: var(--mono); font-size: .7rem; }
.chat-topbar > div { display: flex; align-items: center; gap: .55rem; }
.status-light { width: 7px; height: 7px; border-radius: 50%; background: var(--emerald); box-shadow: 0 0 12px var(--emerald); }
.text-button { border: 0; background: transparent; color: var(--cyan); cursor: pointer; }
.transcript { min-height: 190px; max-height: 360px; overflow-y: auto; padding: 1.5rem; }
.message { display: flex; gap: .8rem; max-width: 820px; margin-bottom: 1rem; }
.message > div { padding: .9rem 1rem; border: 1px solid var(--line); border-radius: 5px 12px 12px 12px; background: var(--paper); }
.message.user { margin-left: auto; flex-direction: row-reverse; }
.message.user > div { border-color: rgba(245, 158, 11, .45); border-radius: 12px 5px 12px 12px; background: rgba(245, 158, 11, .08); }
.message p { margin: .25rem 0 0; }
.message small { color: var(--cyan); }
.speaker { display: grid; flex: 0 0 30px; height: 30px; place-items: center; border: 1px solid var(--cyan); border-radius: 50%; color: var(--cyan); }
.message.user .speaker { border-color: var(--amber); color: var(--amber); }
.composer { display: grid; grid-template-columns: 1fr auto; gap: .8rem; align-items: end; margin: 0 1.5rem 1.5rem; padding: .8rem; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.composer textarea { width: 100%; resize: vertical; border: 0; outline: 0; background: transparent; color: var(--ink); line-height: 1.45; }
.send-button, .confirm-row button { min-height: 44px; border: 0; border-radius: 7px; padding: .65rem .9rem; background: var(--amber); color: #111827; font-weight: 800; cursor: pointer; }
.plan-card { margin: 0 1.5rem 1.5rem; padding: 1.2rem; border: 1px solid var(--cyan); border-radius: 10px; background: rgba(56, 189, 248, .055); }
.plan-card-head { display: flex; justify-content: space-between; gap: 1rem; }
.plan-card h3 { margin: .2rem 0 0; font-family: var(--display); font-size: 1.5rem; }
.pending-badge { align-self: start; border: 1px solid var(--amber); border-radius: 999px; padding: .25rem .55rem; color: var(--amber-soft); }
.plan-card ul { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; padding: 0; list-style: none; }
.plan-card li { display: flex; gap: .65rem; padding: .75rem; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); }
.plan-card li > span { color: var(--cyan); font-family: var(--mono); }
.plan-card li p, .plan-card li small { display: grid; margin: 0; }
.plan-card li small { margin-top: .2rem; color: var(--muted); }
.confirm-row { display: grid; gap: .45rem; margin-top: 1rem; }
.confirm-row label { font-size: .78rem; font-weight: 700; }
.confirm-row > div { display: grid; grid-template-columns: 1fr auto; gap: .6rem; }
.confirm-row input { min-width: 0; border: 1px solid var(--line); border-radius: 7px; padding: .65rem; background: var(--ground); color: var(--ink); font-family: var(--mono); font-size: .75rem; }
#confirm-help { color: var(--muted); }
#confirm-help.error { color: var(--danger); }
.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; margin: 0 1.5rem 1.5rem; }
.result-grid article { display: grid; grid-template-columns: auto 1fr auto; gap: .8rem; align-items: center; padding: .9rem; border: 1px solid rgba(16, 185, 129, .4); border-radius: 8px; background: rgba(16, 185, 129, .06); }
.result-icon { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid var(--emerald); color: var(--emerald); font-family: var(--mono); }
.result-grid b, .result-grid p { display: block; margin: 0; }
.result-grid p { color: var(--muted); font-size: .74rem; }
.result-grid em { color: var(--emerald); font-family: var(--mono); font-size: .62rem; font-style: normal; text-transform: uppercase; }

.architecture { width: min(1360px, calc(100% - 3rem)); margin: 0 auto; padding: 8rem 0; }
.architecture .section-heading { margin-inline: 0; }
.architecture-diagram { margin: 0 0 2rem; border: 1px solid var(--line); background: #050811; box-shadow: var(--shadow); }
.architecture-diagram img { display: block; width: 100%; height: auto; }
.architecture-diagram figcaption { padding: .9rem 1rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .82rem; }
.architecture-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; border: 1px solid var(--line); background: var(--line); }
.architecture-grid article { min-height: 270px; padding: 1.6rem; background: var(--ground); }
.architecture-grid span { color: var(--cyan); font-family: var(--mono); font-size: .65rem; letter-spacing: .1em; }
.architecture-grid h3 { margin: 4rem 0 .8rem; font-family: var(--display); font-size: 1.45rem; }
.architecture-grid p { color: var(--muted); font-size: .88rem; }
footer { width: min(1360px, calc(100% - 3rem)); margin: 0 auto; padding: 2rem 0 3rem; display: grid; grid-template-columns: auto 1fr auto; gap: 1rem; align-items: center; border-top: 1px solid var(--line); }
footer img { width: 42px; }
footer div { display: grid; }
footer span, footer p { margin: 0; color: var(--muted); font-size: .78rem; }

button:focus-visible, a:focus-visible, textarea:focus-visible, input:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 980px) {
  .site-header { align-items: flex-start; padding: 1rem 0; }
  .header-actions { flex-wrap: wrap; justify-content: end; }
  .hero { grid-template-columns: 1fr; padding-top: 5rem; }
  .case-file { width: min(620px, 100%); margin: 2rem auto 0; }
  .section-heading { display: grid; }
  .demo-shell { grid-template-columns: 1fr; }
  .case-index { border-right: 0; border-bottom: 1px solid var(--line); }
  .case-index ol { grid-template-columns: 1fr 1fr; }
  .boundary-note { display: none; }
  .architecture-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .site-header, .hero, .architecture, footer { width: min(100% - 1.5rem, 1360px); }
  .site-header { display: grid; }
  .header-actions { justify-content: start; }
  .repo-link { display: none; }
  .hero { min-height: auto; gap: 4rem; padding: 4rem 0; }
  h1 { font-size: clamp(3.1rem, 16vw, 5rem); }
  h1 em { margin-left: .4rem; }
  .case-paper { min-height: 450px; padding: 1.5rem; }
  .case-paper dl div { grid-template-columns: 1fr; gap: .2rem; }
  .case-paper::after { display: none; }
  .demo-section { padding: 4rem .75rem; }
  .case-index ol, .plan-card ul, .result-grid, .architecture-grid { grid-template-columns: 1fr; }
  .composer { grid-template-columns: 1fr; margin-inline: .75rem; }
  .plan-card, .result-grid { margin-inline: .75rem; }
  .plan-card-head, .confirm-row > div { display: grid; }
  .result-grid article { grid-template-columns: auto 1fr; }
  .result-grid em { grid-column: 2; }
  footer { grid-template-columns: auto 1fr; }
  footer p { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
