:root {
  color-scheme: light dark;
  --bg: #f5f3ee;
  --bg-glow: rgb(255 120 80 / 0.12);
  --surface: #ffffff;
  --surface-2: #f1eee7;
  --surface-3: #e7e3da;
  --border: #e3dfd5;
  --text: #1a1915;
  --text-2: #3d3a33;
  --muted: #6e695f;
  --accent: #d23a20;
  --accent-hover: #b93119;
  --accent-ink: #ffffff;
  --accent-soft: rgb(210 58 32 / 0.1);
  --dark-btn: #1a1915;
  --dark-btn-ink: #ffffff;
  --warn: #a8620a;
  --warn-soft: rgb(196 120 18 / 0.14);
  --ok: #1d8a52;
  --focus: #2f5bea;
  --danger: #c0321b;
  --shadow: 0 1px 2px rgb(26 25 21 / 0.04), 0 10px 30px -12px rgb(26 25 21 / 0.12);
  --radius: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --font: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0e10;
    --bg-glow: rgb(255 90 61 / 0.1);
    --surface: #17171a;
    --surface-2: #202024;
    --surface-3: #2a2a2f;
    --border: #2a2a2f;
    --text: #f3f1ec;
    --text-2: #d6d3cc;
    --muted: #a19c92;
    --accent: #ff5a3d;
    --accent-hover: #ff7559;
    --accent-ink: #1c0a05;
    --accent-soft: rgb(255 90 61 / 0.14);
    --dark-btn: #f3f1ec;
    --dark-btn-ink: #121214;
    --warn: #f0a63a;
    --warn-soft: rgb(240 166 58 / 0.14);
    --ok: #3fbf7f;
    --focus: #7d9bff;
    --danger: #ff6b55;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 12px 32px -12px rgb(0 0 0 / 0.5);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background:
    radial-gradient(1200px 520px at 50% -180px, var(--bg-glow), transparent 70%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.icon {
  width: 20px;
  height: 20px;
  flex: none;
}
.icon-lg {
  width: 34px;
  height: 34px;
}
.icon-xl {
  width: 40px;
  height: 40px;
}

/* ------------------------------------------------------------ chrome */

.topbar {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 20px 8px;
  display: flex;
  align-items: center;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 19px;
  border-radius: 8px;
}

.brand-name span {
  color: var(--accent);
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.brand-mark span {
  width: 3px;
  border-radius: 2px;
  background: var(--accent-ink);
  height: 9px;
}
.brand-mark span:nth-child(2) {
  height: 16px;
}
.brand-mark span:nth-child(3) {
  height: 11px;
}

.main {
  flex: 1;
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 16px 16px 40px;
  outline: none;
}

.site-footer {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 0 20px max(24px, env(safe-area-inset-bottom));
}
.site-footer p {
  margin: 0;
}
.site-footer p + p {
  margin-top: 6px;
}
.site-footer a {
  color: inherit;
}

.view {
  margin: 0 auto;
  animation: view-in 0.28s ease-out;
}
.view-home {
  max-width: 920px;
}
/* The home page is server-rendered: show it immediately instead of fading it in. */
#home {
  animation: none;
}
.view-narrow {
  max-width: 520px;
}
.view-host {
  max-width: 1000px;
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

/* ------------------------------------------------------------ type */

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.muted {
  color: var(--muted);
}

.section-label {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.title-md {
  font-size: 24px;
  margin-bottom: 8px;
}

.room-title {
  font-size: clamp(22px, 5vw, 28px);
  font-weight: 750;
  overflow-wrap: anywhere;
}

/* ------------------------------------------------------------ home */

.hero {
  text-align: center;
  padding: clamp(24px, 6vw, 56px) 0 clamp(24px, 4vw, 40px);
}

.hero h1 {
  text-wrap: balance;
  font-size: clamp(34px, 7vw, 60px);
  font-weight: 780;
  letter-spacing: -0.035em;
}

.hero-soft {
  color: var(--muted);
}

.lede {
  max-width: 560px;
  margin: 18px auto 0;
  font-size: clamp(16px, 2.4vw, 18px);
  color: var(--text-2);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  animation: blink 1.6s ease-in-out infinite;
}

@keyframes blink {
  50% {
    opacity: 0.25;
  }
}

.action-grid {
  display: grid;
  gap: 16px;
}

@media (min-width: 720px) {
  .action-grid {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
}

.steps {
  list-style: none;
  counter-reset: step;
  margin: 32px 0 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

@media (min-width: 720px) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }
}

.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 12px;
  align-items: start;
  color: var(--muted);
  font-size: 15px;
}

.steps li::before {
  content: counter(step);
  grid-row: span 2;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.steps strong {
  color: var(--text);
  font-weight: 650;
}

.resume {
  margin-top: 24px;
}

.resume-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.resume-list a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  text-decoration: none;
  transition: border-color 0.15s;
}
.resume-list a:hover {
  border-color: var(--accent);
}
.resume-code {
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: 0.12em;
}
.resume-name {
  flex: 1;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-section {
  margin-top: clamp(48px, 9vw, 88px);
}

.section-title {
  font-size: clamp(24px, 4.4vw, 34px);
  font-weight: 760;
  letter-spacing: -0.03em;
  text-align: center;
}

.section-lede {
  max-width: 560px;
  margin: 10px auto 0;
  text-align: center;
  color: var(--muted);
}

.feature-grid {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

@media (min-width: 640px) {
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}

@media (min-width: 900px) {
  .feature-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.feature-grid li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
}

.feature-grid h3 {
  font-size: 17px;
  font-weight: 680;
}

.feature-grid p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.faq {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.faq .section-title {
  margin-bottom: 24px;
}

.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-item:first-of-type {
  border-top: 1px solid var(--border);
}

.faq-item summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 2px;
  font-weight: 650;
  border-radius: 6px;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: '+';
  flex: none;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 18px;
  font-weight: 500;
  line-height: 1;
  transition: transform 0.2s ease;
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
}

.faq-item p {
  margin: 0;
  padding: 0 2px 18px;
  color: var(--text-2);
}

/* ------------------------------------------------------------ cards & forms */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(20px, 4vw, 28px);
  box-shadow: var(--shadow);
}

.card.center {
  text-align: center;
}

.card-action {
  display: flex;
  flex-direction: column;
}
.card-action h2 {
  font-size: 22px;
  margin-top: 14px;
}
.card-action > .muted {
  margin: 6px 0 18px;
}
.card-action .btn-block {
  margin-top: auto;
}

.card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--text);
}
.card.center .card-icon {
  margin: 0 auto 16px;
}
.card-icon-live {
  background: var(--accent-soft);
  color: var(--accent);
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.card-head > div {
  min-width: 0;
}

.field-label {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}
.optional {
  color: var(--muted);
  font-weight: 400;
}

.input,
.select {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  margin-bottom: 16px;
  transition: border-color 0.15s, background 0.15s;
}
.input:focus,
.select:focus {
  border-color: var(--focus);
  background: var(--surface);
  outline: none;
  box-shadow: 0 0 0 3px rgb(47 91 234 / 0.2);
}
.input::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

.code-input {
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.35em;
  text-indent: 0.35em;
  text-align: center;
  text-transform: uppercase;
  min-height: 60px;
}
.code-input::placeholder {
  letter-spacing: 0.35em;
}

.select {
  margin-bottom: 0;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  padding-right: 36px;
}

.alert {
  margin: 0 0 16px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--danger);
  font-size: 14px;
  text-align: left;
}

/* ------------------------------------------------------------ buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 18px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 620;
  font-size: 15px;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, transform 0.1s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active:not(:disabled) {
  transform: scale(0.98);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-block {
  width: 100%;
  min-height: 52px;
  font-size: 16px;
}
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}
.btn-dark {
  background: var(--dark-btn);
  color: var(--dark-btn-ink);
}
.btn-dark:hover:not(:disabled) {
  opacity: 0.9;
}
.btn-secondary {
  background: var(--surface-2);
  border-color: var(--border);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--surface-3);
}
.btn-ghost {
  background: transparent;
}
.btn-danger {
  color: var(--danger);
}
.btn-ghost.btn-danger:hover:not(:disabled) {
  background: var(--accent-soft);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.button-row.center {
  justify-content: center;
  margin-top: 20px;
}

/* ------------------------------------------------------------ pill */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: none;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 650;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border);
}
.pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}
.pill[data-tone='live'] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.pill[data-tone='live'] .pill-dot {
  animation: blink 1.4s ease-in-out infinite;
}
.pill[data-tone='warn'] {
  background: var(--warn-soft);
  border-color: transparent;
  color: var(--warn);
}

/* ------------------------------------------------------------ host */

.host-grid {
  display: grid;
  gap: 16px;
}

@media (min-width: 880px) {
  .host-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    gap: 20px;
    align-items: start;
  }
}

.code-display {
  display: flex;
  gap: clamp(6px, 2vw, 10px);
  margin: 4px 0 14px;
}

.code-char {
  flex: 1;
  max-width: 76px;
  aspect-ratio: 4 / 5;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: clamp(30px, 9vw, 46px);
  font-weight: 750;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1px solid var(--border);
  user-select: all;
}

.share-url {
  margin: 0 0 14px;
  font-size: 14px;
  overflow-wrap: anywhere;
}
.share-url a {
  color: var(--text);
  font-weight: 600;
}

.qr-panel {
  margin-top: 16px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: #ffffff;
  border: 1px solid var(--border);
  width: min(100%, 260px);
}
.qr-panel svg {
  display: block;
  width: 100%;
  height: auto;
}

.console-card {
  text-align: center;
}

.onair-wrap {
  display: grid;
  place-items: center;
  padding: 18px 0 8px;
}

.onair {
  --level: 0;
  position: relative;
  width: 168px;
  height: 168px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--accent);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.2s, color 0.2s, transform 0.12s, border-color 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.onair:hover:not(:disabled) {
  border-color: var(--accent);
}
.onair:active:not(:disabled) {
  transform: scale(0.97);
}
.onair:disabled {
  cursor: progress;
  opacity: 0.75;
}

.onair-core {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 6px;
}

.onair-label {
  font-weight: 700;
  font-size: 17px;
  color: var(--text);
}

.onair-ring {
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  transform: scale(calc(1 + var(--level) * 0.28));
  transition: transform 0.08s linear, opacity 0.2s;
}

.onair.is-live {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.onair.is-live .onair-label {
  color: var(--accent-ink);
}
.onair.is-live .onair-ring {
  opacity: 0.22;
}
.onair.is-live::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  animation: pulse 2s ease-out infinite;
}

@keyframes pulse {
  from {
    transform: scale(1);
    opacity: 0.6;
  }
  to {
    transform: scale(1.45);
    opacity: 0;
  }
}

.console-status {
  margin: 14px 0 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  min-height: 24px;
}

.meter {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
  margin: 0 auto 22px;
  max-width: 360px;
}
.meter-fill {
  height: 100%;
  width: 100%;
  transform-origin: left center;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--ok) 0%, var(--ok) 60%, var(--warn) 82%, var(--danger) 100%);
  background-size: 360px 100%;
  transition: transform 0.06s linear;
}

.mute-row {
  display: flex;
  justify-content: center;
  margin: -6px 0 20px;
}

.controls {
  display: grid;
  gap: 16px;
  text-align: left;
  padding: 18px 0;
  border-top: 1px solid var(--border);
}

@media (min-width: 560px) {
  .controls {
    grid-template-columns: 1fr 1fr;
  }
}

.control {
  display: grid;
  gap: 8px;
  align-content: start;
}
.control .btn {
  justify-self: start;
}
.control-label {
  font-size: 13px;
  font-weight: 650;
  color: var(--muted);
}
.control-hint {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.segmented {
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  padding: 4px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  max-width: 320px;
}
.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.segmented label {
  padding: 8px 14px;
  border-radius: 9px;
  text-align: center;
  font-weight: 620;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.segmented input:checked + label {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.12);
}
.segmented input:focus-visible + label {
  outline: 3px solid var(--focus);
  outline-offset: 1px;
}
.segmented input:disabled + label {
  cursor: not-allowed;
  opacity: 0.6;
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  margin: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--border);
  border: 1px solid var(--border);
}
@media (min-width: 560px) {
  .stats {
    grid-template-columns: repeat(4, 1fr);
  }
}
.stats.stats-3 {
  grid-template-columns: repeat(3, 1fr);
}
.stat {
  background: var(--surface);
  padding: 12px 10px;
  text-align: center;
}
.stat dt {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.stat dd {
  margin: 2px 0 0;
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stats-3 .stat dd {
  font-size: 16px;
}

.footer-actions {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

/* ------------------------------------------------------------ listen */

.listen-card {
  text-align: center;
}
.listen-card .card-head {
  text-align: left;
}

.stage {
  position: relative;
  width: min(100%, 300px);
  aspect-ratio: 1;
  margin: 0 auto;
  display: grid;
  place-items: center;
}

.viz {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  color: var(--accent);
}

.play {
  position: relative;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 12px 30px -10px rgb(210 58 32 / 0.6);
  transition: transform 0.12s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.play .icon {
  margin-left: 4px;
}
.play.is-active .icon {
  margin-left: 0;
}
.play:hover {
  background: var(--accent-hover);
}
.play:active {
  transform: scale(0.96);
}
.play.is-active {
  background: var(--dark-btn);
  color: var(--dark-btn-ink);
  box-shadow: none;
}

.play-label {
  margin: 4px 0 0;
  font-weight: 700;
  font-size: 17px;
}

.listen-status {
  margin: 6px auto 18px;
  max-width: 380px;
  color: var(--muted);
  min-height: 48px;
}

.volume-row {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 320px;
  margin: 0 auto 20px;
  color: var(--muted);
}

.range {
  flex: 1;
  accent-color: var(--accent);
  height: 28px;
}

.footnote {
  margin: 16px auto 0;
  max-width: 440px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

/* ------------------------------------------------------------ motion */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
