:root {
  color-scheme: dark;
  --bg: oklch(0.085 0.000 0);
  --surface: oklch(0.145 0.012 222);
  --surface-strong: oklch(0.205 0.020 220);
  --ink: oklch(0.955 0.010 235);
  --muted: oklch(0.720 0.030 225);
  --quiet: oklch(0.520 0.028 225);
  --primary: oklch(0.550 0.091 210);
  --primary-bright: oklch(0.710 0.105 205);
  --accent: oklch(0.690 0.150 54);
  --black: oklch(0.020 0.000 0);
  --line: oklch(0.930 0.010 235 / 0.16);
  --shadow: oklch(0.000 0.000 0 / 0.58);
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-snap: cubic-bezier(0.19, 1, 0.22, 1);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-width: 320px;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, oklch(0.050 0.000 0), var(--bg) 32%, oklch(0.105 0.010 230) 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(115deg, oklch(0.550 0.091 210 / 0.18), transparent 34%),
    linear-gradient(315deg, oklch(0.690 0.150 54 / 0.12), transparent 30%),
    linear-gradient(180deg, transparent, oklch(0.000 0.000 0 / 0.45));
}

img,
video {
  display: block;
  max-width: 100%;
}

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

button {
  font: inherit;
}

.site-shell {
  min-height: 100vh;
}

.topbar {
  position: fixed;
  top: var(--space-4);
  left: 50%;
  z-index: 20;
  width: min(calc(100% - 32px), 1120px);
  height: 56px;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--space-4);
  padding: 0 var(--space-3) 0 var(--space-4);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: oklch(0.090 0.010 225 / 0.72);
  box-shadow: 0 18px 48px var(--shadow);
  backdrop-filter: blur(18px);
}

.brand-mark {
  display: inline-flex;
  align-items: baseline;
  gap: var(--space-2);
  min-width: 0;
}

.brand-mark span {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.brand-mark small {
  color: var(--muted);
  font-size: 0.78rem;
}

.nav-links {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--muted);
  font-size: 0.9rem;
}

.nav-links a,
.sound-toggle,
.primary-action,
.secondary-action,
.viewer-nav,
.icon-button {
  min-height: 40px;
  border-radius: 999px;
  transition: transform 360ms var(--ease-out), background-color 360ms var(--ease-out), color 360ms var(--ease-out), border-color 360ms var(--ease-out);
}

.nav-links a {
  padding: var(--space-2) var(--space-3);
}

.nav-links a:hover {
  color: var(--ink);
  background: oklch(0.955 0.010 235 / 0.08);
}

.sound-toggle {
  border: 1px solid var(--line);
  color: var(--ink);
  background: oklch(0.955 0.010 235 / 0.08);
  padding: 0 var(--space-4);
  cursor: pointer;
}

.sound-toggle:hover,
.primary-action:hover,
.secondary-action:hover,
.viewer-nav:hover,
.icon-button:hover {
  transform: translateY(-1px);
}

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  align-items: end;
  overflow: hidden;
  padding: 128px clamp(20px, 5vw, 80px) clamp(96px, 12vh, 132px);
  isolation: isolate;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: -2;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  background: var(--black);
}

.hero-media img,
.hero-media video {
  grid-area: 1 / 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-media img {
  opacity: 0.72;
  filter: saturate(0.88) contrast(1.08) brightness(0.75);
  transform: scale(1.02);
}

.hero-media video {
  justify-self: end;
  align-self: end;
  width: min(42vw, 680px);
  height: min(48vh, 430px);
  margin: 0 clamp(16px, 4vw, 64px) clamp(84px, 10vh, 120px) 0;
  border-radius: 16px;
  border: 1px solid var(--line);
  object-fit: cover;
  opacity: 0.86;
  box-shadow: 0 32px 80px var(--shadow);
  clip-path: inset(0 round 16px);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(90deg, oklch(0.000 0.000 0 / 0.82), oklch(0.000 0.000 0 / 0.34) 52%, oklch(0.000 0.000 0 / 0.72)),
    linear-gradient(180deg, oklch(0.000 0.000 0 / 0.24), oklch(0.000 0.000 0 / 0.84) 86%);
}

.hero-copy {
  width: min(760px, 100%);
}

.kicker {
  margin: 0 0 var(--space-3);
  color: var(--primary-bright);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero h1,
.section-heading h2 {
  margin: 0;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.hero h1 {
  max-width: 11ch;
  font-size: clamp(4.2rem, 11vw, 6rem);
  line-height: 0.9;
  font-weight: 850;
}

.hero-lede {
  max-width: 640px;
  margin: var(--space-6) 0 0;
  color: oklch(0.850 0.020 225);
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  line-height: 1.7;
  text-wrap: pretty;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-8);
}

.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--space-6);
  font-weight: 760;
}

.primary-action {
  color: oklch(0.985 0.000 0);
  background: var(--primary);
}

.secondary-action {
  color: var(--ink);
  border: 1px solid var(--line);
  background: oklch(0.955 0.010 235 / 0.08);
}

.hero-strip {
  position: absolute;
  right: clamp(20px, 4vw, 80px);
  bottom: var(--space-8);
  display: flex;
  gap: var(--space-3);
}

.strip-frame {
  width: clamp(72px, 8vw, 118px);
  aspect-ratio: 4 / 5;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 24px 54px var(--shadow);
}

.strip-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 600ms var(--ease-out), filter 600ms var(--ease-out);
}

.strip-frame:hover img {
  transform: scale(1.08);
  filter: contrast(1.08);
}

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: var(--space-8);
  width: 28px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  transform: translateX(-50%);
}

.scroll-cue span {
  position: absolute;
  left: 50%;
  top: 9px;
  width: 4px;
  height: 8px;
  border-radius: 999px;
  background: var(--ink);
  transform: translateX(-50%);
  animation: cue 1.8s var(--ease-out) infinite;
}

.intro-panel {
  width: min(1120px, calc(100% - 40px));
  margin: var(--space-20) auto var(--space-16);
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.7fr);
  gap: var(--space-8);
  align-items: end;
  padding-bottom: var(--space-8);
  border-bottom: 1px solid var(--line);
}

.intro-panel > p {
  margin: 0;
  max-width: 780px;
  font-size: clamp(1.55rem, 4vw, 3.2rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.signal-row {
  display: grid;
  gap: var(--space-3);
  color: var(--muted);
}

.signal-row span {
  display: flex;
  justify-content: space-between;
  gap: var(--space-6);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--line);
}

.signal-row strong {
  color: var(--ink);
  font-size: 1.3rem;
}

.gallery-section,
.motion-section,
.timeline-section {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  padding: var(--space-16) 0;
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(280px, 0.7fr);
  gap: var(--space-8);
  align-items: end;
  margin-bottom: var(--space-8);
}

.section-heading h2 {
  font-size: clamp(2.4rem, 7vw, 5.2rem);
  line-height: 0.95;
}

.section-heading p:not(.kicker) {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
}

.memory-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--space-4);
}

.media-tile {
  position: relative;
  min-height: 220px;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  color: var(--ink);
  border: 0;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 20px 60px oklch(0.000 0.000 0 / 0.40);
  transform: translateZ(0);
}

.media-tile:nth-child(1),
.media-tile:nth-child(6),
.media-tile:nth-child(10) {
  grid-column: span 6;
  aspect-ratio: 1.45;
}

.media-tile:nth-child(2),
.media-tile:nth-child(5),
.media-tile:nth-child(11),
.media-tile:nth-child(13) {
  grid-column: span 3;
  aspect-ratio: 0.76;
}

.media-tile:nth-child(3),
.media-tile:nth-child(4),
.media-tile:nth-child(7),
.media-tile:nth-child(8),
.media-tile:nth-child(9),
.media-tile:nth-child(12) {
  grid-column: span 4;
  aspect-ratio: 1;
}

.media-tile img,
.video-card video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-tile img {
  transform: scale(1.015);
  transition: transform 700ms var(--ease-out), filter 700ms var(--ease-out);
}

.media-tile::after,
.video-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 42%, oklch(0.000 0.000 0 / 0.74));
}

.tile-copy,
.video-copy {
  position: absolute;
  left: var(--space-4);
  right: var(--space-4);
  bottom: var(--space-4);
  z-index: 1;
  display: grid;
  gap: var(--space-1);
  text-align: left;
}

.tile-copy strong,
.video-copy strong {
  font-size: clamp(1rem, 2vw, 1.25rem);
  letter-spacing: -0.01em;
}

.tile-copy span,
.video-copy span {
  color: oklch(0.875 0.012 235);
  font-size: 0.86rem;
  line-height: 1.45;
}

.media-tile:hover img,
.media-tile:focus-visible img,
.video-card:hover video,
.video-card:focus-visible video {
  transform: scale(1.08);
  filter: contrast(1.05) saturate(1.05);
}

.media-tile:focus-visible,
.video-card:focus-visible,
.strip-frame:focus-visible,
.sound-toggle:focus-visible,
.viewer-nav:focus-visible,
.icon-button:focus-visible,
.primary-action:focus-visible,
.secondary-action:focus-visible {
  outline: 2px solid var(--primary-bright);
  outline-offset: 3px;
}

.motion-section {
  width: min(100%, 1440px);
}

.motion-section .section-heading {
  width: min(1240px, calc(100% - 40px));
  margin-inline: auto;
}

.video-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(300px, 44vw);
  gap: var(--space-4);
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding: 0 max(20px, calc((100vw - 1240px) / 2)) var(--space-6);
  scroll-snap-type: inline mandatory;
}

.video-card {
  position: relative;
  height: clamp(320px, 54vw, 620px);
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  border: 0;
  border-radius: 16px;
  background: var(--surface);
  scroll-snap-align: center;
}

.video-card video {
  transform: scale(1.01);
  transition: transform 700ms var(--ease-out), filter 700ms var(--ease-out);
}

.video-badge {
  position: absolute;
  top: var(--space-4);
  left: var(--space-4);
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 34px;
  padding: 0 var(--space-3);
  border-radius: 999px;
  color: oklch(0.985 0.000 0);
  background: oklch(0.550 0.091 210 / 0.88);
  backdrop-filter: blur(12px);
  font-size: 0.78rem;
  font-weight: 780;
}

.video-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 18px oklch(0.690 0.150 54 / 0.72);
}

.timeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
}

.timeline-item {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--space-6);
  border-radius: 16px;
  background: linear-gradient(180deg, oklch(0.185 0.016 224), oklch(0.120 0.010 224));
}

.timeline-item span {
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 800;
}

.timeline-item h3 {
  margin: var(--space-8) 0 var(--space-3);
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

.timeline-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 900ms var(--ease-out), transform 900ms var(--ease-out);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.lightbox {
  width: 100vw;
  max-width: none;
  height: 100svh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: transparent;
}

.lightbox::backdrop {
  background: oklch(0.000 0.000 0 / 0.70);
  backdrop-filter: blur(8px);
}

.lightbox-backdrop {
  position: fixed;
  inset: 0;
  background: oklch(0.000 0.000 0 / 0.44);
}

.viewer {
  position: fixed;
  inset: var(--space-4);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: var(--space-4);
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: oklch(0.075 0.006 225 / 0.92);
  box-shadow: 0 40px 100px var(--shadow);
  backdrop-filter: blur(22px);
}

.viewer-topline,
.viewer-footer {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--space-4);
}

.viewer-topline p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.icon-button,
.viewer-nav {
  border: 1px solid var(--line);
  color: var(--ink);
  background: oklch(0.955 0.010 235 / 0.08);
  cursor: pointer;
}

.icon-button {
  width: 42px;
  height: 42px;
  padding: 0;
  font-size: 1.7rem;
  line-height: 1;
}

.viewer-media {
  min-height: 0;
  overflow: hidden;
  border-radius: 16px;
  background: var(--black);
}

.viewer-media img,
.viewer-media video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.viewer-footer h3 {
  margin: 0 0 var(--space-1);
  text-align: center;
  letter-spacing: -0.01em;
}

.viewer-footer p {
  margin: 0;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}

.viewer-nav {
  min-width: 92px;
  padding: 0 var(--space-4);
}

@keyframes cue {
  0% {
    opacity: 0;
    transform: translate(-50%, 0);
  }
  30% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, 16px);
  }
}

@media (max-width: 900px) {
  .topbar {
    grid-template-columns: auto auto;
  }

  .nav-links {
    display: none;
  }

  .brand-mark small {
    display: none;
  }

  .hero {
    min-height: 100svh;
    padding: 112px 20px 104px;
  }

  .hero-media video {
    width: calc(100% - 40px);
    height: 30vh;
    margin: 0 20px 86px;
    opacity: 0.72;
  }

  .hero h1 {
    font-size: clamp(3.6rem, 17vw, 5.2rem);
  }

  .hero-strip {
    left: 20px;
    right: auto;
    bottom: var(--space-6);
  }

  .scroll-cue {
    display: none;
  }

  .intro-panel,
  .section-heading {
    grid-template-columns: 1fr;
  }

  .memory-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .media-tile:nth-child(n) {
    grid-column: span 3;
  }

  .media-tile:nth-child(1),
  .media-tile:nth-child(6),
  .media-tile:nth-child(10) {
    grid-column: span 6;
  }

  .timeline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .topbar {
    top: var(--space-2);
    width: calc(100% - 16px);
    height: 52px;
  }

  .sound-toggle {
    padding: 0 var(--space-3);
    font-size: 0.86rem;
  }

  .hero-actions {
    width: 100%;
  }

  .primary-action,
  .secondary-action {
    flex: 1 1 140px;
  }

  .intro-panel,
  .gallery-section,
  .timeline-section {
    width: min(100% - 28px, 1240px);
  }

  .memory-grid {
    grid-template-columns: 1fr;
  }

  .media-tile:nth-child(n) {
    grid-column: span 1;
    aspect-ratio: 4 / 5;
  }

  .media-tile:nth-child(1),
  .media-tile:nth-child(6),
  .media-tile:nth-child(10) {
    aspect-ratio: 1.16;
  }

  .video-rail {
    grid-auto-columns: minmax(260px, 86vw);
  }

  .timeline {
    grid-template-columns: 1fr;
  }

  .viewer {
    inset: var(--space-2);
    padding: var(--space-2);
    gap: var(--space-2);
  }

  .viewer-topline,
  .viewer-footer {
    grid-template-columns: 1fr auto;
  }

  .viewer-footer {
    grid-template-areas:
      "caption caption"
      "prev next";
  }

  .viewer-footer > div {
    grid-area: caption;
  }

  .viewer-nav[data-prev] {
    grid-area: prev;
  }

  .viewer-nav[data-next] {
    grid-area: next;
  }
}

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

  .reveal {
    opacity: 1;
    transform: none;
  }
}
