:root {
  --bg: #0c0c0c;
  --ink: #ece8e0;
  --ink-dim: #6f6c66;
  --accent: #d8d2c4;
  --paper: #e9e5dc;
  --font-display: "Italiana", "Didot", serif;
  --font-ui: "Space Grotesk", "Helvetica Neue", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
}

/* faint grid backdrop */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 88px 88px;
  pointer-events: none;
  z-index: 0;
}

button { background: none; border: none; color: inherit; font: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }

@media (hover: hover) and (pointer: fine) {
  body, a, button { cursor: none; }
}

/* ---------- webgl ---------- */
.gl {
  position: fixed;
  inset: 0;
  z-index: 1;
}
.gl canvas { display: block; }

/* ---------- preloader ---------- */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.4rem;
}
.preloader__meta {
  display: flex;
  gap: 2rem;
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.preloader__count {
  font-family: var(--font-display);
  font-size: clamp(6rem, 18vw, 14rem);
  line-height: 0.9;
  color: var(--ink);
}
.preloader__count::after { content: "%"; font-size: 0.25em; vertical-align: super; color: var(--ink-dim); }
.preloader__bar {
  width: min(42vw, 320px);
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}
.preloader__bar span {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
}

/* ---------- header ---------- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.6rem 2rem;
  pointer-events: none;
}
.header > * { pointer-events: auto; }

.logo__mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  transition: background 0.4s, color 0.4s;
}
.logo:hover .logo__mark { background: var(--ink); color: var(--bg); }

.view-nav {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}
.view-nav__btn {
  color: var(--ink-dim);
  transition: color 0.35s;
  padding: 0.4rem 0.2rem;
}
.view-nav__btn.is-active { color: var(--ink); }
.view-nav__btn:hover { color: var(--ink); }
.view-nav__dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--ink-dim);
}

.menu-btn {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: var(--ink);
  color: var(--bg);
  border-radius: 999px;
  padding: 0.65rem 1.25rem;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.menu-btn:hover { transform: scale(1.06); }
.menu-btn__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

/* invert header chrome while the paper menu is open */
.logo__mark, .view-nav__btn, .view-nav__dot { transition: color 0.5s, border-color 0.5s, background 0.5s; }
body.menu-open .logo__mark { border-color: rgba(18, 17, 16, 0.35); color: #121110; }
body.menu-open .logo:hover .logo__mark { background: #121110; color: var(--paper); }
body.menu-open .view-nav__btn { color: rgba(18, 17, 16, 0.4); }
body.menu-open .view-nav__btn.is-active,
body.menu-open .view-nav__btn:hover { color: #121110; }
body.menu-open .view-nav__dot { background: rgba(18, 17, 16, 0.4); }

/* ---------- hero ---------- */
.hero {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 4.2rem;
  z-index: 10;
  text-align: center;
  pointer-events: none;
  mix-blend-mode: difference;
}
.hero__eyebrow {
  font-size: 0.68rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.8rem;
  opacity: 0;
}
.hero__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(3.4rem, 11vw, 11rem);
  line-height: 0.92;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.hero__title .char-wrap {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
}
.hero__title .char {
  display: inline-block;
  will-change: transform;
}

/* ---------- badge ---------- */
.badge {
  position: fixed;
  left: 2rem;
  bottom: 2rem;
  z-index: 20;
  width: 108px;
  height: 108px;
  opacity: 0;
}
.badge svg {
  width: 100%;
  height: 100%;
  animation: spin 14s linear infinite;
  fill: var(--ink-dim);
}
.badge text {
  font-family: var(--font-ui);
  font-size: 10.5px;
  letter-spacing: 0.46em;
  text-transform: uppercase;
}
.badge__center {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 0.5rem;
  color: var(--ink-dim);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- work label ---------- */
.work-label {
  position: fixed;
  right: 2rem;
  bottom: 2.4rem;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0;
}
.work-label__index { color: var(--ink-dim); }
.work-label__line { width: 28px; height: 1px; background: rgba(255, 255, 255, 0.25); }
.work-label__title { color: var(--ink); white-space: nowrap; }

/* ---------- scroll hint ---------- */
.scroll-hint {
  position: fixed;
  left: 50%;
  bottom: 1.4rem;
  transform: translateX(-50%);
  z-index: 20;
  font-size: 0.68rem;
  letter-spacing: 0.3em;
  color: var(--ink-dim);
  opacity: 0;
}
.scroll-hint span { display: inline-block; animation: hint-pulse 2.4s ease-in-out infinite; }
@keyframes hint-pulse { 50% { opacity: 0.35; } }

/* ---------- sound button ---------- */
.sound {
  position: fixed;
  right: 2rem;
  bottom: 6.4rem;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: background 0.45s cubic-bezier(0.22, 1, 0.36, 1),
              border-color 0.45s ease,
              padding 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.sound:hover {
  background: rgba(18, 17, 16, 0.55);
  border-color: rgba(255, 255, 255, 0.14);
  padding: 4px 4px 4px 0.85rem;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.sound-btn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  display: grid;
  place-items: center;
  opacity: 0;
}
.sound__slider {
  -webkit-appearance: none;
  appearance: none;
  width: 0;
  height: 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.22);
  outline: none;
  opacity: 0;
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
}
.sound:hover .sound__slider {
  width: 92px;
  opacity: 1;
}
.sound__slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--ink);
}
.sound__slider::-moz-range-thumb {
  width: 11px;
  height: 11px;
  border: none;
  border-radius: 50%;
  background: var(--ink);
}
.sound__slider::-moz-range-track {
  height: 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.22);
}
.sound__slider::-moz-range-progress {
  height: 3px;
  border-radius: 3px;
  background: var(--ink);
}
.sound-btn__bars {
  display: flex;
  align-items: flex-end;
  gap: 2.5px;
  height: 12px;
}
.sound-btn__bars i {
  width: 1.5px;
  background: var(--ink);
  animation: eq 1.1s ease-in-out infinite;
}
.sound-btn__bars i:nth-child(1) { height: 60%; animation-delay: 0s; }
.sound-btn__bars i:nth-child(2) { height: 100%; animation-delay: 0.15s; }
.sound-btn__bars i:nth-child(3) { height: 45%; animation-delay: 0.3s; }
.sound-btn__bars i:nth-child(4) { height: 80%; animation-delay: 0.45s; }
@keyframes eq { 50% { transform: scaleY(0.3); } }
.sound-btn.is-muted .sound-btn__bars i { animation-play-state: paused; transform: scaleY(0.25); }

/* ---------- menu overlay ---------- */
.menu {
  position: fixed;
  inset: 0;
  z-index: 60;
  visibility: hidden;
  pointer-events: none;
}
.menu.is-open { pointer-events: auto; }
.menu__panel {
  position: absolute;
  inset: 0;
  background: var(--paper);
  transform: translateY(-101%);
}
.menu__inner {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 8rem 2rem 2.4rem;
  color: #121110;
}
.menu__links {
  display: flex;
  flex-direction: column;
}
.menu__links a {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 1.4rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(18, 17, 16, 0.14);
  overflow: hidden;
}
.menu__links a em {
  font-style: normal;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: rgba(18, 17, 16, 0.45);
}
.menu__links a span {
  display: inline-block;
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 7vw, 5.4rem);
  line-height: 1.05;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), font-style 0.3s;
}
.menu__links a:hover span {
  transform: translateX(1.6rem);
  font-style: italic;
}
.menu__footer {
  display: flex;
  flex-wrap: wrap;
  gap: 4rem;
  font-size: 0.8rem;
  line-height: 1.7;
}
.menu__footer a { display: block; }
.menu__footer a:hover { text-decoration: underline; }
.menu__footer-label {
  font-size: 0.62rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(18, 17, 16, 0.45);
  margin-bottom: 0.3rem;
}

/* ---------- grain ---------- */
.grain {
  position: fixed;
  inset: -100px;
  z-index: 90;
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain-shift 0.9s steps(4) infinite;
}
@keyframes grain-shift {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-40px, 30px); }
  50% { transform: translate(30px, -45px); }
  75% { transform: translate(-25px, -20px); }
  100% { transform: translate(0, 0); }
}

/* ---------- cursor ---------- */
.cursor, .cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 120;
  border-radius: 50%;
  pointer-events: none;
  display: none;
}
@media (hover: hover) and (pointer: fine) {
  .cursor, .cursor-ring { display: block; }
}
.cursor {
  width: 6px;
  height: 6px;
  background: var(--ink);
  margin: -3px 0 0 -3px;
  mix-blend-mode: difference;
}
.cursor-ring {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  margin: -17px 0 0 -17px;
  mix-blend-mode: difference;
  transition: width 0.3s, height 0.3s, margin 0.3s;
}
.cursor-ring.is-hover {
  width: 56px;
  height: 56px;
  margin: -28px 0 0 -28px;
}

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .header { padding: 1.1rem 1.2rem; }
  .badge { display: none; }
  .work-label { right: 1.2rem; bottom: 1.6rem; }
  .sound-btn { right: 1.2rem; bottom: 5.4rem; }
  .hero { bottom: 5.6rem; }
  .menu__inner { padding: 6.4rem 1.2rem 1.8rem; }
  .menu__footer { gap: 1.6rem; }
}
