/* ============================================================
   page.css — page rhythm: sticky nav, hero, work header,
   contact footer container. Component internals (sphere, cursor,
   lightbox, .work-* footer content, artist carousel) live in
   styles.css / carousel.css — not here.
   ============================================================ */

/* ---------- base rhythm ---------- */

.section {
  padding: clamp(6rem, 12vh, 9rem) 0;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 5vw, 3rem);
}

/* ---------- sticky nav ---------- */

.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  background: transparent;
  pointer-events: none;
}

.site-nav-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 5vw, 3rem);
  height: clamp(4.5rem, 6vw, 5.5rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: auto;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  box-shadow: none;
  transition: max-width var(--dur) var(--ease), height var(--dur) var(--ease),
    margin var(--dur) var(--ease), padding var(--dur) var(--ease),
    background var(--dur) var(--ease), border-color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
}

/* Bar has no background of its own at rest — it reads the page behind it.
   Past a small scroll depth it contracts into a floating pill widget. */
.site-nav.is-scrolled .site-nav-inner {
  max-width: 640px;
  height: 3.6rem;
  margin: 0.85rem auto 0;
  padding: 0 1.4rem;
  background: linear-gradient(180deg, rgba(19, 19, 21, 0.55), rgba(8, 8, 9, 0.45));
  border-color: var(--hairline-strong);
  backdrop-filter: blur(28px) saturate(140%);
  -webkit-backdrop-filter: blur(28px) saturate(140%);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

@media (prefers-reduced-motion: reduce) {
  .site-nav-inner {
    transition: none;
  }
}

.site-nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.site-nav-links a {
  position: relative;
  font-weight: 600;
  font-stretch: 112.5%;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--chrome-dim);
  padding: 0.4rem 0.1rem;
  transition: color 0.2s ease;
}

.site-nav-links a::after {
  content: "";
  position: absolute;
  left: 0.1rem;
  right: 0.1rem;
  bottom: 0;
  height: 1px;
  background: var(--xst-red-hot);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}

.site-nav-links a:hover {
  color: var(--chrome);
}

.site-nav-links a.is-active {
  color: var(--xst-red-hot);
}

.site-nav-links a.is-active::after {
  transform: scaleX(1);
}

@media (max-width: 600px) {
  .site-nav-inner {
    padding: 0 1.25rem;
    height: 4rem;
  }

  .site-nav.is-scrolled .site-nav-inner {
    max-width: calc(100% - 1.5rem);
    height: 3.3rem;
    margin: 0.6rem auto 0;
    padding: 0 1rem;
  }

  .site-nav-links {
    gap: 1.1rem;
  }

  .site-nav-links a {
    font-size: 0.68rem;
  }
}

/* ---------- hero / about ---------- */

.hero.section {
  position: relative;
  padding-top: clamp(6rem, 12vh, 9rem);
  padding-bottom: clamp(3rem, 6vh, 4.5rem);
  overflow: hidden;
}

.hero.section::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(60% 55% at 15% 20%, rgba(224, 27, 27, 0.14), transparent 70%);
}

.hero-inner {
  position: relative;
  z-index: 1;
  text-align: left;
}

.hero-heading {
  font-weight: 900;
  font-stretch: 125%;
  font-size: clamp(2.75rem, 7vw, 5.5rem);
  letter-spacing: -0.03em;
  line-height: 1.02;
  max-width: 16ch;
  color: var(--chrome);
}

.hero-copy {
  max-width: 62ch;
  font-size: clamp(1rem, 1.3vw, 1.15rem);
  line-height: 1.65;
  color: var(--chrome-dim);
  margin-top: 1.25rem;
}

/* ---------- impact panel (the receipts) + XST/Instagram signature ---------- */

.impact-inner {
  position: relative;
  z-index: 1;
  margin-top: clamp(3rem, 7vh, 4.5rem);
}

.impact-panel {
  display: flex;
  align-items: stretch;
  gap: clamp(2rem, 5vw, 3.5rem);
  padding: clamp(1.75rem, 3vw, 2.5rem) clamp(1.75rem, 4vw, 3rem);
  background: linear-gradient(155deg, var(--panel-raised), var(--panel) 70%);
  border: 1px solid var(--hairline);
  border-radius: 20px;
  box-shadow: 0 1px 0 rgba(220, 221, 225, 0.06) inset, 0 24px 48px -28px rgba(0, 0, 0, 0.85);
}

.impact-lead {
  flex: 0 0 auto;
  width: clamp(220px, 26vw, 300px);
}

.impact-total {
  font-weight: 900;
  font-stretch: 125%;
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--chrome);
  margin-top: 0.6rem;
}

.impact-total span {
  color: var(--xst-red);
}

.impact-caption {
  margin-top: 0.6rem;
  max-width: 26ch;
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--chrome-dim);
}

.impact-stats {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.25rem, 2.5vw, 2rem);
  border-left: 1px solid var(--hairline);
  padding-left: clamp(2rem, 5vw, 3.5rem);
}

.impact-stat {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  justify-content: center;
}

.impact-stat-value {
  font-weight: 900;
  font-stretch: 125%;
  font-size: clamp(1.4rem, 2.2vw, 1.85rem);
  letter-spacing: -0.02em;
  color: var(--chrome);
}

.impact-stat-label {
  font-weight: 600;
  font-stretch: 112.5%;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--chrome-dim);
}

/* This is the one ask of the whole hero module now that the hero has no
   CTA of its own — sized and centered to carry that weight on its own. */
.impact-signature {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  margin-top: clamp(3.5rem, 8vh, 5.5rem);
  text-align: center;
}

.impact-logo {
  width: clamp(120px, 15vw, 190px);
  height: auto;
}

.impact-ig {
  font-size: clamp(0.95rem, 1.1vw, 1.05rem);
  padding: 1.05rem 2.5rem;
}

@media (max-width: 900px) {
  .impact-panel {
    flex-direction: column;
    gap: 1.75rem;
  }

  .impact-lead {
    width: 100%;
  }

  .impact-stats {
    border-left: none;
    border-top: 1px solid var(--hairline);
    padding-left: 0;
    padding-top: 1.75rem;
  }
}

@media (max-width: 560px) {
  .impact-stats {
    grid-template-columns: 1fr;
    gap: 1.1rem;
  }
}

/* ---------- work section header ---------- */

.work.section {
  padding-top: 0;
  padding-bottom: clamp(3rem, 6vh, 4.5rem);
}

.work-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 1.5rem;
  margin-bottom: clamp(2rem, 5vh, 3rem);
  border-bottom: 1px solid var(--hairline);
}

.section-eyebrow {
  font-weight: 600;
  font-stretch: 112.5%;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--xst-red);
}

/* ---------- contact / footer container ---------- */

.contact.section {
  position: relative;
  overflow: hidden;
  min-height: min(100vh, 760px);
  display: flex;
  justify-content: center;
  align-items: center;
  border-top: 1px solid var(--hairline);
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .site-nav-links a::after,
  .button-primary {
    transition: none;
  }

  /* Intro: show instantly, no fade, no travel. */
  .is-loading .page,
  .is-loading [data-intro] {
    opacity: 1;
    transform: none;
  }

  .is-ready .page,
  .is-ready [data-intro] {
    transition: none;
  }
}

/* ============================================================
   page-load intro — one orchestrated fade of .page, every load.
   Armed by the inline <head> script (html.is-loading), released
   by the inline script before scene.js (html.is-ready). Runs
   underneath the first-load .loader (below) when that's present,
   so the two never visibly race.
   No-JS never gets .is-loading, so the page renders normally.
   ============================================================ */

:root {
  --intro-dur: 0.5s;
  --intro-step: 50ms;
}

.is-loading .page {
  opacity: 0;
}

.is-ready .page {
  opacity: 1;
  transition: opacity var(--intro-dur) var(--ease);
}

.is-loading [data-intro] {
  opacity: 0;
  transform: translateY(10px);
}

.is-ready [data-intro] {
  opacity: 1;
  transform: none;
  transition: opacity var(--intro-dur) var(--ease),
    transform var(--intro-dur) var(--ease);
  transition-delay: calc(var(--intro-step) * var(--intro-i, 0));
}

.is-ready [data-intro="1"] { --intro-i: 1; }
.is-ready [data-intro="2"] { --intro-i: 2; }
.is-ready [data-intro="3"] { --intro-i: 3; }
.is-ready [data-intro="4"] { --intro-i: 4; }
.is-ready [data-intro="5"] { --intro-i: 5; }

/* ============================================================
   first-load screen — the XST mark resolving out of a coarse
   pixel mosaic. Only exists in the DOM's first paint when
   html.is-first-load was set by the inline head script (i.e. the
   first tab load this session); a refresh never sees it.
   ============================================================ */

.loader {
  display: none;
}

.is-first-load .loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--void);
  opacity: 1;
  transition: opacity 0.4s var(--ease);
}

.loader::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    rgba(224, 27, 27, 0.16),
    transparent 60%
  );
}

.loader-mark {
  position: relative;
  width: min(46vw, 300px);
  height: auto;
  aspect-ratio: 480 / 275;
  image-rendering: pixelated;
  transition: transform 0.5s var(--ease);
}

/* Exit: the mark pulls back into the distance (zoom out) while the black
   screen behind it fades away at the same time, revealing .page — which
   is already fading its own [data-intro] segments up underneath. */
.loader.is-done {
  opacity: 0;
}

.loader.is-done .loader-mark {
  transform: scale(0.82);
}

@media (prefers-reduced-motion: reduce) {
  .is-first-load .loader {
    transition: none;
  }

  .loader-mark {
    transition: none;
  }
}
