:root {
  --paper: #fbf2e3;
  --desk: #f4e6d3;
  --ink: #202c40;
  --muted: #61544a;
  --brick: #a74135;
  --line: #c8b59d;
  --night: #132032;
  --cream: #fff3df;
  --mint: #9bd1c1;
  --action-fill: var(--ink);
  --action-text: var(--cream);
  --action-hover: var(--brick);
  --tab-hover: #fff4de;
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", SimSun, serif;
  --sans: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  --mono: "SFMono-Regular", Consolas, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.65 var(--sans); }
p, h1, h2, h3, figure { margin: 0; }
img, video { display: block; max-width: 100%; height: auto; }
a, button, input { color: inherit; font: inherit; }
a { text-decoration: none; }
button { cursor: pointer; }
button:disabled { cursor: default; }
a:focus-visible, button:focus-visible, input:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--brick);
  outline-offset: 4px;
}
.wrap { width: min(1240px, calc(100% - clamp(42px, 9vw, 128px))); margin-inline: auto; }
.skip-to-main { position: fixed; z-index: 5; top: 12px; left: 12px; padding: 9px 14px; background: var(--ink); color: white; transform: translateY(calc(-100% - 24px)); }
.skip-to-main:focus { transform: none; }

.site-header, .site-footer {
  min-height: 77px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; justify-self: start; gap: 9px; width: fit-content; font-size: 23px; font-weight: 750; letter-spacing: -.06em; white-space: nowrap; }
.site-header nav, .site-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px clamp(20px, 3vw, 47px); font-size: 14px; font-weight: 650; }
.site-header nav a:hover, .site-footer a:hover, .plain-link:hover { color: var(--brick); }
.site-download, .back-top { justify-self: end; font-size: 14px; font-weight: 700; white-space: nowrap; }
.site-download { border: 1px solid var(--ink); border-radius: 2px; padding: 8px 13px; }
.site-download:hover { background: var(--action-fill); color: var(--action-text); }
.site-download span, .primary-link span { margin-inline-start: 5px; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.32fr) minmax(0, .92fr);
  align-items: center;
  gap: clamp(20px, 4vw, 62px);
  padding-block: clamp(20px, 3.7vh, 42px) clamp(36px, 6vh, 70px);
}
.hero-copy { min-width: 0; padding-block: 8px; }
.eyebrow { color: var(--brick); display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 750; letter-spacing: .1em; }
.eyebrow::before { content: ""; width: 21px; height: 2px; flex: none; background: currentColor; }
.hero h1, .section-heading h2, .stage-copy h3, .closing h2 {
  font-family: var(--serif);
  font-weight: 800;
  letter-spacing: -.058em;
}
.hero h1 { font-size: clamp(46px, 5.66vw, 85px); line-height: 1.01; margin-block: 19px 25px; }
.hero h1 em { font-style: normal; color: var(--brick); }
.hero-description { max-width: 25em; color: var(--muted); font-size: clamp(15px, 1.38vw, 19px); line-height: 1.75; }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 11px 23px; margin-top: 29px; }
.primary-link, .plain-link { min-height: 48px; display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 750; }
.primary-link { padding: 9px 16px; background: var(--action-fill); color: var(--action-text); border: 1px solid var(--action-fill); border-radius: 3px; }
.primary-link:hover { background: var(--action-hover); border-color: var(--action-hover); }
.plain-link { text-decoration: underline; text-underline-offset: 4px; }
.play-icon { width: 0; height: 0; display: inline-block; border: solid transparent; border-width: 5px 0 5px 8px; border-left-color: currentColor; flex: none; }
.hero-portrait {
  justify-self: center;
  width: min(100%, 440px, 43svh);
  aspect-ratio: 720 / 1120;
  isolation: isolate;
}
.hero-portrait::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: auto 7% 1.5% 26%;
  height: 5%;
  background: radial-gradient(ellipse, #0002, transparent 72%);
  pointer-events: none;
}
.hero-portrait > :is(img, canvas) { width: 100%; height: 100%; object-fit: contain; }
.hero-portrait > .character-toggle { inset: auto auto 2px 0; }
[data-character-scene] { position: relative; }
[data-character-scene] > canvas { position: absolute; inset: 0; display: block; pointer-events: none; }
[data-character-scene]:has(> canvas:not([hidden])) > img { opacity: 0; }
.character-toggle {
  position: absolute;
  inset: auto 10px 10px auto;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
}
.character-toggle:hover { color: var(--brick); }
.character-toggle:focus-visible { outline-offset: 2px; }

.workbench { background: var(--desk); border-top: 1px solid var(--line); padding: clamp(56px, 7.5vw, 104px) 0; }
.section-heading { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, .74fr); align-items: end; gap: 24px; margin-bottom: clamp(25px, 4vw, 47px); }
.section-heading h2, .closing h2 { font-size: clamp(38px, 5vw, 72px); line-height: 1.08; text-wrap: pretty; }
.section-heading > p { max-width: 20em; color: var(--muted); justify-self: end; line-height: 1.7; }
.step-tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; border-block: 1px solid var(--line); }
.step-tabs button {
  display: flex;
  justify-content: flex-start;
  align-items: baseline;
  gap: clamp(7px, 1.1vw, 17px);
  padding: 13px clamp(8px, 1.25vw, 17px);
  min-height: 56px;
  border: 0;
  border-inline-end: 1px solid var(--line);
  background: transparent;
  text-align: start;
  font-weight: 700;
  font-size: clamp(13px, 1.4vw, 17px);
}
.step-tabs button:last-child { border-inline-end: 0; }
.step-tabs button span { font: 12px var(--mono); color: var(--brick); }
.step-tabs button:hover { background: var(--tab-hover); }
.step-tabs button[aria-selected="true"] { background: var(--action-fill); color: var(--action-text); }
.step-tabs button[aria-selected="true"] span { color: var(--mint); }
.stage-panel { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: clamp(18px, 3.3vw, 52px); align-items: center; padding-top: clamp(16px, 2.6vw, 37px); }
.stage-art { aspect-ratio: 16 / 9; isolation: isolate; margin-bottom: 36px; }
.stage-art > :is(img, canvas) { width: 100%; height: 100%; object-fit: contain; }
.stage-art > .character-toggle {
  inset: auto 0 -36px auto;
  width: auto;
  height: 36px;
  padding-inline: 9px;
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.stage-detail { min-width: 0; }
.stage-copy h3 { font-size: clamp(25px, 3.1vw, 43px); line-height: 1.12; }
.stage-copy p { color: var(--muted); max-width: 25em; margin-block: 11px 19px; }
.stage-screen { background: var(--paper); border: 1px solid var(--line); border-radius: 3px; padding: 0; display: grid; grid-template-columns: minmax(77px, 40%) 1fr; align-items: center; min-height: 62px; overflow: hidden; }
.stage-screen img { width: 100%; border-inline-end: 1px solid var(--line); }
.stage-screen > span { padding: 8px 12px; text-align: start; font-size: 13px; font-weight: 750; }
.stage-screen:hover { border-color: var(--brick); color: var(--brick); }
.stage-screen:disabled { opacity: .78; }
#stage-load-status { margin-top: 8px; color: var(--brick); font-size: 13px; }
#stage-load-status:empty { margin: 0; }

.screening { padding: clamp(54px, 7.5vw, 104px) 0; background: var(--night); color: var(--cream); }
.screening a:focus-visible, .screening button:focus-visible, .screening input:focus-visible { outline-color: var(--mint); }
.screening .eyebrow { color: var(--mint); margin-bottom: 9px; }
.screening .section-heading > p { color: #d6d1c6; }
.screening-desk { display: grid; grid-template-columns: minmax(0, 1fr) clamp(190px, 23vw, 300px); gap: clamp(17px, 3vw, 42px); align-items: start; scroll-margin-top: 18px; }
.screen-frame { min-width: 0; }
.screen-projection { position: relative; aspect-ratio: 16 / 9; background: #080f1a; border: 1px solid #5b687b; }
.screen-projection video { width: 100%; height: 100%; object-fit: contain; }
.screen-play {
  position: absolute;
  inset: 50% auto auto 50%;
  translate: -50% -50%;
  width: clamp(54px, 6vw, 84px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid #fff3dfa0;
  border-radius: 50%;
  color: var(--cream);
  background: #142236d9;
}
.screen-play:hover { background: var(--brick); }
.screen-play .play-icon { border-width: 10px 0 10px 17px; margin-inline-start: 4px; }
.transport { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0 8px; border-bottom: 1px solid #526075; }
.transport button { border: 1px solid #657084; background: transparent; padding: 4px 9px; min-height: 36px; min-width: 54px; font-size: 13px; }
.transport button:hover { border-color: var(--mint); }
.transport input { width: 100%; accent-color: var(--mint); }
.timecode, .shot time { font: 12px var(--mono); font-variant-numeric: tabular-nums; }
#media-status { color: #cacfd8; margin-top: 8px; font-size: 12px; }
.screen-chapters { min-width: 0; display: grid; gap: 14px; }
#frame-detail { min-height: 2.8em; color: #d6d1c6; font-size: 14px; }
.reel { display: grid; grid-template-columns: minmax(0, 1fr); }
.shot {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(50px, 42%) minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 9px 0;
  border: 0;
  border-bottom: 1px solid #4a5668;
  text-align: start;
  background: transparent;
}
.shot:first-child { border-top: 1px solid #4a5668; }
.shot img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; opacity: .7; }
.shot strong, .shot time { display: block; }
.shot strong { font-size: 14px; }
.shot time { margin-top: 5px; color: #c2c9d3; }
.shot:hover img, .shot[aria-pressed="true"] img { opacity: 1; }
.shot[aria-pressed="true"] { border-color: var(--mint); }
.shot[aria-pressed="true"] time { color: var(--mint); }

.closing {
  padding-block: clamp(48px, 6.5vw, 96px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 22px 34px;
}
.closing p { color: var(--muted); margin-top: 13px; }
.closing-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px 20px; }
.site-footer { border-bottom: 0; border-top: 1px solid var(--line); }
.site-footer .brand { font-size: 20px; }

dialog { width: min(1320px, calc(100% - 26px)); max-height: calc(100% - 26px); padding: 16px; border: 1px solid var(--line); color: var(--ink); background: var(--paper); }
dialog::backdrop { background: #101b2cdb; }
.dialog-top { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 13px; }
.dialog-top h2 { margin-inline-end: auto; font: 700 17px/1.4 var(--sans); }
.dialog-top button { padding: 6px 9px; min-height: 39px; border: 1px solid var(--line); background: transparent; font-size: 13px; }
.dialog-top button[aria-pressed="true"] { border-color: var(--brick); color: var(--brick); }
.dialog-image { max-height: 76dvh; overflow: auto; }
.dialog-image img { width: 100%; max-height: 76dvh; object-fit: contain; }
.dialog-image[data-zoomed] img { width: 1280px; max-width: none; max-height: none; }

@media (max-width: 850px) {
  .hero { gap: 20px; }
  .hero h1 { font-size: clamp(37px, 6vw, 56px); margin-block: 13px 17px; }
  .hero-actions { gap: 7px 15px; margin-top: 20px; }
  .section-heading { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .section-heading > p { justify-self: start; max-width: 32em; }
}
@media (max-width: 660px) {
  .wrap { width: calc(100% - 36px); }
  .site-header, .site-footer { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding-block: 12px; }
  .site-header nav, .site-footer nav { grid-row: 2; grid-column: 1 / -1; justify-content: start; gap: 8px 20px; }
  .site-display-tools, .back-top { grid-row: 1; grid-column: 2; }
  .hero { grid-template-columns: minmax(0, 1fr); padding-block: 24px 40px; gap: 13px; }
  .hero h1 { font-size: clamp(38px, 10.3vw, 62px); }
  .hero-portrait { width: min(74%, 310px, 33svh); }
  .step-tabs button { flex-direction: column; justify-content: center; gap: 3px; padding: 7px 3px; font-size: clamp(11px, 3.05vw, 15px); }
  .step-tabs button span { font-size: 11px; }
  .stage-panel, .screening-desk { grid-template-columns: minmax(0, 1fr); }
  .stage-copy p { margin-block: 7px 13px; }
  .reel { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; }
  .shot { grid-template-columns: minmax(45px, 42%) minmax(0, 1fr); }
  .shot:first-child { border-top: 0; }
  .shot strong { font-size: 12px; }
  #frame-detail { min-height: 0; }
  .closing { gap: 17px; }
}
@media (prefers-reduced-motion: no-preference) {
  .hero-copy { animation: copy-enter 430ms cubic-bezier(.18, .73, .22, 1) both; }
  .hero-portrait { animation: portrait-enter 550ms cubic-bezier(.18, .73, .22, 1) both; }
  .shot img { transition: opacity .18s; }
}
@keyframes copy-enter {
  from { opacity: .35; transform: translateY(9px); }
  to { opacity: 1; transform: none; }
}
@keyframes portrait-enter {
  from { opacity: .4; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
