/* ============================================================
   PostCast - Design System
   Dark, modern, Riverside-inspired. Ginstergelb accent.
   ============================================================ */

:root {
  /* Brand */
  --brand: #E1C700;
  --brand-600: #c5ae00;
  --brand-700: #9f8d00;
  --brand-glow: rgba(225, 199, 0, 0.35);
  --accent-2: #ffb800;

  /* Surfaces */
  --bg: #0b0f12;
  --bg-2: #0f151a;
  --surface: #141b21;
  --surface-2: #1a232b;
  --surface-3: #212c35;
  --elevated: #182129;

  /* Text */
  --text: #eef4f2;
  --text-dim: #a7b4bd;
  --text-mute: #6d7d88;

  /* Lines */
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);

  /* Status */
  --danger: #ff5470;
  --danger-glow: rgba(255, 84, 112, 0.35);
  --warn: #ffb020;
  --ok: #E1C700;
  --info: #3ea6ff;

  /* Effects */
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --radius-pill: 999px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.35);
  --glow: 0 0 0 1px var(--border), 0 12px 40px rgba(0, 0, 0, 0.5);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: 'SF Mono', 'JetBrains Mono', 'Fira Code', ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(225, 199, 0, 0.10), transparent 60%),
    radial-gradient(1000px 700px at -10% 10%, rgba(255, 184, 0, 0.08), transparent 55%),
    var(--bg);
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* ---------- Layout helpers ---------- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.between { justify-content: space-between; }
.center { justify-content: center; align-items: center; }
.grow { flex: 1; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.hidden { display: none !important; }
.mono { font-family: var(--mono); }
.dim { color: var(--text-dim); }
.mute { color: var(--text-mute); }

/* ---------- Buttons ---------- */
.btn {
  --b: var(--surface-3);
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 18px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--b);
  color: var(--text);
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
  user-select: none;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-600));
  color: #231f00; border: none;
  box-shadow: 0 8px 24px var(--brand-glow);
}
.btn-primary:hover { box-shadow: 0 12px 32px var(--brand-glow); }

.btn-danger {
  background: linear-gradient(135deg, var(--danger), #e23a55);
  color: #fff; border: none;
  box-shadow: 0 8px 24px var(--danger-glow);
}

.btn-ghost { background: transparent; border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--surface-2); }

.btn-icon {
  width: 46px; height: 46px; padding: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
}
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-lg { padding: 16px 28px; font-size: 16px; }

.btn.active { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand), 0 0 24px var(--brand-glow); }

/* ---------- Cards / panels ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.glass {
  background: rgba(20, 27, 33, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.panel-title {
  font-size: 13px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--text-mute);
  margin: 0 0 12px;
}

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px;
  background: rgba(11, 15, 18, 0.6);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 18px; letter-spacing: -.01em; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-700));
  box-shadow: 0 6px 18px var(--brand-glow);
  color: #231f00; font-weight: 900;
}
.nav-links { display: flex; align-items: center; gap: 8px; }
.nav-links a { padding: 8px 14px; border-radius: var(--radius-pill); color: var(--text-dim); font-weight: 600; font-size: 14px; }
.nav-links a:hover { color: var(--text); background: var(--surface-2); }

/* ---------- Badges / chips ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: var(--radius-pill);
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 12px; font-weight: 600; color: var(--text-dim);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-mute); }
.dot.live { background: var(--danger); box-shadow: 0 0 10px var(--danger); animation: pulse 1.4s infinite; }
.dot.on { background: var(--ok); box-shadow: 0 0 10px var(--ok-glow, var(--ok)); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 13px; font-weight: 600; color: var(--text-dim); }
select, input[type=text], input[type=number], textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
select:focus, input:focus, textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow);
}
select { appearance: none; cursor: pointer; }

.toggle {
  position: relative; width: 46px; height: 26px; border-radius: 999px;
  background: var(--surface-3); border: 1px solid var(--border); cursor: pointer;
  transition: background .2s ease; flex: none;
}
.toggle::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 20px; height: 20px; border-radius: 50%; background: #fff;
  transition: transform .2s ease;
}
.toggle.on { background: var(--brand); }
.toggle.on::after { transform: translateX(20px); }

/* ---------- Toasts ---------- */
#toasts {
  position: fixed; right: 20px; bottom: 20px; z-index: 1000;
  display: flex; flex-direction: column; gap: 10px; max-width: 360px;
}
.toast {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--elevated); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px;
  box-shadow: var(--shadow); animation: slideIn .25s ease;
}
.toast .ic { font-size: 16px; }
.toast.success { border-left: 3px solid var(--ok); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.info { border-left: 3px solid var(--info); }
@keyframes slideIn { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(6px);
  display: grid; place-items: center; padding: 20px;
}
.modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px;
  width: 100%; max-width: 460px; box-shadow: var(--shadow);
}
.modal h3 { margin: 0 0 8px; }

/* ---------- Utility text ---------- */
.muted { color: var(--text-mute); }
.small { font-size: 12px; }
.tag { font-size: 11px; padding: 3px 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-dim); }

/* ============================================================
   Landing page
   ============================================================ */
.hero {
  position: relative; padding: 90px 0 70px; text-align: center;
  overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(700px 380px at 50% 0%, var(--brand-glow), transparent 70%);
  opacity: .5;
}
.hero h1 {
  font-size: clamp(34px, 6vw, 68px); line-height: 1.02;
  letter-spacing: -.03em; margin: 0 auto 20px; max-width: 900px; font-weight: 800;
}
.hero h1 .grad {
  background: linear-gradient(135deg, var(--brand), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.lead { font-size: 19px; color: var(--text-dim); max-width: 620px; margin: 0 auto 30px; line-height: 1.6; }
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.trust { margin-top: 34px; display: flex; gap: 22px; justify-content: center; flex-wrap: wrap; color: var(--text-mute); font-size: 13px; }

.section { padding: 64px 0; }
.section h2 { font-size: 30px; letter-spacing: -.02em; margin: 0 0 8px; text-align: center; }
.section .sub { text-align: center; color: var(--text-dim); max-width: 640px; margin: 0 auto 40px; font-size: 16px; line-height: 1.6; }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature {
  padding: 24px; border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--border);
  transition: transform .18s ease, border-color .18s ease;
}
.feature:hover { transform: translateY(-4px); border-color: var(--border-strong); }
.feature .emoji { font-size: 28px; margin-bottom: 12px; display: block; }
.feature h3 { margin: 0 0 8px; font-size: 17px; }
.feature p { margin: 0; color: var(--text-dim); font-size: 14px; line-height: 1.6; }

.split { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.split .visual {
  aspect-ratio: 16/10; border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, var(--surface-2), var(--bg-2));
  border: 1px solid var(--border);
  box-shadow: var(--shadow); position: relative; overflow: hidden;
  display: grid; place-items: center;
}
.split ul { list-style: none; padding: 0; margin: 18px 0 0; }
.split ul li { display: flex; gap: 12px; padding: 8px 0; color: var(--text-dim); font-size: 15px; }
.split ul li .ok { color: var(--brand); font-weight: 800; }

.cta-band {
  text-align: center; padding: 60px 24px;
  background: linear-gradient(135deg, rgba(225,199,0,.12), rgba(255,184,0,.10));
  border: 1px solid var(--border); border-radius: var(--radius-lg);
}
.cta-band h2 { font-size: 32px; margin: 0 0 12px; }
.cta-band p { color: var(--text-dim); margin: 0 0 26px; }

.footer { padding: 32px 0; color: var(--text-mute); font-size: 13px; text-align: center; border-top: 1px solid var(--border); margin-top: 40px; }

/* ============================================================
   Studio
   ============================================================ */
.studio { display: grid; grid-template-columns: 1fr 360px; gap: 18px; padding: 18px 24px; min-height: 100vh; }
.studio-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; border-bottom: 1px solid var(--border); }
.studio-body { padding: 0; }

.stage { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.stage-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}
.tile {
  position: relative; aspect-ratio: 16/9; border-radius: var(--radius);
  background: #05080a; border: 1px solid var(--border);
  overflow: hidden; display: grid; place-items: center;
}
.tile video { width: 100%; height: 100%; object-fit: cover; background: #000; }
.tile .tile-label {
  position: absolute; left: 10px; bottom: 10px; z-index: 2;
  background: rgba(0,0,0,.55); padding: 4px 10px; border-radius: 8px;
  font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 6px;
}
.tile .tile-mic { position: absolute; right: 10px; bottom: 10px; z-index: 2; font-size: 14px; }
.tile .muted-veil { position: absolute; inset: 0; background: rgba(5,8,10,.55); display: grid; place-items: center; color: var(--text-dim); font-size: 13px; }
.tile.no-source .ph { color: var(--text-mute); text-align: center; padding: 20px; }

/* Transport / control bar */
.transport {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px 18px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius);
}
.transport-center { display: flex; align-items: center; gap: 18px; }
.transport-controls { display: flex; gap: 12px; align-items: center; }
.timer {
  font-family: var(--mono); font-size: 26px; font-weight: 700;
  letter-spacing: .04em; min-width: 130px; text-align: center;
}
.timer.rec { color: var(--danger); }

.rec-btn {
  width: 66px; height: 66px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,.25);
  background: var(--danger); cursor: pointer;
  display: grid; place-items: center;
  box-shadow: 0 0 0 6px var(--danger-glow), 0 10px 30px var(--danger-glow);
  transition: transform .12s ease;
}
.rec-btn:active { transform: scale(.94); }
.rec-btn .rec-inner { width: 26px; height: 26px; border-radius: 8px; background: #fff; transition: all .2s; }
.rec-btn.recording .rec-inner { border-radius: 6px; width: 20px; height: 20px; }

/* Level meter */
.meter { display: flex; align-items: center; gap: 8px; }
.meter-bar { flex: 1; height: 6px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.meter-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--ok), var(--warn) 78%, var(--danger)); transition: width .06s linear; }

/* Side panel */
.side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.track-list { display: flex; flex-direction: column; gap: 8px; }
.track-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border);
}
.track-row .tk-ic { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-3); font-size: 15px; flex: none; }
.track-row audio { height: 34px; flex: 1; }

/* Captions */
.captions {
  height: 220px; overflow-y: auto; padding: 12px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 14px; line-height: 1.5;
}
.caption-line { padding: 4px 0; border-bottom: 1px solid rgba(255,255,255,.04); }
.caption-line .who { color: var(--brand); font-weight: 700; margin-right: 8px; }
.caption-line.interim { color: var(--text-mute); font-style: italic; }

/* Studio tabs */
.tabs { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.tab {
  flex: 1; text-align: center; padding: 9px; border-radius: 8px;
  font-size: 13px; font-weight: 600; color: var(--text-dim); cursor: pointer;
}
.tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* Recording overlay */
.rec-overlay {
  position: fixed; inset: 0; z-index: 200; display: none;
  background: rgba(5,8,10,.85); backdrop-filter: blur(8px);
  place-items: center;
}
.rec-overlay.show { display: grid; }
.rec-card { text-align: center; padding: 40px; }
.rec-card .big-timer { font-family: var(--mono); font-size: 64px; font-weight: 800; }

/* Library */
.library { max-width: 1100px; margin: 0 auto; padding: 24px; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; margin-top: 24px; }
.lib-card { overflow: hidden; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); transition: transform .15s ease; }
.lib-card:hover { transform: translateY(-3px); }
.lib-card .thumb { aspect-ratio: 16/9; background: #05080a; position: relative; display: grid; place-items: center; }
.lib-card .thumb video { width: 100%; height: 100%; object-fit: cover; }
.lib-card .meta { padding: 14px; }
.lib-card .meta h4 { margin: 0 0 4px; font-size: 15px; }
.lib-actions { display: flex; gap: 8px; padding: 0 14px 14px; flex-wrap: wrap; }

/* Preview modal player */
.player { width: 100%; aspect-ratio: 16/9; background: #000; border-radius: var(--radius); overflow: hidden; }
.player video, .player audio { width: 100%; height: 100%; display: block; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .studio { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; gap: 28px; }
  .nav-links a.hide-sm { display: none; }
}

/* Scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 10px; }
::-webkit-scrollbar-track { background: transparent; }

/* File input button */
.file-btn { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }

/* PostCast · Ginstergelb */
.room-panel { border-color: rgba(225,199,0,.28); background: linear-gradient(120deg,rgba(225,199,0,.06),var(--surface) 65%); }
.eyebrow { color:var(--brand); font-size:11px; letter-spacing:.18em; font-weight:800; }
.room-panel h2 { font-size:21px; margin:8px 0 16px; }
.room-fields { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.consent { display:flex; align-items:flex-start; gap:10px; margin:16px 0; color:var(--text-dim); font-size:13px; line-height:1.5; }
input[type=checkbox] { accent-color:var(--brand); }
.recording-notice { color:var(--danger); font-weight:700; }
.rec-overlay.show { inset:auto 24px 20px auto; background:var(--surface); border:1px solid var(--danger); border-radius:20px; box-shadow:var(--shadow); }
.rec-card { padding:14px 20px; }
.rec-card .big-timer { font-size:32px; }
.product-preview { padding:24px; text-align:left; background:#111113; }
.preview-top,.preview-bottom { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.preview-top strong { color:var(--brand); font-size:22px; }
.preview-top>span { font-size:10px; letter-spacing:.12em; }
.preview-people { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; margin:24px 0; }
.preview-people>div { min-height:200px; border-radius:16px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:20px; background:radial-gradient(ellipse at top,rgba(225,199,0,.15),#202023); border:1px solid var(--border); }
.preview-people span { display:grid; place-items:center; width:80px; height:80px; border-radius:50%; background:var(--brand); color:#231f00; font-size:26px; font-weight:800; }
.preview-people strong,.preview-bottom { font-size:12px; }
.preview-bottom>span:first-child { color:var(--brand); letter-spacing:3px; }
@media(max-width:650px) { .room-fields{grid-template-columns:1fr} .studio{padding:12px} .studio-head{flex-wrap:wrap;gap:12px} .transport{flex-wrap:wrap} .preview-top>span,.preview-bottom>span:last-child{display:none} .preview-people>div{min-height:150px} .preview-people span{width:50px;height:50px} .rec-overlay.show{right:12px;bottom:12px} }
.stage-grid:has(> :nth-child(4)) { grid-template-columns:repeat(2,minmax(0,1fr)); }
#tracks-list { max-height:70vh; overflow:auto; }
@media(max-width:600px) { .stage-grid:has(> :nth-child(4)) { grid-template-columns:1fr; } }
