/* ================= AudioTravel — Brand Design System ================= */
:root {
  --bg: #06070b;
  --bg-2: #0b0d14;
  --card: rgba(255, 255, 255, 0.04);
  --card-solid: #10131c;
  --border: rgba(255, 255, 255, 0.09);
  --text: #f2f4f8;
  --muted: #98a1b3;
  --brand: #7c5cff;
  --brand-2: #22d3ee;
  --grad: linear-gradient(135deg, #7c5cff 0%, #22d3ee 100%);
  --radius: 14px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --display: "Space Grotesk", "Inter", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1000px 500px at 80% -10%, rgba(124, 92, 255, 0.18), transparent 60%),
    radial-gradient(800px 400px at 10% 110%, rgba(34, 211, 238, 0.10), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--display); letter-spacing: -0.02em; }
a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }
code { color: var(--brand-2); background: rgba(34, 211, 238, 0.08); padding: 1px 6px; border-radius: 6px; }

.muted { color: var(--muted); }
.small { font-size: 0.8rem; }
.hidden { display: none !important; }

/* ---------- Buttons ---------- */
button, .btn {
  display: inline-block;
  background: var(--grad);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px 22px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}
button:hover:not(:disabled), .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(124, 92, 255, 0.35);
  text-decoration: none;
}
button:disabled { background: #232838; color: #6b7484; cursor: not-allowed; box-shadow: none; }

button.secondary, .btn.secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text);
}
button.secondary:hover:not(:disabled) { box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35); }
button.wide { width: 100%; }

/* ---------- Inputs & selects ---------- */
input, select {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 11px 14px;
  font-size: 0.95rem;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.15s ease;
}
input:focus, select:focus { border-color: var(--brand); }
select { width: auto; padding: 8px 12px; cursor: pointer; }
select option { background: var(--card-solid); }

/* ---------- Layout: centered pages (sender/receiver/auth) ---------- */
.center-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.card {
  width: min(520px, 94vw);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}
.card h1 { font-size: 1.35rem; margin: 0 0 6px; }
.card h2 { font-size: 1rem; margin: 20px 0 8px; }
.card input { margin-top: 8px; }
.card button { margin-top: 12px; }

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: rgba(6, 7, 11, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav .logo {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 9px;
}
.nav .logo:hover { text-decoration: none; }
.nav .nav-links { display: flex; align-items: center; gap: 22px; }
.nav .nav-links a { color: var(--muted); font-size: 0.9rem; }
.nav .nav-links a:hover { color: var(--text); text-decoration: none; }
.nav .btn { padding: 9px 18px; font-size: 0.88rem; }

.logo-mark {
  width: 26px; height: 26px;
  border-radius: 8px;
  background: var(--grad);
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  padding-bottom: 5px;
}
.logo-mark i { width: 3px; background: #fff; border-radius: 2px; display: block; }
.logo-mark i:nth-child(1) { height: 6px; }
.logo-mark i:nth-child(2) { height: 12px; }
.logo-mark i:nth-child(3) { height: 8px; }

/* ---------- Hero ---------- */
.hero {
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 20px 60px;
  position: relative;
  overflow: hidden;
}
.hero .badge {
  font-size: 0.8rem;
  color: var(--brand-2);
  border: 1px solid rgba(34, 211, 238, 0.35);
  background: rgba(34, 211, 238, 0.07);
  padding: 6px 14px;
  border-radius: 100px;
  margin-bottom: 26px;
  letter-spacing: 0.04em;
}
.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  line-height: 1.06;
  margin: 0 0 20px;
  max-width: 840px;
}
.hero h1 .grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p.sub {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--muted);
  max-width: 620px;
  margin: 0 0 36px;
  line-height: 1.6;
}
.hero .cta-row { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.hero .cta-row .btn { padding: 15px 30px; font-size: 1rem; }

/* Animated equalizer */
.eq { display: flex; align-items: flex-end; gap: 5px; height: 56px; margin-top: 56px; }
.eq span {
  width: 6px;
  border-radius: 4px;
  background: var(--grad);
  opacity: 0.85;
  animation: eq-bounce 1.2s ease-in-out infinite;
}
.eq span:nth-child(1) { height: 30%; animation-delay: 0s; }
.eq span:nth-child(2) { height: 65%; animation-delay: 0.15s; }
.eq span:nth-child(3) { height: 100%; animation-delay: 0.3s; }
.eq span:nth-child(4) { height: 55%; animation-delay: 0.45s; }
.eq span:nth-child(5) { height: 80%; animation-delay: 0.6s; }
.eq span:nth-child(6) { height: 40%; animation-delay: 0.75s; }
.eq span:nth-child(7) { height: 70%; animation-delay: 0.9s; }
@keyframes eq-bounce { 0%, 100% { transform: scaleY(0.4); } 50% { transform: scaleY(1); } }
.eq.playing span { animation-play-state: running; }

/* ---------- Sections ---------- */
.section { padding: 90px 20px; max-width: 1120px; margin: 0 auto; }
.section .kicker {
  text-align: center;
  color: var(--brand-2);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.section h2 { text-align: center; font-size: clamp(1.7rem, 4vw, 2.5rem); margin: 0 0 14px; }
.section .sub { text-align: center; color: var(--muted); max-width: 560px; margin: 0 auto 54px; line-height: 1.6; }

.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.feature {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 22px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.feature:hover { transform: translateY(-4px); border-color: rgba(124, 92, 255, 0.45); }
.feature .icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: rgba(124, 92, 255, 0.14);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 16px;
}
.feature h3 { font-size: 1.02rem; margin: 0 0 8px; }
.feature p { color: var(--muted); font-size: 0.88rem; line-height: 1.55; margin: 0; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; counter-reset: step; }
.step {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 24px 24px;
}
.step::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  font-family: var(--display);
  font-size: 2.2rem;
  font-weight: 700;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: block;
  margin-bottom: 12px;
}
.step h3 { font-size: 1.02rem; margin: 0 0 8px; }
.step p { color: var(--muted); font-size: 0.88rem; line-height: 1.55; margin: 0; }

.platforms { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.platforms .pill {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  border-radius: 100px;
  padding: 10px 20px;
  font-size: 0.88rem;
}
.platforms .pill b { color: var(--text); font-weight: 600; }

.cta-band {
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 64px 24px;
  background:
    radial-gradient(500px 200px at 50% 0%, rgba(124, 92, 255, 0.16), transparent 70%),
    var(--card);
}
.cta-band h2 { margin-top: 0; }

/* ---------- Auth card on landing ---------- */
.auth-wrap { max-width: 460px; margin: 0 auto; }
.auth-wrap .card { width: 100%; }
.divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--muted); font-size: 0.78rem;
  margin: 18px 0 6px;
}
.divider::before, .divider::after {
  content: ""; flex: 1; height: 1px; background: var(--border);
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 34px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 0.84rem;
}

/* ---------- Sender / receiver specifics ---------- */
.pill-room {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.3);
  border-radius: 100px;
  padding: 7px 16px;
  font-size: 0.84rem;
  color: var(--muted);
  margin-bottom: 18px;
}
.pill-room .dot { width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 10px #34d399; }
.pill-room code { background: none; padding: 0; color: var(--text); font-weight: 600; }

.btn-row { display: flex; gap: 10px; }
.btn-row button { flex: 1; }

.link-row { display: flex; gap: 8px; margin-top: 8px; }
.link-row input { flex: 1; margin-top: 0; padding: 9px 12px; font-size: 0.86rem; }
.link-row button { margin-top: 0; padding: 9px 16px; font-size: 0.86rem; white-space: nowrap; }

.latency-row { display: flex; align-items: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.latency-row label { color: var(--muted); font-size: 0.88rem; white-space: nowrap; }
.latency-row select { flex: 0 0 auto; }
.latency-row .small { flex-basis: 100%; }

.stability-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  font-size: 0.86rem;
  color: var(--muted);
  cursor: pointer;
}
.stability-row input { width: auto; margin: 0; accent-color: var(--brand); }

ul { list-style: none; padding: 0; margin: 0; }
li { font-size: 0.86rem; }

#status { margin-top: 16px; min-height: 1.2em; font-size: 0.88rem; }

/* Receiver player */
.player { text-align: center; }
.player .disc {
  width: 148px; height: 148px;
  margin: 10px auto 26px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #0b0d14 30%, transparent 31%),
    conic-gradient(from 0deg, rgba(124,92,255,0.65), rgba(34,211,238,0.65), rgba(124,92,255,0.65));
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 60px rgba(124, 92, 255, 0.25);
  animation: spin 9s linear infinite paused;
}
.player.live .disc { animation-play-state: running; }
@keyframes spin { to { transform: rotate(360deg); } }
.player #playBtn { font-size: 1.05rem; padding: 15px 44px; border-radius: 100px; }
.player .controls {
  display: flex; gap: 18px; justify-content: center;
  margin-top: 26px; flex-wrap: wrap;
}
.player .controls .latency-row { margin-top: 0; flex-basis: auto; }
.player .controls .latency-row .small { flex-basis: auto; display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .features { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .features { grid-template-columns: 1fr; }
  .nav { padding: 12px 16px; }
  .nav .nav-links a:not(.btn) { display: none; }
  .card { padding: 22px; }
}
