:root {
  --page: #f3f5f8;
  --ink: #111827;
  --muted: #5b6577;
  --line: #d9dee7;
  --panel: #ffffff;
  --accent: #0a6cff;
  --ok: #0f8a4b;
  --warn: #b45309;
  --bad: #c2261c;
  --screen: #070b14;
  --screen-ink: #f4f7fb;
  --screen-muted: #9aa7bd;
  --screen-card: #111a2c;
  --screen-line: #22304a;
  --alexa: #00caff;
  --radius: 14px;
  font-family: "Amazon Ember", "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --page: #0c1018;
    --ink: #e8ecf3;
    --muted: #98a3b7;
    --line: #232b3a;
    --panel: #131926;
    --accent: #5aa2ff;
    --ok: #3ecf8e;
    --warn: #f0a23b;
    --bad: #ff6b5e;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; } /* wins over the display set on .talk and .home */
body { margin: 0; background: var(--page); color: var(--ink); line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, p { margin: 0; }
button, input { font: inherit; color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 24px; max-width: 1280px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--accent); }
.brand h1 { font-size: 1.15rem; letter-spacing: -0.01em; color: var(--ink); }
.brand p { font-size: 0.875rem; color: var(--muted); }
.status { font-size: 0.8125rem; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }

.stage { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; max-width: 1280px; margin: 0 auto; padding: 0 24px 24px; align-items: start; }

/* the device */
.device { background: #1b1f27; border-radius: 26px; padding: 14px 14px 0; box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.04) inset; }
.screen { background: radial-gradient(120% 90% at 50% 0%, #0f1a30 0%, var(--screen) 60%); color: var(--screen-ink); border-radius: 14px; min-height: clamp(380px, 44vw, 540px); overflow: hidden; display: flex; flex-direction: column; }
.home { margin: auto; text-align: center; padding: 24px; }
.clock { font-size: clamp(3rem, 8vw, 5.500rem); font-weight: 300; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.hint { margin-top: 28px; font-size: 0.8125rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--screen-muted); }
.hint-line { margin-top: 6px; font-size: clamp(1.050rem, 2.400vw, 1.400rem); color: var(--screen-ink); min-height: 1.600em; transition: opacity 0.4s ease; }

.talk { display: flex; flex-direction: column; gap: 14px; padding: clamp(18px, 3vw, 32px); flex: 1; }
.heard { font-size: 0.9375rem; color: var(--screen-muted); }
.heard::before { content: "You: "; opacity: 0.7; }
.said { font-size: clamp(1.100rem, 2.300vw, 1.500rem); line-height: 1.4; letter-spacing: -0.01em; text-wrap: pretty; }
.said.thinking { color: var(--screen-muted); }
.said.long { font-size: clamp(1rem, 1.800vw, 1.200rem); }

.cards { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 320px); gap: 12px; overflow-x: auto; padding: 2px 2px 8px; margin-top: auto; scrollbar-width: thin; scrollbar-color: var(--screen-line) transparent; scroll-snap-type: x proximity; }
.cards:empty { display: none; }
.card { background: var(--screen-card); border: 1px solid var(--screen-line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 8px; scroll-snap-align: start; font-size: 0.875rem; }
.card.urgent { border-color: #7a2a24; box-shadow: 0 0 0 1px #7a2a24 inset; }
.card-top { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tag { font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; background: #1c2942; color: #b9c6dd; white-space: nowrap; }
.tag.stop { background: #4a1a16; color: #ffb4ac; }
.tag.confirmed { background: #3d1f1b; color: #ffb4ac; }
.tag.likely { background: #3d2e12; color: #f6cf8c; }
.tag.possible { background: #1c2942; color: #b9c6dd; }
.card h3 { margin: 0; font-size: 0.9375rem; line-height: 1.35; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card .for { color: var(--screen-muted); font-size: 0.8125rem; }
.card p { color: #cdd6e6; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.card .label { font-size: 0.6875rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--screen-muted); margin-bottom: -4px; }
.card a { color: var(--alexa); text-decoration: none; font-weight: 600; margin-top: auto; padding-top: 4px; }
.card a:hover, .card a:focus-visible { text-decoration: underline; }
.card ul { margin: 0; padding-left: 18px; color: #cdd6e6; }

.lightbar { height: 8px; margin: 10px 18px 0; border-radius: 8px 8px 0 0; background: #2a303b; transition: background 0.3s ease; }
.lightbar[data-state="listening"] { background: linear-gradient(90deg, #0a4bd6, var(--alexa), #0a4bd6); background-size: 200% 100%; animation: sweep 1.4s linear infinite; }
.lightbar[data-state="thinking"] { background: linear-gradient(90deg, #0a4bd6 0%, var(--alexa) 50%, #0a4bd6 100%); background-size: 40% 100%; background-repeat: no-repeat; animation: bounce 1s ease-in-out infinite alternate; }
.lightbar[data-state="speaking"] { background: var(--alexa); animation: pulse 0.9s ease-in-out infinite; }
@keyframes sweep { to { background-position: -200% 0; } }
@keyframes bounce { from { background-position: 0% 0; } to { background-position: 100% 0; } }
@keyframes pulse { 50% { opacity: 0.45; } }

.sim-note { margin: 12px 4px 0; font-size: 0.8125rem; color: var(--muted); }

.ask { display: flex; gap: 8px; margin-top: 16px; }
.ask input { flex: 1; min-width: 0; padding: 13px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); font-size: 1rem; }
.ask input:focus-visible, .ask button:focus-visible, .chip:focus-visible, .link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mic, .send { border: 0; border-radius: 999px; cursor: pointer; font-weight: 600; }
.mic { width: 48px; height: 48px; flex: none; display: grid; place-items: center; background: var(--panel); border: 1px solid var(--line); color: var(--ink); }
.mic[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.mic[disabled] { opacity: 0.45; cursor: not-allowed; }
.send { padding: 0 22px; background: var(--accent); color: #fff; }
.send[disabled] { opacity: 0.6; cursor: progress; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip { padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); font-size: 0.875rem; cursor: pointer; text-align: left; }
.chip:hover { border-color: var(--accent); }

.tools-row { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; justify-content: space-between; margin-top: 14px; font-size: 0.875rem; color: var(--muted); }
.toggle { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; }
.link { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* the trace */
.trace { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; position: sticky; top: 16px; }
.trace h2 { font-size: 1rem; }
.trace-lead { margin-top: 6px; font-size: 0.8125rem; color: var(--muted); }
.meter { margin-top: 18px; }
.meter-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 0.8125rem; color: var(--muted); }
.meter-row strong { font-size: 1.250rem; color: var(--ok); font-variant-numeric: tabular-nums; }
.meter-row strong.slow { color: var(--bad); }
.meter-track { position: relative; height: 10px; border-radius: 999px; background: var(--line); margin-top: 8px; overflow: hidden; }
.meter-fill { height: 100%; width: 0; border-radius: 999px; background: var(--ok); transition: width 0.4s ease; min-width: 3px; }
.meter-fill.slow { background: var(--bad); }
.meter-limit { position: absolute; right: 0; top: 0; bottom: 0; width: 2px; background: var(--muted); }
.meter-scale { display: flex; justify-content: space-between; font-size: 0.6875rem; color: var(--muted); margin-top: 4px; }

.steps { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 10px; }
.step { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.step-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.step-name { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.8125rem; font-weight: 600; overflow-wrap: anywhere; }
.step-ms { font-size: 0.8125rem; font-variant-numeric: tabular-nums; color: var(--ok); white-space: nowrap; }
.step-ms.slow { color: var(--bad); }
.step.failed .step-name::after { content: " (declined)"; font-weight: 400; color: var(--warn); font-family: inherit; }
.step pre { margin: 6px 0 0; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.75rem; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.empty { margin-top: 16px; font-size: 0.875rem; color: var(--muted); }

.facts { margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--line); display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 0.8125rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

/* plain pages: account linking, privacy, terms */
.doc { max-width: 680px; margin: 0 auto; padding: 32px 24px 48px; }
.doc h1 { font-size: 1.75rem; letter-spacing: -0.02em; margin: 16px 0 8px; }
.doc h2 { font-size: 1.0625rem; margin: 28px 0 6px; }
.doc p, .doc li { margin: 0 0 12px; max-width: 65ch; }
.doc .lead { color: var(--muted); }
.doc .note { font-weight: 600; }
.doc a, .foot a, a.link { color: var(--accent); text-underline-offset: 3px; }
.send.big { padding: 12px 22px; }
.flow { padding-left: 20px; color: var(--muted); }
.flow li { margin-bottom: 8px; }
.flow li.failed { color: var(--bad); }

.foot { max-width: 1280px; margin: 0 auto; padding: 8px 24px 32px; font-size: 0.75rem; color: var(--muted); }
.foot p + p { margin-top: 6px; }

@media (max-width: 960px) {
  .stage { grid-template-columns: minmax(0, 1fr); padding: 0 16px 16px; }
  .trace { position: static; }
  .top { padding: 14px 16px; }
  .brand p { display: none; }
  .foot { padding: 8px 16px 24px; }
}
@media (max-width: 520px) {
  .device { border-radius: 18px; padding: 8px 8px 0; }
  .screen { min-height: 420px; }
  .send { padding: 0 16px; }
  .cards { grid-auto-columns: minmax(230px, 82%); }
}
@media (prefers-reduced-motion: reduce) {
  .lightbar, .hint-line, .meter-fill { animation: none !important; transition: none !important; }
}
