/* streamtts — warm, bold, a little brutalist. cream paper, hard shadows,
   pressable buttons. no framework, no build step. */

:root {
  --bg: #eeefe9;
  --surface: #ffffff;
  --ink: #151619;
  --muted: #5b5d66;
  --accent: #ff4a1c;
  --blue: #1d4aff;
  --good: #1d8a4e;
  --bad: #c0392b;
  --radius: 10px;
  --shadow: 3px 3px 0 var(--ink);
  --shadow-lg: 5px 5px 0 var(--ink);
  --mono: ui-monospace, "SF Mono", "Roboto Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  background-image: radial-gradient(rgba(21, 22, 25, 0.06) 1px, transparent 1px);
  background-size: 22px 22px;
  color: var(--ink);
  font-family: "Space Grotesk", system-ui, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 640px; margin: 0 auto; padding: 60px 20px 96px; }

/* ---- header ---- */
header.site { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.wordmark { font-size: 25px; font-weight: 700; letter-spacing: -0.03em; }
.wordmark a { color: var(--ink); text-decoration: none; }
.wordmark a::after { content: "."; color: var(--accent); }
.chip {
  font: 600 11px/1 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 5px 9px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--surface);
}
.chip.beta { background: var(--blue); color: #fff; }
.spacer { flex: 1; }
.nav-link {
  font: 600 13px/1 var(--mono); color: var(--ink); text-decoration: none;
  border: 2px solid var(--ink); border-radius: 999px; padding: 7px 12px;
  background: var(--surface); box-shadow: var(--shadow);
  transition: transform 0.04s ease, box-shadow 0.04s ease;
}
.nav-link:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }

.tagline {
  margin: -8px 0 22px;
  max-width: 52ch;
  font-size: 15px;
  line-height: 1.5;
  color: var(--muted);
}
.tagline em { font-style: italic; color: var(--ink); }

/* ---- card ---- */
.panel {
  position: relative;
  background: var(--surface);
  border: 2px solid var(--ink);
  border-top-width: 6px;
  border-top-color: var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 22px;
}

/* ---- inputs ---- */
textarea {
  width: 100%;
  min-height: 184px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 16px;
  line-height: 1.5;
  padding: 14px;
  resize: vertical;
}
textarea::placeholder { color: #a3a5ac; }
textarea:focus { outline: none; border-color: var(--accent); box-shadow: 2px 2px 0 var(--accent); }

.row { display: flex; align-items: center; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.counter { font: 500 13px/1 var(--mono); color: var(--muted); }

/* custom dropdown — the native <select> popup can't be styled, so we roll our own */
.select { position: relative; }
.select-btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 2px solid var(--ink); border-radius: 8px;
  background: #fff; color: var(--ink);
  font-family: inherit; font-size: 14px; font-weight: 500;
  padding: 9px 12px; cursor: pointer;
}
.select-btn .chev { width: 12px; height: 12px; flex-shrink: 0; transition: transform 0.12s ease; }
.select.open .select-btn { border-color: var(--accent); }
.select.open .chev { transform: rotate(180deg); }

.select-menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 30;
  min-width: 100%; margin: 0; padding: 6px; list-style: none;
  background: var(--surface); border: 2px solid var(--ink);
  border-radius: 10px; box-shadow: var(--shadow-lg);
}
.select-menu li {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px 8px 8px; border-radius: 6px; cursor: pointer;
  font-size: 14px; white-space: nowrap; color: var(--ink);
}
.select-menu li .tick { width: 14px; height: 14px; flex-shrink: 0; opacity: 0; }
.select-menu li:hover { background: var(--bg); }
.select-menu li[aria-selected="true"] { background: var(--accent); color: #fff; font-weight: 500; }
.select-menu li[aria-selected="true"] .tick { opacity: 1; }

/* ---- pressable buttons (the posthog "sticker" feel) ---- */
button.primary, .share button, .playbtn {
  font-family: inherit;
  border: 2px solid var(--ink);
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.04s ease, box-shadow 0.04s ease;
}
button.primary:hover, .share button:hover, .playbtn:hover {
  transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink);
}
button.primary:active, .share button:active, .playbtn:active {
  transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink);
}

button.primary {
  font-size: 15px; font-weight: 700;
  background: var(--accent); color: #fff;
  border-radius: 8px; padding: 11px 20px;
}
button.primary:disabled {
  opacity: 0.55; cursor: default; transform: none; box-shadow: var(--shadow);
}

.error {
  margin-top: 14px; font-size: 14px; font-weight: 500;
  color: var(--bad); background: #fdecea;
  border: 1.5px solid var(--bad); border-radius: 8px; padding: 9px 12px;
}

/* ---- player ---- */
.cast-title { font-size: 21px; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 6px; }
.cast-sub { color: var(--muted); font-size: 13px; margin-bottom: 22px; display: flex; gap: 10px; align-items: center; }

.badge {
  font: 700 11px/1 var(--mono);
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 5px 9px; border-radius: 999px; border: 1.5px solid var(--ink);
}
.badge.live { background: var(--accent); color: #fff; }
.badge.live::before { content: "●"; margin-right: 5px; animation: pulse 1.3s infinite; }
.badge.replay { background: var(--surface); color: var(--muted); }
@keyframes pulse { 50% { opacity: 0.3; } }

.controls { display: flex; align-items: center; gap: 16px; }
.playbtn {
  width: 58px; height: 58px; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: 20px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.playbtn:disabled { opacity: 0.5; transform: none; box-shadow: var(--shadow); cursor: default; }

.progress { flex: 1; }
.bar {
  height: 12px; background: #fff;
  border: 2px solid var(--ink); border-radius: 999px;
  position: relative; cursor: pointer; overflow: hidden;
}
.bar .fill { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--accent); }
.times { display: flex; justify-content: space-between; color: var(--muted); font: 500 12px/1 var(--mono); margin-top: 8px; }

.captions { margin-top: 26px; display: flex; flex-direction: column; gap: 2px; }
.captions p {
  margin: 0; padding: 7px 11px; border-radius: 7px;
  color: var(--muted); cursor: pointer;
  border: 1.5px solid transparent;
  transition: background 0.12s, color 0.12s;
}
.captions p:hover { background: var(--bg); }
.captions p.active { color: var(--ink); font-weight: 500; background: var(--bg); border-color: var(--ink); }
.captions p.pending { opacity: 0.4; }

.share { display: flex; gap: 8px; margin-top: 26px; }
.share input {
  flex: 1; border: 2px solid var(--ink); border-radius: 8px;
  background: #fff; color: var(--muted);
  font: 13px/1 var(--mono); padding: 11px 12px;
}
.share input:focus { outline: none; border-color: var(--accent); }
.share button {
  font-size: 13px; font-weight: 700;
  background: var(--surface); color: var(--ink);
  border-radius: 8px; padding: 0 16px;
}

.tools { display: flex; gap: 8px; margin-top: 16px; }
.pill {
  font: 700 13px/1 var(--mono); letter-spacing: 0.02em;
  background: var(--surface); color: var(--ink);
  border: 2px solid var(--ink); border-radius: 999px;
  padding: 7px 14px; cursor: pointer; box-shadow: var(--shadow);
  transition: transform 0.04s ease, box-shadow 0.04s ease;
}
.pill:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.pill:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.pill:disabled { opacity: 0.45; cursor: default; transform: none; box-shadow: var(--shadow); }

.status { margin-top: 18px; font: 500 14px/1.4 var(--mono); color: var(--muted); }

/* ---- live S2 stream tap (proof the link is a stream, not a file) ---- */
.stream-tap {
  max-width: 600px; margin: 16px auto 0;
  background: var(--surface); border: 2px solid var(--ink); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 12px 16px;
}
.stream-tap summary {
  cursor: pointer; font: 700 12px/1 var(--mono);
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink);
}
.stream-tap .tap-host { color: var(--muted); font-weight: 500; text-transform: none; letter-spacing: 0; margin-left: 8px; }
.tap-note { color: var(--muted); font-size: 13px; margin: 10px 0; }
.tap-rows {
  max-height: 180px; overflow-y: auto;
  font: 500 12px/1.7 var(--mono); border-top: 1.5px solid var(--ink); padding-top: 8px;
}
.tap-row { display: flex; gap: 12px; align-items: baseline; }
.tap-seq { color: var(--muted); width: 52px; }
.tap-e { font-weight: 700; width: 60px; }
.tap-e.tap-audio { color: var(--accent); }
.tap-e.tap-eos { color: var(--good); }
.tap-e.tap-meta, .tap-e.tap-start { color: var(--blue); }
.tap-sz { color: var(--muted); margin-left: auto; }
