/* Blocksmith audience page. Dark navy first (the talk's look), warm paper in light mode. */
:root {
  --bg: #121826; --surface: #1a2133; --surface-2: #222b41; --line: #2e3852; --line-2: #3b4766;
  --fg: #f6f4ef; --muted: #a2abc0; --faint: #6f7a95;
  --accent: #e8a33d; --accent-ink: #1f1405; --accent-text: #f2b961;
  --ok: #72d6a0; --warn: #f2b961; --bad: #ff8f80;
  --stage-1: #1f2944; --stage-2: #121828; --stage-fade: rgba(18, 24, 40, 0.94);
  --chip: #1d2538;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f6f4ef; --surface: #ffffff; --surface-2: #f0ece3; --line: #e1dace; --line-2: #cfc6b5;
    --fg: #141a28; --muted: #586174; --faint: #8c909b;
    --accent: #e8a33d; --accent-ink: #1f1405; --accent-text: #8f5a0b;
    --ok: #1d7a48; --warn: #8f5a0b; --bad: #b3362a;
    --stage-1: #fffdf8; --stage-2: #e8e2d4; --stage-fade: rgba(232, 226, 212, 0.94);
    --chip: #ffffff;
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f6f4ef; --surface: #ffffff; --surface-2: #f0ece3; --line: #e1dace; --line-2: #cfc6b5;
  --fg: #141a28; --muted: #586174; --faint: #8c909b;
  --accent: #e8a33d; --accent-ink: #1f1405; --accent-text: #8f5a0b;
  --ok: #1d7a48; --warn: #8f5a0b; --bad: #b3362a;
  --stage-1: #fffdf8; --stage-2: #e8e2d4; --stage-fade: rgba(232, 226, 212, 0.94);
  --chip: #ffffff;
  color-scheme: light;
}

:root { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 400 15px/1.5 "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.page {
  max-width: 1240px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 10px 28px;
}

/* ------------------------------------------------ masthead */
.masthead { display: flex; align-items: center; gap: 10px; padding-block: 4px 12px; min-width: 0; }
.mark { display: grid; grid-template-columns: 9px 9px; gap: 2px; flex: none; }
.mark i { width: 9px; height: 9px; border-radius: 2px; background: var(--accent); }
.mark i:nth-child(2) { background: var(--fg); }
.mark i:nth-child(3) { background: var(--muted); }
.mark i:nth-child(4) { background: var(--accent); opacity: 0.55; }
.brand { font: 700 19px/1 "Space Grotesk", "IBM Plex Sans", system-ui, sans-serif; letter-spacing: -0.01em; }
.tagline { color: var(--muted); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.mode {
  margin-left: auto; flex: none; display: inline-flex; align-items: center; gap: 6px;
  font: 500 11.5px/1 "JetBrains Mono", ui-monospace, Menlo, monospace; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 6px 9px;
}
.mode .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 22%, transparent); }
.mode.preview .dot { background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }

/* ------------------------------------------------ layout: stacked on phones, side by side from 860 px */
.layout { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); grid-template-areas: "stage" "compose" "facts"; }
.stage { grid-area: stage; }
.compose { grid-area: compose; min-width: 0; display: grid; gap: 14px; align-content: start; }
.facts { grid-area: facts; min-width: 0; }
@media (min-width: 860px) {
  .page { padding-block: 18px 36px; }
  .layout { grid-template-columns: minmax(320px, 410px) minmax(0, 1fr); grid-template-rows: auto 1fr;
    grid-template-areas: "compose stage" "facts stage"; gap: 22px 32px; }
  .compose { padding-top: 6px; }
}

/* ------------------------------------------------ stage */
.stage {
  position: relative; overflow: hidden; border-radius: 20px; border: 1px solid var(--line);
  background: radial-gradient(120% 85% at 50% 30%, var(--stage-1), var(--stage-2));
  height: clamp(270px, 48vh, 560px); height: clamp(270px, min(calc(100vw - 32px), 47svh), 560px);
  scroll-margin-top: 10px;
}
@media (min-width: 860px) { .stage { height: clamp(480px, 80vh, 800px); } }
.view { position: absolute; inset: 0; transition: opacity 0.22s ease, filter 0.3s ease; }
.view canvas { display: block; width: 100% !important; height: 100% !important; touch-action: none; cursor: grab; }
.view canvas:active { cursor: grabbing; }
.view.fade { opacity: 0; }
.view.waiting { opacity: 0.35; filter: saturate(0.4); }

.stage-top { position: absolute; left: 18px; top: 14px; right: 70px; pointer-events: none; display: grid; gap: 2px; }
.kind { font: 500 11px/1.2 "JetBrains Mono", ui-monospace, Menlo, monospace; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-text); }
.dname { margin: 0; font: 600 clamp(21px, 2.3vw, 30px)/1.12 "Space Grotesk", "IBM Plex Sans", system-ui, sans-serif;
  letter-spacing: -0.015em; text-wrap: balance; overflow-wrap: anywhere; }

.spin {
  position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; border-radius: 12px; cursor: pointer;
  display: grid; place-items: center; border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 72%, transparent); color: var(--fg);
}
.spin svg { width: 18px; height: 18px; fill: currentColor; }
.spin[aria-pressed="true"] .i-play, .spin[aria-pressed="false"] .i-pause { display: none; }

.stage-bottom {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 18px 14px; pointer-events: none;
  background: linear-gradient(to top, var(--stage-fade) 40%, transparent);
}
.ticker {
  display: flex; justify-content: flex-end; overflow: hidden; height: 17px; margin-bottom: 4px;
  font: 400 11.5px/17px "JetBrains Mono", ui-monospace, Menlo, monospace; color: var(--faint);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 30%); mask-image: linear-gradient(to right, transparent, #000 30%);
  transition: opacity 0.6s ease;
}
.ticker span { flex: none; white-space: pre; }
.ticker.gone { opacity: 0; }
.state { font-size: 14.5px; line-height: 1.4; font-weight: 500; color: var(--fg); min-height: 1.4em; text-wrap: pretty; }
.state.quiet { color: var(--muted); font-weight: 400; }
.state.ok .tick { color: var(--ok); font-weight: 700; }
.state.warn { color: var(--warn); }
.state.bad { color: var(--bad); }
.state b { font: 500 13.5px "JetBrains Mono", ui-monospace, Menlo, monospace; }
.state .dim { color: var(--muted); font-weight: 400; }
.state.busy::before, .state.wait::before {
  content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 2px; vertical-align: 1px;
  background: var(--accent); animation: blink 1s steps(2, start) infinite;
}
.state.wait::before { background: var(--muted); }
@keyframes blink { to { opacity: 0.25; } }
.bar { height: 3px; border-radius: 2px; background: var(--line); margin-top: 9px; overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.25s linear; }

/* ------------------------------------------------ compose */
.lede { margin: 0; font: 600 clamp(22px, 2.5vw, 31px)/1.16 "Space Grotesk", "IBM Plex Sans", system-ui, sans-serif;
  letter-spacing: -0.02em; text-wrap: balance; }
.lede span { color: var(--muted); font-weight: 500; }
.ask {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px 12px 10px 14px;
  display: grid; gap: 8px; transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.ask:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.ask textarea {
  width: 100%; min-height: 76px; resize: none; border: 0; outline: 0; padding: 2px 0; background: transparent; color: var(--fg);
  font: 400 17px/1.45 "IBM Plex Sans", system-ui, sans-serif; /* 16 px or more: phones do not zoom in on focus */
}
.ask textarea::placeholder { color: var(--faint); }
.ask-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.count { font: 400 12px "JetBrains Mono", ui-monospace, Menlo, monospace; color: var(--faint); }
.go {
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 20px 0 22px; border: 0; border-radius: 12px; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); font: 600 16.5px/1 "Space Grotesk", "IBM Plex Sans", system-ui, sans-serif;
  transition: transform 0.08s ease, filter 0.15s ease, opacity 0.15s ease;
}
.go svg { width: 18px; height: 18px; }
.go:hover { filter: brightness(1.06); }
.go:active { transform: translateY(1px); }
.go:disabled { opacity: 0.55; cursor: progress; }

.demo-note { margin: 0; font-size: 13px; line-height: 1.45; color: var(--muted); border-left: 3px solid var(--accent); padding: 2px 0 2px 10px; }
.label { font: 500 11px/1 "JetBrains Mono", ui-monospace, Menlo, monospace; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
.pick { display: grid; gap: 8px; }
.pick select {
  width: 100%; min-width: 0; appearance: none; -webkit-appearance: none;
  font: 500 15px/1.3 "IBM Plex Sans", system-ui, sans-serif; color: var(--fg);
  background: var(--chip) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%23e8a33d' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center / 18px;
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 40px 11px 12px;
}
.pick select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pick-note { margin: 0; color: var(--muted); font-size: 13.5px; min-height: 1.5em; }
.pick-note .rest { color: var(--warn); }
.try { display: grid; gap: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button {
  min-height: 38px; padding: 7px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--chip); cursor: pointer;
  font-size: 14px; line-height: 1.2; color: var(--fg); text-align: left; transition: border-color 0.15s ease;
}
.chips button:hover { border-color: var(--line-2); }
.kinds { margin: 0; color: var(--muted); font-size: 14px; }
.cmp-link { justify-self: start; color: var(--accent-text); font-weight: 500; font-size: 14.5px; text-decoration: none; padding-block: 4px; }
.cmp-link:hover { text-decoration: underline; }
.kinds b { color: var(--fg); font-weight: 600; }
.mine { display: grid; gap: 8px; }
.mine-row { display: flex; flex-wrap: wrap; gap: 8px; }
.thumb { width: 60px; height: 60px; padding: 0; border-radius: 12px; overflow: hidden; cursor: pointer; border: 1px solid var(--line);
  background: radial-gradient(circle at 50% 35%, var(--stage-1), var(--stage-2)); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb:disabled { opacity: 0.5; cursor: progress; }

/* ------------------------------------------------ facts */
.facts { display: grid; gap: 0; border-top: 1px solid var(--line); }
.fact { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 12px; align-items: baseline; padding-block: 10px; border-bottom: 1px solid var(--line); }
.fact b { font: 600 19px/1.1 "Space Grotesk", "IBM Plex Sans", system-ui, sans-serif; color: var(--accent-text); letter-spacing: -0.01em; }
.fact span { color: var(--muted); font-size: 13.5px; line-height: 1.4; }
.fine { margin: 10px 0 0; color: var(--faint); font-size: 12.5px; }

@media (max-width: 479px) { .tagline { display: none; } }
@media (max-width: 380px) { .go { padding: 0 16px 0 18px; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before { animation: none !important; transition: none !important; }
}
