/* ============================================================
   Stream Player — deep link demo
   Data UI palette: warm off-white surfaces, single emerald accent
   ============================================================ */

:root {
  --bg:          #f4f3ef;
  --surface:     #ffffff;
  --surface-2:   #faf9f6;
  --line:        #e3e1da;
  --line-soft:   #eeece6;
  --ink:         #14171e;
  --ink-2:       #474e5d;
  --muted:       #868c99;
  --primary:     #047857;
  --primary-br:  #10b981;
  --primary-bg:  #e7f3ee;
  --player:      #0d0f13;
  --radius:      16px;
  --radius-sm:   10px;
  --shadow:      0 2px 8px rgba(20, 23, 30, .04);
  --shadow-lg:   0 8px 28px -6px rgba(20, 23, 30, .10);
  --sans: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.15; letter-spacing: -.02em; margin: 0; }
p { margin: 0; }
code { font-family: var(--mono); }

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 56px 24px 80px;
}

/* ───────────────────────────── HERO ───────────────────────────── */

.hero { padding: 24px 0 56px; max-width: 760px; }

.eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(30px, 4.4vw, 46px);
  font-weight: 600;
  margin-bottom: 20px;
}

.lede {
  font-size: 18px;
  color: var(--ink-2);
  font-weight: 300;
  max-width: 640px;
}

.lede strong { font-weight: 600; color: var(--ink); }

/* ─────────────────────────── SECTIONS ─────────────────────────── */

.section { margin-bottom: 84px; }

.section-head { margin-bottom: 28px; }

.section-head h2 {
  font-size: clamp(23px, 3vw, 30px);
  font-weight: 600;
  margin-bottom: 10px;
}

.section-head p { color: var(--ink-2); font-weight: 300; max-width: 640px; }

.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 22px;
  padding: 0 8px;
  margin-bottom: 14px;
  border-radius: 6px;
  background: var(--primary-bg);
  color: var(--primary);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
}

/* ───────────────────────────── CARDS ───────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

.card-title { font-size: 17px; font-weight: 600; margin-bottom: 4px; }
.card-sub { font-size: 14px; color: var(--muted); margin-bottom: 18px; font-weight: 300; }

.tiny { font-size: 13px; line-height: 1.5; }
.muted { color: var(--muted); }
.mt-16 { margin-top: 16px; }

/* ──────────────────────────── DEMO GRID ──────────────────────────── */

.demo-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.player-card { padding: 0; overflow: hidden; }

.video-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--player);
}

.video-wrap video {
  width: 100%;
  height: 100%;
  display: block;
  background: var(--player);
}

.video-note {
  position: absolute;
  inset: auto 0 0 0;
  padding: 12px 16px;
  font-size: 13px;
  color: #cbd5e1;
  background: linear-gradient(transparent, rgba(13, 15, 19, .92));
  display: none;
}

.video-note.is-shown { display: block; }

.player-foot { padding: 18px 20px 20px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all .18s ease;
}

.chip:hover { border-color: var(--primary-br); color: var(--primary); transform: translateY(-1px); }

.chip.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.chips-sm .chip { font-size: 12px; padding: 5px 11px; }

.stream-label {
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  word-break: break-all;
}

/* ──────────────────────────── ACTIONS ──────────────────────────── */

.action-card { display: flex; flex-direction: column; gap: 14px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .18s ease;
  white-space: nowrap;
}

.btn svg { width: 18px; height: 18px; flex: none; }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: #03674b; transform: translateY(-1px); box-shadow: var(--shadow-lg); }

.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover { border-color: var(--primary-br); color: var(--primary); transform: translateY(-1px); }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row .btn { flex: 1 1 auto; }

.uri-box {
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.uri-label {
  display: block;
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 7px;
  font-weight: 600;
}

.uri-box code {
  display: block;
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink);
  word-break: break-all;
}

/* ─────────────────────────── KV TABLE ─────────────────────────── */

.kv {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 0 16px;
  margin: 0;
  font-size: 13px;
}

.kv dt {
  color: var(--muted);
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
  font-weight: 500;
}

.kv dd {
  margin: 0;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  word-break: break-all;
}

.kv dt:last-of-type, .kv dd:last-of-type { border-bottom: 0; }

.kv-trace dd { color: var(--ink-2); }
.kv-trace dd.is-ok { color: var(--primary); font-weight: 500; }
.kv-trace dd.is-bad { color: #b91c1c; }

/* ────────────────────────────── QR ────────────────────────────── */

.qr-card {
  margin-top: 20px;
  display: flex;
  gap: 26px;
  align-items: center;
}

.qr-frame {
  flex: none;
  width: 148px;
  height: 148px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.qr-frame img { display: block; width: 100% !important; height: 100% !important; }
.qr-frame canvas { display: none; }

.qr-text h3 { font-size: 17px; font-weight: 600; margin-bottom: 8px; }
.qr-text p { font-size: 14px; color: var(--ink-2); font-weight: 300; max-width: 560px; }
.qr-text p + p { margin-top: 8px; }

/* ────────────────────────────── FLOW ────────────────────────────── */

.flow {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  counter-reset: flow;
}

.flow-step {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease;
}

.flow-step:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.flow-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 12px;
}

.flow-step h3 { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.flow-step p { font-size: 14px; color: var(--ink-2); font-weight: 300; }
.flow-step em { font-style: normal; color: var(--primary); font-weight: 500; }

.flow-code {
  display: block;
  margin-top: 14px;
  padding: 9px 11px;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  font-size: 11.5px;
  color: var(--ink);
  word-break: break-all;
  line-height: 1.5;
}

/* ─────────────────────────── INSPECTOR ─────────────────────────── */

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}

.field { display: block; margin-bottom: 14px; }

.field > span {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 6px;
}

.field select, .field input {
  width: 100%;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink);
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: border-color .18s ease, box-shadow .18s ease;
}

.field select { font-family: var(--sans); font-size: 14px; }

.field select:focus, .field input:focus {
  outline: none;
  border-color: var(--primary-br);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, .16);
}

.verdict {
  margin: 16px 0;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  display: none;
}

.verdict.is-shown { display: block; }
.verdict.ok { background: var(--primary-bg); color: var(--primary); }
.verdict.bad { background: #fdecec; color: #b91c1c; }

/* ─────────────────────────── REFERENCE ─────────────────────────── */

.table-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.ref-table { width: 100%; border-collapse: collapse; font-size: 14px; }

.ref-table th {
  text-align: left;
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  padding: 14px 18px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}

.ref-table td {
  padding: 13px 18px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-2);
  vertical-align: top;
}

.ref-table tr:last-child td { border-bottom: 0; }
.ref-table td:first-child { white-space: nowrap; }
.ref-table code { font-size: 12px; color: var(--ink); }
.ref-table td:nth-child(2) code { color: var(--primary); }

.fmt-list { list-style: none; margin: 0; padding: 0; }

.fmt-list li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}

.fmt-list li:last-child { border-bottom: 0; }

.fmt {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--primary);
  background: var(--primary-bg);
  padding: 3px 9px;
  border-radius: 6px;
  white-space: nowrap;
}

.fmt-note { font-size: 13px; color: var(--ink-2); }

.cmd { margin-bottom: 16px; }
.cmd:last-child { margin-bottom: 0; }

.cmd-label {
  display: block;
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 6px;
}

.cmd code {
  display: block;
  background: var(--player);
  color: #d7e3dd;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  line-height: 1.7;
  overflow-x: auto;
}

/* ───────────────────────────── FOOTER ───────────────────────────── */

.footer {
  border-top: 1px solid var(--line);
  padding-top: 26px;
  font-size: 14px;
  color: var(--ink-2);
}

.footer code { font-size: 12.5px; color: var(--muted); }
.footer p + p { margin-top: 6px; }

/* ─────────────────────────── RESPONSIVE ─────────────────────────── */

@media (max-width: 900px) {
  .demo-grid, .two-col { grid-template-columns: minmax(0, 1fr); }
  .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .wrap { padding: 36px 16px 60px; }
  .section { margin-bottom: 60px; }
  .flow { grid-template-columns: minmax(0, 1fr); }
  .qr-card { flex-direction: column; align-items: flex-start; }
  .kv { grid-template-columns: 96px minmax(0, 1fr); }
  .ref-table thead { display: none; }
  .ref-table, .ref-table tbody, .ref-table tr, .ref-table td { display: block; width: 100%; }
  .ref-table tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
  .ref-table tr:last-child { border-bottom: 0; }
  .ref-table td { border: 0; padding: 4px 18px; }
  .ref-table td:first-child { white-space: normal; }
}
