:root {
  --ink: #1a2330;
  --muted: #3d4a57;
  --line: #d9e0e6;
  --teal: #0c4f4b;
  --teal-dark: #083f3c;
  --soft: #f6f8f7;
  --field: #eef1f4;
  --copper: #8a3e12;
  --sand: #f8efe4;
  --mint: #e7f2f1;
  --white: #ffffff;
  --shadow: 0 16px 40px rgba(26, 35, 48, 0.06);
  --max: 1120px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
}

body.home {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
figure,
blockquote {
  margin: 0;
}

a {
  color: var(--teal);
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 16px;
  top: -48px;
  background: var(--white);
  color: var(--ink);
  padding: 8px 12px;
  z-index: 3;
}

.skip:focus {
  top: 12px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: "brand clock nav";
  align-items: center;
  gap: 8px 20px;
  width: min(var(--max), calc(100% - 48px));
  margin: 0 auto;
  padding: 16px 0 8px;
}

.brand {
  grid-area: brand;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 650;
  font-size: 1.05rem;
  text-decoration: none;
  letter-spacing: -0.01em;
  min-height: 44px;
}

.mark {
  width: 28px;
  height: 28px;
  color: var(--teal);
  display: block;
}

.clock {
  grid-area: clock;
  justify-self: center;
  color: var(--muted);
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.nav {
  grid-area: nav;
  justify-self: end;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 4px;
}

.nav a {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 10px 8px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
}

.nav a[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.nav a.demo-link {
  color: var(--teal);
  font-weight: 650;
}

.stage {
  width: min(var(--max), calc(100% - 48px));
  margin: 0 auto;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(280px, 0.92fr);
  grid-template-areas:
    "copy viewer"
    "points viewer"
    "status viewer";
  column-gap: 40px;
  row-gap: 14px;
  align-content: center;
  padding: 8px 0 20px;
}

.copy {
  grid-area: copy;
}

.badge,
.tag {
  display: inline-block;
  background: var(--mint);
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  padding: 4px 10px;
  border-radius: 999px;
}

.tag.validation {
  background: var(--sand);
  color: var(--copper);
}

h1 {
  margin-top: 10px;
  font-size: clamp(2rem, 3vw, 2.75rem);
  font-weight: 560;
  letter-spacing: -0.03em;
  line-height: 1.12;
  text-wrap: balance;
  max-width: 14ch;
}

.sub {
  margin-top: 12px;
  max-width: 38ch;
  color: var(--muted);
  font-size: 1.05rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 20px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--teal);
  color: var(--white);
  font: inherit;
  font-weight: 650;
  text-decoration: none;
  border: 0;
  cursor: pointer;
}

.button:hover {
  background: var(--teal-dark);
}

.button:disabled,
button.button:disabled {
  background: #d5dbe1;
  color: var(--ink);
  cursor: not-allowed;
}

.code-field {
  flex: 1 1 220px;
  min-width: 0;
}

.code-field input,
.form input,
.form textarea {
  width: 100%;
  min-height: 52px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--field);
  color: var(--muted);
  font: inherit;
  padding: 0 16px;
}

.form textarea {
  border-radius: 16px;
  padding: 12px 16px;
  min-height: 96px;
  resize: vertical;
}

input:disabled,
textarea:disabled {
  opacity: 1;
  color: var(--muted);
  background: var(--field);
  cursor: not-allowed;
}

input::placeholder {
  color: var(--muted);
  opacity: 1;
}

.note,
.status {
  color: var(--muted);
  font-size: 0.92rem;
}

.note {
  margin-top: 10px;
  max-width: 52ch;
}

.note strong,
.status strong {
  color: var(--ink);
  font-weight: 650;
}

.points {
  grid-area: points;
  list-style: none;
  padding: 0;
  display: grid;
  gap: 6px;
}

.points a {
  display: grid;
  grid-template-columns: 9.5rem minmax(0, 1fr);
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  padding: 4px 0;
  border-radius: 8px;
}

.points a span {
  color: var(--muted);
}

.points a:hover strong {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.status {
  grid-area: status;
}

.viewer {
  grid-area: viewer;
  align-self: center;
  background: var(--soft);
  border: 1px solid #e3e8ec;
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 14px;
  min-width: 0;
}

.viewer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.tabs {
  display: flex;
  gap: 4px;
}

.tabs button,
.pause {
  font: inherit;
  font-size: 0.82rem;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.tabs button[aria-selected="true"] {
  background: var(--white);
  color: var(--ink);
  border-color: var(--line);
  font-weight: 650;
}

.slide[hidden] {
  display: none;
}

.room {
  display: grid;
  gap: 8px;
}

.lead-row {
  display: grid;
  grid-template-columns: 1.25fr 0.85fr;
  gap: 8px;
}

.agent-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.tile {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 10px;
  min-height: 72px;
}

.tile.is-speaking {
  box-shadow: inset 0 0 0 1.5px var(--teal);
}

.tile-name {
  font-weight: 650;
  font-size: 0.92rem;
  line-height: 1.3;
}

.tile-role,
.flag {
  font-size: 0.75rem;
  line-height: 1.3;
}

.tile-role {
  color: var(--muted);
}

.flag {
  margin-top: 6px;
  color: var(--copper);
  font-weight: 650;
}

.flag.quiet {
  color: var(--teal);
  font-weight: 600;
}

.dot::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  background: currentColor;
  vertical-align: 0;
}

.transcript,
.diagram,
.record {
  margin-top: 10px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
}

.kicker {
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.transcript ol,
.flow {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 6px;
}

.who {
  font-weight: 650;
}

.flow {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.box {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 64px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  font-size: 0.85rem;
  font-weight: 650;
  background: var(--soft);
}

.box.is-changed {
  border-style: dashed;
  border-color: var(--copper);
  background: var(--sand);
}

.chg {
  font-size: 0.72rem;
  font-weight: 650;
  color: var(--copper);
}

.marks {
  margin-top: 8px;
  display: grid;
  gap: 4px;
  font-size: 0.88rem;
}

.record-title {
  font-size: 1.05rem;
  font-weight: 650;
  margin-bottom: 8px;
}

.record dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
}

.record dt {
  font-size: 0.75rem;
  color: var(--muted);
}

.record dd {
  margin: 0;
  font-weight: 650;
}

.milestone {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.88rem;
}

.figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.78rem;
}

.page {
  width: min(740px, calc(100% - 48px));
  margin: 0 auto;
  padding: 28px 0 72px;
}

.page h1 {
  max-width: 18ch;
  font-size: clamp(2rem, 4vw, 2.7rem);
}

.lede {
  margin-top: 14px;
  color: var(--muted);
  font-size: 1.12rem;
  max-width: 46ch;
}

.block {
  margin-top: 36px;
}

.block h2 {
  font-size: 1.35rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.block p + p,
.block ul,
.block ol {
  margin-top: 8px;
}

.steps {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 28px;
  margin-top: 36px;
}

.steps h2 {
  font-size: 1.35rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.step-no {
  display: block;
  color: var(--teal);
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.team {
  margin-top: 8px;
  padding-left: 1.1rem;
}

.team li + li {
  margin-top: 4px;
}

.cases {
  display: grid;
  gap: 28px;
  margin-top: 36px;
}

.case {
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.case h2 {
  font-size: 1.35rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.rules {
  padding-left: 1.2rem;
  display: grid;
  gap: 12px;
}

.rules li::marker {
  color: var(--teal);
  font-weight: 650;
}

.cap-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.cap-list h3 {
  font-size: 1.05rem;
  font-weight: 650;
}

.banner {
  margin-top: 22px;
  background: var(--sand);
  color: var(--ink);
  border-radius: 14px;
  padding: 12px 14px;
}

.form {
  margin-top: 22px;
  display: grid;
  gap: 14px;
}

.form label {
  display: grid;
  gap: 6px;
  font-weight: 650;
}

fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  min-inline-size: 0;
  display: grid;
  gap: 14px;
}

.foot {
  width: min(740px, calc(100% - 48px));
  margin: 0 auto;
  padding: 8px 0 40px;
  color: var(--muted);
  font-size: 0.92rem;
}

.foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 10px;
}

.foot a {
  color: var(--teal);
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand clock"
      "nav nav";
    width: min(var(--max), calc(100% - 32px));
  }

  .stage {
    grid-template-columns: 1fr;
    grid-template-areas:
      "copy"
      "viewer"
      "points"
      "status";
    width: min(var(--max), calc(100% - 32px));
    align-content: start;
    padding-top: 18px;
    row-gap: 18px;
  }

  h1,
  .page h1 {
    max-width: 16ch;
  }

  .points a {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

@media (max-width: 420px) {
  .agent-row,
  .flow,
  .record dl {
    grid-template-columns: 1fr 1fr;
  }

  .actions,
  .button,
  .code-field {
    width: 100%;
  }
}

@media (min-width: 1000px) and (max-height: 860px) {
  .topbar {
    padding-top: 10px;
  }

  h1 {
    font-size: 2.15rem;
  }

  .sub {
    margin-top: 8px;
    font-size: 1rem;
  }

  .actions {
    margin-top: 14px;
  }

  .tile {
    min-height: 64px;
    padding: 7px 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
