/* Design tokens for the public landing page (issue #167, ADR-0044): the dark-only "Midnight
   Broadcast" look (issue #212), copied, not imported, from curatd_stream/web/static/style.css,
   since site must not depend on web's files. Reference: docs/design/midnight-broadcast/. */

:root {
  color-scheme: dark;
  --page-bg: #0E1117;
  --bg: #0E1117;
  --surface: #1E222A;
  --surface-2: #262B35;
  --surface-3: #151920;
  --text: #FFFFFF;
  --text-muted: #94A3B8;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --accent: #00F090;
  --accent-fg: #0E1117;
  --accent-soft: rgba(0, 240, 144, 0.12);
  --accent-line: rgba(0, 240, 144, 0.30);
  --accent-glow: rgba(0, 240, 144, 0.45);
  --accent-text: #00F090;
  --danger: #FF7A7A;
  --radius-sm: 8px;
  --radius: 14px;
  --radius-md: 10px;
  --shadow: 0 30px 80px -40px rgba(0, 0, 0, 0.9);
  --font: "Geist", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
}

/* Self-hosted, no request leaves for Google Fonts (issue #207): site's own copies of the
   Latin subsets, since it can't reach the app's (ADR-0044). */
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("fonts/jetbrains-mono-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("fonts/geist-latin.woff2") format("woff2");
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
}

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  background: var(--page-bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent-text);
  text-decoration: none;
}

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

.display {
  font-family: var(--font-mono);
}

h1, h2, h3 {
  margin: 0;
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: -0.03em;
}

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

.muted-link {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 12px;
}

.muted-link::before {
  content: "[ ";
  content: "[ " / "";
}

.muted-link::after {
  content: " ]";
  content: " ]" / "";
}

.muted-link:hover {
  color: var(--text);
}

.eyebrow {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

/* The second declaration hides the prefix from screen readers; older browsers drop it
   and keep the first. */
.eyebrow::before {
  content: "// ";
  content: "// " / "";
}

/* Top bar / footer */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  padding: 10px 20px;
  background: rgba(14, 17, 23, 0.86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}

.brand-mark {
  width: 30px;
  height: 26px;
  color: var(--accent);
  flex: none;
}

.brand-text {
  display: flex;
  flex-direction: column;
  font-family: var(--font-mono);
  line-height: 1;
}

.brand-text b {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.brand-text span {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.42em;
  color: var(--text-muted);
  margin-top: 4px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* A phone has no room for both full labels beside the wordmark. */
@media (max-width: 480px) {
  .nav-q,
  .badge-word {
    display: none;
  }
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border: 1px solid rgba(0, 240, 144, 0.28);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  50% {
    opacity: 0.35;
  }
}

/* Waveform on the demo card's host tiles -- still, since the demo has no per-line times (#213) */

.wave {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 16px;
  flex: none;
}

.wave i {
  display: block;
  width: 3px;
  height: 100%;
  border-radius: 2px;
  background: var(--text-muted);
  opacity: 0.45;
  transform: scaleY(var(--h));
}

.site-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 32px 24px 40px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.footer-copy {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
}

/* Buttons, cards */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-fg);
  box-shadow: 0 0 0 1px rgba(0, 240, 144, 0.4), 0 8px 28px -10px var(--accent-glow);
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 14px 24px;
  cursor: pointer;
}

.button:hover {
  box-shadow: 0 0 0 1px var(--accent), 0 10px 36px -8px var(--accent-glow);
}

.button:active {
  transform: translateY(1px);
}

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

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  padding: 1.5rem;
}

/* Host tiles: the demo card's pair, and the "meet the hosts" cards */

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  background: var(--surface-2);
  border: 3px solid var(--border-strong);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
}

.hosts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 1.25rem;
}

.host {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.host-info {
  min-width: 0;
}

.host-name {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  min-width: 0;
  /* The bars are decoration: clip them rather than let them spill out of the tile. */
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
}

.host-role {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Hero */

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 40px;
  padding: 48px 24px 56px;
  overflow: hidden;
}

/* Faint grid, faded out at the edges -- decoration only, behind everything */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 70% 30%, #000 10%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 70% 30%, #000 10%, transparent 75%);
  opacity: 0.6;
  pointer-events: none;
}

.hero > * {
  position: relative;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.hero-title {
  font-size: 38px;
  line-height: 1.06;
  letter-spacing: -0.035em;
}

.hero-title em {
  font-style: normal;
  white-space: nowrap;
  color: var(--accent);
  text-shadow: 0 0 22px rgba(0, 240, 144, 0.35);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.16em;
  text-decoration-color: rgba(0, 240, 144, 0.45);
}

.hero-lede {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-muted);
}

.hero-cta {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.hero-note {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
}

/* Demo card */

.demo-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.demo-title {
  margin: 0 0 1.1rem;
  font-size: 21px;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.demo-audio {
  width: 100%;
}

.demo-player[hidden] {
  display: none;
}

.demo-ruler {
  height: 5px;
  margin-bottom: 8px;
  background: repeating-linear-gradient(90deg, var(--border-strong) 0 1px, transparent 1px 5%);
}

.demo-progress {
  position: relative;
  height: 6px;
  border-radius: 3px;
  background: var(--surface-2);
  cursor: pointer;
}

/* 4px is untappable on a phone; widen the hit area without changing the drawn bar. */
.demo-progress::before {
  content: "";
  position: absolute;
  inset: -12px 0;
}

.demo-progress-fill {
  height: 100%;
  width: 0;
  border-radius: 3px;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(0, 240, 144, 0.5);
}

.demo-time {
  display: flex;
  justify-content: space-between;
  margin: 8px 0 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

.demo-current {
  color: var(--text);
  font-weight: 500;
}

.demo-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.demo-skip {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 2px 0 rgba(0, 0, 0, 0.4);
  padding: 0;
  cursor: pointer;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
}

.demo-skip:hover {
  border-color: rgba(255, 255, 255, 0.3);
}

.demo-skip:active {
  transform: translateY(1px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.demo-skip svg {
  width: 22px;
  height: 22px;
}

.demo-play {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: var(--accent-fg);
  box-shadow: 0 0 0 6px var(--accent-soft), 0 8px 24px -6px var(--accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}

.demo-play svg {
  width: 26px;
  height: 26px;
}

.demo-play:focus-visible {
  outline-color: var(--text);
  outline-offset: 4px;
}

.demo-card.is-playing .icon-play,
.demo-card:not(.is-playing) .icon-pause {
  display: none;
}

.demo-progress:focus-visible,
.demo-play:focus-visible,
.demo-skip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.demo-footnote {
  margin: 1.25rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* How it works / meet the hosts */

.how-it-works,
.meet-hosts {
  padding: 56px 24px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.how-it-works {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-intro {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.section-intro h2 {
  font-size: 30px;
  line-height: 1.15;
}

.steps-grid .step,
.host-card {
  transition: border-color 0.2s ease;
}

.steps-grid .step:hover,
.host-card:hover {
  border-color: var(--accent-line);
}

.steps-grid {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.step {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.step-number {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--accent);
}

.step h3 {
  font-size: 16px;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.step p {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
}

.host-cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.host-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.host-avatar {
  width: 48px;
  height: 48px;
  font-size: 16px;
}

.host-card h3 {
  font-size: 18px;
  margin-bottom: 2px;
}

.card-role {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.host-card p:last-child {
  margin: 8px 0 0;
  font-size: 15px;
  line-height: 1.6;
}

/* Waitlist */

.waitlist-section {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 56px 24px;
  display: flex;
  justify-content: center;
}

.waitlist-card {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.waitlist-card h2 {
  font-size: 26px;
  line-height: 1.15;
}

.waitlist-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.waitlist-form input[type="email"] {
  min-height: 54px;
  padding: 0 16px;
  font-family: var(--font-mono);
  font-size: 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  width: 100%;
}

.waitlist-form input[type="email"]::placeholder {
  color: #6B7688;
}

.waitlist-form input[type="email"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.waitlist-form input[aria-invalid="true"] {
  border-color: var(--danger);
  outline: 2px solid rgba(255, 122, 122, 0.3);
  outline-offset: 1px;
}

.waitlist-form button {
  margin-top: 6px;
}

.field-error {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--danger);
}

.field-error svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.waitlist-footnote {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-muted);
}

.waitlist-confirm {
  text-align: center;
}

.waitlist-icon {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid rgba(0, 240, 144, 0.35);
  color: var(--accent);
  box-shadow: 0 0 30px -6px var(--accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.waitlist-icon svg {
  width: 30px;
  height: 30px;
}

/* The only card in the flow that isn't green: a failed link reads as different at a glance
   without reading as a crash. */
.waitlist-link-invalid {
  text-align: center;
  margin-bottom: 1.25rem;
}

.waitlist-link-invalid .waitlist-icon {
  background: rgba(255, 122, 122, 0.12);
  border-color: rgba(255, 122, 122, 0.35);
  color: var(--danger);
  box-shadow: none;
}

/* The address is echoed in monospace so a typo is visible before they go looking in a mailbox. */
.waitlist-address {
  font-family: var(--font-mono);
  font-size: 0.95em;
  color: var(--text);
  word-break: break-all;
}

/* Honeypot -- absolutely positioned off-screen, not display:none, which some
   bots skip. */
.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Privacy page */

.legal {
  max-width: 640px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 3rem;
}

.legal h1 {
  font-size: 30px;
  line-height: 1.15;
  margin-bottom: 1.5rem;
}

.legal h2 {
  font-size: 16px;
  margin: 1.75rem 0 0.5rem;
}

.legal p {
  margin: 0;
  line-height: 1.6;
  color: var(--text-muted);
}

/* Desktop */

@media (min-width: 900px) {
  .hero {
    flex-direction: row;
    align-items: center;
    gap: 88px;
    max-width: 1120px;
    margin: 0 auto;
    padding: 112px 24px 120px;
  }

  .hero-copy {
    flex: 1;
    gap: 28px;
  }

  .hero-title {
    font-size: 56px;
  }

  .hero-lede {
    font-size: 18px;
  }

  .demo-card {
    flex: 1;
  }

  .how-it-works,
  .meet-hosts {
    padding: 96px 24px;
  }

  .section-intro h2 {
    font-size: 38px;
  }

  .steps-grid {
    max-width: 1120px;
    margin: 0 auto;
    width: 100%;
    flex-direction: row;
    gap: 32px;
  }

  .step {
    flex: 1;
  }

  .host-cards {
    max-width: 1120px;
    margin: 0 auto;
    width: 100%;
    flex-direction: row;
    gap: 24px;
  }

  .host-card {
    flex: 1;
    padding: 2rem;
  }

  .site-footer {
    flex-direction: row;
    justify-content: space-between;
    max-width: 1120px;
    margin: 0 auto;
    width: 100%;
    padding: 40px 24px 48px;
  }
}

/* Two host tiles don't fit on the narrowest phones; the reference stacks them here too. */
@media (max-width: 380px) {
  .hosts {
    grid-template-columns: 1fr;
  }
}
