:root {
  --bg: #07070a;
  --fg: #f4f1ea;
  --muted: rgba(244, 241, 234, 0.62);
  --line: rgba(244, 241, 234, 0.14);
  --accent: #8b7cff;
  --nav-bg: rgba(7, 7, 10, 0.74);
  --font-display: Georgia, 'Times New Roman', 'Songti SC', 'STSong', serif;
  --font-sans: system-ui, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', monospace;
}

body {
  background:
    radial-gradient(1100px 760px at 18% -4%, rgba(139, 124, 255, 0.14), transparent 62%),
    radial-gradient(900px 700px at 92% 28%, rgba(0, 255, 156, 0.055), transparent 60%),
    radial-gradient(800px 620px at 55% 108%, rgba(200, 169, 106, 0.06), transparent 62%),
    var(--bg);
  animation: page-in 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  transition: opacity 0.24s ease;
}

body.is-leaving {
  opacity: 0;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.86' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

@keyframes page-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: clamp(110px, 15vh, 180px) clamp(20px, 6vw, 92px) clamp(86px, 10vh, 130px);
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    rgba(7, 7, 10, 0.92) 0%,
    rgba(7, 7, 10, 0.62) 32%,
    transparent 62%
  );
}

.hero-scene {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.92;
}

.hero-scene canvas {
  width: 100%;
  height: 100%;
}

.hero-fallback {
  display: none;
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 68% 46%, rgba(139, 124, 255, 0.52), transparent 22%),
    radial-gradient(circle at 82% 28%, rgba(0, 255, 156, 0.22), transparent 28%),
    radial-gradient(circle at 55% 62%, rgba(255, 157, 226, 0.18), transparent 30%);
}

.no-webgl .hero-fallback {
  display: block;
}

.hero-glow {
  position: absolute;
  z-index: 0;
  right: -12%;
  top: 8%;
  width: 62vw;
  height: 62vw;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent), transparent 64%);
  opacity: 0.12;
  filter: blur(80px);
  pointer-events: none;
  transition: background 0.6s ease, opacity 0.6s ease;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 1120px;
}

.eyebrow,
.section-index,
.outro-index {
  margin: 0 0 26px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

h1 {
  margin: 0 0 30px;
  font-family: var(--font-display);
  font-size: clamp(3.4rem, 9.2vw, 9.6rem);
  font-weight: 400;
  line-height: 0.86;
  letter-spacing: -0.055em;
}

h1 em {
  font-style: italic;
  color: var(--accent);
  transition: color 0.55s ease;
}

.hero-lead {
  max-width: 560px;
  margin: 0;
  font-size: clamp(14px, 1.25vw, 18px);
  line-height: 1.85;
  color: var(--muted);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 30px;
  margin-top: clamp(34px, 5vh, 54px);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero-meta b {
  margin-right: 4px;
  color: var(--fg);
  font-size: 13px;
  font-weight: 500;
}

.scroll-hint {
  position: absolute;
  left: clamp(20px, 6vw, 92px);
  bottom: 28px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.25s ease;
}

.scroll-hint:hover {
  color: var(--fg);
}

.scroll-hint span {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 50%;
}

/* ---------- gallery ---------- */

.gallery-section {
  padding: clamp(80px, 10vw, 150px) clamp(20px, 6vw, 92px);
  border-top: 1px solid var(--line);
}

.section-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px 60px;
  align-items: end;
  margin-bottom: clamp(38px, 6vw, 76px);
}

.section-head h2,
.outro h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5.2vw, 5.4rem);
  font-weight: 400;
  line-height: 0.94;
  letter-spacing: -0.045em;
}

.section-index {
  margin-bottom: 18px;
}

.section-note {
  justify-self: end;
  max-width: 480px;
  margin: 0;
  font-size: 13px;
  line-height: 1.9;
  color: var(--muted);
}

.cards {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(12px, 1.7vw, 22px);
}

.card {
  --rx: 0deg;
  --ry: 0deg;
  --mx: 50%;
  --my: 50%;
  position: relative;
  grid-column: span 4;
  display: flex;
  flex-direction: column;
  min-height: clamp(370px, 33vw, 510px);
  padding: clamp(16px, 1.6vw, 24px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.024);
  transform: perspective(1100px) rotateX(var(--rx)) rotateY(var(--ry));
  transform-style: preserve-3d;
  transition:
    transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1),
    border-color 0.4s ease,
    background 0.4s ease,
    box-shadow 0.4s ease;
  will-change: transform;
}

.card:nth-child(1) {
  grid-column: span 7;
  min-height: clamp(420px, 38vw, 580px);
}

.card:nth-child(2) {
  grid-column: span 5;
  min-height: clamp(420px, 38vw, 580px);
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background: radial-gradient(
    620px circle at var(--mx) var(--my),
    var(--accent),
    transparent 56%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  mix-blend-mode: soft-light;
}

.card:hover::before,
.card:focus-visible::before {
  opacity: 0.55;
}

.card:hover,
.card:focus-visible {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 36px 90px -40px var(--accent);
}

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

.preview {
  position: relative;
  z-index: 1;
  display: block;
  flex: 1 1 auto;
  min-height: 188px;
  margin-bottom: 20px;
  overflow: hidden;
  border-radius: 12px;
  transform: translateZ(18px);
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.card:hover .preview {
  transform: translateZ(26px) scale(1.015);
}

.card-body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 7px;
  transform: translateZ(24px);
}

.card-kicker {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.card-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.card-title b {
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 2.4vw, 2.4rem);
  font-weight: 400;
  letter-spacing: -0.025em;
}

.card-title em {
  font-style: normal;
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.card-desc {
  max-width: 38ch;
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--muted);
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 9px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.card-open {
  color: var(--fg);
  white-space: nowrap;
}

/* ---------- card previews ---------- */

.preview--aurora {
  background:
    radial-gradient(circle at 30% 72%, rgba(75, 43, 189, 0.9), transparent 56%),
    radial-gradient(circle at 76% 24%, rgba(15, 110, 140, 0.85), transparent 55%),
    #080814;
}

.p-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(18px);
}

.p-orb--a {
  width: 56%;
  aspect-ratio: 1;
  left: 7%;
  top: 18%;
  background: radial-gradient(circle at 32% 30%, #d6ccff, #6d4dff 46%, transparent 72%);
  opacity: 0.82;
}

.p-orb--b {
  width: 44%;
  aspect-ratio: 1;
  right: 6%;
  bottom: 10%;
  background: radial-gradient(circle at 40% 40%, #a5f8ff, #1488a8 52%, transparent 74%);
  opacity: 0.62;
}

.p-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 44%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%) rotate(16deg);
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 50%;
  box-shadow:
    0 0 42px rgba(160, 140, 255, 0.6),
    inset 0 0 30px rgba(120, 230, 255, 0.24);
}

.p-ring::after {
  content: '';
  position: absolute;
  inset: 14%;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
}

.preview--monolith {
  background: #e9e4da;
}

.p-bar {
  position: absolute;
  bottom: 20%;
  background: #111;
  box-shadow: 14px 18px 0 rgba(17, 17, 17, 0.12);
}

.p-bar--a {
  left: 17%;
  width: 22%;
  height: 54%;
}

.p-bar--b {
  left: 42%;
  width: 16%;
  height: 39%;
}

.p-bar--c {
  left: 60%;
  width: 11%;
  height: 27%;
}

.p-dot {
  position: absolute;
  right: 17%;
  top: 17%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #e33b25;
}

.preview--monolith::after {
  content: 'MONOLITH / 02';
  position: absolute;
  left: 17%;
  top: 13%;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.18em;
  color: rgba(17, 17, 17, 0.55);
}

.preview--neon {
  background:
    radial-gradient(circle at 50% 45%, rgba(0, 255, 156, 0.2), transparent 46%),
    #020604;
}

.p-grid {
  position: absolute;
  inset: -30% -10% -10%;
  background-image:
    linear-gradient(rgba(0, 255, 156, 0.2) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 156, 0.2) 1px, transparent 1px);
  background-size: 26px 26px;
  transform: perspective(300px) rotateX(58deg);
  transform-origin: 50% 100%;
  opacity: 0.62;
}

.p-neon-ring {
  position: absolute;
  left: 50%;
  top: 46%;
  width: 34%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%) rotateX(62deg);
  border: 2px solid #00ff9c;
  border-radius: 50%;
  box-shadow:
    0 0 24px #00ff9c,
    inset 0 0 18px rgba(0, 255, 156, 0.5);
}

.p-scan {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(255, 255, 255, 0.055) 0 1px,
    transparent 1px 4px
  );
  opacity: 0.55;
}

.preview--terra {
  background: #e8dfd1;
}

.p-blob {
  position: absolute;
  border-radius: 52% 48% 44% 56% / 46% 55% 45% 54%;
}

.p-blob--a {
  width: 48%;
  aspect-ratio: 1;
  left: 9%;
  bottom: 7%;
  background: #a65f3f;
  box-shadow: inset -18px -18px 30px rgba(60, 30, 20, 0.22);
}

.p-blob--b {
  width: 34%;
  aspect-ratio: 1;
  right: 11%;
  top: 11%;
  background: #6f7d5a;
  border-radius: 45% 55% 60% 40% / 55% 45% 55% 45%;
}

.p-blob--c {
  width: 16%;
  aspect-ratio: 1;
  right: 33%;
  bottom: 21%;
  background: #c9b79c;
}

.preview--noir {
  background: linear-gradient(115deg, #0b0b0b 0 55%, #efe8da 55% 100%);
}

.p-light {
  position: absolute;
  width: 60%;
  aspect-ratio: 1;
  left: 6%;
  top: 6%;
  background: radial-gradient(circle, rgba(200, 169, 106, 0.5), transparent 66%);
  filter: blur(10px);
}

.p-film {
  position: absolute;
  left: 15%;
  top: 23%;
  width: 47%;
  height: 53%;
  border: 1px solid rgba(243, 237, 226, 0.75);
  box-shadow: 0 0 0 6px rgba(243, 237, 226, 0.06);
}

.p-gold-ring {
  position: absolute;
  right: 11%;
  bottom: 13%;
  width: 30%;
  aspect-ratio: 1;
  border: 1px solid #c8a96a;
  border-radius: 50%;
}

/* ---------- outro / footer ---------- */

.outro {
  padding: clamp(82px, 12vw, 164px) clamp(20px, 6vw, 92px);
  border-top: 1px solid var(--line);
}

.outro h2 em {
  font-style: italic;
  color: var(--accent);
}

.outro p {
  max-width: 640px;
  margin: 28px 0 0;
  font-size: 13.5px;
  line-height: 1.95;
  color: var(--muted);
}

.outro-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.outro-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition:
    border-color 0.25s ease,
    background 0.25s ease,
    color 0.25s ease;
}

.outro-link:hover {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.045);
}

.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 24px clamp(20px, 6vw, 92px);
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.13em;
  color: var(--muted);
}

.footer a {
  transition: color 0.25s ease;
}

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

/* ---------- responsive ---------- */

@media (max-width: 1080px) {
  .card,
  .card:nth-child(1),
  .card:nth-child(2) {
    grid-column: span 6;
    min-height: 420px;
  }

  .card:nth-child(5) {
    grid-column: span 12;
    min-height: 360px;
  }

  .card:nth-child(5) .preview {
    min-height: 240px;
  }
}

@media (max-width: 820px) {
  .section-head {
    grid-template-columns: 1fr;
  }

  .section-note {
    justify-self: start;
    max-width: 560px;
  }

  .hero {
    align-items: flex-end;
    padding-bottom: 120px;
  }

  .hero::before {
    background: linear-gradient(
      180deg,
      rgba(7, 7, 10, 0.1) 0%,
      rgba(7, 7, 10, 0.55) 40%,
      rgba(7, 7, 10, 0.92) 80%
    );
  }

  .hero-scene {
    opacity: 0.8;
    -webkit-mask-image: linear-gradient(180deg, #000 0 25%, transparent 80%);
    mask-image: linear-gradient(180deg, #000 0 25%, transparent 80%);
  }

  .hero-glow {
    width: 100vw;
    height: 100vw;
    right: -30%;
    top: 0;
  }

  .scroll-hint {
    bottom: 74px;
  }
}

@media (max-width: 640px) {
  h1 {
    font-size: clamp(2.7rem, 9.2vw, 9.6rem);
  }

  .hero h1,
  .hero-lead {
    text-shadow: 0 2px 28px rgba(7, 7, 10, 0.82);
  }

  .card,
  .card:nth-child(1),
  .card:nth-child(2),
  .card:nth-child(5) {
    grid-column: span 12;
    min-height: 380px;
  }

  .card:nth-child(1),
  .card:nth-child(2) {
    min-height: 420px;
  }

  .hero-meta {
    gap: 10px 18px;
  }

  .hero-meta span:nth-child(3) {
    display: none;
  }

  .preview {
    min-height: 210px;
  }

  .footer {
    justify-content: flex-start;
  }
}

@media (hover: none), (pointer: coarse) {
  .card {
    transform: none;
  }

  .card::before {
    display: none;
  }
}
