:root {
  --bg: #07080d;
  --surface: rgba(255, 255, 255, 0.05);
  --surface-2: rgba(255, 255, 255, 0.09);
  --solid: #12141d;
  --line: rgba(255, 255, 255, 0.14);
  --line-strong: rgba(255, 255, 255, 0.38);
  --text: #f5f6fa;
  --muted: #bcc3d4;
  --cyan: #22d3ee;
  --violet: #8f90fa;
  --pink: #f472d0;
  --grad: linear-gradient(120deg, #22d3ee 0%, #8f90fa 55%, #f472d0 100%);
  --ink: #05060a;
  --danger: #ff96a3;
  --ok: #5eeaa8;
  --warn: #ffd166;
  --radius: 1.1rem;
  --shadow: 0 1.2rem 3rem rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { font-size: 20px; }
html.big { font-size: 25px; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(60rem 36rem at 8% -12%, rgba(34, 211, 238, 0.17), transparent 62%),
    radial-gradient(52rem 36rem at 104% 4%, rgba(244, 114, 208, 0.15), transparent 60%),
    radial-gradient(60rem 40rem at 50% 118%, rgba(143, 144, 250, 0.14), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

main { max-width: 1320px; margin: 0 auto; padding: 1.5rem 1.25rem 5rem; }
main.narrow { max-width: 520px; padding-top: 4rem; }

h1 { font-size: 2.2rem; line-height: 1.15; letter-spacing: -0.02em; font-weight: 800; margin: 0.5rem 0 1rem; }
h2 { font-size: 1.25rem; letter-spacing: -0.01em; margin: 0 0 0.75rem; }
p { margin: 0.5rem 0; }
.lead { color: var(--muted); font-size: 1.05rem; }
.status { min-height: 1.6rem; font-weight: 600; }
.error { color: var(--danger); font-weight: 700; }
.label { color: var(--muted); font-weight: 700; margin: 1rem 0 0.5rem; }
.note { color: var(--warn); font-weight: 600; }
.empty { color: var(--muted); text-align: center; padding: 3rem 1rem; border: 2px dashed var(--line); border-radius: var(--radius); }

/* ---------- header ---------- */

.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.7rem 1.25rem;
  background: rgba(7, 8, 13, 0.72);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex; align-items: center; gap: 0.6rem;
  background: none; border: 0; padding: 0.4rem; cursor: pointer;
  font: inherit; font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em; color: var(--text);
}
.logo { width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--grad); box-shadow: 0 0 1.2rem rgba(143, 144, 250, 0.7); position: relative; }
.logo::after { content: ""; position: absolute; inset: 32%; border-radius: 50%; background: var(--bg); }

.steps { display: flex; gap: 0.5rem; list-style: none; margin: 0; padding: 0; }
.steps li {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.35rem 0.9rem 0.35rem 0.4rem; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted); font-weight: 700; font-size: 0.9rem;
}
.steps li span {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--surface-2); color: var(--text);
}
.steps li.on { color: var(--text); border-color: var(--line-strong); background: var(--surface-2); }
.steps li.on span, .steps li.done span { background: var(--grad); color: var(--ink); }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 3rem; padding: 0.6rem 1.3rem;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 999px;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  transition: transform 0.12s, border-color 0.12s, box-shadow 0.12s, background 0.12s;
}
.btn:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.primary { background: var(--grad); color: var(--ink); border-color: transparent; font-weight: 800; box-shadow: 0 0.5rem 1.6rem rgba(143, 144, 250, 0.35); }
.btn.primary:hover { box-shadow: 0 0.6rem 2.2rem rgba(143, 144, 250, 0.6); }
.btn.big { min-height: 3.8rem; padding: 0.8rem 2rem; font-size: 1.2rem; }
.btn.small { min-height: 2.5rem; padding: 0.3rem 1rem; font-size: 0.9rem; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }

:focus-visible { outline: 3px solid #ffffff; outline-offset: 3px; }

.row { display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: center; margin-top: 1.5rem; }
.row.between { justify-content: space-between; }
.row.tight { margin-top: 0.8rem; gap: 0.5rem; }

/* ---------- surfaces ---------- */

.panel, .fold, .card, .tile, .choice {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.panel { padding: 1.3rem; margin: 1rem 0; box-shadow: var(--shadow); }

label { display: block; font-weight: 700; margin: 0.9rem 0 0.35rem; }
input[type="text"], input[type="password"] {
  width: 100%; min-height: 3rem; padding: 0.5rem 0.9rem;
  background: rgba(0, 0, 0, 0.45); color: var(--text);
  border: 1px solid var(--line-strong); border-radius: 0.7rem; font: inherit;
}
input[type="text"]:focus, input[type="password"]:focus { border-color: var(--cyan); outline: 3px solid rgba(34, 211, 238, 0.35); outline-offset: 0; }
form .btn { margin-top: 1.3rem; width: 100%; }
.check { display: flex; align-items: center; gap: 0.8rem; cursor: pointer; }
.check input { width: 1.5rem; height: 1.5rem; accent-color: var(--violet); flex: none; }

.hero { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem; margin: 1rem 0 1.5rem; }
.hero h1 { font-size: 2.8rem; margin: 0; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { margin: 0.3rem 0 0; }

.drop {
  display: flex; flex-direction: column; align-items: center; gap: 0.4rem;
  padding: 2.6rem 1rem; margin: 1rem 0; text-align: center; cursor: pointer;
  background: var(--surface); border: 2px dashed var(--line-strong); border-radius: 1.4rem;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.drop:hover, .drop.over { border-color: var(--cyan); background: var(--surface-2); box-shadow: 0 0 3rem rgba(34, 211, 238, 0.18); }
.drop:focus-within { outline: 3px solid #ffffff; outline-offset: 3px; }
.drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.drop-icon { font-size: 3rem; line-height: 1; }
.drop-title { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.01em; }
.drop-hint { color: var(--muted); font-weight: 400; }

.bar { height: 1rem; background: rgba(0, 0, 0, 0.5); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.bar > div { height: 100%; width: 0; background: var(--grad); border-radius: 999px; transition: width 0.4s; }
.tall-bar { height: 1.6rem; }
.phase { font-size: 1.25rem; font-weight: 700; margin-top: 0; }
.pct { font-size: 2.6rem; font-weight: 800; letter-spacing: -0.03em; text-align: center; margin: 0.6rem 0 0; }

/* ---------- list of videos ---------- */

.list { display: grid; grid-template-columns: repeat(auto-fill, minmax(21rem, 1fr)); gap: 1.1rem; }
.card { overflow: hidden; box-shadow: var(--shadow); transition: transform 0.15s, border-color 0.15s; }
.card:hover { transform: translateY(-3px); border-color: var(--line-strong); }
.card img, .card .noimg { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--solid); }
.card .noimg { display: flex; align-items: center; justify-content: center; font-size: 3rem; }
.card .body { padding: 1rem 1.1rem 1.2rem; }
.card h3 { margin: 0; font-size: 1.25rem; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.card .meta { color: var(--muted); margin: 0.2rem 0 0; }
.card .row { margin-top: 0.9rem; gap: 0.5rem; }
.tag { font-weight: 800; }
.tag.ok { color: var(--ok); }
.tag.warn { color: var(--warn); }
.tag.bad { color: var(--danger); }

/* ---------- photos ---------- */

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: 0.8rem; }
.tile { padding: 0.45rem; }
.tile img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 0.75rem; }
.tile .num { font-weight: 800; text-align: center; margin: 0.3rem 0; }
.tile .tools { display: flex; gap: 0.3rem; }
.tile .tools .btn { flex: 1; min-height: 2.6rem; padding: 0.2rem; font-size: 1.05rem; }

/* ---------- studio ---------- */

.studio { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.studio-left { position: sticky; top: 5rem; }
.stage {
  position: relative; margin: 0 auto; overflow: hidden;
  background: #000; border: 1px solid var(--line-strong); border-radius: 1.2rem;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6), 0 1.5rem 4rem rgba(0, 0, 0, 0.6), 0 0 5rem rgba(143, 144, 250, 0.2);
}
.stage.wide { aspect-ratio: 16 / 9; }
.stage.tall { aspect-ratio: 9 / 16; max-height: 72vh; }
.stage.square { aspect-ratio: 1 / 1; max-height: 72vh; }
.stage canvas { display: block; width: 100%; height: 100%; }
.stage-msg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; margin: 0; color: var(--muted); font-weight: 700; }
.transport { display: flex; align-items: center; gap: 0.9rem; margin-top: 1rem; }
.transport .btn { flex: none; min-width: 9.5rem; }
.clock { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--muted); min-width: 5.5rem; text-align: right; }
input[type="range"] { flex: 1; height: 2.4rem; accent-color: var(--violet); cursor: pointer; }

.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr)); gap: 0.7rem; }
.choice { display: flex; flex-direction: column; gap: 0.2rem; margin: 0; padding: 0.9rem 1rem; cursor: pointer; border-width: 2px; transition: transform 0.12s, border-color 0.12s; }
.choice:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.choice input { position: absolute; opacity: 0; }
.choice:has(input:checked) {
  border-color: transparent;
  background: linear-gradient(#171a26, #171a26) padding-box, var(--grad) border-box;
  box-shadow: 0 0 2rem rgba(143, 144, 250, 0.3);
}
.choice:has(input:focus-visible), .chip:has(input:focus-visible) { outline: 3px solid #ffffff; outline-offset: 3px; }
.choice-title { font-size: 1.15rem; font-weight: 800; letter-spacing: -0.01em; }
.choice-text { color: var(--muted); font-weight: 400; font-size: 0.92rem; line-height: 1.35; }

.fold { margin-top: 0.8rem; padding: 0 1.1rem; }
.fold > summary {
  display: flex; align-items: center; gap: 0.6rem; padding: 1rem 0; cursor: pointer;
  font-size: 1.1rem; font-weight: 800; list-style: none;
}
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::after { content: "▾"; margin-left: auto; color: var(--muted); transition: transform 0.15s; }
.fold[open] > summary::after { transform: rotate(180deg); }
.fold[open] { padding-bottom: 1.1rem; }
.count { color: var(--muted); font-weight: 600; font-size: 0.9rem; }

.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
  display: inline-flex; align-items: center; gap: 0.45rem; margin: 0;
  min-height: 2.7rem; padding: 0.35rem 1rem; cursor: pointer;
  background: var(--surface); border: 2px solid var(--line); border-radius: 999px;
  font-weight: 600; transition: border-color 0.12s, background 0.12s;
}
.chip:hover { border-color: var(--line-strong); }
.chip input { position: absolute; opacity: 0; }
.chip:has(input:checked) {
  border-color: transparent; font-weight: 800;
  background: linear-gradient(#1b1e2c, #1b1e2c) padding-box, var(--grad) border-box;
}
.chip:has(input:checked)::before { content: "✓"; color: var(--cyan); font-weight: 900; }

video { display: block; width: 100%; max-height: 72vh; background: #000; border-radius: 1.2rem; border: 1px solid var(--line-strong); box-shadow: var(--shadow); }

.toast {
  position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); z-index: 10;
  width: min(92vw, 40rem); padding: 1rem 1.3rem;
  background: #2b0d16; color: #ffffff; border: 2px solid var(--danger); border-radius: 1rem;
  font-weight: 700; font-size: 1.05rem; box-shadow: var(--shadow);
}

@media (max-width: 1000px) {
  .studio { grid-template-columns: 1fr; }
  .studio-left { position: static; }
  .steps li { padding: 0.3rem; border: 0; font-size: 0; gap: 0; }
  .steps li span { font-size: 0.9rem; }
}
@media (max-width: 560px) {
  h1, .hero h1 { font-size: 1.9rem; }
  .list { grid-template-columns: 1fr; }
  .row .btn.big { flex: 1 1 100%; }
  .transport { flex-wrap: wrap; }
  .transport input { order: 3; flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
