:root {
  --bg: #ffffff;
  --fg: #000000;
  --dim: #e5e5e5;
  --muted: #8c8c8c;
  --accent: #b3261e;
  --display: "Anton", "Impact", sans-serif;
  --menu: "Bebas Neue", "Anton", sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;
  --edge: clamp(16px, 2.8vw, 40px);
  --row: clamp(64px, 15vh, 150px);
  --list-x: clamp(140px, 15vw, 280px);
  --rw: min(26vw, 46vh);
  --focus: .5;
  --card-w: clamp(170px, 18vw, 290px);
}
:root[data-theme="dark"] {
  --bg: #111111;
  --fg: #ffffff;
  --dim: #262626;
  --muted: #7a7a7a;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg); color: var(--fg);
  font-family: var(--mono);
  overflow: hidden; overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  transition: background .4s ease, color .4s ease;
  touch-action: none;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.mono { font-family: var(--mono); font-size: 14px; letter-spacing: -.03em; text-transform: uppercase; line-height: 1.6; }

/* ---------- letter roll (hover) ---------- */
.roll-word { display: inline-flex; overflow: hidden; vertical-align: top; }
.roll-ch { display: inline-flex; flex-direction: column; height: 1.1em; line-height: 1.1em; transition: transform .45s cubic-bezier(.7, 0, .2, 1); transition-delay: calc(var(--i) * 18ms); }
.roll-ch span { display: block; }
[data-roll]:hover .roll-ch, [data-roll]:focus-visible .roll-ch { transform: translateY(-50%); }

/* ---------- top ---------- */
.top { position: fixed; z-index: 30; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; padding: var(--edge); pointer-events: none; }
.top > * { pointer-events: auto; }
.brand { font-family: var(--display); font-size: 22px; text-transform: uppercase; letter-spacing: .01em; }
.top__right { display: flex; align-items: center; gap: 28px; }
.menu-btn { font-family: var(--menu); font-size: 20px; text-transform: uppercase; letter-spacing: .02em; }

/* ---------- side navs ---------- */
.modes, .themes { position: fixed; z-index: 20; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; }
.modes { left: var(--edge); align-items: flex-start; }
.themes { right: var(--edge); align-items: flex-end; }
.modes button, .themes button { display: flex; align-items: center; gap: 8px; padding: 1px 0; text-transform: uppercase; color: var(--fg); opacity: .9; }
.modes button::before, .themes button::after { content: ""; width: 8px; height: 8px; background: currentColor; transform: scale(0); transition: transform .25s ease; }
.modes button[aria-pressed="true"]::before, .themes button[aria-pressed="true"]::after { transform: scale(1); }
.modes button:hover, .themes button:hover { opacity: 1; }

/* ---------- corners ---------- */
.tagline { position: fixed; z-index: 20; left: var(--edge); bottom: var(--edge); max-width: 340px; }
.counter { position: fixed; z-index: 20; right: calc(var(--edge) + 40px); bottom: var(--edge); }
.play { position: fixed; z-index: 20; right: var(--edge); bottom: calc(var(--edge) + 2px); width: 22px; height: 22px; display: grid; place-items: center; }
.play[aria-pressed="true"] .play__icon { d: path("M2 1h3v10H2zM7 1h3v10H7z"); }

/* ---------- stage ---------- */
.stage { position: fixed; inset: 0; perspective: 1600px; overflow: hidden; }

/* LIST */
.names-wrap {
  position: absolute; inset: 0; pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, transparent 4%, #000 22%, #000 74%, transparent 90%);
  mask-image: linear-gradient(180deg, transparent 4%, #000 22%, #000 74%, transparent 90%);
}
.names-wrap .names li { pointer-events: auto; }
.names { list-style: none; position: absolute; left: var(--list-x); right: 0; top: 0; text-align: left; will-change: transform; transition: opacity .5s ease; }
.names li {
  height: var(--row); line-height: var(--row);
  font-family: var(--display); text-transform: uppercase; white-space: nowrap;
  font-size: calc(var(--row) * .84); letter-spacing: -.02em;
  color: var(--dim); transition: color .4s ease;
  cursor: pointer;
}
.names li.is-active { color: transparent; }
.now {
  position: absolute; left: var(--list-x); right: 0; top: calc(var(--focus) * 100%); transform: translateY(-50%); z-index: 3;
  height: var(--row); line-height: var(--row); text-align: left; white-space: nowrap; pointer-events: none;
  font-family: var(--display); text-transform: uppercase; font-size: calc(var(--row) * .84); letter-spacing: -.02em;
  color: var(--fg); transition: opacity .5s ease;
}
.reveal {
  position: absolute; right: clamp(140px, 11vw, 220px); top: 50%; z-index: 2; transform: translateY(-50%);
  width: var(--rw); aspect-ratio: 3 / 4; transition: opacity .5s ease;
}
.reveal__img { width: 100%; height: 100%; object-fit: cover; display: block; }
.reveal__px { position: absolute; inset: -1px; display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(10, 1fr); pointer-events: none; }
.reveal__px i { background: var(--bg); }
.reveal__px.go i { opacity: 0; transition: opacity 0s linear var(--d); }
.stray { position: absolute; width: 12.5%; height: 10%; background: var(--fg); opacity: 0; pointer-events: none; }
.stray.on { animation: blip .42s steps(1) var(--d) both; }
@keyframes blip { 0% { opacity: 0; } 20% { opacity: 1; } 70% { opacity: 1; } 100% { opacity: 0; } }
.reveal__meta { position: absolute; z-index: 3; right: clamp(140px, 11vw, 220px); top: calc(50% + var(--rw) * 2 / 3 + 14px); width: var(--rw); display: flex; justify-content: space-between; pointer-events: none; transition: opacity .5s ease; }

body:not([data-mode="list"]) .names-wrap,
body:not([data-mode="list"]) .names,
body:not([data-mode="list"]) .now,
body:not([data-mode="list"]) .reveal,
body:not([data-mode="list"]) .reveal__meta { opacity: 0; pointer-events: none; }

/* CARDS (gallery / loop / spiral) */
.cards { position: absolute; left: 50%; top: 50%; transform-style: preserve-3d; transition: opacity .5s ease; }
body[data-mode="list"] .cards { opacity: 0; pointer-events: none; }
.card {
  position: absolute; left: 0; top: 0; width: var(--card-w); aspect-ratio: 3 / 4;
  margin-left: calc(var(--card-w) / -2); margin-top: calc(var(--card-w) * -2 / 3);
  overflow: hidden; cursor: pointer; backface-visibility: visible;
  will-change: transform; background: var(--dim);
}
.card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.35) 0%, rgba(0,0,0,0) 28%, rgba(0,0,0,0) 55%, rgba(0,0,0,.55) 100%); }
.card__tag, .card__year { position: absolute; z-index: 1; top: 10px; font-family: var(--menu); font-size: 15px; letter-spacing: .02em; color: #fff; text-transform: uppercase; }
.card__tag { left: 12px; } .card__year { right: 12px; }
.card__name { position: absolute; z-index: 1; left: 10px; bottom: 4px; font-family: var(--display); font-weight: 400; text-transform: uppercase; color: #fff; font-size: calc(var(--card-w) * .16); line-height: 1; letter-spacing: -.01em; white-space: nowrap; }
.cards.morph .card { transition: transform .9s cubic-bezier(.7, 0, .2, 1), opacity .9s ease; }

/* ---------- menu ---------- */
.menu { position: fixed; inset: 0; z-index: 25; background: #000; color: #fff; display: grid; grid-template-columns: 1fr minmax(280px, 400px); gap: 40px; padding: 120px var(--edge) var(--edge); clip-path: inset(0 0 100% 0); transition: clip-path .7s cubic-bezier(.7, 0, .2, 1); }
.menu[hidden] { display: grid; visibility: hidden; }
.menu.open { clip-path: inset(0 0 0 0); visibility: visible; }
body.menu-open .top { color: #fff; }
.menu__links { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }
.menu__link { font-family: var(--display); text-transform: uppercase; font-size: clamp(56px, 10vh, 112px); line-height: 1.04; letter-spacing: -.01em; }
.menu__link .roll-ch { height: 1.04em; line-height: 1.04em; }
.menu__info { display: flex; flex-direction: column; justify-content: flex-end; gap: 16px; font-size: 13px; text-transform: none; letter-spacing: -.02em; line-height: 1.55; color: rgba(255,255,255,.85); }
.menu__info b { color: #fff; text-transform: uppercase; }
.menu__info a { border-bottom: 1px solid var(--accent); }
.menu__fine { color: rgba(255,255,255,.45); text-transform: uppercase; }

/* ---------- small screens ---------- */
@media (max-width: 767px) {
  :root { --row: clamp(48px, 8.5vh, 80px); --card-w: 54vw; --list-x: 16px; --rw: min(58vw, 40vh); --focus: .74; }
  .reveal { right: auto; left: 50%; top: 76px; transform: translateX(-50%); }
  .names-wrap {
    -webkit-mask-image: linear-gradient(180deg, transparent 56%, #000 66%, #000 82%, transparent 88%);
    mask-image: linear-gradient(180deg, transparent 56%, #000 66%, #000 82%, transparent 88%);
  }
  .reveal__meta { right: auto; left: 50%; transform: translateX(-50%); top: calc(76px + var(--rw) * 4 / 3 + 10px); }
  .modes { top: auto; bottom: 64px; left: var(--edge); transform: none; flex-direction: row; gap: 14px; }
  .themes { display: none; }
  .tagline { display: none; }
  .counter { right: auto; left: var(--edge); bottom: var(--edge); }
  .menu { grid-template-columns: 1fr; padding-top: 96px; overflow-y: auto; }
  .menu__info { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .roll-ch, .cards.morph .card, .menu { transition: none; }
}

/* gallery scatter: cards breathe on hover */
body[data-mode="gallery"] .card img { transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
body[data-mode="gallery"] .card:hover img { transform: scale(1.06); }

/* ---------- ABOUT ---------- */
.about {
  position: absolute; inset: 96px clamp(140px, 11vw, 220px) 72px; z-index: 4;
  display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(32px, 5vw, 80px); align-items: center;
  opacity: 0; visibility: hidden; transition: opacity .5s ease, visibility .5s;
}
body[data-mode="about"] .about { opacity: 1; visibility: visible; }
body[data-mode="about"] .cards, body[data-mode="about"] .tagline,
body[data-mode="about"] .counter, body[data-mode="about"] .play { opacity: 0; pointer-events: none; }
.tagline, .counter, .play { transition: opacity .4s ease; }
.about__eyebrow { color: var(--muted); }
.about__name { margin-top: 6px; font-family: var(--display); font-weight: 400; text-transform: uppercase; font-size: clamp(56px, 11vh, 132px); line-height: .9; letter-spacing: -.02em; }
.about__name span { display: block; }
.about__text { margin-top: 24px; max-width: 560px; text-transform: none; font-size: 13px; line-height: 1.6; display: grid; gap: 10px; }
.about__text b { text-transform: uppercase; }
.about__facts { margin-top: 28px; display: grid; grid-template-columns: repeat(4, auto); justify-content: start; gap: 12px 36px; }
.about__facts dt { color: var(--muted); font-size: 12px; }
.about__facts dd { font-family: var(--display); font-size: clamp(26px, 4vh, 40px); line-height: 1.1; text-transform: uppercase; }
.about__cta { display: inline-block; margin-top: 28px; padding: 14px 22px; background: var(--fg); color: var(--bg); }
.about__media { position: relative; height: 100%; display: flex; align-items: center; justify-content: flex-end; }
.about__photo { position: relative; height: min(100%, 64vh); aspect-ratio: 3 / 4; }
.about__photo img, .about__photo2 img { width: 100%; height: 100%; object-fit: cover; display: block; }
.about__px { position: absolute; inset: -1px; display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(10, 1fr); }
.about__px i { background: var(--bg); }
.about__px.go i { opacity: 0; transition: opacity 0s linear var(--d); }
.about__photo2 { position: absolute; left: 0; bottom: 4%; width: 36%; aspect-ratio: 3 / 4; border: 6px solid var(--bg); }

@media (max-width: 1100px) {
  .about__facts { grid-template-columns: repeat(2, auto); }
}
@media (max-width: 767px) {
  .about { inset: 72px 0 96px; padding: 0 16px 56px; display: block; overflow-y: auto; touch-action: pan-y; -webkit-overflow-scrolling: touch;
    -webkit-mask-image: linear-gradient(180deg, #000 0, #000 calc(100% - 48px), transparent 100%); mask-image: linear-gradient(180deg, #000 0, #000 calc(100% - 48px), transparent 100%); }
  .about__facts { gap: 14px 28px; }
  .about__media { height: auto; margin-top: 24px; justify-content: flex-start; }
  .about__photo { height: auto; width: 78%; }
  .about__photo2 { left: auto; right: 0; bottom: -6%; }
  .about__facts { grid-template-columns: repeat(2, auto); }
}
