: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 { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand img { display: block; width: clamp(180px, 19vw, 270px); height: auto; }

.cloud-mode-lane {
  flex: 1;
  position: relative;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-inline: clamp(0.75rem, 2vw, 1.5rem);
  pointer-events: none;
}
.cloud-mode-lane:has(.cloud-mode-badge[hidden]) {
  min-height: 0;
  margin-inline: 0;
}

.cloud-mode-badge {
  position: relative;
  margin-left: auto;
  height: fit-content;
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  color: #38bdf8;
  font-size: 1rem;
  font-weight: 600;
  white-space: nowrap;
  user-select: none;
  text-decoration: none;
  text-shadow: 0 0 8px rgba(56, 189, 248, 0.65);
  filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.8)) drop-shadow(0 0 14px rgba(34, 211, 238, 0.5));
  animation: cloud-pulse 4s ease-in-out infinite alternate;
  pointer-events: auto;
}
.cloud-mode-badge svg {
  display: block;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 4px rgba(56, 189, 248, 0.9));
}
.cloud-mode-badge[hidden] { display: none; }

[data-theme="light"] .cloud-mode-badge {
  color: #0284c7;
  text-shadow: 0 0 6px rgba(2, 132, 199, 0.35);
  filter: drop-shadow(0 0 4px rgba(2, 132, 199, 0.5)) drop-shadow(0 0 10px rgba(2, 132, 199, 0.25));
  animation: cloud-pulse-light 4s ease-in-out infinite alternate;
}
[data-theme="light"] .cloud-mode-badge svg {
  filter: drop-shadow(0 0 3px rgba(2, 132, 199, 0.6));
}

@keyframes cloud-pulse {
  0% {
    opacity: 0.85;
    filter: drop-shadow(0 0 4px rgba(56, 189, 248, 0.5)) drop-shadow(0 0 8px rgba(56, 189, 248, 0.25));
  }
  100% {
    opacity: 1;
    filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.85)) drop-shadow(0 0 15px rgba(34, 211, 238, 0.5));
  }
}

@keyframes cloud-pulse-light {
  0% {
    opacity: 0.85;
    filter: drop-shadow(0 0 3px rgba(2, 132, 199, 0.3)) drop-shadow(0 0 6px rgba(2, 132, 199, 0.15));
  }
  100% {
    opacity: 1;
    filter: drop-shadow(0 0 6px rgba(2, 132, 199, 0.6)) drop-shadow(0 0 11px rgba(2, 132, 199, 0.25));
  }
}
.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: 5.5rem 0 6rem;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(420px, .95fr);
  gap: clamp(2rem, 4vw, 4.5rem);
  align-items: start;
}
.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); }

.hero-visual {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 540px;
  justify-self: start;
  padding-top: .5rem;
}
.hero-visual .case-file {
  width: 100%;
  margin-top: calc(37px + 2.5rem);
}
/* User 2026-09-13 20:0x: hero eyebrow in the cloud-badge blue, title block a bit higher,
   more air between video tile and case file, case file closer to the copy. */
.hero .eyebrow { color: #38bdf8; }
[data-theme="light"] .hero .eyebrow { color: #0284c7; }
.hero-copy { padding-top: 1.25rem; }

.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); }
.message-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; margin-top: .6rem; padding-top: .5rem; border-top: 1px solid var(--line); }
.tool-chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.tool-chip { font-family: var(--mono); font-size: .65rem; padding: .2rem .5rem; border-radius: 4px; border: 1px solid var(--cyan); color: var(--cyan); background: rgba(56, 189, 248, .08); }
.tool-chip.error { border-color: var(--danger); color: var(--danger); background: rgba(251, 113, 133, .08); }
.model-turns-chip { font-family: var(--mono); font-size: .65rem; color: var(--muted); padding: .2rem .4rem; }
.prompt-suggestions { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 1.5rem .75rem; }
.prompt-chip { font-family: var(--mono); font-size: .72rem; padding: .35rem .75rem; border: 1px solid var(--line); border-radius: 999px; background: color-mix(in srgb, var(--paper) 76%, transparent); color: var(--muted); cursor: pointer; transition: border-color .15s ease, color .15s ease, background .15s ease; }
.prompt-chip:hover, .prompt-chip:focus-visible { border-color: var(--cyan); color: var(--ink); background: rgba(56, 189, 248, .08); }
.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); }
.live-data-note { display: flex; align-items: center; gap: .45rem; margin: -0.75rem 1.5rem 1.2rem; color: var(--amber-soft); font-family: var(--mono); font-size: .72rem; }
.live-data-note[hidden] { display: none; }
.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); }
.plan-detected-docs { margin-top: .8rem; padding: .6rem .8rem; border: 1px dashed var(--line); border-radius: 6px; background: var(--paper); }
.plan-detected-docs[hidden] { display: none; }
.detected-docs-label { font-family: var(--mono); font-size: .65rem; color: var(--cyan); text-transform: uppercase; letter-spacing: .08em; }
.detected-docs-list { margin: .3rem 0 0; padding-left: 1.2rem; font-size: .78rem; }
.detected-docs-list code { font-family: var(--mono); color: var(--ink); }
.detected-docs-list span { color: var(--muted); font-size: .72rem; }
.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); }
.audit-line { display: flex; align-items: center; gap: .75rem; margin: 0 1.5rem 1.2rem; padding: .75rem 1rem; border: 1px solid rgba(16, 185, 129, .4); border-radius: 8px; background: rgba(16, 185, 129, .06); font-family: var(--mono); font-size: .75rem; }
.audit-line[hidden] { display: none; }
.audit-line b { color: var(--emerald); font-weight: 700; }
.audit-line span { color: var(--ink); }
.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);
  border-radius: 12px;
  overflow: hidden;
}
.architecture-grid article {
  min-height: 270px;
  padding: 1.6rem;
  display: flex;
  flex-direction: column;
}
.architecture-grid article span {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  padding: .25rem .65rem;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: .65rem;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.architecture-grid article h3 {
  margin: 3.2rem 0 .8rem;
  font-family: var(--display);
  font-size: 1.45rem;
  line-height: 1.25;
}
.architecture-grid article p {
  margin: 0;
  font-size: .88rem;
  line-height: 1.55;
  flex-grow: 1;
}

/* Dark theme card gradations */
.architecture-grid article:nth-child(1) { background: #0b1a38; }
.architecture-grid article:nth-child(2) { background: #0f2a5a; }
.architecture-grid article:nth-child(3) { background: #153578; }
.architecture-grid article:nth-child(4) { background: #1e40af; }

.architecture-grid article:nth-child(1) span,
.architecture-grid article:nth-child(2) span,
.architecture-grid article:nth-child(3) span {
  background: rgba(56, 189, 248, 0.18);
  border: 1px solid #38bdf8;
  color: #e0f2fe;
}
.architecture-grid article:nth-child(4) span {
  background: #10b981;
  border: 1px solid #34d399;
  color: #022c22;
}
.architecture-grid article h3 { color: #ffffff; }
.architecture-grid article p { color: #dbeafe; }

/* Light theme card gradations */
:root[data-theme="light"] .architecture-grid article:nth-child(1) { background: #eff6ff; }
:root[data-theme="light"] .architecture-grid article:nth-child(2) { background: #dbeafe; }
:root[data-theme="light"] .architecture-grid article:nth-child(3) { background: #bfdbfe; }
:root[data-theme="light"] .architecture-grid article:nth-child(4) { background: #93c5fd; }

:root[data-theme="light"] .architecture-grid article:nth-child(1) span,
:root[data-theme="light"] .architecture-grid article:nth-child(2) span,
:root[data-theme="light"] .architecture-grid article:nth-child(3) span {
  background: #1e40af;
  border: 1px solid #1d4ed8;
  color: #ffffff;
}
:root[data-theme="light"] .architecture-grid article:nth-child(4) span {
  background: #064e3b;
  border: 1px solid #047857;
  color: #a7f3d0;
}
:root[data-theme="light"] .architecture-grid article h3 { color: #0f172a; }
:root[data-theme="light"] .architecture-grid article p { color: #1e3a8a; }
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; }

/* Mode-driven display */
:root[data-mode="chooser"] .mode-chooser { display: grid; }
:root[data-mode="chooser"] .case-index { display: none; }
:root[data-mode="chooser"] .chat-panel { display: none; }
:root[data-mode="chooser"] .demo-shell { grid-template-columns: 1fr; }

:root[data-mode="case"] .mode-chooser { display: none; }
:root[data-mode="case"] .case-index { display: block; }
:root[data-mode="case"] .chat-panel { display: block; }
:root[data-mode="case"] .prompt-suggestions { display: none; }
:root[data-mode="case"] .demo-shell { grid-template-columns: 300px minmax(0, 1fr); }

:root[data-mode="chat"] .mode-chooser { display: none; }
:root[data-mode="chat"] .case-index { display: none; }
:root[data-mode="chat"] .chat-panel { display: block; }
:root[data-mode="chat"] .prompt-suggestions { display: flex; }
:root[data-mode="chat"] .demo-shell { grid-template-columns: 1fr; }

.mode-chooser {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  padding: clamp(2rem, 3.5vw, 3rem);
  background: var(--ground);
  align-items: stretch;
}
.entry-tile {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(2.2rem, 3.5vw, 3rem);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.entry-tile:hover {
  transform: translateY(-2px);
}

#tile-case {
  background: linear-gradient(145deg, #1d4ed8 0%, #3b82f6 100%);
  border: 1px solid #60a5fa;
  box-shadow: 0 12px 36px rgba(29, 78, 216, 0.28);
}
#tile-case .tile-tag {
  color: #fef08a;
  background: rgba(0, 0, 0, 0.25);
  padding: .25rem .6rem;
  border-radius: 999px;
  width: fit-content;
}
#tile-case h3 {
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}
#tile-case .tile-desc {
  color: #eff6ff;
  line-height: 1.6;
}
#tile-case #start-case-btn {
  background: #db2777;
  border: 1px solid #be185d;
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(219, 39, 119, 0.35);
}
#tile-case #start-case-btn:hover {
  background: #ec4899;
  border-color: #db2777;
}
#tile-case #start-case-btn:focus-visible {
  outline: 3px solid #f472b6;
  outline-offset: 3px;
}

[data-theme="light"] #tile-case {
  background: linear-gradient(145deg, #eff6ff 0%, #dbeafe 100%);
  border: 1px solid #93c5fd;
  box-shadow: 0 12px 32px rgba(59, 130, 246, 0.15);
}
[data-theme="light"] #tile-case .tile-tag {
  color: #1e40af;
  background: rgba(191, 219, 254, 0.6);
}
[data-theme="light"] #tile-case h3 {
  color: #0f172a;
  text-shadow: none;
}
[data-theme="light"] #tile-case .tile-desc {
  color: #1e3a8a;
}
[data-theme="light"] #tile-case #start-case-btn {
  background: #db2777;
  border: 1px solid #be185d;
  color: #ffffff;
}
[data-theme="light"] #tile-case #start-case-btn:hover {
  background: #be185d;
}

#tile-chat {
  background: linear-gradient(145deg, #052e16 0%, #14532d 100%);
  border: 1px solid #22c55e;
  box-shadow: 0 12px 36px rgba(34, 197, 94, 0.2);
}
#tile-chat .tile-tag {
  color: #86efac;
  background: rgba(0, 0, 0, 0.3);
  padding: .25rem .6rem;
  border-radius: 999px;
  width: fit-content;
}
#tile-chat h3 {
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}
#tile-chat .tile-desc {
  color: #dcfce7;
  line-height: 1.6;
}
#tile-chat #start-chat-btn {
  background: #22c55e;
  border: 1px solid #16a34a;
  color: #052e16;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(34, 197, 94, 0.35);
}
#tile-chat #start-chat-btn:hover:not(:disabled) {
  background: #4ade80;
  border-color: #22c55e;
}
#tile-chat #start-chat-btn:disabled {
  background: #0f3822;
  border-color: #166534;
  color: #4ade80;
  opacity: 0.55;
  box-shadow: none;
}
#tile-chat #start-chat-btn:focus-visible {
  outline: 3px solid #4ade80;
  outline-offset: 3px;
}
#tile-chat .tile-static-note {
  color: #bbf7d0;
}
#tile-chat .tile-static-note a {
  color: #fef08a;
  text-decoration: underline;
  font-weight: 700;
}

[data-theme="light"] #tile-chat {
  background: linear-gradient(145deg, #f0fdf4 0%, #dcfce7 100%);
  border: 1px solid #4ade80;
  box-shadow: 0 12px 32px rgba(34, 197, 94, 0.15);
}
[data-theme="light"] #tile-chat .tile-tag {
  color: #166534;
  background: rgba(187, 247, 208, 0.7);
}
[data-theme="light"] #tile-chat h3 {
  color: #052e16;
  text-shadow: none;
}
[data-theme="light"] #tile-chat .tile-desc {
  color: #14532d;
}
[data-theme="light"] #tile-chat #start-chat-btn {
  background: #16a34a;
  border: 1px solid #15803d;
  color: #ffffff;
}
[data-theme="light"] #tile-chat #start-chat-btn:hover:not(:disabled) {
  background: #15803d;
}
[data-theme="light"] #tile-chat #start-chat-btn:disabled {
  background: #86efac;
  border-color: #4ade80;
  color: #052e16;
  opacity: 0.6;
}
[data-theme="light"] #tile-chat .tile-static-note {
  color: #14532d;
}
[data-theme="light"] #tile-chat .tile-static-note a {
  color: #15803d;
}

.tile-header {
  margin-bottom: 1.4rem;
}
.tile-tag {
  display: inline-block;
  margin-bottom: .8rem;
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.entry-tile h3 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.6rem, 2.2vw, 2.15rem);
  font-weight: 500;
  line-height: 1.2;
}
.tile-desc {
  margin: 0 0 2.2rem;
  font-size: clamp(1.05rem, 1.2vw, 1.15rem);
  line-height: 1.6;
  flex-grow: 1;
}
.tile-footer {
  display: flex;
  flex-direction: column;
  gap: .85rem;
}
.tile-button {
  width: 100%;
  min-height: 52px;
  font-size: .98rem;
  cursor: pointer;
  border-radius: 8px;
}
.tile-button:disabled {
  cursor: not-allowed;
}
.tile-static-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem .6rem;
  font-family: var(--mono);
  font-size: .74rem;
}
.tile-static-note[hidden] { display: none; }
.tile-static-note a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.topbar-status {
  display: flex;
  align-items: center;
  gap: .55rem;
}
.back-link {
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--cyan);
  cursor: pointer;
  padding: .2rem .4rem;
  border-radius: 4px;
}
.back-link:hover {
  text-decoration: underline;
}

.next-mode-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  margin: 1.5rem;
  padding: 1.2rem 1.4rem;
  border: 1px solid var(--cyan);
  border-radius: 10px;
  background: rgba(56, 189, 248, .07);
}
.next-mode-banner[hidden] { display: none; }
.next-mode-text { display: grid; gap: .25rem; }
.next-mode-text strong { color: var(--ink); font-size: .95rem; }
.next-mode-text span { color: var(--muted); font-size: .82rem; }
.next-mode-btn { white-space: nowrap; }

@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; }
  .hero-visual { width: min(620px, 100%); margin: 2.5rem auto 0; justify-self: center; }
  .case-file { width: 100%; margin: calc(37px + 1rem) auto 0; }
  .section-heading { display: grid; }
  .demo-shell { grid-template-columns: 1fr; }
  .mode-chooser { padding: 1.6rem; gap: 1.2rem; }
  .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: 800px) {
  .mode-chooser { grid-template-columns: 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; }
  .mode-chooser { grid-template-columns: 1fr; padding: 1rem; gap: 1rem; }
  .entry-tile { padding: 1.3rem; }
  .next-mode-banner { margin-inline: .75rem; flex-direction: column; align-items: stretch; }
  .next-mode-btn { width: 100%; text-align: center; }
  .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, .prompt-suggestions, .live-data-note, .audit-line { 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 (max-width: 700px) {
  .cloud-mode-lane {
    min-height: 0;
    margin: .4rem 0;
    justify-content: flex-end;
  }
  .cloud-mode-lane:has(.cloud-mode-badge[hidden]) {
    margin: 0;
  }
  .cloud-mode-badge {
    position: relative;
    left: auto;
    top: auto;
    bottom: auto;
    transform: none;
    animation: cloud-pulse 4s ease-in-out infinite alternate;
  }
  [data-theme="light"] .cloud-mode-badge {
    animation: cloud-pulse-light 4s ease-in-out infinite alternate;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
  .cloud-mode-badge,
  [data-theme="light"] .cloud-mode-badge {
    position: relative !important;
    left: auto !important;
    transform: none !important;
    animation: none !important;
    filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.7)) !important;
  }
  [data-theme="light"] .cloud-mode-badge {
    filter: drop-shadow(0 0 4px rgba(2, 132, 199, 0.45)) !important;
  }
}

.generated-files { grid-template-columns: 1fr; }
.generated-files h3 { margin: 0; font-size: .82rem; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.file-actions { display: flex; gap: .4rem; }
.file-action { font: inherit; font-size: .72rem; padding: .3rem .6rem; border: 1px solid var(--line, #cbd5e1); border-radius: .4rem; background: transparent; color: inherit; cursor: pointer; text-decoration: none; }
.file-action:hover, .file-action:focus-visible { border-color: var(--emerald, #059669); outline: none; }
.file-preview { margin: 0; padding: .8rem; font-family: var(--mono); font-size: .72rem; white-space: pre-wrap; word-break: break-word; border: 1px dashed var(--line, #cbd5e1); border-radius: .5rem; max-height: 22rem; overflow: auto; }

/* Hero CTA & Video Thumbnail */
.button-install {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: .15rem;
  padding: .5rem 1rem;
  text-align: left;
}

.hero-cta .button.primary {
  background: #2563eb;
  border-color: #1d4ed8;
  color: #ffffff;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}

.hero-cta .button.primary:hover {
  background: #3b82f6;
  border-color: #2563eb;
  color: #ffffff;
}

.hero-cta .button.primary:focus-visible {
  outline: 3px solid #60a5fa;
  outline-offset: 3px;
}

.hero-cta .button-install {
  background: #db2777;
  border-color: #be185d;
  color: #ffffff;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}

.hero-cta .button-install .button-main {
  color: #ffffff;
}

.hero-cta .button-install .button-sub {
  color: #fce7f3;
}

.hero-cta .button-install:hover {
  background: #ec4899;
  border-color: #db2777;
}

.hero-cta .button-install:hover .button-sub,
.hero-cta .button-install:focus-visible .button-sub {
  color: #ffffff;
}

.hero-cta .button-install:focus-visible {
  outline: 3px solid #f472b6;
  outline-offset: 3px;
}

.hero-video {
  margin: 0;
  width: 100%;
}

.video-thumb {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  width: 100%;
  max-width: 100%;
  text-decoration: none;
  color: inherit;
  border-radius: 10px;
  transition: transform .2s ease;
}

.video-thumb:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 4px;
}

.video-thumb-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 3px solid #e11d48;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 4px 18px rgba(0, 0, 0, .28);
  transition: box-shadow .2s ease, border-color .2s ease;
}

.video-thumb:hover .video-thumb-frame,
.video-thumb:focus-visible .video-thumb-frame {
  border-color: #f43f5e;
  box-shadow: 0 0 0 1px #e11d48, 0 8px 26px rgba(225, 29, 72, .42);
}

.video-thumb:hover {
  transform: translateY(-2px);
}

.video-thumb-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .25s ease;
}

.video-thumb:hover .video-thumb-frame img {
  transform: scale(1.03);
}

.video-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #ffffff;
  color: #e11d48;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .45);
  transition: transform .2s ease, background .2s ease, color .2s ease;
  pointer-events: none;
}

.video-play-btn svg {
  margin-left: 3px;
}

.video-thumb:hover .video-play-btn {
  transform: translate(-50%, -50%) scale(1.1);
  background: #e11d48;
  color: #ffffff;
}

.video-duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, .78);
  color: #ffffff;
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  pointer-events: none;
}

.video-thumb-caption {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-family: var(--mono);
  font-size: .75rem;
  color: var(--muted);
  transition: color .15s ease;
}

.video-caption-icon {
  color: #e11d48;
  font-size: .65rem;
}

.video-thumb:hover .video-thumb-caption,
.video-thumb:focus-visible .video-thumb-caption {
  color: var(--ink);
}

/* Demo Section Headings per Mode */
.demo-head-case,
.demo-head-chat {
  display: none;
}

.demo-head-chooser {
  display: flex;
}

:root[data-mode="case"] .demo-head-case,
html[data-mode="case"] .demo-head-case {
  display: flex;
}

:root[data-mode="case"] .demo-head-chooser,
html[data-mode="case"] .demo-head-chooser,
:root[data-mode="case"] .demo-head-chat,
html[data-mode="case"] .demo-head-chat {
  display: none;
}

:root[data-mode="chat"] .demo-head-chat,
html[data-mode="chat"] .demo-head-chat {
  display: flex;
}

:root[data-mode="chat"] .demo-head-chooser,
html[data-mode="chat"] .demo-head-chooser,
:root[data-mode="chat"] .demo-head-case,
html[data-mode="chat"] .demo-head-case {
  display: none;
}

.demo-head-note {
  display: grid;
  max-width: 430px;
  margin-bottom: 0;
  padding-left: 1rem;
  border-left: 3px solid var(--cyan);
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.5;
}

@media (max-width: 980px) {
  .demo-head-chooser {
    display: grid;
  }
  :root[data-mode="case"] .demo-head-case,
  html[data-mode="case"] .demo-head-case {
    display: grid;
  }
  :root[data-mode="chat"] .demo-head-chat,
  html[data-mode="chat"] .demo-head-chat {
    display: grid;
  }
}

@media (max-width: 640px) {
  .hero-cta {
    flex-direction: column;
    align-items: stretch;
  }
  .hero-cta .button {
    width: 100%;
  }
  .hero-video {
    width: 100%;
  }
  .video-thumb {
    width: 100%;
  }
}

/* Architecture slideshow */
:root[data-theme="light"] .architecture-diagram {
  background: var(--paper-strong);
}

.architecture-diagram {
  outline: none;
}

.architecture-diagram:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.slideshow-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
  overflow: hidden;
}

.slides-track {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
}

.slide.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  position: relative;
  /* keep the stage height so max-height: 100% on the image has a reference; without it the
     tall slides (confirmation sequence, product runtime) overflowed and were cropped */
  width: 100%;
  height: 100%;
}
.slide[data-index="2"] img,
.slide[data-index="3"] img {
  max-height: 92%;
  max-width: 92%;
}

.slide[hidden] {
  display: none !important;
}

.slide[data-tone="dark"] {
  background: #060b14;
  border: 1px solid rgba(142, 164, 189, 0.24);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

:root[data-theme="light"] .slide[data-tone="dark"] {
  background: #070d18;
  border: 1px solid rgba(35, 57, 82, 0.3);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
}

.slide[data-tone="light"] {
  background: #ffffff;
  border: 1px solid rgba(35, 57, 82, 0.18);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
}

:root[data-theme="light"] .slide[data-tone="light"] {
  background: #ffffff;
  border: 1px solid rgba(35, 57, 82, 0.2);
  box-shadow: 0 4px 16px rgba(73, 56, 31, 0.12);
}

.slide img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.slideshow-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(13, 24, 41, 0.82);
  color: var(--ink);
  font-size: 1rem;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

:root[data-theme="light"] .slideshow-nav {
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  border-color: var(--line);
}

.slideshow-nav:hover {
  background: var(--amber);
  color: #111827;
  border-color: var(--amber);
}

.slideshow-nav.prev {
  left: 1.5rem;
}

.slideshow-nav.next {
  right: 1.5rem;
}

.slideshow-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.6rem 1rem;
  border-top: 1px solid var(--line);
  background: rgba(5, 8, 17, 0.4);
}

:root[data-theme="light"] .slideshow-dots {
  background: rgba(232, 223, 207, 0.35);
}

.slideshow-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(142, 164, 189, 0.3);
  cursor: pointer;
  padding: 0;
  transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.slideshow-dot:hover {
  background: var(--amber-soft);
}

.slideshow-dot.active,
.slideshow-dot[aria-selected="true"] {
  background: var(--amber);
  border-color: var(--amber);
  transform: scale(1.25);
}

.slideshow-dot:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.architecture-links {
  margin: 0.75rem 0 2rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.architecture-links a {
  color: var(--cyan);
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (max-width: 640px) {
  .slideshow-stage {
    aspect-ratio: 4 / 3;
    min-height: 240px;
    padding: 0.5rem;
  }
  .slide {
    padding: 0.5rem;
  }
  .slideshow-nav {
    width: 36px;
    height: 36px;
    font-size: 0.85rem;
  }
  .slideshow-nav.prev {
    left: 0.6rem;
  }
  .slideshow-nav.next {
    right: 0.6rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .slide,
  .slideshow-nav,
  .slideshow-dot {
    transition: none !important;
  }
}
