:root {
  --bg: #0a0a0a;
  --fg: #f5f5f5;
  --accent: #ffffff;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  /* labels can bleed past the edges (wide ring) without a horizontal scrollbar */
  overflow-x: clip;
  /* hide the scrollbar (scrolling still works) */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* old Edge/IE */
}
html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none; /* Chrome / Safari */
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-weight: 300; /* Inter Light — thin, sitewide */
  /* sitewide lowercase */
  text-transform: lowercase;
  /* Prevent scroll chaining / rubber-banding so the loop-jump feels seamless. */
  overscroll-behavior: none;
  /* all swipes are handled in JS as one-step navigation */
  touch-action: none;
}

/* Body height (the scroll range) is set in JS based on turn length + cycles.
   Keep a sane fallback before JS runs. */
body {
  min-height: 500vh;
}

/* Full-viewport fixed canvas. Drawn with cover-fit math in JS, so no CLS. */
#stage {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: block;
  background: var(--bg);
  z-index: 0;
}

/* Cinematic vignette: above the canvas (z 0), below the front labels. */
.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(
    130% 100% at 50% 42%,
    transparent 52%,
    rgba(0, 0, 0, 0.18) 78%,
    rgba(0, 0, 0, 0.4) 100%
  );
}

/* ---- Nav buttons -------------------------------------------------------- */
/* The <nav> is a static wrapper (no stacking context) so each fixed label can
   be raised above or dropped below the canvas (z-index 0) individually. */
.nav {
  /* graceful fade-in once the frames are ready (no transform — would trap the
     fixed labels' stacking) */
  opacity: 0;
  transition: opacity 0.9s ease 0.05s;
}
body:not(.loading) .nav {
  opacity: 1;
}

.spin-btn {
  position: fixed;
  left: 50%;
  top: 50%;
  display: inline-block;
  white-space: nowrap;
  font-size: 1rem; /* JS overrides per-depth; this is the pre-JS fallback */
  font-weight: 300; /* Inter Light — thin */
  letter-spacing: 0.06em;
  color: var(--accent);
  text-decoration: none;
  /* plain text, legible over the photo */
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.7);
  /* constant padding + transparent border so the hover pill adds no shift.
     Asymmetric vertical padding (less top, more bottom) optically centers the
     glass pill on the lowercase glyphs. */
  padding: 0.4em 0.95em 0.5em;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease,
    backdrop-filter 0.3s ease, -webkit-backdrop-filter 0.3s ease;
  /* transform, opacity, z-index are driven by JS each scroll tick */
  will-change: transform, opacity;
}

/* liquid-glass pill behind the label on hover */
.spin-btn:hover,
.spin-btn:focus-visible {
  outline: none;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px) saturate(180%);
  -webkit-backdrop-filter: blur(10px) saturate(180%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4),
    inset 0 -1px 6px rgba(255, 255, 255, 0.08), 0 6px 22px rgba(0, 0, 0, 0.3);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
}

/* ---- Loader ------------------------------------------------------------- */
.loader {
  position: fixed;
  inset: 0;
  z-index: 50; /* above the nav labels */
  display: grid;
  place-content: center;
  background: var(--bg);
  transition: opacity 0.5s ease;
}
.loader.done {
  opacity: 0;
  pointer-events: none;
}
.loader__text {
  font-size: 0.95rem;
  letter-spacing: 0.25em;
  color: rgba(245, 245, 245, 0.7);
}
/* keep the cycling dots from nudging the text */
.loader__dots {
  display: inline-block;
  width: 1.5em;
  text-align: left;
}

/* Keep the orbiting labels hidden until the frames are ready. */
body.loading .spin-btn {
  opacity: 0 !important;
  pointer-events: none !important;
}
