:root {
  color-scheme: light;
  --bg: #F7F7F4;
  --surface: #FFFFFF;
  --mat: #EEEEE9;
  --ink: #161817;
  --ink-secondary: #58605B;
  --ink-muted: #767E79;
  --rule: rgba(22, 24, 23, 0.09);
  --rule-strong: rgba(22, 24, 23, 0.17);
  --accent: #1B5744;
  --shadow-stage: 0 1px 2px rgba(22, 24, 23, 0.05), 0 18px 42px -24px rgba(22, 24, 23, 0.2);
  --shadow-still: 0 1px 2px rgba(22, 24, 23, 0.04), 0 10px 26px -18px rgba(22, 24, 23, 0.16);
  --shadow-still-hover: 0 2px 6px rgba(22, 24, 23, 0.06), 0 18px 36px -20px rgba(22, 24, 23, 0.24);
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Menlo, Consolas, monospace;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

img, video {
  display: block;
}

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

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 40;
  padding: 0.55rem 0.9rem;
  background: var(--ink);
  color: var(--bg);
  font-size: 0.85rem;
  border-radius: 6px;
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

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

.shell {
  width: min(64rem, calc(100% - 2 * var(--gutter)));
  margin-inline: auto;
}

/* Header */
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 4.5rem;
  border-bottom: 1px solid var(--rule);
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  overflow: hidden;
  background: #374423;
  border: 1px solid var(--rule-strong);
  box-shadow: 0 1px 3px rgba(22, 24, 23, 0.1);
  transition: transform 200ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 200ms ease;
}

.brand:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px -4px rgba(22, 24, 23, 0.24);
}

.avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.page-tag {
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
}

/* Featured Films */
.films {
  padding-top: clamp(2rem, 4.5vw, 3.5rem);
  display: flex;
  flex-direction: column;
  gap: clamp(3.25rem, 7vw, 5.5rem);
}

.stage {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: var(--mat);
  border: 1px solid var(--rule);
  box-shadow: var(--shadow-stage);
  aspect-ratio: 16 / 9;
}

.stage.is-active,
.stage.is-active video {
  background: #141718;
}

.stage video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--mat);
}

.stage-overlay {
  display: none;
}

.js .stage:not(.is-active) .stage-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, transparent 65%, rgba(22, 24, 23, 0.1) 100%);
  transition: background 220ms ease;
}

.js .stage:not(.is-active) .stage-overlay:hover {
  background: linear-gradient(180deg, rgba(22, 24, 23, 0.02) 45%, rgba(22, 24, 23, 0.16) 100%);
}

.play-badge {
  width: 4rem;
  height: 4rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(22, 24, 23, 0.84);
  color: #F7F7F4;
  box-shadow: 0 12px 30px rgba(15, 20, 18, 0.24), inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1), background 180ms ease;
}

.stage-overlay:hover .play-badge,
.stage-overlay:focus-visible .play-badge {
  transform: scale(1.06);
  background: var(--accent);
}

.duration {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  padding: 0.22rem 0.55rem;
  border-radius: 6px;
  background: rgba(22, 24, 23, 0.72);
  color: #F7F7F4;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  line-height: 1.25;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  backdrop-filter: blur(6px);
}

.caption-bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.4rem 2rem;
  margin-top: 1.05rem;
}

.caption-bar h1,
.caption-bar h2 {
  font-size: clamp(1.12rem, 1.45vw, 1.32rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  flex: none;
}

.caption-bar p {
  font-size: 0.92rem;
  color: var(--ink-secondary);
  text-align: right;
}

/* Stills Gallery */
.stills {
  margin-top: clamp(3.75rem, 8vw, 6.25rem);
  padding-top: clamp(2.75rem, 6vw, 4.5rem);
  border-top: 1px solid var(--rule);
}

.stills-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(2rem, 3.6vw, 2.85rem) clamp(1.5rem, 3vw, 2.25rem);
}

.still-trigger {
  display: block;
  width: 100%;
  text-align: left;
}

.still-frame {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 10px;
  overflow: hidden;
  background: var(--mat);
  border: 1px solid var(--rule);
  box-shadow: var(--shadow-still);
  transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 260ms ease, border-color 180ms ease;
}

.still-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.still-frame--top img {
  object-position: left top;
}

.image-error {
  display: grid;
  position: absolute;
  inset: 0;
  place-items: center;
  color: var(--ink-secondary);
  font-size: .875rem;
}

.still-frame--top-center img {
  object-position: center top;
}

.still-frame--center img {
  object-position: center;
}

.still-trigger:hover .still-frame {
  transform: translateY(-2px);
  border-color: var(--rule-strong);
  box-shadow: var(--shadow-still-hover);
}

.still-trigger:hover .still-frame img {
  transform: scale(1.025);
}

.still h2 {
  margin-top: 0.9rem;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: color 160ms ease;
}

.still-trigger:hover h2 {
  color: var(--accent);
}

.still p {
  margin-top: 0.3rem;
  font-size: 0.865rem;
  line-height: 1.62;
  color: var(--ink-secondary);
}

/* Footer */
.site-footer {
  margin-top: clamp(4rem, 8.5vw, 6.5rem);
  border-top: 1px solid var(--rule);
  min-height: 4.5rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 1.4rem;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  transition: color 160ms ease;
}

.footer-links a:hover {
  color: var(--ink);
}

/* Minimal Lightbox */
.lightbox {
  width: min(62rem, calc(100% - 2rem));
  max-height: calc(100dvh - 2.5rem);
  padding: 0;
  border: 1px solid var(--rule-strong);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 28px 68px -22px rgba(15, 20, 18, 0.34);
  overflow: hidden;
}

.lightbox::backdrop {
  background: rgba(22, 24, 23, 0.46);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.lb-shell {
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 2.5rem);
}

.lb-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1.25rem;
  border-bottom: 1px solid var(--rule);
}

.lb-bar h2 {
  font-size: 1.02rem;
  font-weight: 600;
}

.lb-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: none;
}

.lb-raw {
  display: inline-flex;
  align-items: center;
  min-height: 2.1rem;
  padding: 0 0.7rem;
  border-radius: 6px;
  font-size: 0.8rem;
  color: var(--ink-secondary);
  border: 1px solid var(--rule);
  transition: border-color 160ms ease, color 160ms ease;
}

.lb-raw:hover {
  border-color: var(--rule-strong);
  color: var(--ink);
}

.lb-raw[hidden],
#lb-img[hidden],
#lb-status:empty {
  display: none;
}

#lb-status {
  margin-top: .5rem;
  font-size: .82rem;
  color: var(--ink-secondary);
}

.lb-close {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: var(--ink-secondary);
  border: 1px solid var(--rule);
  transition: background 160ms ease, color 160ms ease;
}

.lb-close:hover {
  background: var(--mat);
  color: var(--ink);
}

.lb-media {
  background: var(--mat);
  padding: 0.85rem 1.25rem;
  overflow: auto;
}

.lb-media img {
  width: 100%;
  height: auto;
  max-height: 68vh;
  object-fit: contain;
  border-radius: 6px;
  background: var(--surface);
}

.lb-desc {
  padding: 0.9rem 1.25rem 1.05rem;
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--ink-secondary);
  border-top: 1px solid var(--rule);
}

/* Responsive */
@media (max-width: 52rem) {
  .caption-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .caption-bar p {
    text-align: left;
  }

  .stills-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.25rem;
  }
}

@media (max-width: 36rem) {
  .masthead {
    min-height: 3.8rem;
  }

  .play-badge {
    width: 3.25rem;
    height: 3.25rem;
  }

  .duration {
    right: 0.7rem;
    bottom: 0.7rem;
  }

  .lb-bar {
    padding: 0.8rem 1rem;
  }

  .lb-media {
    padding: 0.65rem 1rem;
  }

  .lb-desc {
    padding: 0.8rem 1rem 0.95rem;
  }
}

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