:root {
  --bg: #07080c;
  --bg-elev: #0f111a;
  --ink: #e8ebf1;
  --ink-dim: rgba(232, 235, 241, 0.55);
  --ink-faint: rgba(232, 235, 241, 0.18);
  --accent: #a5c1e0;

  --serif: "Fraunces", "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out-slow: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-scroll: 750ms;
  --dur-in: 1300ms;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  position: relative;
  overscroll-behavior: none;
}

/* Cool ambient glow — moonlit, not warm */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(60% 45% at 50% 25%, rgba(165, 193, 224, 0.09), transparent 70%),
    radial-gradient(110% 90% at 50% 105%, rgba(0, 0, 0, 0.65), transparent 60%);
  z-index: 3;
}

/* Subtle grain */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  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)' opacity='0.85'/></svg>");
  z-index: 4;
}

/* -------- Brand + social (morphing between "hero" on intro and "compact"
   in the header of other screens). Both are top-level fixed elements so
   they can transition their position/scale independently of any layout
   flow. State is driven by `body.is-hero`. -------- */

:root {
  --morph-dur: 900ms;
}

.brand {
  position: fixed;
  z-index: 20;
  text-decoration: none;
  line-height: 0;
  transform-origin: top left;
  will-change: transform, top, left;
  transition:
    top var(--morph-dur) var(--ease-out-slow),
    left var(--morph-dur) var(--ease-out-slow),
    transform var(--morph-dur) var(--ease-out-slow);
}

.brand__logo {
  display: block;
  height: 52px; /* base size — the "compact" logo height */
  width: auto;
  border-radius: 6px;
  transition: opacity 350ms var(--ease-out);
}

.brand:hover .brand__logo {
  opacity: 0.85;
}

/* Fade the hero logo down when text is scrolling under it so the copy
   stays readable behind the mark. */
body.is-hero.is-intro-scrolled .brand__logo {
  opacity: 0.28;
}

/* Compact state (all screens after the intro) */
body:not(.is-hero) .brand {
  top: 1.5rem;
  left: clamp(1.5rem, 4vw, 3rem);
  transform: translateX(0) scale(1);
}

/* Hero state (intro screen): scaled up, horizontally centered.
   With transform-origin top-left and scale S, translateX(-50% * S) moves
   the visual center to the `left` value — so `left: 50%` centers it. */
body.is-hero .brand {
  top: 10vh;
  left: 50%;
  transform: translateX(-125%) scale(2.5);
}

/* Social — each item is independently fixed and interpolates between two
   coordinate sets driven by --i (its 0-based order). */
.social {
  list-style: none;
  padding: 0;
  margin: 0;
}

.social__item {
  position: fixed;
  z-index: 20;
  --i: 0;
  transform-origin: center;
  will-change: transform, top, right;
  transition:
    top var(--morph-dur) var(--ease-out-slow),
    right var(--morph-dur) var(--ease-out-slow),
    transform var(--morph-dur) var(--ease-out-slow);
}

.social__item:nth-child(1) { --i: 0; }
.social__item:nth-child(2) { --i: 1; }
.social__item:nth-child(3) { --i: 2; }
.social__item:nth-child(4) { --i: 3; }

/* Compact state: horizontal row at top-right, aligned to the same visual
   header row as the compact brand. Right offset grows for lower --i so
   the DOM order (Instagram → TikTok) reads left → right visually. */
body:not(.is-hero) .social__item {
  top: 2.5rem;
  right: calc(clamp(1.5rem, 4vw, 3rem) + (3 - var(--i)) * 2.5rem);
  transform: scale(1);
}

/* Hero state: vertical column anchored to the right side. */
body.is-hero .social__item {
  top: calc(30vh + var(--i) * 3.8rem);
  right: 2.2rem;
  transform: scale(1.55);
}

.social__item a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  color: var(--ink-dim);
  transition: color 300ms var(--ease-out);
}

.social__item a:hover,
.social__item a:focus-visible {
  color: var(--accent);
  outline: none;
}

.social__item svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* -------- Scroller -------- */

.scroller {
  position: fixed;
  inset: 0;
  will-change: transform;
  transition: transform var(--dur-scroll) var(--ease-out-slow);
  /* pan-y allows native vertical scroll on the intro screen; JS still calls
     preventDefault on non-intro sections to keep those in single-snap mode. */
  touch-action: pan-y;
}

.artist {
  position: relative;
  height: var(--vh, 100vh);
  width: 100vw;
  overflow: hidden;
}

.artist__frame {
  position: absolute;
  inset: 0;
}

/* -------- Intro screen -------- */

.artist--intro .artist__frame {
  /* Block + scroll instead of flex so `.intro`'s auto margins put it at
     the true viewport-center (flex justify-content occasionally leaves a
     sub-pixel offset when content overflows). Content is scrollable when
     it doesn't fit; the JS gates section navigation on scroll-edge. */
  display: block;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-top: 30vh;
  padding-bottom: 12vh;
  padding-inline: clamp(2rem, 5vw, 4rem);
}

.artist--intro .artist__frame::-webkit-scrollbar {
  display: none;
}

.intro {
  max-width: 58ch;
  margin-inline: auto;
  text-align: center;
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity var(--dur-in) var(--ease-out-slow),
    transform var(--dur-in) var(--ease-out-slow);
}

.artist--intro.is-active .intro {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 180ms;
}

.intro p {
  margin: 0 0 1.3rem;
  font-family: var(--sans);
  font-size: clamp(0.92rem, 1.05vw, 1.02rem);
  line-height: 1.75;
  color: var(--ink-dim);
  font-weight: 300;
}

.intro p:last-child {
  margin-bottom: 0;
}

.intro p.intro__lead {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.25rem, 2vw, 1.6rem);
  line-height: 1.45;
  letter-spacing: -0.005em;
  color: var(--ink);
  margin-bottom: 1.9rem;
}

/* Subtle hairline under the lead paragraph */
.intro p.intro__lead::after {
  content: "";
  display: block;
  width: 44px;
  height: 1px;
  margin: 1.6rem auto 0;
  background: var(--accent);
  opacity: 0.65;
  transform-origin: center;
  transform: scaleX(0);
  transition: transform 900ms var(--ease-out-slow) 450ms;
}

.artist--intro.is-active .intro p.intro__lead::after {
  transform: scaleX(1);
}

.intro p.intro__coda {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1rem, 1.3vw, 1.18rem);
  line-height: 1.55;
  color: var(--ink);
  margin-top: 0.4rem;
}

/* -------- Cutout photo -------- */

.artist__photo {
  position: absolute;
  top: 0;
  bottom: 0;
  width: min(58vw, 780px);
  margin: 0;
  opacity: 0;
  transition:
    transform var(--dur-in) var(--ease-out-slow),
    opacity var(--dur-in) var(--ease-out-slow);
  z-index: 2;
  pointer-events: none;
}

.artist[data-side="right"] .artist__photo {
  right: -2vw;
  transform: translateX(80px);
}

.artist[data-side="left"] .artist__photo {
  left: -2vw;
  transform: translateX(-80px);
}

.artist__photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  filter:
    brightness(0.94)
    contrast(1.02)
    saturate(0.82)
    drop-shadow(0 30px 60px rgba(0, 0, 0, 0.55));
  transform: scale(1.02);
  transition: transform 2400ms var(--ease-out-slow);
}

/* -------- Caption / text -------- */

.artist__caption {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 clamp(1.5rem, 5vw, 4rem);
  z-index: 1;
  pointer-events: none;
}

.artist__name,
.artist__bio {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity var(--dur-in) var(--ease-out-slow),
    transform var(--dur-in) var(--ease-out-slow);
}

.artist__name {
  font-family: var(--serif);
  font-weight: 400;
  font-variation-settings: "opsz" 144, "SOFT" 30;
  font-size: clamp(4rem, 12.5vw, 11rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
  margin: 0;
  text-shadow: 0 6px 50px rgba(0, 0, 0, 0.6);
}

.artist__name::after {
  content: "";
  display: block;
  width: 44px;
  height: 1px;
  margin: 1.5rem auto 1.4rem;
  background: var(--accent);
  opacity: 0.7;
  transform-origin: center;
  transform: scaleX(0);
  transition: transform 900ms var(--ease-out-slow) 300ms;
}

.artist__bio {
  max-width: 34ch;
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--ink-dim);
  margin: 0;
  font-weight: 300;
}

/* Active state -> reveal */

.artist.is-active .artist__photo {
  opacity: 1;
  transform: translateX(0);
}

.artist.is-active .artist__photo img {
  transform: scale(1);
}

.artist.is-active .artist__name {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 180ms;
}

.artist.is-active .artist__name::after {
  transform: scaleX(1);
}

.artist.is-active .artist__bio {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 400ms;
}

/* -------- Scroll hint -------- */

.scroll-hint {
  position: fixed;
  z-index: 10;
  left: 50%;
  bottom: 1.6rem;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink-dim);
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  transition: opacity 500ms var(--ease-out);
}

.scroll-hint.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.scroll-hint__line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: hintPulse 2.2s var(--ease-out) infinite;
  transform-origin: top center;
}

@keyframes hintPulse {
  0% {
    transform: scaleY(0);
    opacity: 0;
  }
  40% {
    transform: scaleY(1);
    opacity: 1;
  }
  100% {
    transform: scaleY(1) translateY(30px);
    opacity: 0;
  }
}

/* -------- Small screens -------- */

@media (max-width: 720px) {
  .artist__photo {
    width: 96vw;
    top: 0;
    bottom: 0;
    /* On mobile the cutout is nearly full-width, so it sits BEHIND the copy
       and becomes an atmospheric silhouette rather than covering text. */
    z-index: 1;
  }

  .artist[data-side="right"] .artist__photo {
    right: -10vw;
  }
  .artist[data-side="left"] .artist__photo {
    left: -10vw;
  }

  .artist__photo img {
    filter:
      brightness(0.7)
      contrast(1.05)
      saturate(0.7)
      drop-shadow(0 30px 60px rgba(0, 0, 0, 0.55));
  }

  .artist__caption {
    justify-content: center;
    padding: 0 1.5rem;
    z-index: 2;
  }

  /* Soft radial darkening behind the centered text so it stays legible
     when the figure passes behind it. */
  .artist__caption::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(
      ellipse 65% 45% at 50% 50%,
      rgba(7, 8, 12, 0.72) 0%,
      rgba(7, 8, 12, 0.4) 45%,
      transparent 80%
    );
    z-index: -1;
    pointer-events: none;
  }

  .artist__name {
    font-size: clamp(3.4rem, 18vw, 6rem);
    text-shadow: 0 4px 24px rgba(7, 8, 12, 0.9), 0 0 60px rgba(7, 8, 12, 0.7);
  }

  .artist__bio {
    font-size: 0.9rem;
    text-shadow: 0 2px 10px rgba(7, 8, 12, 0.85);
  }

  /* Mobile: keep both states smaller and better proportioned. */
  body:not(.is-hero) .brand {
    top: 1.1rem;
    left: 1.2rem;
  }

  body:not(.is-hero) .social__item {
    top: 2.1rem;
    right: calc(1.2rem + (3 - var(--i)) * 2.4rem);
  }

  body.is-hero .brand {
    top: 7vh;
    left: 50%;
    transform: translateX(-100%) scale(2);
  }

  body.is-hero .social__item {
    top: calc(24vh + var(--i) * 3.2rem);
    right: 1rem;
    transform: scale(1.3);
  }

  /* Push intro copy down below the hero logo. Padding is symmetric so
     that `.intro`'s margin-inline: auto centers it on the viewport
     centerline (aligned with the hero logo above). */
  .artist--intro .artist__frame {
    padding-top: 26vh;
    padding-bottom: 10vh;
    padding-inline: 1.5rem;
  }

  .intro p {
    font-size: 0.88rem;
    line-height: 1.65;
    margin-bottom: 1rem;
  }

  .intro p.intro__lead {
    font-size: 1.15rem;
    line-height: 1.4;
    margin-bottom: 1.3rem;
  }

  .intro p.intro__lead::after {
    margin-top: 1.1rem;
  }

  .intro p.intro__coda {
    font-size: 0.98rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
