:root {
  color-scheme: dark;
  --bg: #090a0d;
  --panel: #111318;
  --line: #292d35;
  --text: #f4f5f7;
  --muted: #9ca3af;
  --accent: #79b7ff;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

a { color: inherit; }

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  border-bottom: 1px solid var(--line);
}

.brand {
  font-weight: 750;
  text-decoration: none;
}

.nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

.nav a {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
}

.nav a:hover,
.nav a[aria-current="page"] { color: var(--text); }

header {
  padding: 44px 0 28px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  max-width: 760px;
  font-size: 62px;
  line-height: 1;
  letter-spacing: 0;
}

.lede {
  max-width: 720px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 16px;
}

.scene-picker {
  display: flex;
  gap: 6px;
  padding: 28px 0 14px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.scene-tab {
  flex: none;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.scene-tab:hover,
.scene-tab:focus-visible {
  border-color: #4d5664;
  color: var(--text);
  outline: none;
}

.scene-tab.is-active {
  border-color: var(--accent);
  background: #172538;
  color: var(--text);
}

.scene-viewer {
  padding-bottom: 44px;
}

.scene-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 0 14px;
}

.scene-actions {
  display: flex;
  flex: none;
  gap: 8px;
}

.scene-action {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.scene-action:hover,
.scene-action:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.scene-action[hidden] { display: none; }

.scene-stage {
  position: relative;
  height: min(76vh, 820px);
  min-height: 560px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #000;
}

.scene-stage::after {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #090a0d;
  color: var(--muted);
  content: "Loading scene";
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease;
}

.scene-stage.is-loading::after { opacity: 1; }

.scene-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

.recordings {
  border-top: 1px solid var(--line);
}

.recordings summary {
  padding: 22px 0;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}

.recordings[open] summary { color: var(--text); }

.gallery {
  display: grid;
  gap: 34px;
  padding: 34px 0 64px;
}

.entry {
  border-bottom: 1px solid var(--line);
  padding-bottom: 34px;
}

.entry:last-child { border-bottom: 0; }

.entry-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 12px;
}

h2 {
  margin: 0;
  font-size: 21px;
  line-height: 1.2;
  letter-spacing: 0;
}

.meta {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.download {
  flex: none;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.download:hover { text-decoration: underline; }

video {
  display: block;
  width: 100%;
  max-height: 78vh;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #000;
  object-fit: contain;
}

.portrait video {
  max-width: 620px;
  margin: 0 auto;
}

footer {
  padding: 24px 0 48px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 680px) {
  .shell { width: min(100% - 20px, 1180px); }
  .topbar { min-height: 56px; }
  .nav { gap: 12px; }
  .nav a { font-size: 12px; }
  header { padding: 32px 0 22px; }
  h1 { font-size: 36px; }
  .scene-picker { padding-top: 20px; }
  .scene-toolbar { align-items: start; }
  .scene-toolbar h2 { font-size: 17px; }
  .scene-actions { gap: 6px; }
  .scene-action { min-height: 34px; padding: 0 9px; font-size: 12px; }
  .scene-stage { height: 68vh; min-height: 480px; }
  .gallery { gap: 28px; padding-top: 24px; }
  .entry { padding-bottom: 28px; }
  .entry-head { align-items: start; }
  h2 { font-size: 18px; }
  .download { padding-top: 2px; }
  video { border-radius: 4px; }
}
