:root {
  --paper: #f4f1ea;
  --panel: #fbfaf6;
  --ink: #16181d;
  --muted: #5d6068;
  --line: #d9d4c7;
  --grid: rgba(22, 24, 29, 0.05);
  --accent: #d4520f;
  --accent-ink: #ffffff;
  --bubble-me: #16181d;
  --bubble-me-ink: #f4f1ea;
  --bubble-bot: #ece8de;
  --radius: 14px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #121418;
    --panel: #181b20;
    --ink: #ecebe6;
    --muted: #9a9ca3;
    --line: #2b2f36;
    --grid: rgba(236, 235, 230, 0.04);
    --accent: #f0732e;
    --accent-ink: #121418;
    --bubble-me: #ecebe6;
    --bubble-me-ink: #121418;
    --bubble-bot: #22262d;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }

/* ---------- layout: one screen, no page scroll ---------- */
.js body { overflow: hidden; }
.shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas: "top top" "stage guide";
  height: 100dvh;
  max-width: 1440px;
  margin: 0 auto;
}
.top { grid-area: top; }
.stage { grid-area: stage; }
.guide { grid-area: guide; }

/* ---------- header ---------- */
.top {
  display: flex; align-items: center; gap: 24px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; letter-spacing: -0.02em; font-size: 19px; }
.brand .word { font-weight: 400; }
.brand .word b { font-weight: 750; color: var(--accent); }
.mark { width: 28px; height: 28px; fill: var(--ink); }
.mark .core { fill: var(--accent); transform-box: fill-box; transform-origin: center; animation: blink 7s ease-in-out infinite; }
.mark.wink .core { animation: blink-once .32s ease-in-out; }
@keyframes blink { 0%, 93%, 97%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.12); } }
@keyframes blink-once { 50% { transform: scaleY(.12); } }
.tabs { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  text-decoration: none; color: var(--muted); font-size: 14px;
  padding: 6px 12px; border-radius: 999px; white-space: nowrap;
}
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="true"] { color: var(--ink); background: var(--bubble-bot); }
.cta {
  display: inline-block; text-decoration: none; white-space: nowrap;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 600; font-size: 14px; padding: 9px 16px; border-radius: 999px;
}
.cta:hover { filter: brightness(1.06); }
.cta.big { font-size: 16px; padding: 12px 22px; margin-top: 8px; }

/* ---------- stage ---------- */
.stage {
  position: relative;
  overflow: hidden;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px;
  outline: none;
}
.card {
  position: absolute; inset: 0;
  padding: clamp(24px, 5vh, 64px) clamp(24px, 5vw, 72px);
  overflow-y: auto;
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .12s ease, transform .12s ease, visibility 0s linear .12s;
}
.card.on { opacity: 1; visibility: visible; transform: none; transition: opacity .28s ease, transform .28s ease; }
.card > * { max-width: 680px; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: 12px; font-weight: 600; color: var(--accent); margin: 0 0 14px; }
h1, h2 { font-family: var(--display); font-weight: 600; letter-spacing: -0.015em; line-height: 1.1; margin: 0 0 18px; }
h1 { font-size: clamp(32px, 4.6vw, 56px); }
h2 { font-size: clamp(28px, 3.6vw, 44px); }
h3 { font-size: 17px; margin: 0 0 6px; }
.lede { font-size: clamp(17px, 1.5vw, 19px); color: var(--muted); margin: 0 0 22px; }
.sub { color: var(--muted); margin: 14px 0 0; }
.points { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.points li { padding-left: 22px; position: relative; }
.points li::before { content: ""; position: absolute; left: 0; top: .6em; width: 10px; height: 2px; background: var(--accent); }
.points strong { font-weight: 650; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 18px; }
.steps li { display: flex; gap: 16px; align-items: flex-start; }
.steps .n {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700;
  border: 1.5px solid var(--accent); color: var(--accent);
}
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.tile p { margin: 0; color: var(--muted); }

/* ---------- guide ---------- */
.guide {
  display: flex; flex-direction: column; min-height: 0;
  border-left: 1px solid var(--line);
  background: var(--panel);
}
.guide-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.guide-head strong { display: block; font-size: 15px; }
.guide-head .muted { font-size: 12.5px; }
.log { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; }
.msg { max-width: 88%; padding: 10px 14px; border-radius: 16px; font-size: 15px; line-height: 1.45; }
.msg p { margin: 0; }
.msg p + p { margin-top: 6px; }
.msg.bot { background: var(--bubble-bot); border-bottom-left-radius: 4px; align-self: flex-start; }
.msg.me { background: var(--bubble-me); color: var(--bubble-me-ink); border-bottom-right-radius: 4px; align-self: flex-end; }
.msg a { color: var(--accent); font-weight: 600; }
.msg .see { display: inline-block; margin-top: 6px; font-size: 13px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 18px 10px; }
.chips button {
  font: inherit; font-size: 13px; cursor: pointer;
  border: 1px solid var(--line); background: transparent; color: var(--ink);
  padding: 6px 12px; border-radius: 999px;
}
.chips button:hover { border-color: var(--accent); color: var(--accent); }
.ask { display: flex; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); }
.ask input {
  flex: 1; min-width: 0; font: inherit; font-size: 16px;
  padding: 10px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink);
}
.ask input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.send { font: inherit; font-weight: 600; cursor: pointer; border: 0; border-radius: 999px; padding: 0 18px; background: var(--ink); color: var(--paper); }
.icon {
  flex: none; width: 40px; height: 40px; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center;
  border: 1px solid var(--line); background: transparent; color: var(--ink);
}
.icon svg { width: 20px; height: 20px; fill: currentColor; stroke: currentColor; }
.icon svg rect, .icon svg path:first-child { stroke: none; }
.icon[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.icon[aria-pressed="false"] .wave { opacity: .35; }
.icon.listening { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 25%, transparent); } }
.foot { margin: 0; padding: 0 18px 12px; font-size: 12.5px; }

/* ---------- phone: stage above, guide below, still no page scroll ---------- */
@media (max-width: 860px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) minmax(0, 46dvh);
    grid-template-areas: "top" "stage" "guide";
  }
  .top { flex-wrap: wrap; gap: 8px 12px; padding: 10px 16px; }
  .tabs { order: 3; flex-basis: 100%; margin: 0 -4px; }
  .top .cta { margin-left: auto; padding: 7px 12px; font-size: 13px; }
  .card { padding: 20px 16px; }
  .guide { border-left: 0; border-top: 1px solid var(--line); }
  .guide-head { padding: 8px 14px; }
  .guide-head .muted { display: none; }
  .icon { width: 36px; height: 36px; }
  .log { padding: 10px 14px; }
  .chips { padding: 0 14px 8px; }
  .two { grid-template-columns: 1fr; }
  .lede { margin-bottom: 14px; }
}

/* ---------- no JavaScript: an ordinary scrolling page ---------- */
.no-js .shell { display: block; height: auto; }
.no-js .stage { overflow: visible; }
.no-js .card { position: static; opacity: 1; visibility: visible; transform: none; border-bottom: 1px solid var(--line); }
.no-js .guide { display: none; }

@media (prefers-reduced-motion: reduce) {
  .card, .card.on { transition: none; }
  .log { scroll-behavior: auto; }
  .icon.listening { animation: none; }
  .mark .core, .mark.wink .core { animation: none; }
}
