/* SetStreamer: the same dark plum faceplate, on-air red and mixer LEDs as the app. */
:root {
  --plinth: #140C24;
  --panel: #21143A;
  --raised: #2C1C4B;
  --edge: #3A2A5C;
  --on-air: #FF3B46;
  --led-green: #3DDC84;
  --led-amber: #FFC233;
  --ink: #F2EEF8;
  --ink-dim: #A99BC4;
  --radius: 18px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: radial-gradient(1200px 600px at 70% -10%, #2a1458 0%, var(--plinth) 55%) fixed, var(--plinth);
  color: var(--ink);
  font-family: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px 64px; }

h1, h2, h3 { font-stretch: 125%; font-weight: 850; line-height: 1.1; margin: 0 0 .5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.35rem, 3vw, 1.9rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
a { color: var(--ink); text-decoration-color: var(--on-air); text-underline-offset: 3px; }
a:hover { color: #fff; }
code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .92em; word-break: break-all; }
.muted { color: var(--ink-dim); }
.small { font-size: .88rem; }
.center { text-align: center; }
.narrow { max-width: 62ch; }
:focus-visible { outline: 3px solid var(--led-amber); outline-offset: 2px; border-radius: 6px; }

/* Top bar */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  max-width: 1080px; width: 100%; margin: 0 auto; padding: 18px 20px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { border-radius: 8px; }
.brand span { font-stretch: 125%; font-weight: 900; font-size: 1.15rem; }
.topbar nav { display: flex; align-items: center; gap: 18px; font-size: .95rem; white-space: nowrap; }
.topbar nav a { text-decoration: none; color: var(--ink-dim); }
.topbar nav a:hover { color: var(--ink); }
form.inline { display: inline; margin: 0; }

/* Buttons */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(180deg, #FF5A63, var(--on-air) 55%, #C4141F);
  color: #fff; border: 0; border-radius: 14px; padding: 13px 22px;
  font: inherit; font-weight: 750; text-decoration: none; cursor: pointer;
  box-shadow: 0 6px 22px rgba(255, 59, 70, .32);
}
.button:hover { filter: brightness(1.06); color: #fff; }
.button.small { padding: 9px 16px; font-size: .92rem; border-radius: 12px; box-shadow: none; }
.topbar .button.small { color: #fff; }
.button.wide { width: 100%; }
.button.ghost { background: transparent; border: 1.5px solid var(--edge); box-shadow: none; color: var(--ink); }
.button.ghost:hover { border-color: var(--ink-dim); }
.button.danger { background: transparent; border: 1.5px solid var(--on-air); color: var(--on-air); box-shadow: none; }
button.link {
  background: none; border: 0; padding: 0 4px; font: inherit; font-size: .9rem;
  color: var(--ink-dim); text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
button.link:hover { color: var(--ink); }

/* Home: hero */
.hero { display: grid; grid-template-columns: 1.15fr .85fr; align-items: center; gap: 40px; padding: 48px 0 72px; }
.lede { font-size: 1.18rem; color: var(--ink-dim); max-width: 46ch; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.hero-art { width: 100%; height: auto; max-width: 440px; justify-self: end; filter: drop-shadow(0 30px 60px rgba(0,0,0,.45)); }

/* Home: the signal flow, phone → SetStreamer → platforms */
.flow { padding: 24px 0 64px; }
.flow-diagram { display: flex; align-items: center; gap: 0; margin-top: 28px; }
.node, .node-list {
  background: var(--panel); border: 1px solid var(--edge); border-radius: var(--radius);
  padding: 20px; min-width: 0;
}
.node { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.node strong { font-stretch: 112%; }
.node span { color: var(--ink-dim); font-size: .92rem; }
.node-hub { border-color: var(--on-air); box-shadow: 0 0 0 1px rgba(255,59,70,.35), 0 10px 40px rgba(255,59,70,.18); }
.node-list { flex: 1; list-style: none; margin: 0; display: grid; gap: 8px; }
.node-list li::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--led-green); box-shadow: 0 0 8px var(--led-green); margin-right: 10px; }
.wire { flex: 0 0 56px; height: 2px; background: var(--edge); position: relative; overflow: hidden; }
.wire span { position: absolute; inset: 0; width: 40%; background: linear-gradient(90deg, transparent, var(--on-air), transparent); animation: signal 1.8s linear infinite; }
@keyframes signal { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

/* Home: plans */
.plans { padding: 16px 0 24px; }
.plan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 24px 0 16px; }
.plan { background: var(--panel); border: 1px solid var(--edge); border-radius: var(--radius); padding: 24px; }
.plan h3 { margin-bottom: .2em; }
.plan .price { font-size: 1.6rem; font-weight: 800; font-stretch: 112%; margin-bottom: .6em; }
.plan .price small { font-size: .9rem; font-weight: 500; color: var(--ink-dim); }
.plan .or { display: block; font-size: .9rem; font-weight: 500; color: var(--ink-dim); }
.plan ul { margin: 0; padding-left: 1.1em; color: var(--ink-dim); }
.plan li { margin-bottom: .4em; }
.plan-plus { border-color: var(--on-air); }

/* Cards and forms */
.card { background: var(--panel); border: 1px solid var(--edge); border-radius: var(--radius); padding: 24px; margin-bottom: 18px; }
.auth { max-width: 440px; margin: 40px auto; }
label { display: block; font-weight: 650; font-size: .95rem; margin-bottom: 14px; }
label small { display: block; font-weight: 400; color: var(--ink-dim); margin-top: 4px; }
input[type=email], input[type=password], input[type=text], select {
  display: block; width: 100%; margin-top: 6px; padding: 12px 14px;
  background: var(--plinth); color: var(--ink); border: 1px solid var(--edge); border-radius: 12px;
  font: inherit; font-weight: 400;
}
input:focus, select:focus { border-color: var(--ink-dim); outline: none; }
label.compact { margin: 0; display: flex; align-items: center; gap: 10px; }
label.compact select { margin: 0; width: auto; }
label.check { margin: 0; display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--ink-dim); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }

.alert { border-radius: 12px; padding: 12px 16px; margin-bottom: 18px; border-left: 3px solid; background: rgba(0,0,0,.28); }
.alert.error { border-color: var(--on-air); }
.alert.success { border-color: var(--led-green); }
.alert.info { border-color: var(--led-amber); }

/* App Store button */
.store-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 22px; }
.store-badge {
  display: inline-flex; align-items: center; gap: 10px; padding: 8px 18px 8px 14px;
  background: #000; color: #fff; border: 1px solid rgba(255,255,255,.35); border-radius: 12px;
  text-decoration: none; line-height: 1.1;
}
.store-badge:hover { border-color: #fff; }
.store-badge[aria-disabled="true"] { cursor: default; }
.store-badge[aria-disabled="true"]:hover { border-color: rgba(255,255,255,.35); }
.store-icon { width: 26px; height: 26px; }
.store-text { display: flex; flex-direction: column; font-size: 1.2rem; font-weight: 650; letter-spacing: -.01em; }
.store-text small { font-size: .68rem; font-weight: 500; letter-spacing: .02em; }
.plans-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 18px; }
.plans-foot p { margin: 0; }

/* Dashboard */
.dash { max-width: 820px; margin: 24px auto 0; }
.dash-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.dash-head h1 { margin: 0; }
.section-title { margin-top: 36px; }
.plan-badge { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: .85rem; font-weight: 700; border: 1px solid var(--edge); background: var(--raised); }
.plan-badge.plan-plus { border-color: var(--on-air); color: #fff; background: rgba(255,59,70,.2); }

.live-card { display: flex; flex-direction: column; gap: 16px; }
.live-row { display: flex; align-items: center; gap: 16px; }
.live-row p { margin: 2px 0 0; }
.lamp { flex: 0 0 auto; width: 46px; height: 46px; border-radius: 50%; background: #2A1020; border: 2.5px solid rgba(255,59,70,.8); }
.lamp[data-state=live] {
  background: radial-gradient(circle at 40% 35%, #FF6A72, var(--on-air) 55%, #B0121C);
  border-color: transparent; box-shadow: 0 0 22px rgba(255,59,70,.75); animation: glow 1.4s ease-in-out infinite alternate;
}
@keyframes glow { from { box-shadow: 0 0 12px rgba(255,59,70,.45); } to { box-shadow: 0 0 26px rgba(255,59,70,.85); } }

.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--raised); border: 1px solid var(--edge); font-size: .9rem; font-weight: 600; }
.chips li.empty { color: var(--ink-dim); font-weight: 400; }
.led { width: 8px; height: 8px; border-radius: 50%; background: var(--edge); }
.chips li[data-state=live] .led { background: var(--led-green); box-shadow: 0 0 8px var(--led-green); }
.chips li[data-state=connecting] .led, .chips li[data-state=retrying] .led { background: var(--led-amber); box-shadow: 0 0 8px var(--led-amber); }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 10px 18px; margin: 0 0 18px; align-items: baseline; }
.kv dt { color: var(--ink-dim); font-size: .92rem; }
.kv dd { margin: 0; }

.dest-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 6px; }
.dest-head h3 { margin: 0; }
.dest-foot { display: flex; align-items: center; gap: 12px 18px; flex-wrap: wrap; }
.dest-foot label.compact { margin: 0; display: flex; align-items: center; gap: 10px; min-width: 0; max-width: 100%; }
.dest-foot label.compact select { min-width: 0; max-width: 100%; text-overflow: ellipsis; }
.dest-foot .spacer { flex: 1; }
.grid-3 { display: grid; grid-template-columns: 1fr 1.3fr 1.3fr; gap: 0 16px; }
.tip { border-left: 3px solid var(--led-amber); padding: 6px 12px; margin: 0 0 14px; background: rgba(255,194,51,.07); border-radius: 0 8px 8px 0; }
button.link.danger { color: var(--on-air); }

/* One card per platform; each account is a panel inside it */
.card.platform { padding: 22px 24px 18px; }
.platform-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 4px; }
.platform-head h3 { margin: 0; font-size: 1.2rem; }
.platform-head .count { color: var(--ink-dim); font-size: .85rem; font-weight: 600; }
.platform .help { margin: 0 0 10px; }
.platform .tip { margin-bottom: 12px; }
.account { background: rgba(0,0,0,.18); border: 1px solid var(--edge); border-radius: 14px; padding: 16px 18px 14px; margin-top: 12px; }
.account-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.account-name { font-size: 1rem; }
.add-account { display: flex; align-items: center; gap: 12px; margin: 14px 0 0; }
.add-account .button { gap: 8px; }
.add-account .button:disabled { opacity: .5; cursor: not-allowed; }
.button .plus { font-size: 1.15rem; line-height: 1; font-weight: 700; }
.plus-badge { padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; border: 1px solid var(--on-air); color: #fff; background: rgba(255,59,70,.2); }

/* On/off switch */
.switch { display: inline-flex; align-items: center; gap: 10px; margin: 0; cursor: pointer; font-weight: 600; white-space: nowrap; flex-shrink: 0; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 46px; height: 28px; border-radius: 999px; background: var(--plinth); border: 1px solid var(--edge); position: relative; transition: background .15s; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--ink-dim); transition: transform .15s, background .15s; }
.switch input:checked + .track { background: rgba(61,220,132,.25); border-color: var(--led-green); }
.switch input:checked + .track::after { transform: translateX(18px); background: var(--led-green); box-shadow: 0 0 8px var(--led-green); }
.switch input:focus-visible + .track { outline: 3px solid var(--led-amber); outline-offset: 2px; }

.danger { border-color: rgba(255,59,70,.4); }

/* Privacy page */
.prose { max-width: 68ch; margin: 32px auto 0; }
.prose h2 { margin-top: 1.6em; }
.prose ul { padding-left: 1.2em; }

/* Footer */
.footer { display: flex; gap: 20px; justify-content: center; padding: 28px 20px; color: var(--ink-dim); font-size: .9rem; border-top: 1px solid var(--edge); }
.footer a { color: var(--ink-dim); }

/* Phones */
@media (max-width: 760px) {
  body { font-size: 16px; }
  .hero { grid-template-columns: 1fr; padding-top: 16px; gap: 24px; }
  .hero-art { justify-self: center; max-width: 300px; order: -1; }
  .flow-diagram { flex-direction: column; align-items: stretch; }
  .wire { flex: 0 0 32px; width: 2px; height: 32px; align-self: center; }
  .wire span { width: 100%; height: 40%; background: linear-gradient(180deg, transparent, var(--on-air), transparent); animation-name: signal-down; }
  @keyframes signal-down { from { transform: translateY(-100%); } to { transform: translateY(260%); } }
  .plan-grid { grid-template-columns: 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .dest-foot label.compact { flex: 1 1 100%; }
  .card.platform { padding: 18px 14px 14px; }
  .account { padding: 14px 12px 12px; }
  .dest-foot label.compact select { flex: 1; }
  .topbar { padding: 14px 16px; }
  .topbar nav { gap: 12px; font-size: .9rem; }
  .brand span { font-size: 1rem; }
  .brand img { width: 28px; height: 28px; }
  .topbar .button.small { padding: 8px 12px; }
  .card { padding: 18px; }
  .kv { grid-template-columns: 1fr; gap: 4px; }
  .kv dd { margin-bottom: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .wire span, .lamp[data-state=live] { animation: none; }
}
