:root {
  --background: #0f0e13;
  --surface: #18171d;
  --surface-raised: #201f27;
  --outline: #2c2b33;
  --on-surface: #ecedef;
  --muted: #8b9099;
  --accent: #ffb878;
  --accent-soft: rgba(255, 184, 120, 0.14);
  --danger: #ff8a80;
  --radius: 16px;
  --radius-lg: 24px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--background);
  color: var(--on-surface);
  font: 400 16px/1.45 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

/* ---- top bar ---------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 24px;
  padding: 14px max(16px, env(safe-area-inset-left)) 14px max(16px, env(safe-area-inset-right));
  background: linear-gradient(var(--background) 70%, transparent);
}
.brand { font-weight: 600; font-size: 18px; letter-spacing: -0.01em; }
.tabs { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.tabs a {
  padding: 6px 12px; border-radius: 999px; color: var(--muted); font-weight: 500; white-space: nowrap;
  transition: color 150ms ease-out, background 150ms ease-out;
}
.tabs a:hover { color: var(--on-surface); }
#account-btn.active { box-shadow: inset 0 0 0 1px var(--outline); }
.tabs a.active { color: var(--on-surface); background: var(--surface-raised); }

@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; gap: 8px 16px; }
  .tabs { order: 3; flex-basis: 100%; }
  #account-btn { margin-left: auto; }
}

/* ---- layout ----------------------------------------------------------- */
main { max-width: 720px; margin: 0 auto; padding: 16px 16px 96px; animation: enter 200ms ease-out; }
@keyframes enter { from { opacity: 0; transform: translateY(16px); } }

h1 { font-size: 32px; font-weight: 600; letter-spacing: -0.02em; margin: 16px 0 4px; }
h2 { font-size: 18px; font-weight: 600; margin: 32px 0 12px; }
.lede { color: var(--muted); margin: 0 0 24px; }
.muted { color: var(--muted); }
.small-text { font-size: 14px; }

.row-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.row-head .lede { margin-bottom: 0; }

/* ---- cards & lists ---------------------------------------------------- */
.card { background: var(--surface); border-radius: var(--radius-lg); padding: 24px; }
.list { display: flex; flex-direction: column; gap: 8px; }
.item {
  display: flex; align-items: center; gap: 16px;
  background: var(--surface); border-radius: var(--radius); padding: 14px 16px;
}
.item .grow { flex: 1; min-width: 0; }
.item .title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .meta { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill {
  display: inline-block; font-size: 12px; font-weight: 500; padding: 2px 8px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); vertical-align: 1px; margin-left: 6px;
}
.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty p { margin: 0 0 16px; }

/* ---- forms ------------------------------------------------------------ */
form { display: flex; flex-direction: column; gap: 16px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); font-weight: 500; }
input, select {
  font: inherit; color: var(--on-surface);
  background: var(--surface-raised); border: 1px solid transparent; border-radius: 12px;
  padding: 12px 14px; outline: none; width: 100%;
  transition: border-color 150ms ease-out, box-shadow 150ms ease-out;
}
input:focus, select:focus { border-color: rgba(255, 184, 120, 0.5); box-shadow: 0 0 0 4px var(--accent-soft); }
input::placeholder { color: #5d626b; }
.input-action { display: flex; gap: 8px; align-items: center; }
.input-action input { flex: 1; min-width: 0; }
.code-input { font: 600 28px/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 0.3em; text-align: center; text-transform: uppercase; }

.segmented { display: flex; background: var(--surface-raised); border-radius: 12px; padding: 4px; gap: 4px; }
.segmented button { flex: 1; background: transparent; color: var(--muted); }
.segmented button.on { background: var(--surface); color: var(--on-surface); box-shadow: 0 1px 2px rgba(0,0,0,.4); }

details summary { cursor: pointer; color: var(--muted); font-size: 14px; list-style: none; }
details summary::before { content: "+ "; }
details[open] summary::before { content: "– "; }
details[open] summary { margin-bottom: 16px; }

.actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.error { color: var(--danger); font-size: 14px; margin: 0; }

button {
  font: 500 15px/1 Inter, system-ui, sans-serif; cursor: pointer;
  border: 0; border-radius: 12px; padding: 12px 18px;
  background: var(--accent); color: #2a1709;
  transition: transform 150ms ease-out, opacity 150ms ease-out, background 150ms ease-out;
}
button:active { transform: scale(0.97); }
/* A link that looks like the primary button (downloads). */
a.btn { display: inline-block; font: 500 15px/1 Inter, system-ui, sans-serif; border-radius: 12px; padding: 12px 18px;
  background: var(--accent); color: #2a1709; text-decoration: none; }
a.btn:active { transform: scale(0.97); }
button:disabled { opacity: 0.5; cursor: default; }
button.ghost { background: var(--surface-raised); color: var(--on-surface); }
button.quiet { background: transparent; color: var(--muted); padding: 8px 10px; }
button.quiet:hover { color: var(--on-surface); }
button.danger { color: var(--danger); }
button.small { padding: 8px 12px; font-size: 14px; }

/* ---- sheet (modal) ---------------------------------------------------- */
.scrim {
  position: fixed; inset: 0; z-index: 20; background: rgba(5, 6, 8, 0.7);
  display: flex; align-items: center; justify-content: center; padding: 16px;
  animation: fade 150ms ease-out;
}
.sheet {
  background: var(--surface); border-radius: var(--radius-lg); padding: 24px;
  width: 100%; max-width: 480px; max-height: calc(100vh - 32px); overflow-y: auto;
  animation: enter 200ms ease-out;
}
.sheet h2 { margin-top: 0; }
@keyframes fade { from { opacity: 0; } }
@media (max-width: 640px) {
  .scrim { align-items: flex-end; padding: 0; }
  .sheet { border-radius: var(--radius-lg) var(--radius-lg) 0 0; padding-bottom: max(24px, env(safe-area-inset-bottom)); }
}

/* ---- auth ------------------------------------------------------------- */
.auth { max-width: 380px; margin: 10vh auto 0; }
.auth h1 { margin-bottom: 8px; }
.switch { text-align: center; margin-top: 16px; font-size: 14px; color: var(--muted); }
.switch button { padding: 4px; background: none; color: var(--accent); }

/* ---- toast ------------------------------------------------------------ */
.toast {
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); z-index: 30;
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  background: var(--surface-raised); color: var(--on-surface); padding: 12px 18px; border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0,0,0,.4); font-size: 14px; max-width: calc(100vw - 32px);
  transition: opacity 150ms ease-out, transform 150ms ease-out;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); transition-duration: 150ms; }
.toast.warn { color: #ffd59a; }

.success-mark {
  width: 64px; height: 64px; border-radius: 50%; margin: 8px auto 16px;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-size: 30px;
}
.center { text-align: center; }
.invite { font: 600 15px ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 0.12em; }

/* ---- about ------------------------------------------------------------ */
.about .jump { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.about .doc { scroll-margin-top: 72px; }
.about .doc h2 { font-size: 24px; margin: 48px 0 12px; letter-spacing: -0.01em; }
.about .doc h3 { font-size: 16px; font-weight: 600; margin: 24px 0 8px; }
.about .doc p, .about .doc li { color: #c4c7cd; }
.about .doc p { margin: 0 0 12px; }
.about .doc ul { margin: 0 0 12px; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.about .stage h3 { margin-top: 24px; }
.about .item .meta.wrap { white-space: normal; }

/* ---- landing ---------------------------------------------------------- */
main.wide { max-width: 1120px; padding-top: 0; }
.landing { --gap: clamp(72px, 10vw, 120px); }
.landing a.btn, .landing .btn {
  display: inline-flex; align-items: center; justify-content: center;
  font: 500 15px/1 Inter, system-ui, sans-serif; border-radius: 12px; padding: 14px 20px;
  background: var(--accent); color: #2a1709; transition: transform 150ms ease-out, background 150ms ease-out;
}
.landing .btn:active { transform: scale(0.97); }
.landing .btn.ghost { background: var(--surface-raised); color: var(--on-surface); }
.landing .btn.small { padding: 8px 14px; font-size: 14px; }

.landing-nav { display: flex; align-items: center; justify-content: space-between; padding: 18px 0; }
.landing-nav nav { display: flex; align-items: center; gap: 20px; font-size: 15px; color: var(--muted); }
.landing-nav nav a:not(.btn):hover { color: var(--on-surface); }

.hero { display: grid; grid-template-columns: 1fr 1.15fr; gap: 56px; align-items: center; padding: clamp(32px, 8vw, 96px) 0 var(--gap); }
.eyebrow { color: var(--accent); font-size: 14px; font-weight: 500; margin: 0 0 16px; }
.hero h1 { font-size: clamp(40px, 6vw, 64px); line-height: 1.05; letter-spacing: -0.035em; margin: 0 0 20px; }
.hero-lede { font-size: 19px; color: #c4c7cd; margin: 0 0 32px; max-width: 30em; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; }
.fine { color: var(--muted); font-size: 14px; margin: 20px 0 0; }

/* TV mock: sized in container units so it scales as one piece. */
.tv { container-type: inline-size; }
.tv-screen {
  aspect-ratio: 16 / 9; border-radius: 1.6cqw; padding: 4cqw 4.5cqw; overflow: hidden;
  background: radial-gradient(120% 90% at 85% 0%, #2a2140 0%, var(--background) 55%);
  box-shadow: 0 0 0 0.9cqw #050608, 0 0 0 1.05cqw #2a2d33, 0 40px 80px -20px rgba(0,0,0,.7), 0 0 120px -30px rgba(255,184,120,.25);
}
.tv-stand { width: 22%; height: 1.4cqw; margin: 2.2cqw auto 0; border-radius: 0 0 1cqw 1cqw; background: linear-gradient(#2a2d33, #17191d); }
.tv-greeting { font-size: 3.6cqw; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 2.6cqw; }
.tv-row-title { font-size: 1.5cqw; color: var(--muted); font-weight: 500; margin-bottom: 1.2cqw; }
.tv-row { display: flex; gap: 1.6cqw; margin-bottom: 2.8cqw; }
.tv-card, .tv-tile { flex: 1; min-width: 0; background: var(--surface); border-radius: 1.4cqw; padding: 1.4cqw; }
.tv-card { transform-origin: center bottom; transition: transform 300ms ease-out; }
.tv-card.focused { background: var(--surface-raised); transform: scale(1.06); box-shadow: 0 0 0 0.2cqw rgba(255,184,120,.45), 0 1cqw 3cqw rgba(0,0,0,.5); }
.tv-logo {
  width: 4.4cqw; height: 4.4cqw; border-radius: 1cqw; margin-bottom: 1.2cqw;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-raised); color: var(--muted); font-size: 1.5cqw; font-weight: 600;
}
.tv-card.focused .tv-logo { background: var(--accent-soft); color: var(--accent); }
.tv-name { font-size: 1.55cqw; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-now { font-size: 1.25cqw; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 0.3cqw; }
.tv-bar { height: 0.3cqw; border-radius: 1cqw; background: var(--outline); margin-top: 1cqw; overflow: hidden; }
.tv-bar span { display: block; height: 100%; background: var(--accent); }
.tv-tile { padding: 1.8cqw 1.4cqw; }

/* Player during a watch party: a made-up picture, the party line, floating reactions and the overlay. */
.tv-player {
  position: relative; overflow: hidden; aspect-ratio: 16 / 9; padding: 0;
  background: radial-gradient(70% 90% at 30% 35%, #2c4a3a 0%, #17271f 55%, #0b120e 100%);
}
.tv-party {
  position: absolute; top: 3cqw; left: 3cqw; display: flex; align-items: center; gap: 1cqw;
  font-size: 1.5cqw; font-weight: 500; padding: 0.9cqw 1.6cqw; border-radius: 99cqw; background: rgba(14,15,18,.72);
}
.tv-dot { width: 1cqw; height: 1cqw; border-radius: 50%; background: var(--accent); }
.tv-float { position: absolute; font-size: 3.4cqw; animation: tv-float 4.8s ease-out infinite; opacity: 0; }
@keyframes tv-float {
  0% { opacity: 0; transform: translateY(0) scale(.8); }
  15% { opacity: 1; transform: translateY(-2cqw) scale(1); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-14cqw); }
}
.tv-overlay {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: flex-end; justify-content: space-between;
  gap: 3cqw; padding: 8cqw 3cqw 3cqw; background: linear-gradient(transparent, rgba(14,15,18,.92));
}
.tv-overlay > div:first-child { flex: 1; min-width: 0; }
.tv-overlay .tv-name { font-size: 2.2cqw; font-weight: 600; }
.tv-overlay .tv-now { font-size: 1.4cqw; }
.tv-overlay .tv-bar { max-width: 40cqw; }
.tv-reacts { display: flex; gap: 0.6cqw; padding: 0.6cqw; border-radius: 99cqw; background: rgba(31,34,39,.9); }
.tv-reacts span { font-size: 2.2cqw; width: 4cqw; height: 4cqw; display: grid; place-items: center; border-radius: 50%; }
.tv-reacts span.on { background: var(--accent-soft); box-shadow: 0 0 0 0.2cqw rgba(255,184,120,.6); }

.band { padding-bottom: var(--gap); }
.band h2, .closing h2 { font-size: clamp(28px, 3.6vw, 40px); letter-spacing: -0.025em; line-height: 1.15; margin: 0 0 12px; }
.section-lede { color: var(--muted); font-size: 18px; margin: 0 0 40px; }
.section-lede a { color: var(--accent); white-space: nowrap; }

.spotlight { display: grid; grid-template-columns: 1.15fr 1fr; gap: 56px; align-items: center; }
.spotlight .section-lede { margin-bottom: 28px; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature { background: var(--surface); border-radius: var(--radius-lg); padding: 28px; }
.feature-icon {
  width: 40px; height: 40px; border-radius: 12px; margin-bottom: 20px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent); font-size: 18px;
}
.feature h3 { font-size: 17px; font-weight: 600; margin: 0 0 8px; }
.feature p { color: var(--muted); margin: 0; font-size: 15px; }

.steps { list-style: none; padding: 0; margin: 40px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.steps li { display: flex; gap: 16px; align-items: flex-start; }
.step-n {
  flex: none; width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--outline); color: var(--accent); font-weight: 600; font-size: 15px;
}
.steps h3 { font-size: 17px; margin: 6px 0 6px; }
.steps p { color: var(--muted); margin: 0; font-size: 15px; }

.trust { display: grid; grid-template-columns: 1fr 1.4fr; gap: 56px; align-items: start; }
.trust .section-lede { margin-bottom: 0; }
.trust-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.trust-list li { padding: 18px 0; border-top: 1px solid var(--outline); color: var(--muted); }
.trust-list li:last-child { border-bottom: 1px solid var(--outline); }
.trust-list strong { color: var(--on-surface); font-weight: 500; }

.closing {
  text-align: center; padding: 64px 24px; margin-bottom: 48px; border-radius: var(--radius-lg);
  background: radial-gradient(80% 120% at 50% 0%, #2a2140 0%, var(--surface) 70%);
}
.closing .cta { justify-content: center; margin: 28px 0 20px; }
.closing .subtle { color: var(--muted); font-size: 14px; }
.closing .subtle:hover { color: var(--on-surface); }

.landing-foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 14px; padding: 8px 0 24px; }
.landing-foot nav { display: flex; gap: 20px; flex-wrap: wrap; }
.landing-foot a:hover { color: var(--on-surface); }

@media (max-width: 860px) {
  .hero, .trust, .spotlight { grid-template-columns: 1fr; gap: 40px; }
  .features, .steps { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .landing-nav nav a:not(.btn) { display: none; }
  .features, .steps { grid-template-columns: 1fr; }
  .hero-lede { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  .tv-card { transition: none; }
  .tv-float { animation: none; opacity: 1; }
}

/* ---- admin: plans --------------------------------------------------------- */
table.grid { width: 100%; border-collapse: collapse; font-size: 15px; }
table.grid th { text-align: left; color: var(--muted); font-weight: 500; font-size: 14px; padding: 10px 20px; }
table.grid td { padding: 12px 20px; border-top: 1px solid var(--outline); vertical-align: middle; }
table.grid th:not(:first-child), table.grid td.center { text-align: center; width: 90px; }
table.grid input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--accent); }
.admin-row { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.admin-row label { flex: 0 0 auto; }
.admin-row select, .admin-row input { width: auto; min-width: 120px; padding: 8px 12px; }
table.grid .meta { color: var(--muted); font-size: 14px; }

/* The logo mark beside the wordmark. */
.brand { display: inline-flex; align-items: center; gap: 8px; }
.brand img { border-radius: 6px; }
