:root {
  --ink: #0c0d0d;
  --ink-soft: #131515;
  --paper: #f4f0e8;
  --muted: #a6a39b;
  --line: rgba(244, 240, 232, 0.14);
  --accent: #f36a3d;
  --accent-soft: #c94d2a;
  --success: #8ebc8a;
  --danger: #f08b7d;
  --radius: 22px;
  --font-display: Georgia, "Songti SC", "SimSun", serif;
  --font-body: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 82% 14%, rgba(243, 106, 61, 0.08), transparent 25rem),
    var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
}
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
.hidden { display: none !important; }

.site-header {
  width: min(1180px, calc(100% - 48px));
  min-height: 84px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  width: max-content;
  text-decoration: none;
  letter-spacing: 0.16em;
  font-size: 13px;
  font-weight: 700;
}
.brand svg { width: 24px; height: 24px; color: var(--accent); }
nav { display: flex; gap: 30px; }
nav a, .text-button, footer a {
  text-decoration: none;
  font-size: 14px;
  color: var(--muted);
}
nav a:hover, nav a:focus-visible, .text-button:hover, footer a:hover { color: var(--paper); }
.text-button {
  justify-self: end;
  border: 0;
  background: transparent;
  cursor: pointer;
  min-height: 42px;
}

main { overflow: clip; }
.hero {
  width: min(1180px, calc(100% - 48px));
  min-height: 650px;
  margin: 0 auto;
  padding: 76px 0 82px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.86fr);
  align-items: center;
  gap: clamp(44px, 8vw, 112px);
}
.hero-copy { max-width: 640px; }
.eyebrow {
  margin: 0 0 18px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
h1, h2, h3, p { margin-top: 0; }
h1 {
  margin-bottom: 28px;
  font-family: var(--font-display);
  font-size: clamp(48px, 6vw, 82px);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.055em;
}
.lede {
  max-width: 520px;
  margin-bottom: 34px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.85;
}
.hero-actions { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.primary-button {
  display: inline-flex;
  min-height: 48px;
  padding: 0 22px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #160b07;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease;
}
.primary-button:hover { background: #ff8055; transform: translateY(-1px); }
.primary-button:disabled { opacity: 0.55; cursor: wait; transform: none; }
.quiet-link {
  color: var(--paper);
  font-size: 14px;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: 3px;
}
.quiet-link span { color: var(--accent); }
.session-note {
  margin-top: 30px;
  color: var(--muted);
  font-size: 13px;
}

.projection {
  position: relative;
  min-height: 470px;
  overflow: hidden;
  border: 1px solid rgba(244, 240, 232, 0.1);
  border-radius: 6px 68px 6px 6px;
  background:
    linear-gradient(140deg, rgba(243, 106, 61, 0.38), transparent 38%),
    linear-gradient(315deg, #313b35, transparent 45%),
    #161b19;
  box-shadow: 0 50px 100px rgba(0, 0, 0, 0.38);
  isolation: isolate;
}
.projection::before {
  content: "";
  position: absolute;
  inset: 34px;
  border: 1px solid rgba(244, 240, 232, 0.12);
  border-radius: 2px 42px 2px 2px;
}
.projection::after {
  content: "";
  position: absolute;
  width: 70%;
  aspect-ratio: 1;
  left: -30%;
  bottom: -50%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(243, 106, 61, 0.4), transparent 66%);
  filter: blur(14px);
}
.projection-grain {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0.18;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
}
.projection-copy {
  position: absolute;
  z-index: 2;
  left: 62px;
  right: 50px;
  top: 86px;
  display: grid;
}
.projection-copy span, .projection-copy small {
  font-size: 10px;
  letter-spacing: 0.22em;
}
.projection-copy span { color: var(--accent); }
.projection-copy strong {
  max-width: 330px;
  margin: 150px 0 13px;
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 400;
  line-height: 1.15;
}
.projection-copy small { color: var(--muted); }
.projection-line {
  position: absolute;
  z-index: 2;
  right: 50px;
  bottom: 60px;
  width: 86px;
  height: 2px;
  background: var(--accent);
}

.section {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 88px 0;
}
.library { border-top: 1px solid var(--line); }
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 38px;
}
h2 {
  margin-bottom: 0;
  font-family: var(--font-display);
  font-size: clamp(34px, 4vw, 54px);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.035em;
}
.count { color: var(--muted); font-size: 13px; }
.film-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 30px 22px;
}
.film-card {
  min-width: 0;
  opacity: 0;
  transform: translateY(12px);
  animation: reveal 500ms ease forwards;
  animation-delay: var(--delay);
}
@keyframes reveal { to { opacity: 1; transform: none; } }
.film-visual {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  border-radius: 4px 28px 4px 4px;
  background:
    radial-gradient(circle at 70% 25%, hsl(var(--hue) 38% 32% / 0.78), transparent 35%),
    linear-gradient(145deg, hsl(var(--hue) 22% 12%), #121414 62%);
}
.film-visual img { width: 100%; height: 100%; object-fit: cover; }
.film-number {
  position: absolute;
  left: 17px;
  top: 16px;
  color: rgba(244, 240, 232, 0.62);
  font-family: var(--font-display);
  font-size: 13px;
}
.play-button {
  position: absolute;
  right: 17px;
  bottom: 17px;
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 50%;
  background: rgba(12, 13, 13, 0.74);
  color: var(--paper);
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: background 180ms ease, transform 180ms ease;
}
.play-button svg { width: 20px; height: 20px; transform: translateX(1px); }
.play-button:hover, .play-button:focus-visible {
  background: var(--accent);
  color: var(--ink);
  transform: scale(1.05);
}
.film-body { padding: 16px 3px 0; }
.film-body h3 {
  margin-bottom: 5px;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 400;
  letter-spacing: -0.02em;
}
.film-body p {
  min-height: 42px;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}
.film-body span { color: #777973; font-size: 11px; letter-spacing: 0.08em; }
.empty-state {
  grid-column: 1 / -1;
  min-height: 220px;
  display: grid;
  place-content: center;
  text-align: center;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}
.empty-state strong {
  color: var(--paper);
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 400;
}

.redeem {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.72fr);
  gap: clamp(40px, 8vw, 110px);
  align-items: start;
  border-top: 1px solid var(--line);
}
.redeem-copy > p:not(.eyebrow) {
  max-width: 540px;
  margin: 24px 0;
  color: var(--muted);
}
.redeem-form, .admin-form, .admin-login form {
  display: grid;
  gap: 12px;
  padding: 30px;
  background: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius) 6px var(--radius) 6px;
}
label { color: var(--muted); font-size: 12px; }
input, textarea {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  background: #0b0c0c;
  color: var(--paper);
  transition: border-color 160ms ease;
}
textarea { resize: vertical; }
input:focus, textarea:focus { border-color: var(--accent); }
.redeem-form .primary-button { margin-top: 6px; }
.form-note, .field-help { margin: 0; color: #777973; font-size: 12px; }
.form-error { min-height: 20px; margin: 0; color: var(--danger); font-size: 13px; }

footer {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  min-height: 130px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  border-top: 1px solid var(--line);
  color: #777973;
  font-size: 12px;
}
footer span:nth-child(2) { text-align: center; }
footer a { text-align: right; }

dialog {
  width: min(440px, calc(100% - 32px));
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 6px 30px 6px 6px;
  background: #131515;
  color: var(--paper);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.72);
}
dialog::backdrop { background: rgba(3, 4, 4, 0.82); backdrop-filter: blur(6px); }
.dialog-close { position: absolute; right: 17px; top: 12px; }
.dialog-close button {
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 26px;
  cursor: pointer;
}
dialog h2 {
  margin-bottom: 24px;
  font-size: 34px;
}
.auth-tabs { display: flex; gap: 20px; margin-bottom: 22px; border-bottom: 1px solid var(--line); }
.auth-tabs button {
  padding: 0 0 10px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.auth-tabs button.active { border-color: var(--accent); color: var(--paper); }
#auth-form, #code-form { display: grid; gap: 10px; }
#auth-form .primary-button, #code-form .primary-button { margin-top: 8px; }
.code-help { margin: -10px 0 22px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.quiet-button {
  border: 0;
  background: none;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}
.quiet-button:hover, .quiet-button:focus-visible { color: var(--paper); }
.player-dialog { width: min(980px, calc(100% - 32px)); padding: 32px; }
.player-frame {
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 4px;
}
.player-frame video { width: 100%; height: 100%; }
.player-note { margin: 13px 0 0; color: var(--muted); font-size: 12px; }
.toast {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: 28px;
  max-width: min(520px, calc(100% - 32px));
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #202322;
  color: var(--paper);
  font-size: 13px;
  opacity: 0;
  transform: translate(-50%, 12px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.admin-body { min-height: 100vh; }
.admin-shell { width: min(1180px, calc(100% - 48px)); margin: 0 auto; padding: 68px 0; }
.admin-login { max-width: 440px; }
.admin-login h1 { font-size: 58px; }
.admin-login form { margin-top: 28px; }
.admin-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.72fr);
  gap: 44px;
  align-items: start;
}
.section-heading.compact { align-items: center; margin-bottom: 24px; }
.section-heading.compact h1, .section-heading.compact h2 { font-size: 36px; }
.admin-list { border-top: 1px solid var(--line); }
.admin-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 2px;
  border-bottom: 1px solid var(--line);
}
.admin-row div:first-child { display: grid; gap: 4px; min-width: 0; }
.admin-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-row span { color: var(--muted); font-size: 12px; }
.admin-row div:last-child { display: flex; gap: 8px; }
.admin-row button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  background: transparent;
  color: var(--paper);
  cursor: pointer;
}
.admin-row .danger-button { color: var(--danger); }
.admin-form { position: sticky; top: 24px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; align-items: end; gap: 14px; }
.check-label { display: flex; align-items: center; gap: 8px; min-height: 48px; }
.check-label input { width: 18px; min-height: 18px; }
.empty-copy { color: var(--muted); }

@media (max-width: 900px) {
  .site-header { grid-template-columns: 1fr auto; }
  nav { display: none; }
  .hero { grid-template-columns: 1fr; min-height: auto; padding-top: 54px; }
  .projection { min-height: 380px; }
  .film-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .redeem, .admin-panel { grid-template-columns: 1fr; }
  .admin-form { position: static; }
}
@media (max-width: 620px) {
  .site-header, .hero, .section, footer, .admin-shell { width: min(100% - 30px, 1180px); }
  .site-header { min-height: 70px; }
  .hero { padding: 42px 0 62px; gap: 42px; }
  h1 { font-size: 48px; }
  .lede { font-size: 15px; }
  .projection { min-height: 330px; border-radius: 4px 42px 4px 4px; }
  .projection-copy { left: 36px; right: 30px; top: 52px; }
  .projection-copy strong { margin-top: 92px; font-size: 30px; }
  .projection::before { inset: 20px; }
  .section { padding: 64px 0; }
  .section-heading { align-items: start; }
  .film-grid { grid-template-columns: 1fr; }
  .film-visual { aspect-ratio: 5 / 4; }
  .redeem-form, .admin-form, dialog { padding: 24px; }
  footer { grid-template-columns: 1fr; gap: 8px; padding: 32px 0; }
  footer span:nth-child(2), footer a { text-align: left; }
  .player-dialog { padding: 22px; }
  .form-row { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
