:root {
  color-scheme: light;
  --paper: #f5f2ea;
  --paper-deep: #ece6da;
  --ink: #292c27;
  --muted: #71756b;
  --accent: #a54334;
  --accent-dark: #883427;
  --green: #576d5f;
  --line: rgba(75, 76, 61, .17);
  --lead: #5f6158;
  --panel: #f8f5ed;
  --on-accent: #fffaf0;
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", "Noto Serif SC", SimSun, serif;
  --sans: "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #181d19;
  --paper-deep: #222922;
  --ink: #eee8dc;
  --muted: #adb4a6;
  --accent: #db927b;
  --accent-dark: #eda58e;
  --green: #a6bdab;
  --line: rgba(209, 218, 195, .19);
  --lead: #c4c9bc;
  --panel: #222922;
  --on-accent: #18201a;
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  background: var(--paper);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 82% 38%, rgba(164, 67, 52, .025), transparent 35%),
    var(--paper);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-underline-offset: 4px; }
button { color: inherit; font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
svg { display: block; width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  z-index: 30;
  top: 8px;
  left: 12px;
  padding: 8px 14px;
  color: var(--on-accent);
  background: var(--accent-dark);
  transform: translateY(-150%);
}

.skip-link:focus { transform: translateY(0); }

.site-header {
  position: sticky;
  z-index: 10;
  top: 0;
  flex: 0 0 auto;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.header-inner {
  width: min(calc(100% - 44px), 1200px);
  min-height: 92px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 52px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  font: 23px/1 var(--serif);
}

.brand-copy { display: grid; gap: 1px; }
.brand-copy strong { font: 500 18px/1.4 var(--serif); letter-spacing: .12em; white-space: nowrap; }
.brand-copy small { color: var(--muted); font: 9px/1.5 Georgia, serif; letter-spacing: .16em; }

.header-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  font-size: 12px;
  letter-spacing: .04em;
  white-space: nowrap;
}

.header-nav a,
.header-nav button {
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 0;
  background: transparent;
  text-decoration: none;
  cursor: pointer;
}

.header-nav a:hover,
.header-nav button:hover { color: var(--accent); }
.header-nav svg { width: 12px; height: 12px; }
.about-trigger { font-family: var(--sans); }
.header-nav .theme-toggle { width: 44px; padding: 0; }
.header-nav .theme-toggle svg { width: 17px; height: 17px; }
.theme-sun { display: none; }
:root[data-theme="dark"] .theme-moon { display: none; }
:root[data-theme="dark"] .theme-sun { display: block; }

.page-main {
  width: min(calc(100% - 44px), 1160px);
  flex: 1 0 auto;
  margin: 0 auto;
}

.film-room {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(0, .98fr);
  grid-template-rows: auto auto;
  grid-template-areas: "projection heading" "projection index";
  align-items: center;
  column-gap: clamp(56px, 8vw, 112px);
  row-gap: 22px;
  padding: clamp(48px, 6.5vw, 82px) 0 clamp(68px, 8vw, 104px);
}

.page-heading { grid-area: heading; align-self: end; padding-bottom: 5px; }

.eyebrow {
  margin: 0 0 17px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--green);
  font: 9px/1.5 Georgia, serif;
  letter-spacing: .22em;
}

.eyebrow > span { width: 28px; height: 1px; background: var(--accent); }

h1, h2, p { overflow-wrap: anywhere; }

h1 {
  margin: 0;
  font: 400 clamp(39px, 5.2vw, 60px)/1.24 var(--serif);
  letter-spacing: .11em;
}

.page-lead {
  margin: 13px 0 0;
  color: var(--lead);
  font: 400 clamp(17px, 2.1vw, 21px)/1.9 var(--serif);
  letter-spacing: .07em;
}

.page-intro {
  max-width: 390px;
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 2;
}

.projection {
  grid-area: projection;
  justify-self: center;
  align-self: center;
  width: 100%;
  max-width: 100%;
  margin: 0;
}

.projection-label {
  width: min(100%, 360px, 38.25svh);
  min-height: 30px;
  margin: 0 auto 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .09em;
}

.projection-label > span:first-child { color: var(--accent); }
.projection-label i, .index-count i { color: #a8a798; font-style: normal; }

.screen-frame {
  position: relative;
  width: min(100%, 360px, 38.25svh);
  aspect-ratio: 9 / 16;
  margin: 0 auto;
  overflow: clip;
  background: var(--paper-deep);
  box-shadow: 0 18px 40px rgba(70, 56, 33, .11);
}

.screen-cover { position: absolute; inset: 0; width: 100%; height: calc(100% - 48px); object-fit: contain; }

.poster-overlay { position: absolute; z-index: 1; inset: 0 0 48px; display: grid; place-items: center; pointer-events: none; background: var(--paper-deep); }
.poster-overlay img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.poster-play-mark { position: relative; width: 58px; height: 58px; display: grid; place-items: center; border: 1px solid rgba(255, 253, 245, .9); border-radius: 50%; background: rgba(35, 39, 34, .28); }
.poster-play-mark::after { content: ""; width: 0; height: 0; margin-left: 4px; border-top: 10px solid transparent; border-bottom: 10px solid transparent; border-left: 16px solid #fffdf5; }

.screen-frame:not(.is-ready) iframe { pointer-events: none; }
.screen-frame:not(.is-ready) .poster-play-mark { display: none; }
.poster-loading { position: relative; padding: 10px 16px; border-radius: 24px; background: rgba(23, 27, 23, .82); color: #fffdf5; font: 13px/1.5 var(--sans); }
.screen-frame.is-ready .poster-loading { display: none; }

.screen-frame iframe { position: absolute; inset: 0; width: 100%; height: calc(100% + 48px); border: 0; background: #171714; }

/* Keep the 48px playback controls and clip the following 48px promotion row. */
.screen-frame.is-playing { box-sizing: content-box; padding-bottom: 48px; }

.projection-caption {
  width: min(100%, 360px, 38.25svh);
  margin: 12px auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.caption-title { min-width: 0; display: flex; align-items: baseline; gap: 10px; }
.current-index { flex: 0 0 auto; color: var(--accent); font: 12px/1 Georgia, serif; }
.caption-title strong { overflow: hidden; color: var(--ink); font: 400 14px/1.6 var(--serif); letter-spacing: .04em; text-overflow: ellipsis; white-space: nowrap; }

.source-link,
.footer-account {
  min-height: 44px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--accent-dark);
  font-size: 11px;
  letter-spacing: .02em;
  text-decoration: none;
}

.source-link:hover, .footer-account:hover { text-decoration: underline; }
.source-link svg, .footer-account svg { width: 12px; height: 12px; }

.player-status {
  width: min(100%, 360px, 38.25svh);
  margin: 0 auto;
  padding-top: 2px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.8;
}

.film-index { grid-area: index; align-self: start; width: 100%; padding-top: 10px; }

.index-heading {
  min-height: 53px;
  margin-bottom: 8px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.index-kicker { margin: 0 0 3px; color: var(--accent); font: 8px/1.4 Georgia, serif; letter-spacing: .2em; }
.index-heading h2 { margin: 0 0 8px; font: 400 22px/1.3 var(--serif); letter-spacing: .08em; }
.index-count { padding-bottom: 9px; color: var(--green); font: 12px/1 Georgia, serif; letter-spacing: .06em; }
.index-count i { font: 10px/1 var(--sans); }

.film-list { margin: 0; padding: 0; list-style: none; }
.film-list li + li { border-top: 1px solid var(--line); }

.film-option {
  position: relative;
  width: 100%;
  min-height: 100px;
  padding: 15px 8px 15px 0;
  display: grid;
  grid-template-columns: 33px minmax(0, 1fr) 20px;
  align-items: start;
  gap: 8px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.film-option::before { position: absolute; top: 17px; bottom: 17px; left: -12px; width: 2px; content: ""; background: transparent; }
.film-option:hover { color: var(--accent-dark); }
.film-option.is-active::before { background: var(--accent); }
.film-number { padding-top: 3px; color: var(--muted); font: 11px/1.4 Georgia, serif; letter-spacing: .08em; }
.film-option.is-active .film-number { color: var(--accent); }
.film-copy { min-width: 0; display: grid; gap: 5px; }
.film-copy strong { font: 400 17px/1.55 var(--serif); letter-spacing: .04em; }
.film-copy > span { color: var(--muted); font-size: 12px; line-height: 1.9; }
.option-arrow { width: 15px; height: 15px; margin-top: 4px; color: #a4a697; transition: color 160ms ease, transform 160ms ease; }
.film-option:hover .option-arrow, .film-option.is-active .option-arrow { color: var(--accent); transform: translateX(2px); }
.film-option.is-active .film-copy strong { color: var(--accent-dark); }

.index-note {
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .04em;
}

.site-footer { flex: 0 0 auto; border-top: 1px solid var(--line); }
.footer-inner { width: min(calc(100% - 44px), 1200px); margin: 0 auto; }

.footer-top {
  min-height: 74px;
  padding: 14px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 1fr) auto;
  align-items: center;
  gap: 24px;
}

.footer-brand { display: inline-grid; justify-self: start; gap: 2px; text-decoration: none; }
.footer-brand > span { font: 400 15px/1.4 var(--serif); letter-spacing: .08em; }
.footer-brand small { color: var(--muted); font: 8px/1.5 Georgia, serif; letter-spacing: .15em; }
.footer-motto { margin: 0; color: var(--muted); font: 13px/1.6 var(--serif); letter-spacing: .04em; text-align: center; }
.footer-account { justify-self: end; }

.footer-meta {
  min-height: 55px;
  padding: 11px 0 13px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.8;
}

.footer-meta p { margin: 0; text-align: right; }
.footer-meta p span { color: var(--muted); }
.footer-links { display: flex; align-items: center; gap: 22px; }
.footer-home { min-height: 44px; display: inline-flex; align-items: center; color: var(--ink); text-decoration: none; }
.footer-home:hover { color: var(--accent); }

.about-dialog {
  width: min(calc(100% - 32px), 520px);
  max-height: min(86vh, 720px);
  padding: 0;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(45, 42, 33, .2);
}

.about-dialog::backdrop { background: rgba(36, 39, 34, .4); }
.dialog-heading { padding: 25px 27px 18px; display: flex; align-items: start; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); }
.dialog-heading .eyebrow { margin-bottom: 10px; }
.dialog-heading h2 { margin: 0; font: 400 25px/1.5 var(--serif); letter-spacing: .08em; }
.dialog-close { width: 44px; height: 44px; flex: 0 0 auto; display: grid; place-items: center; border: 0; background: transparent; cursor: pointer; }
.dialog-close svg { width: 18px; height: 18px; }
.dialog-content { padding: 18px 27px 26px; color: var(--lead); font-size: 13px; line-height: 2; }
.dialog-content p { margin: 0 0 12px; }
.dialog-done { min-width: 84px; min-height: 44px; margin-top: 8px; padding: 0 16px; color: var(--accent-dark); border: 1px solid color-mix(in srgb, var(--accent) 38%, transparent); background: transparent; cursor: pointer; }
.dialog-done:hover { color: var(--on-accent); border-color: var(--accent-dark); background: var(--accent-dark); }

@media (max-width: 850px) {
  .film-room {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    grid-template-areas: "heading" "projection" "index";
    justify-items: center;
    row-gap: 30px;
    padding-top: 52px;
  }

  .page-heading, .film-index { width: min(100%, 560px); }
  .page-heading { justify-self: start; }
  .projection { width: min(100%, 330px); }
  .projection-label, .projection-caption, .player-status, .screen-frame { width: min(100%, 330px); }
  .screen-frame { max-width: 100%; }
  .film-index { padding-top: 0; }
}

@media (max-width: 560px) {
  .header-inner { width: min(calc(100% - 36px), 1200px); min-height: 76px; gap: 8px; }
  .brand { gap: 8px; }
  .brand-mark { width: 32px; height: 42px; font-size: 19px; }
  .brand-copy strong { font-size: 14px; letter-spacing: .06em; }
  .brand-copy small { display: none; }
  .header-nav { gap: 1px; font-size: 11px; }
  .header-nav a, .header-nav button { min-height: 44px; padding: 0 7px; gap: 3px; }
  .header-nav svg { width: 10px; height: 10px; }
  .page-main { width: min(calc(100% - 40px), 1160px); }
  .film-room { row-gap: 26px; padding: 39px 0 57px; }
  h1 { font-size: clamp(36px, 10.4vw, 48px); letter-spacing: .08em; }
  .eyebrow { margin-bottom: 12px; font-size: 8px; }
  .page-lead { margin-top: 9px; font-size: 17px; }
  .page-intro { margin-top: 9px; font-size: 12px; }
  .projection { width: min(100%, 330px); }
  .projection-label, .projection-caption, .player-status, .screen-frame { width: min(100%, 330px); }
  .screen-frame { max-width: 100%; }
  .projection-caption { margin-top: 8px; gap: 8px; }
  .caption-title { gap: 7px; }
  .caption-title strong { font-size: 13px; }
  .source-link { font-size: 10px; }
  .film-index { width: 100%; }
  .index-heading h2 { font-size: 20px; }
  .film-option { min-height: 94px; padding-block: 13px; grid-template-columns: 27px minmax(0, 1fr) 18px; gap: 6px; }
  .film-option::before { left: -9px; }
  .film-copy strong { font-size: 16px; }
  .film-copy > span { font-size: 11px; line-height: 1.8; }
  .footer-inner { width: min(calc(100% - 40px), 1200px); }
  .footer-top { min-height: 0; padding: 17px 0 13px; grid-template-columns: minmax(0, 1fr) auto; gap: 9px 12px; }
  .footer-brand { grid-column: 1; grid-row: 1; }
  .footer-motto { grid-column: 1; grid-row: 2; justify-self: start; font-size: 12px; text-align: left; }
  .footer-account { grid-column: 2; grid-row: 1 / 3; }
  .footer-meta { min-height: 0; padding: 11px 0 15px; flex-direction: column; align-items: flex-start; gap: 5px; }
  .footer-meta p { text-align: left; }
  .dialog-heading { padding: 19px 18px 15px; }
  .dialog-heading h2 { font-size: 22px; }
  .dialog-content { padding: 15px 18px 21px; font-size: 12px; }
}

@media (max-width: 370px) {
  .header-inner { width: calc(100% - 28px); gap: 4px; }
  .brand { gap: 6px; }
  .brand-mark { width: 29px; height: 40px; font-size: 18px; }
  .brand-copy strong { font-size: 13px; }
  .header-nav { gap: 0; font-size: 10px; }
  .header-nav a, .header-nav button { padding-inline: 6px; }
  .header-nav a:nth-child(2) { gap: 2px; }
  .page-main, .footer-inner { width: calc(100% - 36px); }
  .film-room { padding-top: 32px; }
  .film-copy strong { font-size: 15px; }
  .film-copy > span { font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

@media (max-width: 350px) {
  .header-inner { flex-wrap: wrap; padding-block: 10px; gap: 3px; }
  .header-nav { margin-left: auto; }
}

.brand-mark svg { width: 32px; height: 36px; max-width: calc(100% - 6px); fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.brand-mark .reel-hub { fill: currentColor; stroke: none; }
