/* Viziblu design system
   Monochrome, editorial, generous whitespace. One accent: on-air red, used only for live state and destructive actions. */

@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 400 700;
  src: url("/assets/fonts/instrument-sans-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 400 700;
  src: url("/assets/fonts/instrument-sans-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* color */
  --paper: #ffffff;
  --ink: #000000;
  --graphite: #5e5e5e;
  --line: #e4e4e4;
  --wash: #f5f5f3;
  --on-air: #e1261c;
  --on-air-ink: #b3150d;
  --focus: #000000;

  /* type */
  --font: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --t-display: clamp(3rem, 9vw, 7.5rem);
  --t-h1: clamp(2rem, 4vw, 3rem);
  --t-h2: 1.375rem;
  --t-body: 1rem;
  --t-small: .875rem;

  /* space */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 72px; --s9: 112px;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1200px;
  --control: 48px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; background: var(--paper); color: var(--ink); }
body { font: 400 var(--t-body)/1.55 var(--font); min-height: 100vh; display: flex; flex-direction: column; }
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

h1, h2, h3, p { margin: 0; }
h1 { font-size: var(--t-h1); font-weight: 600; line-height: 1.05; letter-spacing: -.03em; }
h2 { font-size: var(--t-h2); font-weight: 600; line-height: 1.2; letter-spacing: -.015em; }
h3 { font-size: 1.0625rem; font-weight: 600; line-height: 1.3; }
.muted { color: var(--graphite); }
.small { font-size: var(--t-small); }

/* ---------- layout */
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
main { flex: 1; }
.page { padding-top: var(--s7); padding-bottom: var(--s9); }
.page-narrow { max-width: 720px; }

/* ---------- header */
.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: var(--s5); min-height: 72px; }
.wordmark { font-size: 1.375rem; font-weight: 700; letter-spacing: -.04em; text-decoration: none; }
.nav { display: flex; align-items: center; gap: var(--s5); font-size: var(--t-small); }
.nav a { text-decoration: none; }
.nav a:hover, .nav a[aria-current="page"] { text-decoration: underline; }
.nav .who { color: var(--graphite); max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-footer { border-top: 1px solid var(--line); padding: var(--s6) 0; font-size: var(--t-small); color: var(--graphite); }

/* ---------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: var(--control); padding: 0 var(--s5);
  font: 600 .9375rem/1 var(--font); letter-spacing: -.005em; text-decoration: none; white-space: nowrap;
  color: var(--paper); background: var(--ink); border: 1px solid var(--ink); border-radius: 0; cursor: pointer;
}
.btn:hover { background: #262626; text-decoration: none; }
.btn:disabled { opacity: .35; cursor: not-allowed; }
.btn-outline { color: var(--ink); background: var(--paper); }
.btn-outline:hover { background: var(--wash); }
.btn-danger { color: var(--on-air-ink); background: var(--paper); border-color: var(--on-air-ink); }
.btn-danger:hover { background: #fff3f2; }
.btn-small { min-height: 40px; padding: 0 var(--s4); font-size: var(--t-small); }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; text-underline-offset: .2em; cursor: pointer; }
.back { display: inline-block; font-size: var(--t-small); margin-bottom: var(--s5); }

/* ---------- forms */
.field { display: grid; gap: var(--s2); margin-bottom: var(--s5); }
.field > label, .label { font-size: var(--t-small); font-weight: 600; }
.hint { font-size: var(--t-small); color: var(--graphite); }
.input {
  width: 100%; min-height: var(--control); padding: 0 var(--s4);
  font: 400 1rem/1.4 var(--font); color: var(--ink); background: var(--paper);
  border: 1px solid #bdbdbd; border-radius: 0;
}
.input:hover { border-color: var(--ink); }
.input:focus { outline: none; border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.input[aria-invalid="true"] { border-color: var(--on-air-ink); }
.input-prefix { display: flex; align-items: stretch; }
.input-prefix span { display: flex; align-items: center; padding: 0 var(--s3); background: var(--wash); border: 1px solid #bdbdbd; border-right: 0; color: var(--graphite); font-size: .9375rem; white-space: nowrap; }
.form-error { color: var(--on-air-ink); font-size: var(--t-small); }

/* ---------- copy fields */
.copy { display: grid; gap: var(--s2); margin-bottom: var(--s5); }
.copy-row { display: flex; gap: var(--s2); }
.copy-row .input { font-family: var(--mono); font-size: .875rem; background: var(--wash); border-color: var(--wash); min-width: 0; }
.copy-row .input:hover { border-color: var(--wash); }

/* ---------- live state */
.live { display: inline-flex; align-items: center; gap: var(--s2); font-size: var(--t-small); font-weight: 600; white-space: nowrap; }
.live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #b5b5b5; flex: none; }
.live[data-live="true"]::before { background: var(--on-air); animation: pulse 1.6s ease-in-out infinite; }
.live[data-live="false"] { color: var(--graphite); font-weight: 400; }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .live[data-live="true"]::before { animation: none; } }

/* ---------- player */
.player { position: relative; aspect-ratio: 16 / 9; background: var(--ink); overflow: hidden; }
.player video { width: 100%; height: 100%; background: var(--ink); }
.player-overlay { position: absolute; inset: 0; display: grid; place-items: center; padding: var(--s5); color: #bdbdbd; text-align: center; background: var(--ink); pointer-events: none; }

/* ---------- landing */
.hero { padding-top: var(--s8); padding-bottom: var(--s7); }
.hero h1 { font-size: var(--t-display); line-height: .95; letter-spacing: -.042em; word-spacing: .04em; font-weight: 600; max-width: 13ch; }
.hero .lede { margin-top: var(--s6); font-size: 1.1875rem; max-width: 46ch; color: var(--graphite); }
.hero .actions { margin-top: var(--s6); display: flex; gap: var(--s3); flex-wrap: wrap; }
.stage { position: relative; aspect-ratio: 16 / 9; background: var(--ink); color: var(--paper); margin-top: var(--s7); overflow: hidden; }
.stage .on-air { position: absolute; top: var(--s5); left: var(--s5); color: var(--paper); }
.stage .on-air::before { background: var(--on-air); }
.stage .slide { position: absolute; inset: 14% 22% 14% 8%; background: var(--paper); color: var(--ink); padding: clamp(16px, 4vw, 48px); display: flex; flex-direction: column; justify-content: space-between; }
.stage .slide strong { font-size: clamp(1rem, 3.2vw, 2.5rem); letter-spacing: -.035em; line-height: 1; font-weight: 600; }
.stage .slide span { display: block; height: clamp(4px, .8vw, 10px); background: var(--line); }
.stage .slide span + span { margin-top: clamp(4px, .8vw, 10px); width: 70%; }
.stage .speaker { position: absolute; right: 4%; bottom: 14%; width: 14%; aspect-ratio: 1; background: #2a2a2a; display: grid; place-items: center; font-weight: 600; font-size: clamp(.75rem, 2vw, 1.5rem); color: #d8d8d8; }
.stage .url { position: absolute; left: var(--s5); bottom: var(--s5); font-size: var(--t-small); color: #bdbdbd; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s6); margin-top: var(--s6); padding: 0; list-style: none; counter-reset: step; }
.steps li { border-top: 1px solid var(--ink); padding-top: var(--s4); counter-increment: step; }
.steps li::before { content: counter(step); display: block; font-size: 2.5rem; font-weight: 600; letter-spacing: -.04em; line-height: 1; margin-bottom: var(--s5); }
.steps p { color: var(--graphite); margin-top: var(--s2); }
.section { padding-top: var(--s9); }

/* ---------- auth */
.auth { max-width: 420px; padding-top: var(--s8); padding-bottom: var(--s9); }
.auth h1 { margin-bottom: var(--s6); }
.auth .hint { margin-top: var(--s5); }

/* ---------- dashboard list */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s5); flex-wrap: wrap; padding-bottom: var(--s5); border-bottom: 1px solid var(--ink); }
.events { list-style: none; margin: 0; padding: 0; }
.event-row { display: grid; grid-template-columns: 1fr auto auto; gap: var(--s5); align-items: center; padding: var(--s5) 0; border-bottom: 1px solid var(--line); }
.event-row a.title { font-size: 1.125rem; font-weight: 600; letter-spacing: -.01em; text-decoration: none; }
.event-row a.title:hover { text-decoration: underline; }
.event-row .url { font-size: var(--t-small); color: var(--graphite); margin-top: 2px; word-break: break-all; }
.event-row .source { font-size: var(--t-small); color: var(--graphite); }
.empty { padding: var(--s8) 0; max-width: 52ch; }
.empty p { color: var(--graphite); margin: var(--s3) 0 var(--s5); }

/* ---------- source picker */
.sources-field { border: 0; padding: 0; margin: 0 0 var(--s6); min-width: 0; }
.sources-field legend { padding: 0; margin-bottom: var(--s2); }
.page-narrow h1 { margin-bottom: var(--s6); }
.sources { display: grid; gap: var(--s2); }
.source-option { display: grid; grid-template-columns: auto 1fr; gap: var(--s3); align-items: start; padding: var(--s4); border: 1px solid #bdbdbd; cursor: pointer; }
.source-option:hover { border-color: var(--ink); }
.source-option:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.source-option:has(input:disabled) { cursor: not-allowed; color: var(--graphite); border-style: dashed; }
.source-option input { margin: 4px 0 0; accent-color: var(--ink); width: 18px; height: 18px; }
.source-option strong { display: block; font-weight: 600; }
.source-option small { display: block; color: var(--graphite); font-size: var(--t-small); }

/* ---------- event detail */
.event-head { display: grid; gap: var(--s3); padding-bottom: var(--s6); border-bottom: 1px solid var(--ink); }
.event-head .meta { display: flex; gap: var(--s5); align-items: center; flex-wrap: wrap; font-size: var(--t-small); }
.cols { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: var(--s8); padding-top: var(--s6); }
.cols h2 { margin-bottom: var(--s5); }
.share { margin-top: var(--s6); padding: var(--s5); background: var(--wash); }
.share p { font-size: var(--t-small); color: var(--graphite); margin: var(--s2) 0 var(--s4); }
.tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 1px; background: var(--ink); border: 1px solid var(--ink); margin-bottom: var(--s5); }
.tab { min-height: 44px; padding: 0 var(--s3); font: 500 var(--t-small)/1.2 var(--font); color: var(--ink); background: var(--paper); border: 0; cursor: pointer; }
.tab[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.instructions ol { margin: 0; padding-left: 1.25rem; }
.instructions li { margin-bottom: var(--s3); padding-left: var(--s1); }
.instructions .req { margin-bottom: var(--s5); padding: var(--s4); border-left: 2px solid var(--ink); background: var(--wash); font-size: var(--t-small); }
.instructions .req ul { margin: var(--s2) 0 0; padding-left: 1.1rem; }
.instructions .notes { margin-top: var(--s5); font-size: var(--t-small); color: var(--graphite); }
.instructions .notes p + p { margin-top: var(--s2); }
.settings { margin-top: var(--s9); padding-top: var(--s6); border-top: 1px solid var(--ink); }
.settings-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s5); align-items: center; padding: var(--s5) 0; border-bottom: 1px solid var(--line); }
.settings-row.single { grid-template-columns: 1fr; }
.settings-row.single .field { margin-bottom: 0; }
.settings-row p { font-size: var(--t-small); color: var(--graphite); margin-top: 2px; }
.inline-form { display: flex; gap: var(--s2); }

/* ---------- watch */
.watch { padding-top: var(--s6); padding-bottom: var(--s8); }
.watch h1 { margin-bottom: var(--s5); }
.watch .below { display: flex; justify-content: space-between; gap: var(--s5); flex-wrap: wrap; margin-top: var(--s4); font-size: var(--t-small); color: var(--graphite); }

/* ---------- toast + dialog */
.toast { position: fixed; left: 50%; bottom: var(--s6); transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: var(--s3) var(--s5); font-size: var(--t-small); font-weight: 600; z-index: 10; }
dialog { border: 1px solid var(--ink); border-radius: 0; padding: var(--s6); max-width: 460px; width: calc(100% - 32px); }
dialog::backdrop { background: rgba(0, 0, 0, .4); }
dialog h2 { margin-bottom: var(--s3); }
dialog p { color: var(--graphite); }
dialog .actions { display: flex; gap: var(--s2); justify-content: flex-end; margin-top: var(--s6); flex-wrap: wrap; }

/* ---------- responsive */
@media (max-width: 860px) {
  .cols { grid-template-columns: minmax(0, 1fr); gap: var(--s7); }
  .steps { grid-template-columns: 1fr; }
  .event-row { grid-template-columns: 1fr auto; }
  .event-row .source { display: none; }
  .settings-row { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .tabs { grid-auto-flow: row; grid-template-columns: 1fr 1fr; }
  .stage { aspect-ratio: 4 / 3; }
  .stage .on-air { top: var(--s4); left: var(--s4); }
  .stage .url { left: var(--s4); bottom: var(--s4); font-size: .75rem; }
  .stage .slide { inset: 48px 30% 48px var(--s4); padding: var(--s4); }
  .stage .speaker { right: var(--s4); bottom: 48px; width: 22%; }
  .section { padding-top: var(--s8); }
  .nav .who { display: none; }
  .copy-row { flex-wrap: wrap; }
  .copy-row .input { flex: 1 1 100%; }
  .copy-row .btn { flex: 1; }
  .inline-form { flex-direction: column; }
  .page-head .btn { width: 100%; }
}
