/* ───────── Tokens ───────── */
:root {
  --abyss: #01040c;
  --deep: #040b1e;
  --navy: #0a1a3f;
  --royal: #1d4ed8;
  --blue: #3b82f6;
  --sky: #7cc4ff;
  --ice: #e6f0ff;
  --text: #e6f0ff;
  --muted: rgba(230, 240, 255, 0.62);
  --faint: rgba(230, 240, 255, 0.14);
  --line: rgba(124, 196, 255, 0.18);

  --bg: #0b2a6b;               /* updated by JS as you scroll (depth) */
  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;

  --pad: clamp(16px, 4vw, 56px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s linear;
}
img, video, iframe, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
em { font-family: var(--serif); font-style: italic; font-weight: 300; color: var(--sky); }
::selection { background: var(--blue); color: #fff; }
:focus-visible { outline: 2px solid var(--sky); outline-offset: 4px; border-radius: 4px; }

/* Film grain overlay */
.grain {
  position: fixed; inset: -50%; z-index: 100; pointer-events: none; opacity: 0.06;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain 1s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -3%); } 60% { transform: translate(-2%, -1%); }
  80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); }
}

/* Custom cursor (pointer devices only) */
.cursor { position: fixed; top: 0; left: 0; z-index: 120; pointer-events: none; display: none; }
.cursor span {
  display: flex; align-items: center; justify-content: center;
  width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%;
  border: 1.5px solid var(--sky); background: rgba(124, 196, 255, 0.08);
  font: 500 10px/1 var(--mono); letter-spacing: 0.08em; color: var(--deep); text-transform: uppercase;
  transition: width 0.35s var(--ease), height 0.35s var(--ease), margin 0.35s var(--ease), background 0.3s, border-color 0.3s;
}
.cursor.is-hover span { width: 44px; height: 44px; margin: -22px 0 0 -22px; background: rgba(124, 196, 255, 0.12); }
.cursor.is-play span { width: 76px; height: 76px; margin: -38px 0 0 -38px; background: var(--sky); border-color: var(--sky); }
@media (hover: hover) and (pointer: fine) {
  .cursor { display: block; }
  body, a, button { cursor: none; }
}

/* ───────── Nav ───────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px var(--pad);
  background: linear-gradient(180deg, rgba(1, 4, 12, 0.35), transparent);
}
.nav__logo { font: 600 15px/1 var(--mono); letter-spacing: 0.1em; }
.nav__links { display: flex; gap: clamp(14px, 3vw, 36px); font-size: 14px; }
.nav__links a { position: relative; opacity: 0.85; }
.nav__links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: right; transition: transform 0.5s var(--ease);
}
.nav__links a:hover::after { transform: scaleX(1); transform-origin: left; }
.nav__sound { display: flex; align-items: center; gap: 10px; font: 500 12px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.08em; }
.bars { display: flex; align-items: flex-end; gap: 2px; height: 12px; }
.bars i { width: 2px; height: 3px; background: currentColor; transition: height 0.3s; }
.nav__sound[aria-pressed="true"] .bars i { animation: bar 0.9s ease-in-out infinite; }
.nav__sound[aria-pressed="true"] .bars i:nth-child(2) { animation-delay: -0.3s; }
.nav__sound[aria-pressed="true"] .bars i:nth-child(3) { animation-delay: -0.6s; }
.nav__sound[aria-pressed="true"] .bars i:nth-child(4) { animation-delay: -0.15s; }
@keyframes bar { 0%, 100% { height: 3px; } 50% { height: 12px; } }
@media (max-width: 640px) {
  .nav__links { display: none; }
  .nav__sound-label { display: none; }
}

/* ───────── Depth gauge ───────── */
.depth {
  position: fixed; right: 14px; top: 50%; z-index: 40; transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: flex-end; gap: 10px;
  font-family: var(--mono); pointer-events: none;
}
.depth__track { width: 2px; height: 140px; background: var(--faint); position: relative; overflow: hidden; border-radius: 2px; }
.depth__fill { position: absolute; inset: 0; background: linear-gradient(var(--sky), var(--blue)); transform-origin: top; transform: scaleY(0); }
.depth__readout { font-size: 13px; color: var(--ice); }
.depth__num { font-variant-numeric: tabular-nums; }
.depth__unit { opacity: 0.5; margin-left: 2px; }
.depth__label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); writing-mode: vertical-rl; transform: rotate(180deg); }
@media (max-width: 900px) { .depth { display: none; } }

/* ───────── Shared ───────── */
section { position: relative; padding: clamp(80px, 14vh, 160px) var(--pad); }
.eyebrow {
  margin: 0 0 18px; font: 500 12px/1 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--sky);
  display: inline-flex; align-items: center; gap: 12px;
}
.eyebrow::before { content: ""; width: 24px; height: 1px; background: currentColor; }
.section-title {
  margin: 0; font-family: var(--serif); font-weight: 400; letter-spacing: -0.02em; line-height: 1;
  font-size: clamp(40px, 7vw, 104px);
}
.section-head { max-width: 1400px; margin: 0 auto 48px; }
.section-head--center { text-align: center; }

.reveal { opacity: 0; transform: translateY(28px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

/* ───────── Hero ───────── */
.hero {
  min-height: 100svh; display: grid; place-items: center; padding-top: 100px; padding-bottom: 100px; overflow: hidden;
  background:
    radial-gradient(120% 70% at 50% -10%, rgba(124, 196, 255, 0.35), transparent 60%),
    linear-gradient(180deg, #1d4ed8 0%, transparent 100%);
}
.hero__canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero__inner { position: relative; z-index: 2; text-align: center; width: 100%; }
.hero__name {
  margin: 0; font-family: var(--serif); font-weight: 500; line-height: 0.84; letter-spacing: -0.03em;
  font-size: clamp(80px, 21vw, 300px); user-select: none;
}
.hero__line { display: block; white-space: nowrap; }
.hero__line--outline { color: transparent; -webkit-text-stroke: 1.5px var(--ice); font-style: italic; font-weight: 300; }
.char { display: inline-block; will-change: transform; cursor: pointer; }
.char.is-sinking { transition: none; }
.hero__disciplines { display: flex; align-items: center; justify-content: center; gap: clamp(12px, 3vw, 32px); margin-top: clamp(28px, 5vh, 56px); flex-wrap: wrap; }
.hero__disciplines button { font-size: clamp(15px, 1.6vw, 20px); display: inline-flex; align-items: baseline; gap: 8px; transition: color 0.3s; }
.hero__disciplines button span { font: 400 11px/1 var(--mono); color: var(--sky); }
.hero__disciplines button:hover { color: var(--sky); }
.hero__disciplines i { width: 5px; height: 5px; border-radius: 50%; background: var(--sky); opacity: 0.6; }
.hero__hint { position: absolute; left: var(--pad); bottom: 32px; margin: 0; font: 400 11px/1.4 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); z-index: 2; }
.hero__scroll { position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 10px; font: 500 11px/1 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; }
.hero__scroll i { width: 1px; height: 44px; background: linear-gradient(var(--ice), transparent); animation: drip 2s var(--ease) infinite; transform-origin: top; }
@keyframes drip { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }
@media (max-width: 640px) { .hero__hint { display: none; } }

/* ───────── Intro ───────── */
.intro { max-width: 1200px; margin: 0 auto; }
.intro__text { margin: 0; font-family: var(--serif); font-weight: 300; font-size: clamp(28px, 4.2vw, 60px); line-height: 1.18; letter-spacing: -0.015em; }
.intro__text .w { opacity: 0.14; transition: opacity 0.4s; }
.intro__text .w.is-lit { opacity: 1; }

/* ───────── Work grid ───────── */
.work { max-width: 1480px; margin: 0 auto; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 auto 40px; max-width: 1400px; }
.filters button {
  padding: 10px 18px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px;
  transition: background 0.3s, color 0.3s, border-color 0.3s;
}
.filters button sup { font: 400 10px/1 var(--mono); color: var(--sky); margin-left: 2px; }
.filters button:hover { border-color: var(--sky); }
.filters button.is-active { background: var(--ice); color: var(--deep); border-color: var(--ice); }
.filters button.is-active sup { color: var(--royal); }

.grid {
  max-width: 1400px; margin: 0 auto;
  --gap: clamp(16px, 2vw, 28px);
  display: flex; flex-wrap: wrap; justify-content: center; gap: calc(var(--gap) * 2) var(--gap);
}
.card { width: calc(50% - var(--gap) / 2); transition: opacity 0.5s var(--ease), transform 0.6s var(--ease); }
.card--portrait { width: calc(25% - var(--gap) * 3 / 4); }
.card.is-hidden { display: none; }
@media (max-width: 1000px) { .card { width: 100%; } .card--portrait { width: calc(50% - var(--gap) / 2); } }

.card__media {
  position: relative; overflow: hidden; border-radius: 14px; aspect-ratio: 16 / 9;
  background: var(--navy); isolation: isolate;
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.5s var(--ease), box-shadow 0.5s;
}
.card--portrait .card__media { aspect-ratio: 9 / 16; }
.card:hover .card__media { box-shadow: 0 30px 80px -30px rgba(59, 130, 246, 0.6); }
.card__media img, .card__media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card__spot {
  position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: 0; transition: opacity 0.4s;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgba(124, 196, 255, 0.25), transparent 60%);
}
.card:hover .card__spot { opacity: 1; }

.card__play {
  position: absolute; right: 16px; bottom: 16px; z-index: 4;
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(230, 240, 255, 0.12); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(230, 240, 255, 0.3); transition: transform 0.4s var(--ease), background 0.3s;
}
.card__play svg { width: 16px; height: 16px; margin-left: 3px; fill: var(--ice); }
.card:hover .card__play { transform: scale(1.1); background: var(--sky); }
.card:hover .card__play svg { fill: var(--deep); }
.card__tc { position: absolute; left: 16px; top: 14px; z-index: 4; font: 400 11px/1 var(--mono); letter-spacing: 0.08em; color: rgba(230, 240, 255, 0.8); display: flex; align-items: center; gap: 8px; }
.card__tc::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #ff4d5e; animation: rec 1.4s steps(2) infinite; }
@keyframes rec { 50% { opacity: 0; } }

.card__body { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; padding: 18px 2px 0; }
.card__title { margin: 0; font-family: var(--serif); font-weight: 400; font-size: clamp(22px, 2.2vw, 30px); line-height: 1.1; }
.card__meta { font: 400 11px/1.6 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--sky); text-align: right; white-space: nowrap; }
.card__desc { grid-column: 1 / -1; margin: 6px 0 0; color: var(--muted); font-size: 15px; max-width: 52ch; }

/* Placeholders: one style per discipline */
.ph { position: absolute; inset: 0; overflow: hidden; }
.ph__label {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 2; text-align: center; width: 90%;
  font: 500 11px/1.5 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: rgba(230, 240, 255, 0.75);
}
.ph__label strong { display: block; font: italic 300 clamp(22px, 3vw, 38px)/1.1 var(--serif); letter-spacing: -0.01em; text-transform: none; color: var(--ice); margin-bottom: 8px; }

.ph--film { background: radial-gradient(80% 60% at 30% 30%, #1d4ed8, #0a1a3f 70%); }
.ph--film::before, .ph--film::after { content: ""; position: absolute; left: 0; right: 0; height: 11%; background: #01040c; z-index: 1; }
.ph--film::before { top: 0; } .ph--film::after { bottom: 0; }
.ph--film .ph__beam {
  position: absolute; inset: -40%; background: conic-gradient(from 200deg at 20% 20%, transparent, rgba(124, 196, 255, 0.35), transparent 25%);
  animation: sweep 7s ease-in-out infinite alternate;
}
@keyframes sweep { to { transform: rotate(35deg); } }

.ph--diving { background: linear-gradient(180deg, #2f7fe0 0%, #0d3a8f 45%, #041030 100%); }
.ph--diving .ph__beam {
  position: absolute; inset: 0; opacity: 0.55; mix-blend-mode: screen;
  background:
    repeating-linear-gradient(100deg, transparent 0 40px, rgba(255, 255, 255, 0.08) 40px 44px, transparent 44px 90px),
    repeating-linear-gradient(80deg, transparent 0 60px, rgba(255, 255, 255, 0.06) 60px 63px, transparent 63px 130px);
  animation: caustics 9s linear infinite;
}
@keyframes caustics { to { background-position: 400px 0, -300px 0; } }
.ph--diving .bubble { position: absolute; bottom: -20px; border-radius: 50%; border: 1px solid rgba(230, 240, 255, 0.55); background: rgba(230, 240, 255, 0.08); animation: rise linear infinite; }
@keyframes rise { to { transform: translateY(calc(-1 * var(--h, 600px))) translateX(var(--dx, 10px)); opacity: 0; } }

.ph--piano { background: #050d24; }
.ph--piano .ph__keys { position: absolute; left: 0; right: 0; bottom: 0; height: 38%; display: flex; gap: 2px; padding: 0 2px; opacity: 0.9; }
.ph--piano .ph__keys span { flex: 1; background: linear-gradient(#dfe9ff, #b8cbef); border-radius: 0 0 4px 4px; animation: press 3.2s ease-in-out infinite; animation-delay: calc(var(--i) * 0.23s); }
@keyframes press { 0%, 80%, 100% { transform: none; background: linear-gradient(#dfe9ff, #b8cbef); } 88% { transform: translateY(3px); background: linear-gradient(#7cc4ff, #3b82f6); } }
.ph--piano .ph__beam { position: absolute; inset: 0; background: radial-gradient(60% 50% at 50% 20%, rgba(59, 130, 246, 0.45), transparent 70%); }

/* ───────── Piano ───────── */
.piano { overflow: hidden; text-align: center; }
.piano__ripples { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.piano__help { color: var(--muted); margin: 20px auto 0; max-width: 56ch; font-size: 15px; }
kbd { font: 500 11px/1 var(--mono); padding: 3px 6px; border: 1px solid var(--line); border-radius: 4px; color: var(--ice); }
.keyboard {
  position: relative; z-index: 2; margin: 0 auto; width: min(100%, 880px); height: clamp(150px, 26vw, 250px);
  display: flex; user-select: none; touch-action: none;
  filter: drop-shadow(0 30px 60px rgba(29, 78, 216, 0.45));
}
.key { position: relative; flex: 1; border-radius: 0 0 10px 10px; transition: transform 0.08s, background 0.2s; }
.key--white { background: linear-gradient(180deg, #f3f7ff 0%, #d6e3fb 100%); margin: 0 1.5px; box-shadow: inset 0 -8px 0 rgba(10, 26, 63, 0.12); }
.key--white.is-down { background: linear-gradient(180deg, #7cc4ff, #3b82f6); transform: translateY(3px); box-shadow: inset 0 -3px 0 rgba(10, 26, 63, 0.2); }
.key--black {
  position: absolute; top: 0; z-index: 2; width: calc(100% / 14 * 0.62); height: 60%;
  background: linear-gradient(180deg, #0a1a3f, #01040c); border-radius: 0 0 7px 7px; box-shadow: 0 6px 12px rgba(0, 0, 0, 0.5), inset 0 -5px 0 rgba(124, 196, 255, 0.15);
}
.key--black.is-down { background: linear-gradient(180deg, #1d4ed8, #0a1a3f); transform: translateY(2px); }
.key__lbl { position: absolute; bottom: 12px; left: 0; right: 0; font: 500 10px/1 var(--mono); color: rgba(10, 26, 63, 0.45); }
.key--black .key__lbl { color: rgba(230, 240, 255, 0.45); bottom: 8px; }
@media (hover: none) { .key__lbl { display: none; } }
.piano__note { position: relative; z-index: 2; margin: 28px 0 0; font: italic 300 clamp(28px, 4vw, 48px)/1 var(--serif); color: var(--sky); min-height: 1em; }

/* ───────── About ───────── */
.about__grid { max-width: 1300px; margin: 0 auto; display: grid; grid-template-columns: 5fr 7fr; gap: clamp(32px, 6vw, 96px); align-items: center; }
@media (max-width: 860px) { .about__grid { grid-template-columns: 1fr; } }
.portrait-placeholder {
  aspect-ratio: 4 / 5; border-radius: 16px; position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: radial-gradient(90% 70% at 50% 0%, #1d4ed8, #0a1a3f 60%, #040b1e);
  border: 1px solid var(--line);
}
.portrait-placeholder span { font: italic 300 44px/1 var(--serif); }
.portrait-placeholder small { font: 400 11px/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.about__copy > p:not(.eyebrow) { font-size: clamp(16px, 1.3vw, 19px); color: var(--muted); margin: 28px 0; max-width: 56ch; }
.about__list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.about__list li { display: grid; grid-template-columns: 40px 1fr; gap: 2px 12px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.about__list span { font: 400 11px/2 var(--mono); color: var(--sky); grid-row: span 2; }
.about__list strong { font-weight: 500; font-size: 18px; }
.about__list em { font-family: var(--sans); font-style: normal; font-size: 14px; color: var(--muted); }

/* ───────── Contact ───────── */
.contact { text-align: center; padding-bottom: clamp(100px, 18vh, 200px); }
.contact .eyebrow { justify-content: center; }
.contact__title { margin: 0 0 40px; font-family: var(--serif); font-weight: 400; font-size: clamp(52px, 11vw, 170px); line-height: 0.92; letter-spacing: -0.03em; }
.contact__mail {
  display: inline-block; padding: 20px 36px; border-radius: 999px; border: 1px solid var(--sky);
  font-size: clamp(16px, 2vw, 22px); transition: background 0.3s, color 0.3s; will-change: transform;
}
.contact__mail:hover { background: var(--sky); color: var(--deep); }
.contact__links { display: flex; justify-content: center; flex-wrap: wrap; gap: 28px; margin-top: 44px; font: 500 12px/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; }
.contact__links a { color: var(--muted); transition: color 0.3s; }
.contact__links a:hover { color: var(--sky); }

.footer { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 24px var(--pad); border-top: 1px solid var(--line); font: 400 12px/1 var(--mono); color: var(--muted); }
.footer__top:hover { color: var(--sky); }

/* ───────── Lightbox ───────── */
.lightbox {
  position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px;
  padding: 72px var(--pad) 32px; background: rgba(1, 4, 12, 0.92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  opacity: 0; transition: opacity 0.4s var(--ease);
}
.lightbox.is-open { opacity: 1; }
.lightbox[hidden] { display: none; }
.lightbox__close { position: absolute; top: 20px; right: var(--pad); font: 500 12px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; display: flex; align-items: center; gap: 10px; }
.lightbox__close span { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; }
.lightbox__stage { width: min(100%, 1200px); aspect-ratio: 16 / 9; max-height: 75vh; border-radius: 14px; overflow: hidden; background: #000; position: relative; }
.lightbox__stage.is-portrait { width: auto; height: 75vh; aspect-ratio: 9 / 16; max-width: 100%; }
.lightbox__stage iframe, .lightbox__stage video { width: 100%; height: 100%; border: 0; }
.lightbox__stage .ph { border-radius: 14px; }
.lightbox__meta { text-align: center; max-width: 60ch; }
.lightbox__meta h3 { margin: 0; font: 400 clamp(24px, 3vw, 36px)/1.1 var(--serif); }
.lightbox__meta p:not(.eyebrow) { margin: 8px 0 0; color: var(--muted); font-size: 15px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
  .intro__text .w { opacity: 1; }
}

@media (max-width: 560px) {
  .card--portrait .card__body { grid-template-columns: 1fr; }
  .card--portrait .card__meta { text-align: left; order: -1; }
  .card--portrait .card__title { font-size: 20px; }
  .card--portrait .card__desc { font-size: 13px; }
  .card--portrait .card__play { width: 40px; height: 40px; right: 10px; bottom: 10px; }
  .card--portrait .ph__label strong { font-size: 20px; }
}
