/* Auto Edit: page layer on top of house-style.css.
   The stage holds two 9:16 videos (Raw, AI Edit) and shows one or both. */

/* ---------- Stage ---------- */
/* The rail is taller than the stage: don't stretch the stage column, or the badge leaves the video. */
.stage-layout { align-items: start; }
.stage {
  aspect-ratio: auto;
  height: clamp(520px, calc(100dvh - var(--bar-h) - 150px), 800px);
  background: radial-gradient(120% 90% at 50% 0%, #1c1c20, #070708 70%);
  border: 1px solid var(--rule);
}
.panes {
  position: absolute;
  inset: 70px 20px 26px;
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: clamp(12px, 2vw, 28px);
}
.pane {
  position: relative;
  margin: 0;
  height: 100%;
  aspect-ratio: 9 / 16;
  min-width: 0;
}
.pane video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
  background: #000;
}
.pane figcaption {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 6px 10px;
  border: 1px solid var(--glass-line);
  border-radius: 4px;
  background: var(--glass);
  backdrop-filter: blur(10px);
  font: 500 11px / 1 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  pointer-events: none;
}
.pane-edit figcaption { color: var(--accent); }
.stage[data-view='edit'] .pane-raw,
.stage[data-view='raw'] .pane-edit { display: none; }

.stage-top .shortcut-row { grid-area: shortcuts; }
.shortcut-row button { min-height: 34px; padding: 5px 12px; font-size: 11px; }
#sound[aria-pressed='true'] .wave,
#sound:not([aria-pressed='true']) .cross { display: none; }

.stage-play { z-index: 4; }
.stage.playing .stage-play { opacity: 0; pointer-events: none; }
.stage-play { transition: opacity 0.25s; }
/* While playing, the button pauses: keyboard focus shows it, with a pause icon. */
.stage.playing .stage-play:focus-visible { opacity: 1; }
.stage-play .icon-pause,
.stage.playing .stage-play .icon-play { display: none; }
.stage.playing .stage-play .icon-pause { display: inline; }

/* Seekable progress line at the bottom of the stage */
.progress {
  position: absolute; left: 20px; right: 20px; bottom: 10px; height: 4px;
  border-radius: 2px; cursor: pointer; touch-action: none;
  background: color-mix(in srgb, var(--ink) 14%, transparent);
}
.progress::before { content: ''; position: absolute; inset: -10px 0; }
.progress span { display: block; height: 100%; width: 0; border-radius: 2px; background: var(--accent); }
/* The badge is a caption under the stage: over the video it would cover the edit's own captions. */
.stage-badge {
  position: static; max-width: 100%; margin: 10px 0 0; padding: 0;
  border: 0; border-radius: 0; background: none; backdrop-filter: none;
  font-size: 12px; color: var(--muted);
}

/* ---------- Beats rail ---------- */
aside { min-width: 0; }
.beats { display: grid; }
.beat {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 9px 0;
  border-top: 1px solid var(--rule);
  text-align: left;
}
.beat:last-child { border-bottom: 1px solid var(--rule); }
.beat img {
  width: 40px; height: 71px; object-fit: cover; border-radius: 4px;
  opacity: 0.75; transition: opacity 0.2s;
}
.beat .num { display: block; margin-bottom: 4px; font: 500 10px / 1 var(--mono); color: var(--muted); }
.beat strong { display: block; font-size: 13px; font-weight: 500; }
.beat small { display: block; margin-top: 3px; font-size: 11px; line-height: 1.4; color: var(--muted); }
.beat.selected img, .beat:hover img { opacity: 1; }
.beat.selected strong, .beat.selected .num { color: var(--accent); }

.receipt .facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 14px 0 0; font-size: 12px; }
.receipt dt { font: 500 10px / 1.5 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.receipt dd { margin: 0; line-height: 1.45; color: var(--ink); }

/* ---------- Get the skill ---------- */
.get {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 20px 56px;
  margin-top: 64px;
  padding: clamp(22px, 3vw, 40px);
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: var(--panel);
}
.get-head h2 { margin: 12px 0 14px; font: 400 clamp(44px, 4.6vw, 72px) / 0.95 'Instrument Serif', serif; letter-spacing: -0.02em; }
.get-head h2 em { color: var(--accent); }
.get-head > p { margin: 0; max-width: 460px; font-size: 15px; line-height: 1.55; color: var(--muted); }
.get-actions { display: grid; grid-template-columns: 1.3fr 1fr; gap: 8px; margin-top: 24px; max-width: 520px; }
.get-actions .action { justify-content: flex-start; }
.get-steps { list-style: none; margin: 0; padding: 0; }
.get-steps li { display: grid; grid-template-columns: 44px 1fr; gap: 14px; padding: 18px 0; border-top: 1px solid var(--line); }
.get-steps li:first-child { border-top: 0; padding-top: 4px; }
.get-steps h3 { margin: 0 0 6px; font: 400 25px / 1.1 'Instrument Serif', serif; }
.get-steps p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--muted); }
.get-steps a { color: var(--ink); }
.get-steps a:hover { color: var(--accent); }
.get-steps code {
  display: inline-block; margin-top: 10px; padding: 9px 12px;
  border: 1px solid var(--line-2); border-radius: 6px; background: var(--bg);
  font: 500 13px / 1.3 var(--mono); color: var(--ink); word-break: break-all;
}
.get-needs { grid-column: 1 / -1; margin: 4px 0 0; padding-top: 18px; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.55; color: var(--muted); }
.get-needs b { margin-right: 10px; font: 500 11px / 1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }

.how-downloads { grid-template-columns: repeat(2, 1fr); }

/* Footer: the shared runtime mounts its tool links in [data-exploration-controls] */
.foot {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; margin-top: 48px;
  padding: 22px 4.2%; border-top: 1px solid var(--rule); background: var(--exploration-footer-bg);
  font: 400 12px / 1.4 var(--mono); color: var(--muted);
}
.foot-id { letter-spacing: 0.1em; text-transform: uppercase; }
.foot-link { min-height: 44px; display: inline-flex; align-items: center; color: var(--ink); text-decoration: none; }
.foot-link:hover { color: var(--accent); }
.foot [data-exploration-controls] { flex: 1 1 320px; display: flex; justify-content: flex-end; border-top: 0; background: none; } /* the footer draws the rule and background */

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .beats { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 20px; }
  .beat:nth-last-child(2) { border-bottom: 1px solid var(--rule); }
}
@media (max-width: 820px) {
  /* three actions in the mobile bar instead of four */
  .bar-actions { grid-template-columns: minmax(0, 1.45fr) minmax(0, 0.8fr) minmax(0, 1.35fr); }
}
@media (max-width: 800px) {
  .stage { height: auto; padding: 60px 12px 24px; }
  .panes { position: relative; inset: auto; gap: 10px; }
  .pane { height: auto; width: 100%; max-width: min(100%, calc((100dvh - var(--bar-h) - 120px) * 9 / 16)); }
  .stage[data-view='compare'] .pane { width: calc(50% - 5px); max-width: none; }
  .pane figcaption { left: 6px; bottom: 6px; padding: 5px 7px; font-size: 10px; }
  .get-steps code { font-size: 12px; }
  .stage-top .shortcut-row { position: static; transform: none; grid-area: badges; justify-self: start; }
  .stage-top { grid-template-columns: 1fr auto; grid-template-areas: 'badges tools'; }
  .progress { left: 12px; right: 12px; bottom: 9px; }
  .stage-badge { white-space: normal; }
  .beats { grid-template-columns: 1fr; }
  .beat:nth-last-child(2) { border-bottom: 0; }
  .get { grid-template-columns: 1fr; margin-top: 40px; }
  .get-actions { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .stage { padding: 56px 8px 22px; }
  .stage-top { inset: 8px; }
  .shortcut-row button { padding: 5px 8px; }
}
