:root {
  color-scheme: dark;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #f0f5ff;
  background: #08111d;
  --line: #28384d;
  --muted: #aabbd0;
  --mint: #7ce9dc;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(ellipse at 77% 5%, #14283b 0, transparent 43%), #08111d; }
button, input, select, textarea { font: inherit; }
button, a, select, input[type="range"], summary { touch-action: manipulation; }
a { color: inherit; text-underline-offset: 4px; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 4px; }
.shell { width: min(1100px, calc(100% - 64px)); margin-inline: auto; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.topbar { border-bottom: 1px solid #26374a; }
.topbar-inner { min-height: 67px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.identity { display: inline-flex; align-items: center; gap: 10px; font-weight: 720; letter-spacing: -.035em; font-size: 20px; text-decoration: none; }
.identity img { border-radius: 8px; border: 1px solid #2b4355; }
.sample-link { font-size: 13px; font-weight: 650; color: var(--muted); text-decoration: none; }
.sample-link:hover, .sample-link span { color: var(--mint); }

.intro { padding-block: 43px 28px; }
.intro h1 { margin: 0; font-size: clamp(37px, 6vw, 67px); line-height: 1; letter-spacing: -.067em; font-weight: 760; }
.intro h1 span { color: var(--mint); }
.intro p { color: var(--muted); margin: 15px 0 0; font-size: clamp(15px, 2vw, 18px); line-height: 1.55; }

.studio { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.06fr); border: 1px solid var(--line); border-radius: 20px; background: #101b2a; overflow: hidden; }
.controls { padding: 29px 31px 23px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.field { color: #e0ebfa; display: block; font-size: 13px; font-weight: 680; margin-bottom: 8px; }
.field small { margin-left: 5px; font-size: 11px; font-weight: 500; color: var(--muted); white-space: nowrap; }
fieldset > select, fieldset > input { margin-bottom: 18px; }
input:not([type="range"]), select, textarea { width: 100%; padding: 11px 12px; color: inherit; border: 1px solid #32445d; border-radius: 8px; background: #0a1422; line-height: 1.35; font-size: 14px; }
textarea { min-height: 70px; resize: vertical; }
.caption-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.format-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: center; }
.format-value { padding-left: 8px; }
.format-value > span:last-child { display: block; padding-block: 10px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.export-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin-top: 24px; }
.primary { display: inline-flex; align-items: center; gap: 18px; min-height: 44px; border: 0; border-radius: 9px; padding: 0 16px; background: var(--mint); color: #081c24; font-weight: 760; font-size: 14px; cursor: pointer; }
.primary:hover { background: #9ff4e9; }
.primary:disabled { opacity: .62; cursor: wait; }
.download { font-size: 14px; font-weight: 700; color: var(--mint); }
.status { min-height: 1.5em; color: var(--muted); margin: 11px 0 0; font-size: 12px; line-height: 1.5; }

.preview-panel { display: flex; flex-direction: column; min-width: 0; background: #0b1523; border-left: 1px solid var(--line); }
.preview-heading { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.preview-heading h2 { margin: 0; font-size: 14px; font-weight: 720; }
.preview-heading span { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.preview-stage { flex: 1; min-height: 362px; display: grid; place-items: center; padding: 18px; background: radial-gradient(ellipse at center, #172a43, #0b1523 76%); }
canvas { display: block; width: min(100%, 216px); height: auto; aspect-ratio: 9 / 16; border-radius: 13px; border: 1px solid #416079; box-shadow: 0 16px 36px #030810c2; }
.transport { display: flex; align-items: center; gap: 12px; padding: 12px 15px; border-top: 1px solid var(--line); }
.play { padding: 7px 9px; min-width: 60px; color: #e8f2ff; border: 1px solid #34465c; border-radius: 7px; background: #152235; cursor: pointer; font-size: 12px; }
.play:disabled { opacity: .55; cursor: default; }
input[type="range"] { flex: 1; min-width: 28px; margin: 0; accent-color: var(--mint); }
.time { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }

.python-sample { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 22px; align-items: start; padding: 24px 0 42px; scroll-margin-top: 16px; }
.python-sample h2 { margin: 0 0 7px; font-size: 17px; }
.python-sample p { color: var(--muted); margin: 0; font-size: 13px; line-height: 1.5; max-width: 570px; }
details { min-width: 138px; }
summary { cursor: pointer; color: var(--mint); font-size: 13px; padding-block: 5px; font-weight: 660; }
video { display: block; width: min(100%, 220px); max-height: 390px; margin-top: 12px; border-radius: 10px; background: #050a11; }

@media (max-width: 780px) {
  .shell { width: calc(100% - 36px); }
  .controls { padding: 22px 20px; }
  .caption-fields { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .studio { grid-template-columns: 1fr; }
  .preview-panel { border-left: 0; border-top: 1px solid var(--line); }
  .intro { padding-block: 32px 23px; }
  .caption-fields { grid-template-columns: 1fr 1fr; }
  .python-sample { grid-template-columns: 1fr; gap: 9px; }
  .topbar-inner { min-height: 60px; }
}
@media (max-width: 380px) {
  .shell { width: calc(100% - 24px); }
  .identity { font-size: 17px; }
  .sample-link { font-size: 11px; }
  .caption-fields { grid-template-columns: 1fr; }
}

.demo-footer { display: flex; flex-wrap: wrap; gap: 12px 22px; padding-block: 24px; }
.demo-footer a { color: inherit; text-underline-offset: .2em; }
