/* A nod to Amazon's product look: dark navy chrome, a light page, an orange call
   to action, and the Alexa blue light bar. No Amazon logos or wordmarks. */
:root {
  --navy: #232f3e;
  --navy-900: #131921;
  --navy-700: #37475a;
  --page: #eaeded;
  --card: #ffffff;
  --ink: #0f1111;
  --muted: #565959;
  --line: #d5d9d9;
  --orange: #ffa41c;
  --orange-edge: #ff8f00;
  --alexa: #00caff;
  --alexa-deep: #0a6cff;
  --link: #007185;
  --focus: #0050b5; /* 6:1 on the light page; cyan is used on dark surfaces */
  font-family: "Amazon Ember", "Helvetica Neue", Arial, system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--ink); line-height: 1.5; }
a { color: var(--link); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.site-header .bar :focus-visible, .screen :focus-visible { outline-color: var(--alexa); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header */
.site-header .bar { background: var(--navy); color: #fff; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px max(20px, calc((100% - 1120px) / 2)); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; font-size: 1.15rem; letter-spacing: -0.01em; }
.ring { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--alexa); box-shadow: 0 0 10px rgba(0, 202, 255, .55); }
.site-header nav { display: flex; gap: 20px; font-size: .92rem; }
.site-header nav a { color: #fff; text-decoration: none; }
.site-header nav a:hover { text-decoration: underline; }
.intro { max-width: 1120px; margin: 0 auto; padding: 36px 20px 4px; }
.eyebrow { margin: 0 0 6px; font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--link); }
.intro h1 { margin: 0; font-size: clamp(1.8rem, 3.4vw, 2.6rem); line-height: 1.15; letter-spacing: -0.02em; max-width: 760px; }
.tagline { margin: 10px 0 0; color: var(--muted); max-width: 680px; font-size: 1.05rem; }

.layout { max-width: 1120px; margin: 0 auto; padding: 24px 20px; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 28px; align-items: start; }

/* Smart display: a screen on a fabric-covered speaker base */
.device { display: grid; justify-items: center; }
.display { position: relative; width: 100%; background: #0b0e12; border-radius: 22px; padding: 14px; box-shadow: 0 1px 0 #2a3038 inset, 0 18px 40px rgba(15, 17, 17, .28); z-index: 1; }
.camera { position: absolute; top: 5px; right: 26px; width: 5px; height: 5px; border-radius: 50%; background: #1d232b; }
.screen { position: relative; aspect-ratio: 16 / 10; border-radius: 10px; background: radial-gradient(130% 120% at 15% 0%, #12406e 0%, #0b2744 50%, #071628 100%); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px 24px 34px; gap: 8px; }
.screen-title { margin: 0; font-size: clamp(1.3rem, 2.6vw, 2.05rem); font-weight: 700; line-height: 1.22; letter-spacing: -0.01em; }
.screen-hint { margin: 0; color: #b9cbe0; font-size: clamp(.95rem, 1.6vw, 1.15rem); min-height: 1.4em; }
.screen-choices { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 12px; }
.screen-choices button { font: inherit; font-size: 1.05rem; font-weight: 600; padding: 10px 24px; border-radius: 999px; border: 2px solid rgba(255,255,255,.7); background: rgba(255,255,255,.06); color: #fff; cursor: pointer; box-shadow: none; }
.screen-choices button:hover:not(:disabled) { background: rgba(255,255,255,.18); }
.screen-choices button:disabled { opacity: .45; cursor: default; }
.base { width: 104%; height: 54px; margin-top: -8px; border-radius: 0 0 46px 46px / 0 0 40px 40px; background-color: #2b2f35; background-image: radial-gradient(circle at 2px 2px, rgba(255,255,255,.09) 1px, transparent 1.4px); background-size: 6px 6px; box-shadow: 0 14px 24px rgba(15, 17, 17, .22); }

/* Alexa light bar along the bottom edge of the screen */
.lightbar { position: absolute; left: 0; right: 0; bottom: 0; height: 6px; border-radius: 0 0 10px 10px; background: transparent; transition: background .2s, box-shadow .2s; }
.lightbar[data-mode="speaking"] { background: var(--alexa); box-shadow: 0 0 16px var(--alexa); animation: speak 1.1s ease-in-out infinite alternate; }
.lightbar[data-mode="listening"] { background: linear-gradient(90deg, var(--alexa-deep), var(--alexa), var(--alexa-deep)); background-size: 200% 100%; box-shadow: 0 0 18px var(--alexa); animation: listen 1.2s linear infinite; }
@keyframes speak { from { opacity: .55; } to { opacity: 1; } }
@keyframes listen { to { background-position: 200% 0; } }

/* Controls */
.controls { margin-top: 22px; display: grid; grid-template-columns: auto auto 1fr; gap: 12px; align-items: center; }
.controls .type-form, .controls .toggles, .controls .fine { grid-column: 1 / -1; }
.controls > button { justify-self: start; }
button { font: inherit; padding: 9px 20px; border-radius: 999px; border: 1px solid var(--line); cursor: pointer; background: var(--card); color: var(--ink); box-shadow: 0 2px 5px rgba(213, 217, 217, .5); }
button:hover:not(:disabled) { background: #f7fafa; }
button.primary { background: var(--orange); border-color: var(--orange-edge); font-weight: 700; }
button.primary:hover:not(:disabled) { background: #fa8900; }
#talk { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 700; }
#talk:hover:not(:disabled) { background: var(--navy-700); }
button:disabled { opacity: .5; cursor: default; }
.type-form { display: flex; gap: 8px; }
.type-form input { flex: 1; min-width: 0; font: inherit; padding: 9px 16px; border-radius: 999px; border: 1px solid #888c8c; background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(15,17,17,.15) inset; }
.type-form input:focus { outline: none; border-color: var(--alexa-deep); box-shadow: 0 0 0 3px rgba(0, 202, 255, .35); }
.toggles { display: flex; gap: 20px; color: var(--muted); font-size: .95rem; }
.toggles input { accent-color: var(--link); }
.fine { margin: 0; color: var(--muted); font-size: .8rem; }

/* Scenarios + transcript */
.transcript-col { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px; display: flex; flex-direction: column; gap: 14px; height: clamp(520px, calc(100vh - 120px), 760px); position: sticky; top: 16px; box-shadow: 0 2px 5px rgba(15,17,17,.06); }
.scenarios h2 { margin: 0 0 10px; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.scenario-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.scenario-list button { text-align: left; border-radius: 8px; padding: 10px 12px; display: grid; gap: 2px; align-content: start; box-shadow: none; }
.scenario-list button strong { font-size: .95rem; }
.scenario-list button span { font-size: .78rem; color: var(--muted); line-height: 1.35; }
.scenario-list button:hover { border-color: #888c8c; }
.scenario-list button[aria-pressed="true"] { border-color: var(--orange-edge); box-shadow: 0 0 0 2px var(--orange) inset; background: #fffaf2; }

.transcript { list-style: none; margin: 0; padding: 14px 2px 4px 0; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--line); }
.turn { display: grid; gap: 4px; max-width: 88%; }
.turn.agent { justify-self: start; }
.turn.user { align-self: flex-end; justify-items: end; }
.turn .who { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.turn.agent .who { color: var(--link); }
.bubble { margin: 0; padding: 10px 14px; border-radius: 16px; background: #f0f2f2; }
.turn.agent .bubble { border-top-left-radius: 4px; border-left: 3px solid var(--alexa); }
.turn.user .bubble { background: var(--navy); color: #fff; border-top-right-radius: 4px; }
.how-tag { font-size: .7rem; color: var(--muted); }
.turn.system { max-width: 100%; align-self: center; color: var(--muted); font-size: .85rem; text-align: center; }
.notes { list-style: none; margin: 2px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.notes li { font-size: .72rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: #e6f8fd; color: #00597a; border: 1px solid #9edff5; cursor: help; }
.hide-notes .notes { display: none; }

/* How it works */
.how { max-width: 1120px; margin: 12px auto 0; padding: 28px 20px 48px; border-top: 1px solid var(--line); }
.how h2 { font-size: 1.3rem; margin-top: 0; }
.how-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.how h3 { font-size: 1rem; margin: 0 0 6px; }
.how p, .principles { color: var(--muted); margin: 0; font-size: .95rem; }
.principles { padding-left: 1.2em; }
code { background: #f0f2f2; border: 1px solid var(--line); padding: 1px 6px; border-radius: 4px; font-size: .88em; }

/* Embed mode: ?embed=1 hides page chrome for iframes */
.embed .site-header, .embed .how { display: none; }
.embed .layout { padding-top: 12px; }

@media (max-width: 860px) {
  .layout, .how-grid { grid-template-columns: 1fr; }
  .transcript-col { height: auto; min-height: 420px; max-height: 80vh; position: static; }
  .site-header nav { gap: 14px; font-size: .85rem; }
}
@media (prefers-reduced-motion: reduce) {
  .lightbar { animation: none !important; }
}
