/* Explainer Studio, styled to match breachsoftwarestudios.com */
:root {
  /* brand tokens (from breachsoftwarestudios.com) */
  --blue: #1c6bff;
  --cyan: #25e2ec;
  --grad: linear-gradient(100deg, var(--blue), var(--cyan));
  --bg: #03070d;
  --deep: #07111c;
  --panel: #0b1826;
  --panel-2: #0f2032;
  --text: #e7f2f8;
  --muted: #8ea6b8;
  --line: rgba(120, 200, 235, 0.13);
  --line-strong: rgba(120, 200, 235, 0.28);

  /* app aliases (used across app.js) */
  --paper: var(--bg);
  --card: var(--panel);
  --ink: var(--text);
  --accent: var(--cyan);
  --accent-soft: rgba(37, 226, 236, 0.12);
  --ok: #3ee8a4;
  --ok-soft: rgba(62, 232, 164, 0.12);
  --warn: #ffc46b;
  --warn-soft: rgba(255, 196, 107, 0.12);
  --danger: #ff6b7d;
  --rail: var(--deep);

  --serif: "Unbounded", "Arial Black", system-ui, sans-serif; /* display font */
  --sans: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Consolas, monospace;
  --r: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--sans);
  color: var(--text);
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(28, 107, 255, 0.16), transparent 60%),
    radial-gradient(700px 420px at 10% 110%, rgba(37, 226, 236, 0.08), transparent 60%),
    linear-gradient(rgba(120, 200, 235, 0.035) 1px, transparent 1px) 0 0 / 56px 56px,
    linear-gradient(90deg, rgba(120, 200, 235, 0.035) 1px, transparent 1px) 0 0 / 56px 56px,
    var(--bg);
  background-attachment: fixed;
  display: grid;
  grid-template-columns: 250px 1fr;
  font-size: 15.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
a { color: var(--cyan); }
::selection { background: rgba(37, 226, 236, 0.3); }
code { font-family: var(--mono); font-size: 0.9em; color: var(--cyan); }

/* gradient text helper */
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- rail ---------- */
.rail { background: rgba(7, 17, 28, 0.92); backdrop-filter: blur(8px); border-right: 1px solid var(--line); color: var(--muted); padding: 22px 16px; display: flex; flex-direction: column; gap: 26px; height: 100vh; position: sticky; top: 0; overflow-y: auto; }
.brand { display: grid; gap: 6px; justify-items: start; text-decoration: none; }
.brand img { width: 170px; height: auto; display: block; }
.brand .product { font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--cyan); padding-left: 2px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.steps li { display: flex; gap: 11px; align-items: center; padding: 9px 10px; border-radius: 10px; color: #5f7688; cursor: default; font-weight: 500; border: 1px solid transparent; }
.steps li span { width: 24px; height: 24px; border-radius: 8px; border: 1px solid var(--line-strong); display: grid; place-items: center; font-size: 11px; font-family: var(--mono); }
.steps li.done { color: var(--text); cursor: pointer; }
.steps li.done:hover { background: rgba(255, 255, 255, 0.03); }
.steps li.done span { border-color: rgba(37, 226, 236, 0.45); color: var(--cyan); }
.steps li.active { background: rgba(28, 107, 255, 0.1); border-color: var(--line); color: #fff; }
.steps li.active span { background: var(--grad); border-color: transparent; color: #02121a; font-weight: 700; }
.rail-head { display: flex; justify-content: space-between; text-transform: uppercase; letter-spacing: 0.14em; font-size: 10.5px; font-family: var(--mono); color: #5f7688; margin-bottom: 8px; }
.link { background: none; border: 0; color: var(--cyan); padding: 0; font-size: 12px; font-family: var(--sans); letter-spacing: 0; text-transform: none; }
.link:hover { text-decoration: underline; }
.project-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.project-list li { padding: 7px 9px; border-radius: 8px; font-size: 13.5px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.project-list li:hover { background: rgba(255, 255, 255, 0.03); color: var(--text); }
.project-list li.current { background: rgba(37, 226, 236, 0.08); color: #fff; }
.spent { margin-top: auto; font-size: 12px; color: #5f7688; border-top: 1px solid var(--line); padding-top: 12px; }
.spent b { color: var(--text); font-weight: 600; font-family: var(--mono); }

/* ---------- main ---------- */
main { padding: 40px clamp(20px, 4vw, 60px) 90px; max-width: 1300px; width: 100%; }
h1 { font-family: var(--serif); font-weight: 800; font-size: clamp(26px, 3vw, 36px); line-height: 1.15; margin: 0 0 10px; letter-spacing: -0.01em; color: #fff; }
h2 { font-family: var(--serif); font-weight: 600; font-size: 19px; margin: 34px 0 12px; letter-spacing: -0.01em; color: #fff; }
h3 { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.16em; color: var(--cyan); margin: 0 0 10px; font-weight: 500; }
.lede { color: var(--muted); margin: 0 0 26px; max-width: 72ch; font-size: 16.5px; }
.card { background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.005)), var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* buttons: same shapes as the website */
.btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.02); color: var(--text); padding: 11px 20px; border-radius: 12px; font-weight: 600; transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, background 0.15s ease; }
.btn:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.05); }
.btn.accent { background: var(--grad); border-color: transparent; color: #02121a; box-shadow: 0 8px 28px -10px rgba(37, 226, 236, 0.55); }
.btn.accent:hover { transform: translateY(-1px); box-shadow: 0 12px 34px -10px rgba(37, 226, 236, 0.7); background: var(--grad); }
.btn.ghost { background: rgba(255, 255, 255, 0.02); color: var(--text); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.05); }
.btn.sm { padding: 6px 13px; font-size: 13px; font-weight: 500; border-radius: 10px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }

label.field { display: grid; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 500; }
input[type=text], input[type=password], input[type=number], select, textarea { background: rgba(3, 7, 13, 0.6); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; color: var(--text); }
select option, select optgroup { background: var(--panel); color: var(--text); }
input::placeholder, textarea::placeholder { color: #4d6374; }
input:focus, select:focus, textarea:focus { outline: none; border-color: rgba(37, 226, 236, 0.6); box-shadow: 0 0 0 3px rgba(37, 226, 236, 0.12); }
textarea { resize: vertical; min-height: 64px; }
.prompt-box { font-family: var(--sans); font-size: 21px; font-weight: 500; line-height: 1.4; min-height: 120px; padding: 18px; }
.options { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin: 18px 0 22px; }
input[type=range] { accent-color: var(--cyan); }
input[type=checkbox] { accent-color: var(--cyan); }

.pill { display: inline-block; padding: 3px 10px; border-radius: 7px; font-size: 11.5px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); color: var(--muted); font-weight: 500; font-family: var(--mono); letter-spacing: 0.02em; }
.pill.ok { background: var(--ok-soft); color: var(--ok); border-color: rgba(62, 232, 164, 0.25); }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: rgba(255, 196, 107, 0.25); }
.pill.accent { background: var(--grad); color: #02121a; border-color: transparent; }
.note { background: var(--warn-soft); border: 1px solid rgba(255, 196, 107, 0.25); border-radius: 10px; padding: 12px 14px; font-size: 14px; color: #ffd99c; }
.note.info { background: rgba(28, 107, 255, 0.1); border-color: rgba(28, 107, 255, 0.3); color: #b9d2ff; }

/* ---------- research ---------- */
.facts { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.facts li { padding: 13px 15px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.facts li::marker { color: var(--cyan); font-family: var(--mono); }
.facts small { color: var(--muted); }
.timeline { border-left: 2px solid transparent; border-image: var(--grad) 1; margin-left: 6px; padding-left: 18px; display: grid; gap: 12px; }
.timeline div b { font-family: var(--mono); color: var(--cyan); display: block; font-weight: 500; }

/* ---------- storyboard ---------- */
.sb-toolbar { position: sticky; top: 0; z-index: 5; background: rgba(3, 7, 13, 0.88); backdrop-filter: blur(10px); padding: 12px 0; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.scenes { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 18px; }
.scene { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column; transition: border-color 0.15s ease; }
.scene:hover { border-color: var(--line-strong); }
.still { position: relative; aspect-ratio: 16/9; background: repeating-linear-gradient(45deg, #0a1522, #0a1522 10px, #0c1a29 10px, #0c1a29 20px); display: grid; place-items: center; color: #4d6374; font-size: 13px; font-family: var(--mono); }
.still.portrait { aspect-ratio: 9/16; max-height: 420px; }
.still.square { aspect-ratio: 1/1; }
.still img { width: 100%; height: 100%; object-fit: cover; display: block; position: absolute; inset: 0; }
.still .tc { position: absolute; left: 10px; top: 10px; background: rgba(3, 7, 13, 0.78); border: 1px solid var(--line); color: var(--cyan); font-family: var(--mono); font-size: 11.5px; padding: 2px 8px; border-radius: 6px; }
.still .ost { position: absolute; left: 0; right: 0; bottom: 12px; text-align: center; color: #fff; font-family: var(--serif); font-weight: 600; font-size: 16px; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.85); padding: 0 12px; }
.scene-body { padding: 15px; display: grid; gap: 10px; }
.scene-body .title-input { font-family: var(--serif); font-size: 16px; font-weight: 600; border: 0; border-bottom: 1px dashed transparent; border-radius: 0; padding: 2px 0; background: transparent; color: #fff; }
.scene-body .title-input:hover { border-bottom-color: var(--line-strong); }
.scene-body .title-input:focus { box-shadow: none; border-bottom-color: var(--cyan); }
.scene-body textarea { min-height: 56px; font-size: 14px; }
.scene-meta { display: grid; grid-template-columns: 70px 1fr 1fr; gap: 8px; }
.scene-actions { display: flex; gap: 6px; flex-wrap: wrap; border-top: 1px solid var(--line); padding: 10px 15px; background: rgba(3, 7, 13, 0.35); margin-top: auto; }
details.more summary { font-size: 13px; color: var(--muted); cursor: pointer; }
details.more summary:hover { color: var(--cyan); }
details.more[open] { display: grid; gap: 8px; }
.wordcount { font-size: 11.5px; color: var(--muted); font-family: var(--mono); }
.wordcount.over { color: var(--warn); font-weight: 500; }

/* ---------- production ---------- */
table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
th, td { padding: 11px 13px; text-align: left; border-bottom: 1px solid var(--line); font-size: 14px; }
tr:last-child td { border-bottom: 0; }
th { background: rgba(3, 7, 13, 0.5); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--cyan); font-family: var(--mono); font-weight: 500; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.num b { font-family: var(--mono); font-weight: 500; color: #fff; }
tr.pick { cursor: pointer; }
tr.pick:hover td { background: rgba(255, 255, 255, 0.025); }
tr.selected td { background: rgba(28, 107, 255, 0.14) !important; }
tr.selected td:first-child { box-shadow: inset 3px 0 0 var(--cyan); }
tr.disabled td { color: #5f7688; }
tr.novideo td { background: rgba(3, 7, 13, 0.4); color: var(--muted); font-size: 13px; }
.big-total { font-family: var(--serif); font-size: 44px; font-weight: 800; line-height: 1.05; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.estimate-panel { position: sticky; top: 20px; }
.prod-layout { display: grid; grid-template-columns: 1fr 370px; gap: 24px; align-items: start; }
@media (max-width: 1100px) { .prod-layout { grid-template-columns: 1fr; } .estimate-panel { position: static; } }
.est-lines { display: grid; gap: 9px; margin: 18px 0; }
.est-lines div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.est-lines b { font-family: var(--mono); font-weight: 500; }
.est-lines small { display: block; color: var(--muted); font-size: 12px; }
.range { width: 100%; }

/* ---------- spec ---------- */
.spec-scene { display: grid; grid-template-columns: 240px 1fr; gap: 18px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.spec-scene img { width: 100%; border-radius: 10px; border: 1px solid var(--line); }
pre { background: #02050a; border: 1px solid var(--line); color: #cfe6f2; padding: 13px 15px; border-radius: 10px; font-family: var(--mono); font-size: 12.5px; white-space: pre-wrap; word-break: break-word; margin: 6px 0 0; }

/* ---------- overlays ---------- */
.busy { position: fixed; inset: 0; background: rgba(3, 7, 13, 0.75); backdrop-filter: blur(4px); display: grid; place-items: center; z-index: 50; }
.busy-card { background: var(--panel); border: 1px solid var(--line); padding: 30px 38px; border-radius: 18px; text-align: center; max-width: 440px; box-shadow: 0 30px 80px -20px rgba(28, 107, 255, 0.35); }
.busy-card p { font-family: var(--serif); font-weight: 600; font-size: 18px; margin: 16px 0 6px; color: #fff; }
.busy-card small { color: var(--muted); }
.spinner { width: 38px; height: 38px; border-radius: 50%; margin: 0 auto; background: conic-gradient(from 0deg, transparent 0 25%, var(--blue) 50%, var(--cyan)); -webkit-mask: radial-gradient(circle, transparent 54%, #000 56%); mask: radial-gradient(circle, transparent 54%, #000 56%); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--panel-2); border: 1px solid var(--line-strong); color: var(--text); padding: 12px 20px; border-radius: 12px; z-index: 80; max-width: 80vw; font-size: 14px; box-shadow: 0 20px 50px -15px rgba(0, 0, 0, 0.8); }
.toast.error { border-color: rgba(255, 107, 125, 0.5); color: #ffc2ca; }

.animatic { position: fixed; inset: 0; background: #010307; z-index: 70; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 24px; }
.animatic-stage { position: relative; width: min(1100px, 92vw); aspect-ratio: 16/9; background: #000; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.animatic-stage img { width: 100%; height: 100%; object-fit: cover; animation: kb 8s ease-out forwards; }
@keyframes kb { from { transform: scale(1); } to { transform: scale(1.08); } }
.ani-text { position: absolute; left: 0; right: 0; bottom: 18%; text-align: center; color: #fff; font-family: var(--serif); font-weight: 800; font-size: clamp(20px, 3vw, 38px); text-shadow: 0 2px 14px rgba(0, 0, 0, 0.85); padding: 0 8%; }
.ani-caption { position: absolute; left: 8%; right: 8%; bottom: 36px; text-align: center; color: #fff; background: rgba(3, 7, 13, 0.72); border: 1px solid var(--line); padding: 8px 14px; border-radius: 8px; font-size: clamp(13px, 1.4vw, 17px); }
.ani-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255, 255, 255, 0.1); }
.ani-bar div { height: 100%; background: var(--grad); width: 0; transition: width 0.2s linear; }
.ani-controls { display: flex; gap: 18px; align-items: center; color: var(--muted); font-size: 14px; font-family: var(--mono); }

/* scrollbars */
* { scrollbar-color: #1d3347 transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #1d3347; border-radius: 10px; border: 2px solid var(--bg); }
