:root {
  --performance-white: #f3f1ed;
  --performance-red: #df2f25;
  --performance-yellow: #f7df00;
  --performance-black: #000;
}

html:has(.performance-page) {
  scroll-behavior: smooth;
  scroll-padding-top: calc(92px + env(safe-area-inset-top));
  background: #000;
}

.performance-page {
  --performance-header-height: 92px;
  min-height: 100%;
  margin: 0;
  overflow-x: clip;
  background: var(--performance-black);
  color: var(--performance-white);
}

.performance-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 9999;
  min-height: calc(var(--performance-header-height) + env(safe-area-inset-top));
  display: grid;
  grid-template-columns: minmax(112px, 190px) minmax(180px, 1fr) auto auto;
  align-items: center;
  gap: clamp(10px, 1.7vw, 28px);
  padding: calc(10px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
  background: #000;
  border-bottom: 1px solid rgba(243, 241, 237, .22);
}

.performance-logo,
.performance-logo img,
.performance-heading-link,
.performance-heading-link img,
.performance-home img { display: block; }
.performance-logo img { width: 100%; height: auto; }
.performance-heading-link { width: min(100%, 430px); }
.performance-heading-link img { width: 100%; height: auto; }
.performance-home { width: 54px; aspect-ratio: 1; }
.performance-home img { width: 100%; height: 100%; object-fit: contain; border-radius: 50%; }

.performance-menu-toggle {
  width: 54px;
  height: 54px;
  display: grid;
  place-content: center;
  gap: 6px;
  padding: 0;
  color: var(--performance-white);
  background: transparent;
  border: 1px solid rgba(243, 241, 237, .55);
  border-radius: 50%;
  cursor: pointer;
}
.performance-menu-toggle span { display: block; width: 24px; height: 2px; background: currentColor; transition: transform .24s ease, opacity .2s ease; }
.performance-menu-open .performance-menu-toggle { color: var(--performance-red); border-color: var(--performance-red); }
.performance-menu-open .performance-menu-toggle span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.performance-menu-open .performance-menu-toggle span:nth-child(2) { opacity: 0; }
.performance-menu-open .performance-menu-toggle span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.performance-progress { position: absolute; inset: auto 0 -2px; height: 2px; overflow: hidden; }
.performance-progress span { display: block; width: 100%; height: 100%; transform: scaleX(0); transform-origin: left; background: linear-gradient(90deg, var(--performance-white) 0 33.33%, var(--performance-red) 33.33% 66.66%, var(--performance-yellow) 66.66%); }

.performance-menu-scrim { position: fixed; inset: 0; z-index: 9997; background: rgba(0, 0, 0, .72); backdrop-filter: blur(3px); }
.performance-drawer {
  position: fixed;
  z-index: 9998;
  top: calc(var(--performance-header-height) + env(safe-area-inset-top));
  right: 0;
  bottom: 0;
  width: min(720px, 92vw);
  padding: clamp(28px, 5vw, 64px);
  display: flex;
  flex-direction: column;
  background: #030303;
  border-left: 1px solid rgba(243, 241, 237, .12);
  transform: translateX(102%);
  transition: transform .32s cubic-bezier(.2, .8, .2, 1);
  overflow-y: auto;
}
.performance-menu-open { overflow: hidden; }
.performance-menu-open .performance-drawer { transform: translateX(0); }
.performance-drawer-label { margin-bottom: clamp(18px, 4vh, 44px); color: #777; font: 700 clamp(12px, 1.1vw, 16px)/1.2 Arial, sans-serif; letter-spacing: .25em; text-transform: uppercase; }
.performance-nav-link { display: grid; grid-template-columns: 44px 1fr; align-items: baseline; gap: 12px; padding: clamp(16px, 2.4vh, 28px) 0; border-bottom: 1px solid #252525; color: var(--performance-white); font: 900 clamp(22px, 3.1vw, 44px)/.95 Arial Black, Arial, sans-serif; text-transform: uppercase; text-decoration: none; transition: transform .2s ease; }
.performance-nav-link span { color: #747474; font-size: 11px; letter-spacing: .18em; }
.performance-nav-link.color-1 { color: var(--performance-red); }
.performance-nav-link.color-2 { color: var(--performance-yellow); }
.performance-nav-top { margin-top: auto; padding-top: 40px; display: flex; justify-content: space-between; color: #999; font: 700 13px/1 Arial, sans-serif; letter-spacing: .22em; text-transform: uppercase; text-decoration: none; }

.performance-portfolio { padding-top: calc(var(--performance-header-height) + env(safe-area-inset-top)); background: #000; }
.performance-piece { min-height: 100svh; padding: clamp(26px, 5vw, 72px) clamp(16px, 5vw, 80px) clamp(72px, 10vw, 140px); border-bottom: 1px solid #222; scroll-margin-top: calc(var(--performance-header-height) + env(safe-area-inset-top)); }
.performance-piece > * { width: min(1120px, 100%); margin-left: auto; margin-right: auto; }
.performance-visual { margin-top: 0; margin-bottom: 0; overflow: hidden; background: #060606; }
.performance-visual img { display: block; width: 100%; height: auto; }
.performance-visual-portrait { width: min(720px, 100%); }
.performance-visual-landscape { width: min(1120px, 100%); }

.performance-caption { margin-top: 0; padding: clamp(22px, 3vw, 38px) clamp(18px, 3vw, 36px) clamp(26px, 3vw, 42px); display: grid; grid-template-columns: auto 1fr; align-items: end; gap: clamp(20px, 4vw, 64px); background: #050505; border-top: 1px solid #1d1d1d; }
.performance-caption span { color: var(--performance-yellow); font: 700 clamp(10px, .9vw, 13px)/1 Arial, sans-serif; letter-spacing: .25em; text-transform: uppercase; white-space: nowrap; }
.performance-caption h1,
.performance-caption h2 { margin: 0; color: var(--performance-white); font: 900 clamp(38px, 6.6vw, 94px)/.86 Arial Black, Arial, sans-serif; letter-spacing: -.055em; text-align: right; text-transform: uppercase; }
#nd-neurodivergente .performance-caption h1 { color: var(--performance-red); }
#dj-abulafia .performance-caption h2 { color: var(--performance-yellow); }

.performance-video { position: relative; width: min(620px, 100%); aspect-ratio: 9 / 16; margin-top: clamp(42px, 7vw, 90px); overflow: hidden; background: #080808; border: 1px solid #262626; box-shadow: 0 24px 80px rgba(0,0,0,.58); }
.performance-video::before { content: ""; position: absolute; inset: 0; background: linear-gradient(145deg, rgba(223,47,37,.10), transparent 40%, rgba(247,223,0,.05)); }
.performance-video iframe { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; border: 0; }

.performance-story { max-width: 880px; padding: clamp(28px, 5vw, 64px) clamp(20px, 3vw, 36px) 0; font: 400 clamp(18px, 1.65vw, 24px)/1.65 Arial, sans-serif; color: #c7c5c0; }
.performance-story p { margin: 0 0 1.5em; }
.performance-story p:last-child { margin-bottom: 0; color: var(--performance-white); }
.performance-film { margin-top: clamp(56px, 8vw, 100px); }
.performance-film-title { margin: 0 0 24px; padding-inline: clamp(20px, 3vw, 36px); font: 900 clamp(30px, 5vw, 64px)/1.04 Arial Black, Arial, sans-serif; letter-spacing: -.045em; text-transform: uppercase; overflow-wrap: anywhere; }
.performance-film .performance-video { margin: 0 auto; }
.performance-video-wide { width: 100%; aspect-ratio: 16 / 9; }
#nd-neurodivergente .performance-film-title { color: var(--performance-red); }
#dj-abulafia .performance-film-title { color: var(--performance-yellow); }

.performance-spotify {
  width: fit-content;
  margin-top: clamp(22px, 3vw, 34px);
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 13px 20px;
  color: var(--performance-white);
  background: #111;
  border: 1px solid #343434;
  border-radius: 999px;
  font: 800 15px/1.2 Arial, sans-serif;
  letter-spacing: .04em;
  text-decoration: none;
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
}
.performance-spotify img { width: 32px; height: 32px; flex: 0 0 32px; }

@media (hover:hover) {
  .performance-nav-link:hover { transform: translateX(8px); }
  .performance-spotify:hover { transform: translateY(-2px); border-color: #1ed760; background: #151515; }
}

@media (max-width: 760px) {
  html:has(.performance-page) { scroll-padding-top: calc(72px + env(safe-area-inset-top)); }
  .performance-page { --performance-header-height: 72px; }
  .performance-header { grid-template-columns: minmax(70px, 88px) minmax(118px, 1fr) 42px 42px; gap: 6px; padding-left: max(10px, env(safe-area-inset-left)); padding-right: max(10px, env(safe-area-inset-right)); }
  .performance-heading-link { width: 100%; max-width: 174px; }
  .performance-home { width: 42px; }
  .performance-menu-toggle { width: 42px; height: 42px; gap: 5px; }
  .performance-menu-toggle span { width: 18px; }
  .performance-menu-open .performance-menu-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .performance-menu-open .performance-menu-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .performance-drawer { width: 100%; border-left: 0; padding: 28px 24px max(28px, env(safe-area-inset-bottom)); }
  .performance-nav-link { grid-template-columns: 34px 1fr; font-size: clamp(21px, 6.6vw, 32px); }
  .performance-piece { padding-left: 0; padding-right: 0; }
  .performance-caption { grid-template-columns: 1fr; gap: 12px; }
  .performance-caption h1,
  .performance-caption h2 { text-align: left; font-size: clamp(34px, 10.5vw, 58px); }
  #nd-neurodivergente .performance-caption h1 { font-size: clamp(26px, 8.7vw, 58px); overflow-wrap: anywhere; }
  .performance-spotify { margin-left: 18px; }
  .performance-video { border-left: 0; border-right: 0; }
}

@media (max-width: 390px) {
  .performance-header { grid-template-columns: 68px minmax(102px, 1fr) 38px 38px; gap: 4px; }
  .performance-home, .performance-menu-toggle { width: 38px; height: 38px; }
  .performance-heading-link { max-width: 148px; }
}

@media (prefers-reduced-motion: reduce) {
  html:has(.performance-page) { scroll-behavior: auto; }
  .performance-drawer, .performance-nav-link, .performance-menu-toggle span { transition: none; }
}
