/* OpenMontage Web Studio — cinematic dark studio theme */

@import url('/static/fonts/fonts.css');

:root {
  --bg: #0b0b0d;
  --bg-soft: #101013;
  --panel: #131316;
  --panel-2: #17171b;
  --line: rgba(243, 238, 230, 0.10);
  --line-strong: rgba(243, 238, 230, 0.20);
  --ink: #f3eee6;
  --ink-dim: #c3bcb1;
  --muted: #8b857c;
  --accent: #e2552b;
  --accent-ink: #ff8a5c;
  --accent-soft: rgba(226, 85, 43, 0.13);
  --ok: #86c98a;
  --warn: #e8c06a;
  --err: #ef7b6a;
  --serif: 'Instrument Serif', 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, monospace;
  --r: 14px;
  --r-lg: 20px;
  --shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.9);
  --max: 1200px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(60% 42% at 78% -6%, rgba(226, 85, 43, 0.16), transparent 70%),
    radial-gradient(46% 40% at 4% 12%, rgba(120, 92, 255, 0.08), transparent 72%),
    linear-gradient(180deg, #0c0c0f 0%, #0b0b0d 45%, #09090b 100%);
  pointer-events: none;
  z-index: 0;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.7'/%3E%3C/svg%3E");
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: rgba(226, 85, 43, 0.35); }

/* ---------------------------------------------------------------- nav */

.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px clamp(18px, 4vw, 44px);
  border-bottom: 1px solid var(--line);
  background: rgba(11, 11, 13, 0.72);
  backdrop-filter: blur(18px) saturate(140%);
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { color: var(--accent); display: grid; place-items: center; }
.brand-text { font-weight: 600; letter-spacing: -0.01em; font-size: 16px; display: flex; align-items: baseline; gap: 9px; }
.brand-text em { font-family: var(--serif); font-style: italic; font-size: 17px; color: var(--muted); font-weight: 400; }

.nav-links { display: flex; align-items: center; gap: clamp(10px, 2vw, 26px); font-size: 14px; }
.nav-links a { color: var(--ink-dim); position: relative; padding: 4px 0; letter-spacing: 0.01em; transition: color 0.18s ease; }
.nav-links a:hover { color: var(--ink); }
.nav-links a[aria-current='page'] { color: var(--ink); }
.nav-links a[aria-current='page']::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -6px; height: 1.5px; background: var(--accent);
}
.nav-gh { border: 1px solid var(--line-strong); border-radius: 999px; padding: 6px 13px !important; font-size: 12.5px; }
.nav-gh:hover { border-color: var(--accent); color: var(--accent-ink) !important; }

/* ---------------------------------------------------------------- layout */

.app { position: relative; z-index: 2; flex: 1; padding: clamp(26px, 4vw, 54px) clamp(18px, 4vw, 44px) 80px; }
.wrap { max-width: var(--max); margin: 0 auto; }
.section { margin-top: clamp(48px, 7vw, 96px); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.section-head h2 { font-weight: 600; font-size: clamp(20px, 2.4vw, 26px); margin: 0; letter-spacing: -0.02em; }
.eyebrow {
  font-size: 11.5px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--muted);
  display: inline-flex; align-items: center; gap: 10px; font-weight: 600;
}
.eyebrow::before { content: ''; width: 18px; height: 1.5px; background: var(--accent); display: inline-block; }

/* ---------------------------------------------------------------- hero */

.hero { display: grid; gap: 24px; max-width: 900px; }
.hero h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(42px, 6.6vw, 84px);
  line-height: 0.98;
  letter-spacing: -0.02em;
  margin: 0;
}
.hero h1 em { font-style: italic; color: var(--accent-ink); }
.hero .lead { color: var(--ink-dim); font-size: clamp(16px, 1.5vw, 18.5px); max-width: 62ch; margin: 0; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.pill {
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 13px; font-size: 12.5px;
  color: var(--ink-dim); display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,0.02);
}
.pill b { color: var(--ink); font-weight: 600; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(134, 201, 138, 0.12); }
.dot.warn { background: var(--warn); box-shadow: 0 0 0 3px rgba(232, 192, 106, 0.12); }

/* ---------------------------------------------------------------- composer */

.studio-grid { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr); gap: 22px; align-items: start; margin-top: 34px; }

.panel {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(23, 23, 27, 0.92), rgba(17, 17, 20, 0.92));
  box-shadow: var(--shadow);
  overflow: hidden;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel-head h3 { margin: 0; font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.panel-body { padding: 20px; }

.mode-tabs { display: inline-flex; padding: 3px; gap: 3px; border: 1px solid var(--line); border-radius: 999px; background: rgba(0, 0, 0, 0.25); }
.mode-tabs button {
  border: 0; background: transparent; color: var(--muted); padding: 6px 14px; border-radius: 999px;
  font-size: 12.5px; font-weight: 500; cursor: pointer; transition: all 0.16s ease; white-space: nowrap;
}
.mode-tabs button[aria-pressed='true'] { background: var(--ink); color: #0b0b0d; }

.prompt-wrap { position: relative; margin-top: 6px; }
textarea.prompt, input.prompt {
  width: 100%; background: transparent; color: var(--ink); border: 0; border-bottom: 1px solid var(--line-strong);
  padding: 16px 2px 14px; font-family: var(--serif); font-size: clamp(24px, 2.6vw, 30px); line-height: 1.22;
  resize: none; outline: none; letter-spacing: -0.01em;
}
textarea.prompt::placeholder, input.prompt::placeholder { color: rgba(243, 238, 230, 0.28); }
textarea.prompt:focus, input.prompt:focus { border-color: var(--accent); }
.prompt-hint { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--muted); margin-top: 9px; }
.prompt-hint .count { font-variant-numeric: tabular-nums; }

.examples { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.examples button {
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.02); color: var(--ink-dim);
  border-radius: 999px; padding: 6px 12px; font-size: 12.5px; cursor: pointer; transition: all 0.16s ease;
}
.examples button:hover { border-color: var(--line-strong); color: var(--ink); transform: translateY(-1px); }

.field { margin-top: 20px; }
.field-label { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 11.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 10px; }
.field-label span { letter-spacing: 0; text-transform: none; font-weight: 400; color: var(--muted); font-size: 12px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.02); border-radius: 10px;
  padding: 9px 13px; font-size: 13px; color: var(--ink-dim); cursor: pointer; text-align: left;
  transition: all 0.16s ease; display: grid; gap: 2px;
}
.chip small { color: var(--muted); font-size: 11px; letter-spacing: 0.02em; }
.chip:hover { border-color: var(--line-strong); color: var(--ink); }
.chip[aria-pressed='true'] { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
.chip[aria-pressed='true'] small { color: var(--accent-ink); }
.chip[disabled] { opacity: 0.42; cursor: not-allowed; }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button {
  border: 0; border-right: 1px solid var(--line); background: transparent; color: var(--ink-dim);
  padding: 8px 14px; font-size: 13px; cursor: pointer; transition: all 0.14s ease;
}
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed='true'] { background: rgba(243, 238, 230, 0.92); color: #0b0b0d; font-weight: 600; }

.styles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.style-card { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; background: rgba(255,255,255,0.02); cursor: pointer; transition: all 0.16s ease; }
.style-card:hover { border-color: var(--line-strong); }
.style-card[aria-pressed='true'] { border-color: var(--accent); background: var(--accent-soft); }
.swatches { display: flex; gap: 3px; }
.swatches i { width: 12px; height: 12px; border-radius: 3px; display: block; }
.style-card b { font-size: 12.5px; font-weight: 500; }

.advanced { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 6px; }
.advanced summary { list-style: none; cursor: pointer; font-size: 12.5px; color: var(--muted); padding: 10px 0; display: flex; align-items: center; gap: 8px; }
.advanced summary::-webkit-details-marker { display: none; }
.advanced summary::before { content: '+'; font-family: var(--mono); color: var(--accent-ink); }
.advanced[open] summary::before { content: '−'; }
.adv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding-bottom: 8px; }
select.select {
  width: 100%; background: rgba(0, 0, 0, 0.28); border: 1px solid var(--line); border-radius: 9px;
  padding: 9px 11px; font-size: 13px; color: var(--ink); outline: none; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
select.select:focus { border-color: var(--accent); }

.toggle-row { display: flex; gap: 18px; flex-wrap: wrap; }
.toggle { display: inline-flex; align-items: center; gap: 9px; font-size: 13px; color: var(--ink-dim); cursor: pointer; }
.toggle input { appearance: none; width: 34px; height: 19px; border-radius: 999px; background: rgba(255,255,255,0.12); position: relative; cursor: pointer; transition: background 0.18s ease; }
.toggle input::after { content: ''; position: absolute; top: 2.5px; left: 2.5px; width: 14px; height: 14px; border-radius: 50%; background: var(--ink); transition: transform 0.18s ease; }
.toggle input:checked { background: var(--accent); }
.toggle input:checked::after { transform: translateX(15px); }

.actions { display: flex; align-items: center; gap: 12px; margin-top: 22px; flex-wrap: wrap; }
.btn {
  border: 1px solid var(--line-strong); background: transparent; color: var(--ink); border-radius: 11px;
  padding: 12px 18px; font-size: 13.5px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 9px;
  transition: all 0.16s ease; white-space: nowrap;
}
.btn:hover { border-color: var(--ink); transform: translateY(-1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #150a06; font-weight: 600; box-shadow: 0 12px 30px -14px rgba(226, 85, 43, 0.9); }
.btn.primary:hover { background: #ff7a4d; border-color: #ff7a4d; color: #150a06; }
.btn.ghost { border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--ink); }
.btn[disabled] { opacity: 0.5; cursor: progress; transform: none; }
.btn.small { padding: 8px 13px; font-size: 12.5px; border-radius: 9px; }

/* ---------------------------------------------------------------- plan preview */

.plan { position: sticky; top: 92px; }
.plan-title { font-family: var(--serif); font-size: clamp(24px, 2.6vw, 32px); line-height: 1.08; margin: 2px 0 8px; letter-spacing: -0.01em; }
.plan-sub { color: var(--muted); font-size: 12.5px; display: flex; flex-wrap: wrap; gap: 8px 14px; margin-bottom: 16px; }
.plan-beats { display: grid; gap: 0; }
.beat { display: grid; grid-template-columns: 30px 1fr; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.beat:first-child { border-top: 0; }
.beat-num { font-family: var(--mono); font-size: 11px; color: var(--accent-ink); padding-top: 2px; }
.beat h4 { margin: 0; font-size: 14px; font-weight: 500; letter-spacing: -0.005em; }
.beat p { margin: 3px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.checklist { display: grid; gap: 6px; margin-top: 6px; }
.check { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; color: var(--ink-dim); }
.check .mark { font-size: 11px; margin-top: 1px; }
.check.ok .mark { color: var(--ok); }
.check.no .mark { color: var(--warn); }
.check small { color: var(--muted); display: block; }
.plan-foot { display: flex; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; font-size: 12px; color: var(--muted); }
.plan-empty { color: var(--muted); font-size: 13px; text-align: center; padding: 40px 12px; border: 1px dashed var(--line); border-radius: 12px; }

/* ---------------------------------------------------------------- cards / grids */

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

.project-card {
  border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--panel);
  transition: all 0.2s ease; display: flex; flex-direction: column;
}
.project-card:hover { border-color: var(--line-strong); transform: translateY(-2px); box-shadow: var(--shadow); }
.project-thumb { aspect-ratio: 16 / 9; flex: none; background: var(--bg-soft); position: relative; overflow: hidden; }
.project-thumb.vertical { aspect-ratio: 16 / 9; }
.project-thumb.vertical img { object-fit: contain; background: #000; }
.project-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.project-thumb .placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; }
.project-body { padding: 13px 15px 15px; display: grid; gap: 7px; }
.project-body h3 { margin: 0; font-size: 15px; font-weight: 500; letter-spacing: -0.01em; line-height: 1.3; }
.project-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 11.5px; color: var(--muted); }
.status-pill { font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-dim); }
.status-pill.done { border-color: rgba(134,201,138,.4); color: var(--ok); }
.status-pill.running, .status-pill.queued { border-color: rgba(226,85,43,.5); color: var(--accent-ink); }
.status-pill.failed { border-color: rgba(239,123,106,.4); color: var(--err); }

.empty {
  border: 1px dashed var(--line); border-radius: var(--r-lg); padding: 46px 24px; text-align: center; color: var(--muted);
}
.empty h3 { color: var(--ink); margin: 0 0 6px; font-family: var(--serif); font-weight: 400; font-size: 24px; }

/* ---------------------------------------------------------------- pipeline catalog */

.pipeline-row { border-bottom: 1px solid var(--line); padding: 18px 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: start; }
.pipeline-row:first-child { border-top: 1px solid var(--line); }
.pipeline-row h3 { margin: 0 0 4px; font-size: 17px; font-weight: 500; letter-spacing: -0.01em; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pipeline-row p { margin: 0; color: var(--muted); font-size: 13.5px; max-width: 74ch; }
.pipeline-stages { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.stage-tag { font-size: 11px; border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px; color: var(--muted); font-family: var(--mono); }
.stage-tag.gate { border-color: rgba(232,192,106,.4); color: var(--warn); }
.badge { font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; border-radius: 999px; padding: 3px 9px; border: 1px solid var(--line); color: var(--muted); }
.badge.web { border-color: rgba(134,201,138,.35); color: var(--ok); }
.badge.agent { border-color: var(--line); color: var(--muted); }

/* ---------------------------------------------------------------- board */

.board-head { display: grid; gap: 14px; margin-bottom: 26px; }
.board-title { font-family: var(--serif); font-size: clamp(30px, 4.4vw, 52px); line-height: 1.02; margin: 0; letter-spacing: -0.02em; }
.board-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; color: var(--muted); font-size: 13px; }
.board-actions { display: flex; flex-wrap: wrap; gap: 9px; }

.board-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 0.9fr); gap: 22px; align-items: start; }

.player-shell { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: #000; position: relative; }
.player-shell.vertical { max-width: 460px; margin: 0 auto; }
.player-shell video { width: 100%; display: block; aspect-ratio: 16 / 9; background: #000; }
.player-shell.vertical video { aspect-ratio: 9 / 16; }
.player-shell.square video { aspect-ratio: 1 / 1; }

.render-state { padding: 26px; display: grid; gap: 16px; }
.render-state h3 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 26px; }
.progress { height: 4px; background: rgba(255,255,255,0.08); border-radius: 999px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width 0.6s cubic-bezier(.2,.7,.3,1); }
.render-state .now { font-size: 13px; color: var(--ink-dim); display: flex; justify-content: space-between; gap: 12px; }

.stage-rail { display: grid; gap: 0; margin-top: 18px; }
.stage-item { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; padding: 9px 0; align-items: center; position: relative; }
.stage-item::before { content: ''; position: absolute; left: 10px; top: 0; bottom: 0; width: 1px; background: var(--line); }
.stage-item:first-child::before { top: 50%; }
.stage-item:last-child::before { bottom: 50%; }
.stage-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--panel-2); border: 1px solid var(--line-strong); z-index: 1; margin-left: 6px; }
.stage-item.active .stage-dot { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px rgba(226,85,43,.16); }
.stage-item.done .stage-dot { background: var(--ok); border-color: var(--ok); }
.stage-item span { font-size: 13px; color: var(--muted); }
.stage-item.active span { color: var(--ink); }
.stage-item.done span { color: var(--ink-dim); }
.stage-item time { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }

.filmstrip { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 12px; scroll-snap-type: x mandatory; }
.frame { flex: 0 0 196px; scroll-snap-align: start; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--panel); }
.frame .img { aspect-ratio: 16 / 9; background: var(--bg-soft); position: relative; overflow: hidden; }
.frame.vertical { flex-basis: 128px; }
.frame.vertical .img { aspect-ratio: 9 / 16; }
.frame .img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.frame .img .shimmer { position: absolute; inset: 0; background: linear-gradient(100deg, rgba(255,255,255,0.02) 20%, rgba(255,255,255,0.08) 40%, rgba(255,255,255,0.02) 60%); background-size: 200% 100%; animation: shimmer 1.6s infinite linear; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.frame .cap { padding: 8px 10px 10px; display: grid; gap: 3px; }
.frame .cap b { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.frame .cap p { margin: 0; font-size: 12px; color: var(--ink-dim); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.side-card { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); overflow: hidden; margin-bottom: 16px; }
.side-card .panel-head { padding: 13px 16px; }
.side-card .panel-body { padding: 15px 16px; }
.decision { padding: 10px 0; border-top: 1px solid var(--line); font-size: 12.5px; }
.decision:first-child { border-top: 0; padding-top: 0; }
.decision b { display: block; color: var(--ink); font-weight: 500; font-size: 13px; }
.decision .chosen { color: var(--accent-ink); font-family: var(--mono); font-size: 11.5px; margin: 2px 0 3px; }
.decision p { margin: 0; color: var(--muted); line-height: 1.45; }

.scene-list { display: grid; gap: 12px; }
.scene-line { display: grid; grid-template-columns: 26px 1fr; gap: 10px; font-size: 12.5px; }
.scene-line .n { font-family: var(--mono); color: var(--accent-ink); font-size: 11px; padding-top: 2px; }
.scene-line b { display: block; font-weight: 500; font-size: 13px; color: var(--ink); margin-bottom: 2px; }
.scene-line p { margin: 0; color: var(--muted); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 12.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--ink-dim); text-align: right; font-variant-numeric: tabular-nums; }

.error-box { border: 1px solid rgba(239,123,106,.35); background: rgba(239,123,106,.07); border-radius: 10px; padding: 12px 14px; font-size: 12.5px; color: #ffb9ae; font-family: var(--mono); }

/* ---------------------------------------------------------------- how it works */

.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.step { border-top: 1px solid var(--line-strong); padding-top: 14px; }
.step .k { font-family: var(--mono); font-size: 11px; color: var(--accent-ink); letter-spacing: 0.08em; }
.step h4 { margin: 6px 0 4px; font-size: 15px; font-weight: 500; }
.step p { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.5; }

.prose { max-width: 72ch; color: var(--ink-dim); font-size: 15.5px; }
.prose h2 { color: var(--ink); font-family: var(--serif); font-weight: 400; font-size: clamp(26px, 3vw, 36px); margin: 40px 0 10px; letter-spacing: -0.01em; }
.prose p { margin: 0 0 14px; }
.prose ul { margin: 0 0 18px; padding-left: 20px; }
.prose li { margin-bottom: 7px; }
.prose code { font-family: var(--mono); font-size: 0.86em; background: rgba(255,255,255,0.06); padding: 1.5px 6px; border-radius: 5px; }
.prose a { color: var(--accent-ink); border-bottom: 1px solid rgba(255,138,92,0.35); }

/* ---------------------------------------------------------------- toast + footer */

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: #1c1c21; border: 1px solid var(--line-strong); color: var(--ink); border-radius: 11px;
  padding: 11px 18px; font-size: 13px; z-index: 90; transition: all 0.24s ease; max-width: min(92vw, 520px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { border-color: rgba(239,123,106,.5); color: #ffc4bb; }

.footer { position: relative; z-index: 2; border-top: 1px solid var(--line); padding: 34px clamp(18px, 4vw, 44px) 40px; background: rgba(9,9,11,0.7); }
.footer-inner { max-width: var(--max); margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 34px; }
.footer-brand p { margin: 0; color: var(--muted); font-size: 12.5px; max-width: 46ch; }
.footer-brand strong { color: var(--ink-dim); }
.footer-brand a { color: var(--ink-dim); border-bottom: 1px solid var(--line-strong); }
.footer-mark { color: var(--accent); font-size: 18px; }
.footer-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.footer-cols h4 { margin: 0 0 6px; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.footer-cols p { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.5; }

/* ---------------------------------------------------------------- responsive */

@media (max-width: 1080px) {
  .studio-grid, .board-grid { grid-template-columns: 1fr; }
  .plan { position: static; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-inner { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  body { font-size: 15px; }
  .nav { padding: 12px 16px; flex-wrap: wrap; gap: 10px; }
  .nav-links { gap: 14px; font-size: 13px; width: 100%; justify-content: space-between; }
  .brand-text em { display: none; }
  .grid.three, .grid.two { grid-template-columns: 1fr; }
  .styles { grid-template-columns: 1fr; }
  .adv-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .footer-cols { grid-template-columns: 1fr; }
  .frame { flex-basis: 168px; }
  .hero h1 { font-size: clamp(34px, 9vw, 52px); }
  .panel-body { padding: 16px; }
  .board-actions .btn { flex: 1 1 auto; justify-content: center; }
  .pipeline-row { grid-template-columns: 1fr; }
  .panel-head h3 { font-size: 11px; letter-spacing: 0.12em; }
  .mode-tabs button { padding: 6px 11px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
