/* Sublim Recorder — interface styles.
   One memorable object (the recording console); everything else stays quiet.
   Selectors are single classes on purpose, to avoid specificity fights. */

@font-face { font-family: "Bitter"; src: url("../fonts/bitter-var.woff") format("woff"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Fira Sans"; src: url("../fonts/fira-400.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Fira Sans"; src: url("../fonts/fira-400i.woff") format("woff"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Fira Sans"; src: url("../fonts/fira-500.woff") format("woff"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Fira Sans"; src: url("../fonts/fira-600.woff") format("woff"); font-weight: 600; font-display: swap; }

:root {
  --paper: #edf0f3;
  --panel: #fafbfc;
  --ink: #1b2233;
  --muted: #4a5568;
  --rule: #cbd2dc;
  --rule-soft: #dde2e9;
  --signal: #3147d6;
  --signal-deep: #2536ae;
  --signal-wash: #e3e7fb;
  --rec: #d92d2d;
  --rec-wash: #fbe7e7;
  --ok: #1f7a57;
  --ok-wash: #def1e9;
  --warn: #8a5300;
  --warn-wash: #f8ecd2;
  --f-display: "Bitter", Georgia, "Times New Roman", serif;
  --f-text: "Fira Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r-sm: 6px;
  --r-lg: 14px;
  --rail: 15rem;
  --gap: 1rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 1rem/1.55 var(--f-text); font-feature-settings: "lnum", "kern";
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--f-display); font-weight: 650; line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.125rem; font-weight: 600; }
p { margin: 0 0 0.75em; }
a { color: var(--signal); text-underline-offset: 0.18em; }
a:hover { color: var(--signal-deep); }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; border-radius: 3px; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum", "lnum"; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hidden { display: none !important; }
.stack > * + * { margin-top: var(--gap); }
.stack-lg > * + * { margin-top: 2.25rem; }
.row { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.row-end { align-items: flex-end; }
.grow { flex: 1 1 auto; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 2.5rem; padding: 0.45rem 1rem; border-radius: var(--r-sm); border: 1px solid transparent;
  background: var(--signal); color: #fff; font-weight: 500; text-decoration: none; cursor: pointer;
  transition: background-color 0.12s;
}
.btn:hover { background: var(--signal-deep); color: #fff; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn-quiet { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-quiet:hover { background: var(--ink); color: var(--panel); }
.btn-plain { background: transparent; color: var(--signal); padding-inline: 0.5rem; }
.btn-plain:hover { background: var(--signal-wash); color: var(--signal-deep); }
.btn-danger { background: var(--rec); }
.btn-danger:hover { background: #b32323; }
.btn-danger-quiet { background: transparent; color: var(--rec); border-color: var(--rec); }
.btn-danger-quiet:hover { background: var(--rec); color: #fff; }
.btn-small { min-height: 2rem; padding: 0.2rem 0.7rem; font-size: 0.875rem; }
.btn-block { width: 100%; }
.btn svg { width: 1.1rem; height: 1.1rem; flex: none; }
.btn .spinner { width: 1em; height: 1em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- forms ---------- */
.field { display: block; }
.field + .field { margin-top: 1rem; }
.field-label { display: block; font-weight: 500; margin-bottom: 0.3rem; }
.field-hint { display: block; color: var(--muted); font-size: 0.875rem; margin-top: 0.3rem; }
.input, .select, .textarea {
  width: 100%; min-height: 2.6rem; padding: 0.5rem 0.75rem; background: var(--panel);
  border: 1px solid #8a94a6; border-radius: var(--r-sm);
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--ink); }
.input:focus, .select:focus, .textarea:focus { outline: 3px solid var(--signal-wash); border-color: var(--signal); }
.textarea { min-height: 6rem; resize: vertical; }
.check { display: flex; gap: 0.7rem; align-items: flex-start; cursor: pointer; }
.check input { width: 1.2rem; height: 1.2rem; margin: 0.2rem 0 0; accent-color: var(--signal); flex: none; }
.form-error { color: var(--rec); background: var(--rec-wash); padding: 0.6rem 0.8rem; border-radius: var(--r-sm); margin: 0 0 1rem; }
.form-error:empty { display: none; }
.inline-fields > .field { margin-top: 0; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0; }
.inline-fields { align-items: start; display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; }

/* ---------- status chips ---------- */
.chip { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.1rem 0.6rem; border-radius: 99px; font-size: 0.8125rem; font-weight: 500; background: var(--rule-soft); color: var(--ink); white-space: nowrap; }
.chip-scheduled { background: var(--signal-wash); color: var(--signal-deep); }
.chip-joining { background: var(--warn-wash); color: var(--warn); }
.chip-recording { background: var(--rec-wash); color: #a31f1f; }
.chip-completed { background: var(--ok-wash); color: var(--ok); }
.chip-failed { background: var(--rec-wash); color: #a31f1f; }
.chip-canceled { background: var(--rule-soft); color: var(--muted); }
.chip-role { background: var(--panel); border: 1px solid var(--rule); }
.dot { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: currentColor; flex: none; }
.dot-live { background: var(--rec); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.25; } }

/* ---------- the recording console (the one memorable object) ---------- */
.console {
  background: var(--ink); color: #e8ecf4; border-radius: var(--r-lg); padding: 1.25rem 1.4rem 1.1rem;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 18px 40px -22px rgba(27, 34, 51, 0.7);
}
.console-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; font-size: 0.875rem; color: #aab4c8; }
.console-rec { display: inline-flex; align-items: center; gap: 0.5rem; color: #ff8d8d; font-weight: 600; }
.console-rec .dot { background: #ff5a5a; animation: pulse 1.6s ease-in-out infinite; }
.console-time { font-family: var(--f-display); font-weight: 500; font-size: 3.25rem; line-height: 1; letter-spacing: -0.02em; margin: 0.9rem 0 0.2rem; color: #fff; }
.console-title { color: #cfd6e6; margin: 0 0 1rem; }
.meter { display: flex; align-items: flex-end; gap: 3px; height: 3.2rem; }
.meter-bar { flex: 1 1 0; min-width: 2px; background: #6f84ff; border-radius: 1px; height: 12%; transform-origin: bottom; }
.meter-bar.is-hot { background: #ff6b6b; }
.meter.is-live .meter-bar { animation: level var(--d, 1.1s) ease-in-out infinite alternate; animation-delay: var(--o, 0s); }
@keyframes level { from { height: 10%; } to { height: var(--h, 70%); } }
.console-foot { display: flex; gap: 1.5rem; margin-top: 1rem; padding-top: 0.8rem; border-top: 1px solid rgba(255, 255, 255, 0.12); font-size: 0.875rem; color: #aab4c8; flex-wrap: wrap; }
.console-foot b { color: #fff; font-weight: 500; }
.console a { color: #a9b6ff; }
.console a:hover { color: #fff; }

/* worker channels */
.channels { display: grid; gap: 0.5rem; }
.channel { display: grid; grid-template-columns: 6.5rem 1fr auto; gap: 0.9rem; align-items: center; padding: 0.55rem 0.9rem; border-radius: var(--r-sm); background: #252e45; color: #cfd6e6; font-size: 0.875rem; }
.channel .meter { height: 1.4rem; }
.channel.is-busy .meter-bar { background: #ff6b6b; }
.channel.is-off { opacity: 0.6; }

/* ---------- app shell ---------- */
.shell { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: 100vh; }
.rail { background: var(--ink); color: #c8d0e0; padding: 1.25rem 0.9rem; display: flex; flex-direction: column; gap: 1.25rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: inline-flex; align-items: center; gap: 0.55rem; color: #fff; text-decoration: none; font-family: var(--f-display); font-weight: 700; font-size: 1.3rem; letter-spacing: -0.02em; }
.brand:hover { color: #fff; }
.brand-mark { width: 0.8rem; height: 0.8rem; border-radius: 50%; background: var(--rec); box-shadow: 0 0 0 4px rgba(217, 45, 45, 0.28); }
.rail-org .select { background: #252e45; border-color: #3b4766; color: #fff; min-height: 2.3rem; }
.nav { display: grid; gap: 2px; }
.nav-link { display: flex; align-items: center; gap: 0.7rem; padding: 0.55rem 0.7rem; border-radius: var(--r-sm); color: #c8d0e0; text-decoration: none; font-weight: 500; }
.nav-link:hover { background: #252e45; color: #fff; }
.nav-link[aria-current="page"] { background: #fff; color: var(--ink); }
.nav-link svg { width: 1.15rem; height: 1.15rem; flex: none; }
.rail-foot { margin-top: auto; display: grid; gap: 0.6rem; font-size: 0.875rem; }
.rail-user { color: #fff; font-weight: 500; overflow-wrap: anywhere; }
.rail .btn-plain { color: #c8d0e0; justify-content: flex-start; padding-inline: 0.7rem; }
.rail .btn-plain:hover { background: #252e45; color: #fff; }
.topbar { display: none; }
.main { padding: 2rem clamp(1rem, 3vw, 2.75rem) 4rem; max-width: 74rem; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.banner { margin-bottom: 1.5rem; }
.page-head p { margin: 0.35rem 0 0; color: var(--muted); max-width: 60ch; }
.section { margin-top: 2.25rem; }
.section > h2, .section-head h2 { font-size: 1.25rem; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 0.75rem; }

/* ---------- panels, logs, tables ---------- */
.panel { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-sm); padding: 1.25rem; }
.panel-flat { background: transparent; border: 0; border-top: 2px solid var(--ink); border-radius: 0; padding: 1rem 0 0; }
.log { list-style: none; margin: 0; padding: 0; background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-sm); }
.log-row { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr) auto; gap: 1rem; align-items: center; padding: 0.8rem 1rem; border-top: 1px solid var(--rule-soft); }
.log-row:first-child { border-top: 0; }
.log-time { font-family: var(--f-display); font-weight: 500; font-size: 0.95rem; line-height: 1.25; }
.log-time small { display: block; font-family: var(--f-text); color: var(--muted); font-size: 0.8125rem; }
.log-title { font-weight: 500; overflow-wrap: anywhere; }
.log-title a { color: inherit; text-decoration: none; }
.log-title a:hover { text-decoration: underline; }
.log-sub { color: var(--muted); font-size: 0.875rem; overflow-wrap: anywhere; }
.log-actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.log-row.is-live { border-left: 4px solid var(--rec); padding-left: calc(1rem - 3px); }
.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-sm); }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-weight: 500; color: var(--muted); font-size: 0.875rem; padding: 0.6rem 1rem; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.table td { padding: 0.7rem 1rem; border-top: 1px solid var(--rule-soft); vertical-align: middle; }
.table tr:first-child td { border-top: 0; }
.empty { text-align: center; padding: 2.5rem 1.25rem; background: var(--panel); border: 1px dashed #98a2b3; border-radius: var(--r-sm); }
.empty h3 { margin-bottom: 0.4rem; }
.empty p { color: var(--muted); max-width: 46ch; margin: 0 auto 1rem; }

/* usage bar */
.usage-bar { height: 0.6rem; background: var(--rule-soft); border-radius: 99px; overflow: hidden; }
.usage-fill { height: 100%; background: var(--signal); border-radius: 99px; }
.usage-fill.is-high { background: #c27a00; }
.usage-fill.is-full { background: var(--rec); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 1.25rem 2rem; margin: 0; }
.tabs { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.facts-sm dd { font-size: 1.125rem; }
.facts dt { color: var(--muted); font-size: 0.875rem; }
.facts dd { margin: 0.1rem 0 0; font-family: var(--f-display); font-size: 1.5rem; font-weight: 600; }
.facts dd small { font-family: var(--f-text); font-size: 0.875rem; font-weight: 400; color: var(--muted); }

/* dashboard layout */
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(16rem, 1fr); gap: 2rem; align-items: start; }

/* video */
.player { width: 100%; max-height: 70vh; background: #000; border-radius: var(--r-sm); }
.files { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 0.75rem; }

/* ---------- toast / dialog ---------- */
.toasts { position: fixed; right: 1rem; bottom: 1rem; display: grid; gap: 0.5rem; z-index: 50; max-width: min(24rem, calc(100vw - 2rem)); }
.toast { background: var(--ink); color: #fff; padding: 0.7rem 1rem; border-radius: var(--r-sm); box-shadow: 0 8px 24px -10px rgba(0, 0, 0, 0.5); }
.toast-error { background: #a31f1f; }
dialog { border: 0; border-radius: var(--r-lg); padding: 1.5rem; max-width: min(32rem, calc(100vw - 2rem)); width: 100%; background: var(--panel); color: var(--ink); box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.5); }
dialog::backdrop { background: rgba(27, 34, 51, 0.55); }
dialog h3 { margin-bottom: 0.6rem; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 1.25rem; flex-wrap: wrap; }
.secret { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; background: var(--paper); border: 1px solid var(--rule); padding: 0.6rem 0.75rem; border-radius: var(--r-sm); overflow-wrap: anywhere; user-select: all; font-size: 0.875rem; }

/* ---------- public pages ---------- */
.pub-nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem clamp(1rem, 4vw, 3rem); max-width: 80rem; margin: 0 auto; }
.pub-nav .brand { color: var(--ink); }
.pub-nav .brand:hover { color: var(--ink); }
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: clamp(1.5rem, 5vw, 4.5rem); align-items: center; padding: clamp(2rem, 6vw, 5rem) clamp(1rem, 4vw, 3rem) clamp(2.5rem, 6vw, 5rem); max-width: 80rem; margin: 0 auto; }
.hero h1 { font-size: clamp(2.2rem, 4.6vw, 3.6rem); font-weight: 700; line-height: 1.05; letter-spacing: -0.025em; max-width: 14ch; }
.hero-lead { font-size: 1.1875rem; max-width: 52ch; margin: 1.25rem 0 1.75rem; color: #2f3a4f; }
.platforms { display: flex; gap: 1.1rem; flex-wrap: wrap; margin-top: 1.5rem; color: var(--muted); font-weight: 500; }
.band { padding: clamp(2.5rem, 6vw, 4.5rem) clamp(1rem, 4vw, 3rem); }
.band-inner { max-width: 72rem; margin: 0 auto; }
.band-ink { background: var(--ink); color: #dbe1ee; }
.band-ink h2 { color: #fff; }
.band h2 { margin-bottom: 0.9rem; }
.band-panel { background: var(--panel); border-block: 1px solid var(--rule); }
.how { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 2rem; margin-top: 1.75rem; }
.how h3 { margin-bottom: 0.4rem; }
.how p { color: var(--muted); margin: 0; }
.consent-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(1.5rem, 5vw, 4rem); align-items: center; }
.consent-split p { max-width: 54ch; }
.consent-mock { background: var(--panel); color: var(--ink); border-radius: var(--r-lg); padding: 1.25rem; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 0; margin-top: 1.75rem; border: 1px solid var(--ink); border-radius: var(--r-sm); background: var(--panel); }
.plan { padding: 1.5rem; border-left: 1px solid var(--rule); display: flex; flex-direction: column; gap: 0.9rem; }
.plan:first-child { border-left: 0; }
.plan-price { font-family: var(--f-display); font-size: 2.75rem; font-weight: 700; line-height: 1; letter-spacing: -0.03em; }
.plan-price small { font-family: var(--f-text); font-size: 1rem; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.plan ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.45rem; }
.plan li::before { content: "–"; margin-right: 0.55rem; color: var(--muted); }
.plan.is-current { background: var(--signal-wash); }
.foot { padding: 2rem clamp(1rem, 4vw, 3rem); color: var(--muted); font-size: 0.875rem; max-width: 80rem; margin: 0 auto; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

.auth { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.auth-card { width: 100%; max-width: 26rem; }
.auth-card .brand { color: var(--ink); margin-bottom: 1.5rem; }
.auth-card h1 { font-size: 1.75rem; margin-bottom: 1.25rem; }
.auth-links { margin-top: 1.25rem; display: grid; gap: 0.35rem; font-size: 0.9375rem; }

.skeleton { background: linear-gradient(90deg, var(--rule-soft), #eef1f5, var(--rule-soft)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; border-radius: var(--r-sm); height: 4rem; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- responsive ---------- */
@media (max-width: 62rem) {
  .dash-grid, .hero, .consent-split { grid-template-columns: 1fr; }
  .hero h1 { max-width: 18ch; }
}
@media (max-width: 52rem) {
  .shell { grid-template-columns: 1fr; }
  .topbar { display: flex; align-items: center; justify-content: space-between; padding: 0.7rem 1rem; background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 20; }
  .rail { position: fixed; inset: 0 auto 0 0; width: min(18rem, 86vw); z-index: 30; transform: translateX(-100%); transition: transform 0.18s ease; }
  .rail.is-open { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(27, 34, 51, 0.5); z-index: 25; }
  .log-row { grid-template-columns: 1fr; gap: 0.35rem; }
  .log-actions { justify-content: flex-start; }
  .plan { border-left: 0; border-top: 1px solid var(--rule); }
  .plan:first-child { border-top: 0; }
  .console-time { font-size: 2.6rem; }
  .channel { grid-template-columns: 5rem 1fr auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
