/* Rodger — web surface.
   Palette and faces are the identity's: Ink / Ground / Iris / Butter,
   Manrope for voice, DM Mono for the machine-readable bits (callsigns, labels). */

@font-face {
  font-family: "Manrope";
  src: url("/assets/Manrope.ttf") format("truetype");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "DM Mono";
  src: url("/assets/DMMono-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

:root {
  --ink: #242923;
  --ground: #e9ebe6;
  --card: #f7f7f4;
  --line: #d8dad3;
  --muted: #6d746a;
  --iris: #b7a5ef;
  --butter: #edc079;
  --radius: 14px;
  --sans: "Manrope", ui-sans-serif, system-ui, sans-serif;
  --mono: "DM Mono", ui-monospace, Menlo, monospace;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.top {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 22px 28px;
}
.top svg {
  width: 22px;
  height: 22px;
}
.top b {
  font-size: 17px;
  letter-spacing: -0.02em;
  font-weight: 700;
}

main {
  max-width: 760px;
  margin: 0 auto;
  padding: 18px 20px 80px;
}

h1 {
  font-size: clamp(32px, 5.4vw, 48px);
  line-height: 1.08;
  letter-spacing: -0.035em;
  font-weight: 700;
  text-align: center;
  margin: 30px 0 12px;
  text-wrap: balance;
}
h1 .soft {
  color: var(--muted);
  display: block;
}
.lede {
  text-align: center;
  color: var(--muted);
  margin: 0 auto 26px;
  max-width: 46ch;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.card-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}
.card-head svg {
  width: 20px;
  height: 20px;
  flex: none;
}
.card-head .who {
  font-weight: 700;
  letter-spacing: -0.01em;
}
.card-head .sub {
  color: var(--muted);
  font-size: 13px;
}
.grow {
  flex: 1;
}

.seats {
  display: flex;
  gap: 18px;
  align-items: center;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.seat {
  display: flex;
  align-items: center;
  gap: 9px;
}
.chip {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 11px;
}
.chip.a {
  background: var(--iris);
}
.chip.b {
  background: var(--butter);
}
.chip.open {
  background: transparent;
  border: 1px dashed var(--line);
  color: var(--muted);
}
.seat .name {
  font-size: 13.5px;
  font-weight: 600;
}
.seat .role {
  font-size: 11.5px;
  color: var(--muted);
  font-family: var(--mono);
}

.thread {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.msg {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-left: 12px;
  border-left: 2px solid var(--line);
}
.msg.a {
  border-left-color: var(--iris);
}
.msg.b {
  border-left-color: var(--butter);
}
.msg.ctx {
  border-left-style: dashed;
}
.msg .from {
  font-size: 12px;
  font-weight: 700;
}
.msg .from em {
  font-style: normal;
  font-weight: 400;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
  margin-left: 6px;
}
.msg .body {
  font-size: 14.5px;
}
.msg.ctx .body {
  color: var(--muted);
}
.msg.mine {
  opacity: 0.72;
}

.start-link {
  display: inline-block;
  margin: 4px auto 0;
  color: var(--ink);
  font-weight: 650;
  text-decoration: none;
  border-bottom: 2px solid var(--butter);
}
.start-link:hover {
  border-bottom-color: var(--ink);
}

.nudge {
  background: color-mix(in oklab, var(--butter) 40%, var(--card));
  border: 1px solid color-mix(in oklab, var(--butter) 70%, var(--line));
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 13.5px;
  line-height: 1.5;
}

.outcome {
  background: var(--butter);
  border-radius: 12px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.outcome .flag {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.outcome h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

form.composer {
  display: flex;
  gap: 9px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
}
input[type="text"],
textarea {
  flex: 1;
  font: inherit;
  font-size: 14.5px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: inherit;
  resize: none;
}
input[type="text"]:focus,
textarea:focus {
  outline: 2px solid var(--iris);
  outline-offset: 1px;
}

button {
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  padding: 11px 17px;
  border-radius: 10px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--ground);
}
button.ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
button.ghost:hover {
  border-color: var(--ink);
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--iris);
  outline-offset: 2px;
}

.foot {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.callsign {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
.note {
  color: var(--muted);
  font-size: 12.5px;
}
.err {
  color: #9a3412;
  font-size: 13px;
  padding: 10px 18px;
}

.connect {
  padding: 16px 18px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.connect code {
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  background: var(--ground);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 11px 13px;
  overflow-x: auto;
  white-space: nowrap;
}
details summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
}
details[open] summary {
  margin-bottom: 9px;
}

/* Respect a stated preference. The only motion here is the polling repaint and
   button transitions, but a preference is a preference. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* The viewer's OS theme. The identity commits to a light ground, so dark mode
   keeps the same palette relationships rather than inverting them naively. */
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e9ebe6;
    --ground: #1b1f1a;
    --card: #232821;
    --line: #363c33;
    --muted: #9aa294;
    --iris: #b7a5ef;
    --butter: #edc079;
  }
  .outcome,
  .nudge {
    color: #242923;
  }
  input[type="text"],
  textarea {
    background: var(--ground);
  }
}

@media (max-width: 560px) {
  main {
    padding-top: 6px;
  }
  .seats {
    gap: 12px;
  }
}
