:root {
  --font-display: "Inter Tight", "Noto Sans SC", system-ui, sans-serif;
  --font-cn: "Noto Sans SC", "Inter Tight", system-ui, sans-serif;
  --paper: #f6f2e8;
  --ink: #f8f8f5;
  --accent: #c6ff45;
  --red: #f05b4f;
  --blue: #78a8ff;
  --portrait-width: min(430px, 100vw);
  --portrait-edge: calc((100vw - var(--portrait-width)) / 2 + 18px);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: #fff;
  color: var(--ink);
  font-family: var(--font-cn);
}

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

#scroll-spacer {
  position: relative;
  min-height: 500vh;
  user-select: none;
  background: #fff;
  cursor: none;
}

.blend {
  color: #fff;
  mix-blend-mode: exclusion;
}

#cursor {
  position: fixed;
  z-index: 50;
  left: 50%;
  top: 50%;
  width: 48px;
  height: 48px;
  pointer-events: none;
  transform: translate(-50%, -50%);
  mix-blend-mode: exclusion;
}

#cursor svg {
  width: 100%;
  height: 100%;
}

#cursor circle,
#cursor path {
  fill: none;
  stroke: #fff;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#main-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 28%, rgba(198, 255, 69, 0.32), transparent 26%),
    linear-gradient(120deg, #151515, #4f5345 42%, #d8d0bc);
  opacity: 1;
  transition: opacity 0.35s ease, visibility 0.2s ease;
}

#main-canvas::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.58), transparent 45%, rgba(0, 0, 0, 0.42)),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.06) 1px, transparent 1px, transparent 6px);
}

.hero-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-image: url("./assets/webp/hero-installation.webp");
  background-size: cover;
  background-position: center;
  transition: opacity 0.18s ease, transform 0.18s ease, filter 0.18s ease;
}

#hero-left {
  opacity: 0;
  filter: contrast(1.08) saturate(0.9) hue-rotate(18deg);
  transform: scale(1.04) translateX(-1.5%);
}

#hero-right {
  opacity: 1;
  filter: contrast(1.02) saturate(1.08);
  transform: scale(1.03) translateX(1.5%);
}

.topbar {
  position: fixed;
  z-index: 20;
  top: 32px;
  left: 32px;
  right: 32px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
  animation: rise 0.65s cubic-bezier(0.25, 0.1, 0.25, 1) both;
}

.wordmark {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 0.8;
}

.wordmark span {
  font-size: clamp(72px, 12vw, 180px);
}

.wordmark i {
  margin-top: 6px;
  font-style: normal;
  font-size: 14px;
  writing-mode: vertical-rl;
}

.topbar nav {
  display: flex;
  flex-shrink: 0;
  gap: 46px;
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: 0;
  text-transform: uppercase;
  white-space: nowrap;
  animation: rise 0.65s 0.15s cubic-bezier(0.25, 0.1, 0.25, 1) both;
}

.topbar nav span {
  white-space: nowrap;
  word-break: keep-all;
}

.caption {
  position: fixed;
  z-index: 20;
  left: 32px;
  top: 244px;
  width: min(470px, calc(44vw - 32px));
  margin: 0;
  pointer-events: none;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.55;
  letter-spacing: 0;
  animation: rise 0.65s 0.3s cubic-bezier(0.25, 0.1, 0.25, 1) both;
}

#outro-info {
  position: fixed;
  z-index: 20;
  right: 32px;
  bottom: 80px;
  width: 390px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  pointer-events: none;
  animation: fadeIn 0.65s 0.45s both;
}

.identity {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 28px;
}

.symbol {
  position: relative;
  width: 34px;
  height: 34px;
}

.symbol svg,
.symbol span {
  position: absolute;
  inset: 0;
}

.symbol circle {
  fill: none;
  stroke: #fff;
  stroke-width: 2.5;
}

.symbol span {
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 13px;
}

#outro-info h1 {
  margin: 0;
  max-width: 390px;
  font-size: clamp(30px, 3.2vw, 50px);
  line-height: 0.98;
  letter-spacing: 0;
  text-transform: uppercase;
}

#outro-info p {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(58px, 6.6vw, 104px);
  line-height: 0.9;
  letter-spacing: 0;
  text-transform: uppercase;
}

#black-panel {
  position: fixed;
  inset: 0;
  z-index: 10;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(198, 255, 69, 0.08), transparent 24%, rgba(120, 168, 255, 0.12)),
    #050505;
  transform: translateY(100vh);
  pointer-events: none;
}

#gallery-wrap {
  width: min(1380px, calc(100vw - 40px));
  min-height: 100vh;
  margin: 0 auto;
  padding: min(32vh, 320px) 0 28vh;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(18px, 3vw, 48px);
  will-change: transform;
}

.slide {
  min-height: clamp(320px, 42vw, 560px);
  aspect-ratio: 4 / 5;
  padding: clamp(18px, 2.2vw, 32px);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.26);
  background:
    radial-gradient(circle at 22% 24%, rgba(198, 255, 69, 0.2), transparent 18%),
    radial-gradient(circle at 88% 72%, rgba(240, 91, 79, 0.16), transparent 20%),
    linear-gradient(160deg, rgba(246, 242, 232, 0.16), rgba(120, 168, 255, 0.07) 46%, rgba(255, 255, 255, 0.02)),
    #101111;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    inset 0 -120px 110px rgba(0, 0, 0, 0.38);
  transform: scale(0);
  transform-origin: left bottom;
  will-change: transform;
}

.slide::after {
  content: "";
  position: absolute;
  inset: 18px;
  z-index: 0;
  pointer-events: none;
  border-top: 1px solid rgba(198, 255, 69, 0.28);
  border-left: 1px solid rgba(255, 255, 255, 0.16);
  background:
    linear-gradient(90deg, transparent 0 18%, rgba(198, 255, 69, 0.16) 18% 18.4%, transparent 18.4% 58%, rgba(255, 255, 255, 0.12) 58% 58.3%, transparent 58.3%),
    linear-gradient(0deg, transparent 0 34%, rgba(240, 91, 79, 0.18) 34% 34.5%, transparent 34.5% 70%, rgba(120, 168, 255, 0.14) 70% 70.4%, transparent 70.4%);
  opacity: 0.82;
}

.slide:nth-child(4n + 1) {
  grid-column: span 2;
  aspect-ratio: 16 / 10;
}

.slide:nth-child(3n) {
  margin-top: 18vh;
}

.slide:nth-child(5n) {
  margin-top: 8vh;
}

.slide::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.18) 34%, rgba(0, 0, 0, 0.86) 100%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.07) 1px, transparent 1px, transparent 22px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.035) 1px, transparent 1px, transparent 7px);
  opacity: 0.96;
}

.slide:nth-child(2n) {
  background:
    radial-gradient(circle at 76% 18%, rgba(120, 168, 255, 0.18), transparent 17%),
    radial-gradient(circle at 16% 82%, rgba(198, 255, 69, 0.16), transparent 18%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(25, 31, 35, 0.98) 52%, rgba(0, 0, 0, 0.98)),
    #101111;
}

.slide:nth-child(3n) {
  background:
    radial-gradient(circle at 84% 34%, rgba(198, 255, 69, 0.24), transparent 14%),
    linear-gradient(130deg, rgba(240, 91, 79, 0.22), rgba(12, 12, 12, 0.9) 42%, rgba(120, 168, 255, 0.11)),
    #111;
}

.slide:nth-child(5n) {
  background:
    linear-gradient(90deg, rgba(198, 255, 69, 0.16), transparent 22%, rgba(240, 91, 79, 0.16) 88%),
    linear-gradient(160deg, rgba(246, 242, 232, 0.13), rgba(9, 12, 14, 0.98)),
    #101111;
}

.slide.visual {
  background-size: cover;
  background-position: center;
}

.slide.visual::after {
  border-color: rgba(255, 255, 255, 0.22);
  background:
    linear-gradient(90deg, transparent 0 52%, rgba(198, 255, 69, 0.2) 52% 52.5%, transparent 52.5%),
    linear-gradient(0deg, transparent 0 64%, rgba(255, 255, 255, 0.16) 64% 64.35%, transparent 64.35%);
}

.slide.intro {
  background:
    linear-gradient(140deg, rgba(198, 255, 69, 0.62), rgba(240, 91, 79, 0.52) 42%, rgba(17, 17, 17, 0.94)),
    #111;
}

.slide.intro::after,
.slide.outro-card::after {
  border-top-color: rgba(255, 255, 255, 0.28);
}

.slide.outro-card {
  background:
    linear-gradient(145deg, rgba(120, 168, 255, 0.54), rgba(246, 242, 232, 0.1) 46%, rgba(198, 255, 69, 0.28)),
    #101010;
}

.slide > * {
  position: relative;
  z-index: 1;
}

.kicker {
  width: fit-content;
  margin-bottom: auto;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.44);
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0;
  color: var(--accent);
  white-space: nowrap;
  word-break: keep-all;
}

.slide h2 {
  margin: 0 0 12px;
  font-size: clamp(23px, 7vw, 31px);
  line-height: 1.08;
  letter-spacing: 0;
  word-break: keep-all;
  overflow-wrap: normal;
  text-wrap: balance;
}

.slide p {
  margin: 0;
  max-width: 34em;
  font-size: clamp(12px, 3.45vw, 14px);
  line-height: 1.58;
  letter-spacing: 0;
}

#outro-overlay {
  position: fixed;
  inset: 0;
  z-index: 12;
  pointer-events: none;
  background: #fff;
  opacity: 0;
}

#outro-buy {
  position: fixed;
  z-index: 20;
  right: 32px;
  bottom: 32px;
  width: 330px;
  height: 174px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #050505;
  color: #fff;
  mix-blend-mode: normal;
  font-family: var(--font-display);
  font-size: 108px;
  line-height: 1;
  transform: scale(0);
  transform-origin: right bottom;
  pointer-events: auto;
}

#outro-footer {
  position: fixed;
  z-index: 20;
  left: 32px;
  right: 32px;
  bottom: 32px;
  display: flex;
  justify-content: space-between;
  gap: 80px;
  opacity: 0;
  pointer-events: none;
  font-family: var(--font-display);
  font-size: 13px;
  line-height: 1;
  letter-spacing: 0;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (max-width: 1023px) {
  #scroll-spacer {
    cursor: auto;
  }

  #cursor {
    display: none;
  }

  #main-canvas {
    top: 0;
    height: 100vh;
  }

  .topbar {
    top: 18px;
    left: 18px;
    right: 18px;
  }

  .topbar nav {
    gap: 12px;
    font-size: 12px;
  }

  .topbar nav span:first-child {
    display: none;
  }

  .wordmark span {
    font-size: clamp(64px, 22vw, 104px);
  }

  .wordmark i {
    margin-top: 4px;
    font-size: 12px;
  }

  .caption {
    top: 128px;
    left: 18px;
    width: calc(100vw - 36px);
    font-size: 12px;
    line-height: 1.45;
  }

  #outro-info {
    left: 18px;
    right: 18px;
    bottom: 38px;
    width: auto;
  }

  #outro-info h1 {
    max-width: min(430px, calc(100vw - 36px));
    font-size: clamp(25px, 7.6vw, 32px);
    line-height: 1.04;
    word-break: keep-all;
    overflow-wrap: normal;
    text-wrap: balance;
  }

  #outro-info p {
    font-size: clamp(50px, 16vw, 70px);
  }

  #gallery-wrap {
    width: calc(100vw - 28px);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    padding-top: 28vh;
  }

  .slide,
  .slide:nth-child(4n + 1) {
    grid-column: span 2;
    min-height: clamp(390px, 62vh, 430px);
    aspect-ratio: auto;
  }

  .slide:nth-child(3n),
  .slide:nth-child(5n) {
    margin-top: 0;
  }

  #outro-buy {
    left: 18px;
    right: 18px;
    bottom: 58px;
    width: auto;
    height: 104px;
    font-size: 72px;
  }

  #outro-footer {
    left: 18px;
    right: 18px;
    bottom: 24px;
    gap: 20px;
    font-size: 11px;
  }
}

/* Keep the public preview in the same portrait reading mode on every viewport. */
#scroll-spacer {
  cursor: auto;
}

#cursor {
  display: none;
}

#main-canvas,
#black-panel {
  left: 50%;
  right: auto;
  width: var(--portrait-width);
  transform: translateX(-50%);
}

#main-canvas {
  top: 0;
  height: 100vh;
}

#black-panel {
  transform: translate(-50%, 100vh);
}

.topbar {
  top: 18px;
  left: var(--portrait-edge);
  right: var(--portrait-edge);
}

.topbar nav {
  gap: 12px;
  font-size: 12px;
}

.topbar nav span:first-child {
  display: none;
}

.wordmark span {
  font-size: clamp(64px, 22vw, 104px);
}

.wordmark i {
  margin-top: 4px;
  font-size: 12px;
}

.caption {
  top: 128px;
  left: var(--portrait-edge);
  width: calc(var(--portrait-width) - 36px);
  font-size: 12px;
  line-height: 1.45;
}

#outro-info {
  left: var(--portrait-edge);
  right: var(--portrait-edge);
  bottom: 38px;
  width: auto;
}

#outro-info h1 {
  max-width: calc(var(--portrait-width) - 36px);
  font-size: clamp(25px, 7.6vw, 32px);
  line-height: 1.04;
  word-break: keep-all;
  overflow-wrap: normal;
  text-wrap: balance;
}

#outro-info p {
  font-size: clamp(50px, 16vw, 70px);
}

#gallery-wrap {
  width: calc(var(--portrait-width) - 28px);
  grid-template-columns: 1fr;
  gap: 18px;
  padding-top: 28vh;
}

.slide,
.slide:nth-child(4n + 1) {
  grid-column: 1;
  min-height: clamp(390px, 62vh, 430px);
  aspect-ratio: auto;
}

.slide:nth-child(3n),
.slide:nth-child(5n) {
  margin-top: 0;
}

#outro-buy {
  left: var(--portrait-edge);
  right: var(--portrait-edge);
  bottom: 58px;
  width: auto;
  height: 104px;
  font-size: 72px;
}

#outro-footer {
  left: var(--portrait-edge);
  right: var(--portrait-edge);
  bottom: 24px;
  gap: 20px;
  font-size: 11px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .slide {
    will-change: auto;
  }
}
