@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,500;0,600;1,500&family=Inter:wght@400;500;600&display=swap');

:root {
  color-scheme: dark;
  --night: #040609;
  --paper: #f4eee4;
  --gold: #d0a45f;
  --gold-light: #efd7aa;
  --cyan: #79c8cb;
  --wine: #5e1729;
  --muted: #9a9da1;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: Inter, ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { min-width: 320px; min-height: 100%; overflow-x: clip; }
body {
  margin: 0;
  color: var(--paper);
  background: var(--night);
  font-family: var(--sans);
  overflow: hidden;
}
button, a { color: inherit; font: inherit; }

.minuit-scene {
  position: fixed;
  z-index: -4;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(4,6,9,.98) 0 24%, rgba(4,6,9,.63) 56%, rgba(4,6,9,.92)),
    linear-gradient(0deg, rgba(4,6,9,.92), transparent 45%, rgba(4,6,9,.68)),
    url("assets/alexandre-hero.png") 58% center/cover no-repeat;
  filter: saturate(.72) contrast(1.12);
  transform: scale(1.04);
  transition: filter 1.4s ease, transform 2s cubic-bezier(.16,.8,.16,1);
}
.experience-started .minuit-scene { filter: saturate(.95) contrast(1.08) brightness(.75); transform: scale(1); }
#visualizer { position: fixed; z-index: -2; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.grain {
  position: fixed;
  z-index: 20;
  inset: -70%;
  pointer-events: none;
  opacity: .04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.9'/%3E%3C/svg%3E");
  animation: grain .24s steps(2) infinite;
}
@keyframes grain { 0% { transform: translate(1%, -1%); } 50% { transform: translate(-1%, 1%); } 100% { transform: translate(.5%, -.5%); } }

.minuit-header {
  position: fixed;
  z-index: 30;
  inset: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: min(1500px, calc(100% - 3rem));
  margin-inline: auto;
  padding: 1.35rem 0;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.brand { font-family: var(--serif); font-size: 1.08rem; font-weight: 600; letter-spacing: .18em; text-decoration: none; }
.minuit-header p { display: flex; align-items: center; gap: .65rem; margin: 0; color: #9b9b9b; font-size: .65rem; letter-spacing: .14em; text-transform: uppercase; }
.minuit-header p i { width: .42rem; aspect-ratio: 1; border-radius: 50%; background: var(--wine); box-shadow: 0 0 .8rem #8b2941; animation: record 1.5s ease-in-out infinite; }
@keyframes record { 50% { opacity: .35; } }
.back-link { justify-self: end; color: #c6c3be; font-size: .68rem; letter-spacing: .12em; text-decoration: none; text-transform: uppercase; }
.back-link::before { content: "←"; margin-right: .6rem; color: var(--gold); }

.entry-gate {
  position: fixed;
  z-index: 10;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 7rem 1.2rem 3rem;
  text-align: center;
  background: radial-gradient(circle at 50% 48%, rgba(208,164,95,.13), transparent 25%), rgba(3,5,8,.42);
  transition: opacity .9s ease, visibility .9s step-end, transform .9s cubic-bezier(.3,.7,.2,1);
}
.experience-started .entry-gate { visibility: hidden; opacity: 0; transform: scale(1.06); }
.gate-kicker { margin: 0 0 1.5rem; color: var(--cyan); font-size: .66rem; font-weight: 600; letter-spacing: .2em; }
.gate-seal { position: relative; display: grid; width: clamp(8rem, 16vw, 11rem); aspect-ratio: 1; place-items: center; border: 1px solid rgba(208,164,95,.45); border-radius: 50%; box-shadow: 0 0 0 1rem rgba(208,164,95,.025), 0 0 0 2.5rem rgba(208,164,95,.015), inset 0 0 55px rgba(208,164,95,.09); }
.gate-seal span { color: var(--gold-light); font-family: var(--serif); font-size: clamp(4.5rem, 10vw, 7rem); line-height: 1; }
.gate-seal i { position: absolute; bottom: -2.6rem; width: 1px; height: 2.6rem; background: linear-gradient(var(--gold), transparent); }
.gate-time { margin: 3rem 0 0; color: var(--gold); font-family: var(--serif); font-size: 1.35rem; letter-spacing: .08em; }
.entry-gate h1 { max-width: 860px; margin: .35rem 0 .8rem; font-family: var(--serif); font-size: clamp(3.3rem, 7.4vw, 7rem); font-weight: 500; line-height: .9; letter-spacing: -.035em; text-wrap: balance; }
.gate-copy { max-width: 520px; margin: 0; color: #b8b7b5; font-family: var(--serif); font-size: clamp(1.12rem, 1.6vw, 1.42rem); line-height: 1.45; }
.enter-button { display: inline-flex; min-height: 3.5rem; align-items: center; gap: 1.3rem; margin-top: 1.65rem; border: 1px solid var(--gold); border-radius: 999px; padding: .35rem .45rem .35rem 1.35rem; color: #090806; background: linear-gradient(135deg, var(--gold-light), #af7c38); font-size: .72rem; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; cursor: pointer; box-shadow: 0 10px 45px rgba(208,164,95,.14); transition: transform .25s ease, box-shadow .25s ease; }
.enter-button:hover { transform: translateY(-2px); box-shadow: 0 16px 55px rgba(208,164,95,.23); }
.enter-button i { display: grid; width: 2.7rem; aspect-ratio: 1; place-items: center; border-radius: 50%; color: var(--paper); background: #101116; font-size: .8rem; font-style: normal; }
.entry-gate small { margin-top: .8rem; color: #6f7174; font-size: .6rem; letter-spacing: .08em; }

.player-stage {
  position: relative;
  z-index: 2;
  display: grid;
  min-height: 100svh;
  grid-template-columns: 1fr .8fr;
  grid-template-rows: 1fr auto;
  align-items: center;
  gap: 2rem 7vw;
  padding: 7rem max(5vw, calc((100vw - 1440px) / 2)) 2.5rem;
  visibility: hidden;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 1s .3s ease, visibility 1s .3s step-start, transform 1s .3s ease;
}
.experience-started .player-stage { visibility: visible; opacity: 1; transform: none; }
.track-copy { align-self: end; }
.track-label { display: flex; max-width: 650px; align-items: center; justify-content: space-between; color: #85888c; font-size: .64rem; letter-spacing: .16em; }
.track-live { display: flex; align-items: center; gap: .5rem; }
.track-live i { width: .42rem; aspect-ratio: 1; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 .9rem rgba(121,200,203,.8); }
.track-live b { color: #b9cfd0; font-weight: 500; }
.track-clock { margin: 2rem 0 -.5rem; color: var(--cyan); font-family: var(--serif); font-size: clamp(3rem, 7vw, 7.5rem); line-height: .8; }
.track-copy h2 { margin: 0; font-family: var(--serif); font-size: clamp(5.5rem, 12vw, 12rem); font-weight: 500; line-height: .75; letter-spacing: -.045em; }
.track-note { margin: 2rem 0 0; color: #bbb9b5; font-family: var(--serif); font-size: clamp(1.1rem, 1.55vw, 1.5rem); line-height: 1.45; }
.voice-orbit { position: relative; display: grid; width: min(32vw, 460px); aspect-ratio: 1; place-items: center; justify-self: center; }
.voice-orbit strong { color: var(--gold-light); font-family: var(--serif); font-size: clamp(7rem, 14vw, 13rem); font-weight: 500; text-shadow: 0 0 70px rgba(208,164,95,.22); }
.orbit { position: absolute; border: 1px solid rgba(121,200,203,.22); border-radius: 50%; animation: orbitPulse 4s ease-in-out infinite; }
.orbit-one { inset: 12%; }
.orbit-two { inset: 1%; animation-delay: -.8s; }
.orbit-three { inset: -12%; animation-delay: -1.6s; }
@keyframes orbitPulse { 50% { opacity: .3; transform: scale(.94); } }
.fragment-window { grid-column: 2; align-self: end; max-width: 520px; min-height: 8.8rem; border-left: 1px solid rgba(208,164,95,.5); padding: 1.25rem 0 1.25rem 1.5rem; }
.fragment-window span { color: #777a7e; font-size: .6rem; letter-spacing: .16em; }
.fragment-window p { margin: .8rem 0 0; font-family: var(--serif); font-size: clamp(1.75rem, 3vw, 3.2rem); line-height: 1; transition: opacity .25s ease, transform .25s ease; }
.fragment-window p.is-changing { opacity: 0; transform: translateY(8px); }
.player-controls { grid-column: 1; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1.2rem; align-self: end; max-width: 650px; }
.play-button, .sound-button { display: grid; place-items: center; border: 1px solid rgba(244,238,228,.25); border-radius: 50%; color: var(--paper); background: rgba(4,6,9,.62); cursor: pointer; backdrop-filter: blur(8px); }
.play-button { width: 3.6rem; aspect-ratio: 1; font-size: .95rem; }
.sound-button { width: 2.8rem; aspect-ratio: 1; color: #aaa; font-size: .55rem; letter-spacing: .05em; }
.timeline input { width: 100%; height: 2px; margin: 0; accent-color: var(--gold); cursor: pointer; }
.time-row { display: flex; justify-content: space-between; margin-top: .55rem; color: #73767a; font-size: .62rem; font-variant-numeric: tabular-nums; }
.gesture-note { grid-column: 2; align-self: end; margin: 0; color: #65686c; font-size: .61rem; letter-spacing: .12em; text-align: right; text-transform: uppercase; }

@media (max-width: 820px) {
  body { overflow-y: auto; overflow-x: clip; }
  .minuit-header { width: calc(100% - 2rem); }
  .minuit-header p { display: none; }
  .minuit-header { grid-template-columns: 1fr 1fr; }
  .player-stage { grid-template-columns: 1fr; grid-template-rows: auto; align-content: center; padding: 7rem 1.2rem 2rem; }
  .track-copy { align-self: auto; }
  .voice-orbit { position: absolute; z-index: -1; top: 28%; right: -8rem; width: 23rem; opacity: .3; }
  .fragment-window, .player-controls, .gesture-note { grid-column: 1; }
  .fragment-window { min-height: 7.5rem; }
  .gesture-note { text-align: left; }
}

@media (max-width: 520px) {
  .entry-gate { padding-top: 6rem; }
  .gate-seal { width: 7rem; }
  .entry-gate h1 { font-size: 3.55rem; }
  .track-copy h2 { font-size: clamp(5rem, 24vw, 7rem); }
  .track-clock { font-size: 3.7rem; }
  .player-controls { gap: .75rem; }
  .back-link { font-size: 0; }
  .back-link::before { font-size: 1.1rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
