/* ─────────────────────────────────────────────────────────────
   swainmahisa.com — work in progress
   palette: brief — charcoal, black, white, off-white. no accents.
   type:    helvetica neue stack. weight 300 body, 700 bold names.
   motion:  gsap-driven. one ink-themed signature across all phases.
───────────────────────────────────────────────────────────── */

:root {
  /* palette strictly per brief: charcoal grey, black, white, off-white */
  --bg: #0a0a0a;          /* black */
  --fg: #f2efe9;          /* off-white */
  --hairline: #2a2a2a;    /* deep charcoal grey */
  --muted: #7a7a7a;       /* mid charcoal grey */
  --bright: #ffffff;      /* white — used in selection */
  --page-tx: 900ms cubic-bezier(0.65, 0, 0.35, 1);
  --font-sans: "Helvetica Neue", Helvetica, "Inter", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { background: var(--bg); }

html.lenis,
html.lenis body {
  height: auto;
}
.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}
.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}
.lenis.lenis-stopped {
  overflow: hidden;
}

body {
  background:
    radial-gradient(
      ellipse 110% 85% at 50% 45%,
      transparent 0%,
      transparent 55%,
      #050505 100%
    ),
    var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1, "liga" 1;
  overflow-x: hidden;
}

/* Hide content during initial paint until intro fires (prevents FOUC) */
body.is-loading .status,
body.is-loading .corner,
body.is-loading .logo-wrap,
body.is-loading .chunk,
body.is-loading .footer {
  opacity: 0;
}

img { display: block; max-width: 100%; height: auto; }

/* ─── status badge ───────────────────────────────────────── */

.status {
  position: fixed;
  top: clamp(1rem, 2vw, 1.75rem);
  left: clamp(1rem, 2vw, 1.75rem);
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg);
  mix-blend-mode: difference;
  filter: invert(1);
}

.status-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
  animation: pulse 2.4s ease-in-out infinite;
}

.status-sep { opacity: 0.4; font-weight: 300; }
.status-meta { opacity: 0.7; font-variant-numeric: tabular-nums; }

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.3; transform: scale(0.85); }
}

/* ─── corner mark (persistent header logo, post-pin) ─────── */

.corner {
  position: fixed;
  top: clamp(0.9rem, 1.8vw, 1.5rem);
  right: clamp(1rem, 2vw, 1.75rem);
  z-index: 25;
  width: clamp(110px, 13vw, 200px);
  aspect-ratio: 16 / 9;
  pointer-events: none;
  opacity: 0;
}

.corner picture {
  position: absolute;
  inset: 0;
}

.corner-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ─── side tracklist rail ───────────────────────────────── */

.rail {
  position: fixed;
  top: 50%;
  right: clamp(1rem, 1.8vw, 2rem);
  transform: translateY(-50%);
  z-index: 24;
  pointer-events: none;
  opacity: 0;
  color: var(--fg);
  width: max-content;
}

.rail-marks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-rows: repeat(6, auto);
  gap: 2.25rem;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.rail-mark {
  display: grid;
  grid-template-columns: auto auto auto 10px;
  align-items: center;
  gap: 1rem;
  color: color-mix(in srgb, currentColor 30%, transparent);
  transition: color 0.4s ease;
}

.rail-num {
  letter-spacing: 0.14em;
  color: color-mix(in srgb, currentColor 48%, transparent);
  transition: color 0.4s ease;
}

.rail-title {
  letter-spacing: 0.1em;
  text-transform: uppercase;
  min-width: 6.5rem;
  text-align: right;
}

.rail-time {
  color: color-mix(in srgb, currentColor 28%, transparent);
  transition: color 0.4s ease;
}

.rail-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: color-mix(in srgb, currentColor 22%, transparent);
  justify-self: center;
  transition: background 0.35s ease, transform 0.35s ease;
}

.rail-mark.is-passed { color: color-mix(in srgb, currentColor 48%, transparent); }
.rail-mark.is-passed .rail-num { color: color-mix(in srgb, currentColor 55%, transparent); }
.rail-mark.is-passed .rail-time { color: color-mix(in srgb, currentColor 38%, transparent); }
.rail-mark.is-passed .rail-dot {
  background: color-mix(in srgb, currentColor 60%, transparent);
}

.rail-mark.is-active { color: currentColor; }
.rail-mark.is-active .rail-num { color: currentColor; }
.rail-mark.is-active .rail-time { color: color-mix(in srgb, currentColor 75%, transparent); }
.rail-mark.is-active .rail-dot {
  background: currentColor;
  transform: scale(1.35);
}

/* ─── hero pin ──────────────────────────────────────────── */

.pin-host {
  /* this is the scroll-distance the pin will travel over */
  height: 130svh;
  position: relative;
}

.pin-stage {
  height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(3rem, 8vh, 6rem) 1.5rem;
  position: relative;
}

.logo-wrap {
  position: relative;
  width: clamp(280px, 68vw, 980px);
  aspect-ratio: 1 / 1;
  transform-origin: center center;
  will-change: transform, opacity, filter;
}

.logo-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.logo-black { display: none; }

/* ── ink droplets ── */

.drips {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  width: 100%;
  height: 50%;
  pointer-events: none;
  overflow: visible;
}

.drip {
  fill: var(--fg);
  opacity: 0;
  transform-origin: center;
}

/* ─── scroll hint (hero only) ────────────────────────────── */

.scroll-hint {
  position: absolute;
  bottom: clamp(2rem, 6vh, 4rem);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.05rem;
  color: var(--fg);
  opacity: 0;
  pointer-events: none;
  z-index: 5;
}

.scroll-hint-track {
  position: relative;
  width: 1.5px;
  height: 78px;
  background: color-mix(in srgb, currentColor 24%, transparent);
  overflow: visible;
}

.scroll-hint-drop {
  position: absolute;
  top: 0;
  left: 50%;
  width: 7px;
  height: 7px;
  margin-left: -3.5px;
  border-radius: 50%;
  background: currentColor;
  animation: hint-drip 2s cubic-bezier(0.55, 0, 0.6, 1) infinite;
  box-shadow: 0 0 10px color-mix(in srgb, currentColor 35%, transparent);
}

@keyframes hint-drip {
  0%   { transform: translateY(-10px) scale(0.6); opacity: 0; }
  18%  { opacity: 1; transform: translateY(0) scale(1); }
  82%  { opacity: 0.95; }
  100% { transform: translateY(82px) scale(0.6); opacity: 0; }
}

.scroll-hint-label {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.78rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: color-mix(in srgb, currentColor 65%, transparent);
}

@media (max-width: 640px) {
  .scroll-hint {
    bottom: 1.5rem;
    gap: 0.8rem;
  }
  .scroll-hint-track { height: 62px; }
  .scroll-hint-label { font-size: 0.68rem; }
  .scroll-hint-drop { width: 6px; height: 6px; margin-left: -3px; }
  @keyframes hint-drip {
    0%   { transform: translateY(-8px) scale(0.6); opacity: 0; }
    18%  { opacity: 1; transform: translateY(0) scale(1); }
    82%  { opacity: 0.95; }
    100% { transform: translateY(66px) scale(0.6); opacity: 0; }
  }
}

/* ─── manifesto / chunks ─────────────────────────────────── */

.manifesto {
  position: relative;
  z-index: 2;
}

/* ── ink trails: subtle sinuous paths drawing with scroll ── */

.ink-trails {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  overflow: visible;
}

.ink-trail {
  fill: none;
  stroke: currentColor;
  stroke-width: 0.35;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.18;
  vector-effect: non-scaling-stroke;
  will-change: stroke-dashoffset;
}

.ink-trail-a { stroke-width: 1.6; }

.chapter {
  min-height: 78svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(3rem, 8vh, 5rem) clamp(1.5rem, 5vw, 4rem);
  position: relative;
  overflow: hidden;
}

.chapter:first-of-type {
  align-items: flex-start;
  min-height: 70svh;
  padding-top: clamp(3.5rem, 9vh, 6rem);
}

/* giant chapter number watermark — mid-charcoal grey */
.chapter::before {
  content: attr(data-num);
  position: absolute;
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: clamp(16rem, 38vw, 32rem);
  line-height: 0.85;
  color: #3a3a3a;
  user-select: none;
  pointer-events: none;
  letter-spacing: -0.06em;
  z-index: 0;
  white-space: nowrap;
}

.chapter[data-num="01"]::before { top: 48%; right: -4%; transform: translateY(-50%); }
.chapter[data-num="02"]::before { top: 50%; left: -4%; transform: translateY(-50%); }
.chapter[data-num="03"]::before { top: 50%; left: 50%; transform: translate(-50%, -50%); }
.chapter[data-num="04"]::before { top: 50%; right: -3%; transform: translateY(-50%); }
.chapter[data-num="05"]::before { top: 50%; left: -3%; transform: translateY(-50%); }
.chapter[data-num="06"]::before { top: 50%; left: 50%; transform: translate(-50%, -50%); }

/* chapter frame: holds eyebrow + chunk together */
.chapter-frame {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 920px;
  display: flex;
  flex-direction: column;
  gap: clamp(1.25rem, 3vh, 2.25rem);
}

.chapter-pivot .chapter-frame { max-width: 1280px; }

/* eyebrow: small mono label matching tracklist style */
.chapter-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  position: relative;
  padding-bottom: clamp(0.6rem, 1.4vh, 1rem);
}

.chapter-meta::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 1px;
  background: currentColor;
  opacity: 0.55;
}

.chapter-num {
  color: var(--fg);
  font-weight: 500;
  letter-spacing: 0.14em;
}

.chapter-name {
  color: var(--muted);
}

.chunk {
  max-width: 920px;
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2.55rem);
  line-height: 1.35;
  letter-spacing: -0.015em;
  font-weight: 300;
  will-change: transform, opacity, filter;
}

/* billboard moment — chunk 3 breaks scale */
.chapter-pivot {
  min-height: 92svh;
  align-items: center;
}

.chunk-pivot {
  display: block;
  max-width: 1280px;
  text-align: left;
}

.pivot-lead {
  display: block;
  font-size: clamp(2.4rem, 7.8vw, 6.2rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.pivot-tail {
  display: block;
  margin-top: clamp(1rem, 2.5vh, 2rem);
  font-size: clamp(1.05rem, 1.8vw, 1.45rem);
  font-weight: 300;
  letter-spacing: -0.005em;
  line-height: 1.45;
  max-width: 36em;
  color: color-mix(in srgb, currentColor 80%, transparent);
}

.chunk-closing {
  font-size: clamp(1.6rem, 3.6vw, 3rem);
  letter-spacing: -0.015em;
}

.chunk-closing em {
  font-style: italic;
  font-weight: 400;
  display: inline;
}

/* ── bolded name + drawn underline ── */

.name {
  font-weight: 700;
  position: relative;
  display: inline-block;
  white-space: nowrap;
}

.name-underline {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.18em;
  width: 100%;
  height: 0.18em;
  overflow: visible;
  pointer-events: none;
}

.name-underline path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-dasharray: 220;
  stroke-dashoffset: 220;
  will-change: stroke-dashoffset;
}

/* ─── release credits panel ──────────────────────────────── */

.release {
  position: relative;
  z-index: 2;
  padding: clamp(4rem, 12vh, 8rem) clamp(1.5rem, 5vw, 4rem) clamp(3rem, 8vh, 5rem);
  border-top: 1px solid var(--hairline);
  max-width: 880px;
  margin: 0 auto;
}

.release-eyebrow {
  display: block;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: clamp(1.75rem, 4vh, 2.5rem);
}

.release-list {
  margin: 0;
  display: grid;
  gap: clamp(0.85rem, 1.6vh, 1.2rem);
}

.release-row {
  display: grid;
  grid-template-columns: minmax(7rem, 11rem) 1fr;
  align-items: baseline;
  gap: 1.5rem;
  padding-bottom: clamp(0.6rem, 1.4vh, 1rem);
  border-bottom: 1px solid var(--hairline);
}

.release-row:last-child { border-bottom: none; }

.release-row dt {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.release-row dd {
  margin: 0;
  font-size: clamp(1.1rem, 1.6vw, 1.45rem);
  font-weight: 400;
  letter-spacing: -0.005em;
  color: var(--fg);
}

/* ─── footer ─────────────────────────────────────────────── */

.footer {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 2rem clamp(1.5rem, 5vw, 4rem);
  border-top: 1px solid var(--hairline);
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  position: relative;
  z-index: 2;
}

.footer-mid { flex: 1; text-align: center; }
.footer-end { text-align: right; }

/* ─── mobile tuning ──────────────────────────────────────── */

@media (max-width: 880px) {
  .rail-title { display: none; }
  .rail-time { display: none; }
  .rail-mark {
    grid-template-columns: auto 10px;
  }
}

@media (max-width: 640px) {
  .status {
    font-size: 0.62rem;
    gap: 0.45rem;
    letter-spacing: 0.1em;
  }
  .corner {
    width: clamp(78px, 20vw, 110px);
    top: 0.75rem;
    right: 0.9rem;
  }
  .logo-wrap { width: 84vw; }
  .pin-host { height: 120svh; }
  .rail {
    right: 0.65rem;
  }
  .rail-marks { gap: 1.5rem; font-size: 0.62rem; }
  .chapter { min-height: 70svh; }
  .chapter::before { font-size: clamp(12rem, 60vw, 22rem); opacity: 0.03; }
  .chapter-meta { font-size: 0.65rem; }
  .release {
    padding: clamp(3rem, 8vh, 4rem) 1.25rem clamp(2rem, 5vh, 3rem);
  }
  .release-row {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }
  .release-row dd { font-size: 1.1rem; }
  .footer {
    flex-direction: column;
    gap: 0.6rem;
    text-align: left;
    padding: 1.5rem 1.25rem;
  }
  .footer-mid, .footer-end { text-align: left; flex: none; }
}

/* ─── reduced motion ─────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  body.is-loading .status,
  body.is-loading .corner,
  body.is-loading .logo-wrap,
  body.is-loading .chunk,
  body.is-loading .footer { opacity: 1; }
  .pin-host { height: 100svh; }
  .name-underline path { stroke-dashoffset: 0; }
  .rail { opacity: 1; }
  .ink-trail { stroke-dashoffset: 0 !important; }
  .scroll-hint { display: none; }
}

/* light-mode footer no longer needed — closing inversion removed */

/* ─── selection / focus ──────────────────────────────────── */

::selection {
  background: var(--bright);
  color: var(--bg);
}

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}
