:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #eef0f3;
  --text: #1c2026;
  --muted: #5d6673;
  --border: #d9dde3;
  --accent: #2f5bd3;
  --accent-text: #ffffff;
  --ok: #1f8a5b;
  --warn: #a86a00;
  --danger: #c23b3b;
  --speak: #2f5bd3;
  --you: #1f8a5b;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(0 0 0 / 6%), 0 4px 16px rgb(0 0 0 / 5%);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121418;
    --surface: #1b1e24;
    --surface-2: #252931;
    --text: #e6e8eb;
    --muted: #9aa3ae;
    --border: #333843;
    --accent: #7b9cff;
    --accent-text: #0d1220;
    --ok: #4cc28d;
    --warn: #e0a640;
    --danger: #ff7b7b;
    --speak: #7b9cff;
    --you: #4cc28d;
    --shadow: none;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

[hidden] { display: none !important; }

.topbar {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.9rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.brand { font-weight: 700; letter-spacing: 0.02em; }
.tagline { color: var(--muted); font-size: 0.9rem; }
.topnav { margin-left: auto; display: flex; gap: 1.1rem; }
.topnav a { color: var(--muted); font-size: 0.9rem; }

main {
  max-width: 880px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

h1 { font-size: 1.6rem; margin: 0 0 0.4rem; }
h2 { font-size: 1.15rem; margin: 1.5rem 0 0.5rem; }
.lead { color: var(--muted); margin-top: 0; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.25rem;
  margin: 1.25rem 0;
}

.scenario h2 { margin-top: 0; }
.scenario .meta { color: var(--muted); font-size: 0.9rem; margin: 0.2rem 0 0.6rem; }
.scenario ol { margin: 0.5rem 0 0; padding-left: 1.3rem; color: var(--muted); }

.options { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem 2rem; margin: 1.25rem 0 1rem; align-items: start; }
.options-col { display: grid; gap: 1.1rem; }
.options .switch { grid-column: 1 / -1; }
.field > label, .field > legend { display: block; font-weight: 600; margin-bottom: 0.35rem; }
.hint { color: var(--muted); font-size: 0.85rem; font-weight: 400; }
p.hint { margin: 0.35rem 0 0; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { padding: 0; }
textarea {
  width: 100%;
  min-height: 7rem;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  resize: vertical;
}
.segmented { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.segmented label { padding: 0.45rem 0.9rem; cursor: pointer; background: var(--surface); border-right: 1px solid var(--border); }
.segmented label:last-child { border-right: 0; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label:has(input:checked) { background: var(--accent); color: var(--accent-text); }
.segmented label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: -2px; }
.switch { display: inline-flex; gap: 0.5rem; align-items: center; cursor: pointer; }
.switch input { margin: 0; }

.actions { display: flex; align-items: center; gap: 1rem; margin-top: 1.25rem; flex-wrap: wrap; }
.start-notes { display: grid; gap: 0.1rem; }
.clock .cost { margin-left: 0.75rem; font-size: 0.95rem; }

/* Setup and settings */
.view.narrow { max-width: 640px; margin: 0 auto; }
.text-input {
  width: 100%;
  font: inherit;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}
.text-input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.field > label.radio { display: flex; gap: 0.5rem; align-items: baseline; margin: 0.3rem 0; cursor: pointer; font-weight: 400; }
.card > .field + .field { margin-top: 1rem; }
.card h2:first-child { margin-top: 0; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0.9rem 1rem; margin: 0.75rem 0; }
.check-lines { list-style: none; padding: 0; margin: 0.75rem 0 0; display: grid; gap: 0.35rem; }
.check-lines li { padding-left: 1.4rem; position: relative; }
.check-lines li::before { position: absolute; left: 0; font-weight: 700; }
.check-lines li.ok::before { content: "\2713"; color: var(--ok); }
.check-lines li.bad { color: var(--danger); }
.check-lines li.bad::before { content: "\2715"; }
.check-lines li.unknown { color: var(--muted); }
.check-lines li.unknown::before { content: "?"; }
.facts { color: var(--muted); font-size: 0.92rem; padding-left: 1.2rem; display: grid; gap: 0.3rem; }
details summary { cursor: pointer; color: var(--accent); margin: 0.75rem 0 0.25rem; }
.actions.center { justify-content: center; }

button {
  font: inherit;
  border-radius: 10px;
  padding: 0.65rem 1.2rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
button:disabled { opacity: 0.55; cursor: not-allowed; }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 600; }
button.danger { background: #c23b3b; color: #fff; border-color: #c23b3b; font-weight: 600; } /* white text reads on it in both schemes */

.message { color: var(--danger); min-height: 1.5em; }
.status { text-align: center; color: var(--muted); min-height: 1.5em; }

/* Call */
.call-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 1rem; }
.call-title { font-weight: 600; }
.clock { font-variant-numeric: tabular-nums; font-size: 1.1rem; white-space: nowrap; }
.clock.late #elapsed { color: var(--warn); }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.tile {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  min-height: 260px;
  transition: border-color 0.2s;
}
.avatar {
  --ring: var(--speak);
  width: 96px;
  height: 96px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  font-size: 2rem;
  font-weight: 600;
  box-shadow: 0 0 0 0 var(--ring);
  transition: box-shadow 0.15s;
}
.avatar.you { --ring: var(--you); font-size: 1.1rem; }
.who { text-align: center; display: grid; }
.speaking { display: flex; gap: 4px; height: 18px; align-items: end; opacity: 0.25; transition: opacity 0.2s; }
.speaking i { display: block; width: 4px; height: 6px; border-radius: 2px; background: var(--speak); }
#tile-candidate .speaking i { background: var(--you); }
.tile.is-speaking .speaking { opacity: 1; }
.tile.is-speaking .speaking i { animation: bar 0.9s ease-in-out infinite; }
.tile.is-speaking .speaking i:nth-child(2) { animation-delay: 0.15s; }
.tile.is-speaking .speaking i:nth-child(3) { animation-delay: 0.3s; }
.tile.is-speaking .speaking i:nth-child(4) { animation-delay: 0.45s; }
.tile.is-speaking .avatar { box-shadow: 0 0 0 4px var(--ring); }
@keyframes bar { 0%, 100% { height: 5px; } 50% { height: 18px; } }
@media (prefers-reduced-motion: reduce) {
  .tile.is-speaking .speaking i { animation: none; height: 14px; }
}
.caption {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
  max-height: 4.5em;
  overflow: hidden;
}

@media (max-width: 640px) {
  main { padding: 1.25rem 0.9rem 3rem; }
  .tiles { grid-template-columns: 1fr; }
  .tile { min-height: 0; padding: 1.25rem 1rem; flex-direction: row; justify-content: flex-start; flex-wrap: wrap; }
  .avatar { width: 56px; height: 56px; font-size: 1.3rem; }
  .avatar.you { font-size: 0.85rem; }
  .who { text-align: left; }
  .caption { flex-basis: 100%; text-align: left; }
}

/* Start screen */
.start-links { display: flex; gap: 1.25rem; flex-wrap: wrap; margin: 0.25rem 0 1.25rem; font-size: 0.95rem; }
.exercise-groups { display: grid; gap: 0.6rem; }
.exercise-group { display: grid; grid-template-columns: 6.5rem 1fr; align-items: start; gap: 0.75rem; }
.group-label { color: var(--muted); font-size: 0.9rem; padding-top: 0.4rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chips label {
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  cursor: pointer;
  font-size: 0.92rem;
}
.chips input { position: absolute; opacity: 0; pointer-events: none; }
.chips label:hover { border-color: var(--accent); }
.chips label:has(input:checked) { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.chips label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.scenario .agenda { color: var(--muted); font-size: 0.875rem; margin: 0.6rem 0 0; }
.section-title { font-size: 1rem; margin: 1.25rem 0 0.6rem; }
.material-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.material-grid:has(> .field[hidden]) { grid-template-columns: 1fr; }
.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 0.75rem; margin-bottom: 0.35rem; }
.label-row label { font-weight: 600; }
button.link { padding: 0; border: 0; background: none; color: var(--accent); font-size: 0.875rem; text-decoration: underline; }
select {
  font: inherit;
  padding: 0.45rem 0.6rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  min-width: 14rem;
}
a { color: var(--accent); }
@media (max-width: 640px) {
  .tagline { display: none; }
  .options .segmented { display: flex; width: 100%; }
  .options .segmented label { flex: 1 1 auto; text-align: center; border-bottom: 1px solid var(--border); margin-bottom: -1px; }
  .options { grid-template-columns: 1fr; }
  .exercise-group { grid-template-columns: 1fr; gap: 0.3rem; }
  .group-label { padding-top: 0; }
  .material-grid { grid-template-columns: 1fr; }
  select { width: 100%; }
}

/* The static demo site */
.site-banner {
  margin: 0;
  padding: 0.5rem 1.25rem;
  text-align: center;
  font-size: 0.9rem;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  border-bottom: 1px solid var(--border);
}
/* Its front page: one line, one frame of a replay, the sample interviews. */
html[data-site="static"] body[data-view="start"] main { max-width: 1080px; padding-top: 2.5rem; }
html[data-site="static"] body[data-view="start"] .site-banner { display: none; } /* the page says it itself */
.home-hero { max-width: 44rem; margin-bottom: 1.75rem; }
.home-hero h1 { font-size: clamp(1.65rem, 3.4vw, 2.2rem); line-height: 1.2; margin: 0 0 0.6rem; }
.home-hero .lead { font-size: 1.1rem; margin: 0; }
.home-preview { margin: 0 0 2.75rem; }
.home-preview img { display: block; width: 100%; height: auto; } /* drawn on the page's own background */
.home-preview figcaption { margin-top: 0.55rem; font-size: 0.85rem; color: var(--muted); }
.home-title { font-size: 1.3rem; margin: 0 0 0.3rem; }
.home-note { margin: 0 0 1.1rem; color: var(--muted); }
.home-run { margin: 2rem 0 0; color: var(--muted); }
.demo-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.demo-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 4px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.15rem 1.15rem;
  display: flex; flex-direction: column; gap: 0.3rem;
}
.demo-card h3 { margin: 0.15rem 0 0; font-size: 1.12rem; line-height: 1.35; }
.demo-card .meta { color: var(--muted); font-size: 0.9rem; margin: 0; }
.demo-card .demo-summary { margin: 0.4rem 0 0; }
.demo-card .actions { margin-top: auto; padding-top: 1rem; gap: 0.5rem 1.1rem; }
.demo-kind { margin: 0; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; }
@media (max-width: 900px) {
  .demo-list { grid-template-columns: 1fr; }
}
a.button {
  display: inline-block;
  border-radius: 10px;
  padding: 0.6rem 1.15rem;
  text-decoration: none;
  border: 1px solid var(--border);
}
a.button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 600; }
