:root {
  --black: #050505;
  --ink: #f4f7ff;
  --muted: rgba(244, 247, 255, 0.62);
  --blue: #4d7cff;
  --line: rgba(244, 247, 255, 0.16);
  --mono: "SFMono-Regular", "Cascadia Code", "Roboto Mono", Consolas, monospace;
  --sans: "Source Han Sans SC", "Noto Sans CJK SC", "Noto Sans SC", "Microsoft YaHei",
    Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--black);
  color: var(--ink);
  scroll-behavior: auto;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background: var(--black);
  color: var(--ink);
  font-family: var(--sans);
  cursor: none;
}

a,
button {
  color: inherit;
  cursor: none;
}

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

.noise {
  position: fixed;
  inset: 0;
  z-index: 900;
  pointer-events: none;
  opacity: 0.18;
  mix-blend-mode: screen;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.18) 0 1px, transparent 1px),
    radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.12) 0 1px, transparent 1px);
  background-size: 7px 7px, 11px 11px;
}

.cursor {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 1000;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(244, 247, 255, 0.76);
  border-radius: 50%;
  pointer-events: none;
  transform: translate3d(-50%, -50%, 0);
  transition: width 0.18s ease, height 0.18s ease, border-color 0.18s ease;
}

.cursor span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--blue);
  font: 700 10px/1 var(--mono);
  opacity: 0;
}

.cursor.is-view {
  width: 82px;
  height: 82px;
  border-color: var(--blue);
  background: rgba(5, 5, 5, 0.22);
  backdrop-filter: blur(6px);
}

.cursor.is-view span {
  opacity: 1;
}

.loader {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 16px;
  background: #000;
  clip-path: inset(0 0 0 0);
}

.loader__brand,
.loader__line,
.loader__count,
.kicker,
.scroll-cue,
.work-card__meta,
.work-card__label,
.chapter__note,
.breath span,
.contact,
.lightbox figcaption {
  font-family: var(--mono);
  letter-spacing: 0;
  text-transform: uppercase;
}

.loader__brand {
  color: var(--ink);
  font-size: clamp(18px, 2.4vw, 34px);
  font-weight: 800;
}

.loader__line,
.loader__count {
  color: var(--blue);
  font-size: 12px;
}

.hero {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  display: grid;
  align-items: end;
  padding: clamp(28px, 5vw, 72px);
}

.hero__canvas,
.hero__fallback,
.hero__shade {
  position: absolute;
  inset: 0;
}

.hero__canvas {
  z-index: 1;
}

.hero__fallback {
  z-index: 0;
  background: url("./assets/images/11-blue-aquarium.webp") center / cover no-repeat;
  transform: scale(1.04);
}

.hero__shade {
  z-index: 2;
  background:
    linear-gradient(90deg, rgba(5, 5, 5, 0.84), rgba(5, 5, 5, 0.14) 55%, rgba(5, 5, 5, 0.66)),
    linear-gradient(0deg, rgba(5, 5, 5, 0.88), transparent 42%);
}

.hero__copy {
  position: relative;
  z-index: 3;
  max-width: 1180px;
}

.kicker {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: clamp(11px, 1.1vw, 14px);
  font-weight: 700;
}

.hero h1,
.ending h2 {
  margin: 0;
  max-width: 12ch;
  font-size: clamp(58px, 13vw, 188px);
  line-height: 1.04;
  font-weight: 950;
  letter-spacing: 0;
}

.manifesto {
  max-width: 720px;
  margin: 28px 0 0;
  color: rgba(244, 247, 255, 0.78);
  font-size: clamp(18px, 2.2vw, 32px);
  line-height: 1.45;
  font-weight: 800;
}

.scroll-cue,
.contact {
  position: relative;
  z-index: 4;
  width: fit-content;
  min-height: 46px;
  display: inline-grid;
  place-items: center;
  padding: 0 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(5, 5, 5, 0.28);
  text-decoration: none;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  backdrop-filter: blur(10px);
}

.scroll-cue {
  position: absolute;
  right: clamp(24px, 5vw, 72px);
  bottom: clamp(24px, 5vw, 72px);
}

.statement {
  padding: clamp(90px, 14vw, 180px) clamp(24px, 7vw, 92px);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.statement p {
  margin: 0 0 28px;
  color: var(--blue);
  font: 800 12px/1.2 var(--mono);
}

.statement h2 {
  margin: 0;
  max-width: 980px;
  font-size: clamp(34px, 7.5vw, 116px);
  line-height: 1.08;
  font-weight: 950;
}

.works {
  position: relative;
}

.chapter {
  position: relative;
  min-height: 100svh;
  padding: 0 clamp(18px, 4.4vw, 72px) clamp(86px, 10vw, 150px);
  border-bottom: 1px solid var(--line);
}

.chapter__intro {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(280px, 1.1fr);
  gap: clamp(28px, 5vw, 84px);
  align-items: center;
}

.chapter__number {
  color: var(--blue);
  font: 900 clamp(54px, 10vw, 150px) / 0.9 var(--mono);
}

.chapter__title {
  margin: 12px 0 18px;
  font-size: clamp(70px, 15vw, 230px);
  line-height: 0.92;
  font-weight: 950;
}

.chapter__note {
  max-width: 520px;
  color: rgba(244, 247, 255, 0.74);
  font-size: 13px;
  line-height: 1.7;
}

.chapter__note strong {
  color: var(--ink);
  font-weight: 900;
}

.particle-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid rgba(77, 124, 255, 0.32);
  background: #03050a;
}

.particle-wrap canvas,
.particle-wrap img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.particle-wrap img {
  opacity: 0;
}

.chapter__grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(14px, 2vw, 28px);
  align-items: start;
}

.work-card {
  position: relative;
  min-height: 220px;
  grid-column: span 4;
  overflow: hidden;
  border: 1px solid rgba(244, 247, 255, 0.1);
  background: #0a0a0a;
  isolation: isolate;
}

.work-card.fallback-hidden {
  opacity: 0;
  transform: translateY(36px);
}

.work-card.fallback-hidden.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.work-card:nth-child(3n + 2) {
  margin-top: 10svh;
}

.work-card:nth-child(4n) {
  grid-column: span 5;
}

.work-card:nth-child(5n) {
  grid-column: span 7;
}

.work-card button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.work-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  filter: saturate(0.96) contrast(1.04);
  transform: scale(1.001);
  transition: transform 0.55s ease, filter 0.55s ease;
}

.work-card::after {
  content: "";
  position: absolute;
  inset: -20%;
  z-index: 1;
  opacity: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(77, 124, 255, 0.42), transparent 18%),
    repeating-linear-gradient(90deg, transparent 0 10px, rgba(77, 124, 255, 0.08) 10px 11px);
  mix-blend-mode: screen;
  transform: scale(1.06);
  transition: opacity 0.25s ease;
}

.work-card:hover img {
  transform: scale(1.075);
  filter: saturate(1.1) contrast(1.1);
}

.work-card:hover::after {
  opacity: 1;
}

.work-card__caption {
  position: absolute;
  inset: auto 0 0;
  z-index: 2;
  display: grid;
  gap: 8px;
  padding: 18px;
  background: linear-gradient(0deg, rgba(5, 5, 5, 0.86), transparent);
}

.work-card__label {
  color: var(--blue);
  font-size: 10px;
  font-weight: 900;
}

.work-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(20px, 2.2vw, 34px);
  line-height: 1.05;
}

.work-card__meta {
  color: rgba(244, 247, 255, 0.76);
  font-size: 10px;
  line-height: 1.45;
}

.breath {
  min-height: 120svh;
  display: grid;
  place-items: center;
  background: var(--black);
}

.breath span {
  color: rgba(255, 255, 255, 0.92);
  font-size: clamp(18px, 4vw, 54px);
  font-weight: 900;
}

.ending {
  min-height: 100svh;
  display: grid;
  align-content: center;
  gap: 30px;
  padding: clamp(36px, 7vw, 96px);
  overflow: hidden;
}

.ending h2 {
  max-width: none;
  line-height: 1.15;
  color: transparent;
  -webkit-text-stroke: 2px var(--ink);
  text-stroke: 2px var(--ink);
  transform-origin: left center;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: none;
  place-items: center;
  padding: clamp(16px, 4vw, 48px);
  background: rgba(0, 0, 0, 0.94);
}

.lightbox.is-open {
  display: grid;
}

.lightbox figure {
  width: min(92vw, 1500px);
  margin: 0;
}

.lightbox__image {
  width: 100%;
  max-height: 82svh;
  object-fit: contain;
  filter: contrast(1.04);
}

.lightbox__image.is-switching {
  image-rendering: pixelated;
  transform: scale(1.02);
  filter: contrast(1.4) saturate(0.4);
}

.lightbox figcaption {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 11px;
}

.lightbox__close,
.lightbox__nav {
  position: fixed;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(5, 5, 5, 0.56);
  color: var(--ink);
  font-size: 24px;
}

.lightbox__close {
  right: 24px;
  top: 24px;
}

.lightbox__nav--prev {
  left: 24px;
  top: 50%;
}

.lightbox__nav--next {
  right: 24px;
  top: 50%;
}

@media (max-width: 840px) {
  body {
    cursor: auto;
  }

  a,
  button {
    cursor: pointer;
  }

  .cursor {
    display: none;
  }

  .hero {
    min-height: 92svh;
  }

  .hero h1 {
    font-size: clamp(52px, 17vw, 96px);
    line-height: 1.08;
  }

  .manifesto {
    font-size: 18px;
  }

  .chapter {
    padding-left: 16px;
    padding-right: 16px;
  }

  .chapter__intro {
    min-height: auto;
    padding: 86px 0 40px;
    grid-template-columns: 1fr;
  }

  .chapter__title {
    font-size: clamp(66px, 24vw, 120px);
  }

  .particle-wrap img {
    opacity: 1;
  }

  .particle-wrap canvas {
    display: none;
  }

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

  .work-card,
  .work-card:nth-child(4n),
  .work-card:nth-child(5n) {
    grid-column: 1;
    margin-top: 0;
  }

  .work-card__label,
  .work-card__meta {
    font-size: 11px;
    line-height: 1.55;
  }

  .work-card h3 {
    font-size: 24px;
    line-height: 1.08;
  }

  .ending h2 {
    font-size: clamp(60px, 20vw, 112px);
    -webkit-text-stroke-width: 1px;
  }
}

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

  .hero__canvas {
    display: none;
  }
}
