/* SeenRank for Alexa+ simulator. A smart display sitting on a limestone desk;
   the one loud thing is the teal light bar that shows the assistant's state. */
:root {
  --stone: #d9e0de;      /* the desk the device sits on */
  --stone-deep: #c6d0cd;
  --ink: #122022;        /* text on stone */
  --ink-soft: #4b5c5e;
  --graphite: #1b2224;   /* device shell */
  --screen: #0b1112;     /* matches the card's own background */
  --screen-text: #ecf3f2;
  --screen-soft: #8fa3a1;
  --teal: #2dd4bf;       /* the light */
  --teal-brand: #0f766e; /* SeenRank's brand teal, for controls on stone */
  --serif: "Instrument Serif", Georgia, serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--stone); }
body {
  margin: 0; color: var(--ink); font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased;
  background: radial-gradient(90% 70% at 70% 35%, #e6ecea 0%, var(--stone) 60%, var(--stone-deep) 100%);
  min-height: 100vh;
}
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--teal-brand); outline-offset: 3px; }

.stage {
  display: grid; grid-template-columns: minmax(260px, 340px) 1fr; gap: clamp(28px, 4vw, 64px);
  max-width: 1500px; margin: 0 auto; padding: clamp(24px, 4vw, 56px) clamp(16px, 4vw, 56px);
  align-items: start; align-content: center; min-height: 100vh;
}

/* Side panel */
.side h1 { font: 400 clamp(38px, 3.6vw, 52px)/1.02 var(--serif); letter-spacing: -.01em; margin: 0 0 14px; }
.lede { color: var(--ink-soft); margin: 0 0 30px; max-width: 34ch; }
.side h2 { font: 600 13px/1 var(--sans); color: var(--ink-soft); margin: 0 0 10px; }
.phrases { list-style: none; padding: 0; margin: 0 0 30px; display: grid; gap: 6px; }
.phrases button {
  width: 100%; text-align: left; padding: 10px 14px; border-radius: 12px; cursor: pointer;
  background: rgba(255,255,255,.55); border: 1px solid rgba(18,32,34,.08);
  font-family: var(--serif); font-size: 19px; line-height: 1.25;
  transition: background .2s ease, transform .2s ease;
}
.phrases button::before { content: "\201C"; color: var(--teal-brand); }
.phrases button::after { content: "\201D"; color: var(--teal-brand); }
.phrases button:hover { background: rgba(255,255,255,.85); transform: translateX(2px); }
.phrases button:disabled { opacity: .5; cursor: default; transform: none; }

.log { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: 13.5px; color: var(--ink-soft); }
.log li { padding-left: 14px; position: relative; }
.log li::before { content: ""; position: absolute; left: 0; top: .6em; width: 6px; height: 6px; border-radius: 50%; background: var(--stone-deep); }
.log li.log-heard::before { background: var(--ink); }
.log li.tool::before { background: var(--teal-brand); }
.log li.fail::before { background: #c2410c; }
.log code { font: 500 12.5px/1.4 ui-monospace, "Cascadia Code", Consolas, monospace; color: var(--ink); }
.log-empty::before { display: none; }
.log-empty { padding-left: 0 !important; }

/* The device */
.device-wrap { display: grid; justify-items: center; gap: 22px; }
.device {
  width: min(100%, 980px); padding: 18px 18px 26px; border-radius: 34px; position: relative;
  background: linear-gradient(180deg, #252e30 0%, var(--graphite) 60%, #151b1c 100%);
  box-shadow: 0 1px 0 rgba(255,255,255,.08) inset, 0 40px 80px -30px rgba(18,32,34,.55), 0 12px 24px -12px rgba(18,32,34,.4);
}
.screen {
  aspect-ratio: 16 / 10; border-radius: 20px; overflow: hidden; background: var(--screen); color: var(--screen-text);
  display: grid; grid-template-columns: 1fr; align-items: center; position: relative;
}
.device.has-card .screen { grid-template-columns: minmax(0, 1fr) minmax(300px, 42%); }

.caption-pane { padding: clamp(22px, 4vw, 52px); display: grid; gap: 14px; align-content: center; min-height: 100%; }
.heard { margin: 0; color: var(--screen-soft); font-size: clamp(14px, 1.3vw, 17px); min-height: 1.5em; }
.heard:not(:empty)::before { content: "You: "; color: #5f7472; }
.said {
  margin: 0; font: 400 clamp(24px, 2.7vw, 38px)/1.18 var(--serif); letter-spacing: -.005em; text-wrap: pretty;
  max-height: 100%; overflow: hidden;
}
.idle-time { display: block; font: 400 clamp(56px, 7vw, 96px)/1 var(--serif); color: var(--screen-text); margin-bottom: 18px; }
.device:not([data-state="idle"]) .idle-time, .device.answered .idle-time { display: none; }
.said .word { opacity: .28; transition: opacity .18s ease; }
.said .word.on { opacity: 1; }

.card-pane { height: 100%; padding: 14px 14px 14px 0; display: flex; align-items: center; }
.card-pane iframe { width: 100%; height: 100%; border: 0; background: transparent; border-radius: 16px; }

/* The light bar: the one loud element */
.lightbar { position: absolute; left: 50%; bottom: 9px; width: 34%; height: 5px; transform: translateX(-50%); border-radius: 99px; background: rgba(45,212,191,.08); overflow: hidden; }
.lightbar span { position: absolute; inset: 0; border-radius: inherit; background: var(--teal); opacity: 0; box-shadow: 0 0 18px 4px rgba(45,212,191,.55); }
.device[data-state="listening"] .lightbar span { opacity: 1; animation: breathe 1.4s ease-in-out infinite; }
.device[data-state="thinking"] .lightbar span { opacity: 1; width: 38%; animation: sweep 1.1s ease-in-out infinite alternate; }
.device[data-state="speaking"] .lightbar span { opacity: 1; animation: talk .32s ease-in-out infinite alternate; }
@keyframes breathe { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@keyframes sweep { from { transform: translateX(-10%); } to { transform: translateX(175%); } }
@keyframes talk { from { opacity: .55; transform: scaleX(.86); } to { opacity: 1; transform: scaleX(1); } }

/* Controls under the device */
.controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: center; width: min(100%, 980px); }
.talk {
  display: inline-flex; align-items: center; gap: 10px; padding: 12px 22px 12px 14px; border-radius: 999px; cursor: pointer;
  border: 0; background: var(--teal-brand); color: #f0fdfa; font-weight: 600; user-select: none; touch-action: none;
  box-shadow: 0 10px 24px -12px rgba(15,118,110,.8); transition: transform .15s ease, background .2s ease;
}
.talk svg { width: 26px; height: 26px; fill: currentColor; padding: 3px; border-radius: 50%; background: rgba(255,255,255,.14); }
.talk:hover { background: #115e59; }
.talk.held { transform: scale(.97); background: #134e4a; }
.talk:disabled { opacity: .5; cursor: default; }
.hint { color: var(--ink-soft); font-size: 13px; }
.type { flex: 1 1 260px; max-width: 420px; }
.type input {
  width: 100%; padding: 12px 16px; border-radius: 999px; border: 1px solid rgba(18,32,34,.14); background: rgba(255,255,255,.7);
}
.send { padding: 12px 20px; border-radius: 999px; border: 1px solid rgba(18,32,34,.18); background: transparent; cursor: pointer; font-weight: 600; }
.send:hover { background: rgba(255,255,255,.6); }
.note { margin: 0; min-height: 1.4em; color: #9a3412; font-size: 14px; text-align: center; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 1000px) {
  .stage { grid-template-columns: 1fr; }
  .side { order: 2; }
  .device-wrap { order: 1; }
}
@media (max-width: 720px) {
  .device { padding: 10px 10px 20px; border-radius: 24px; }
  .screen { aspect-ratio: auto; min-height: 320px; }
  .device.has-card .screen { grid-template-columns: 1fr; }
  .card-pane { padding: 0 10px 12px; height: auto; }
  .card-pane iframe { height: 340px; }
  .hint { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .lightbar span { animation: none !important; }
  .phrases button { transition: none; }
}
