/* ------------------------------------------------------------------
   HBD Suraj — Colour chapters. One grid, one typeface pair, six flat
   colours, hard edges. No gradients, no shadows at rest, no hairlines.
------------------------------------------------------------------ */
:root {
  --night: #0a0a0a;  --night-ink: #ffffff;
  --after: #ff3b1f;  --after-ink: #0a0a0a;
  --dawn:  #ffb000;  --dawn-ink:  #0a0a0a;
  --acid:  #c6ff00;  --acid-ink:  #0a0a0a;
  --sky:   #8fd3ff;  --sky-ink:   #0a0a0a;
  --paper: #ffffff;

  --bg: var(--night);
  --ink: var(--night-ink);
  --accent: var(--acid);

  --display: 'League Spartan', 'Arial Black', sans-serif;
  --text: 'Figtree', 'Helvetica Neue', Arial, sans-serif;

  --step-small: 1rem;                                    /* 16px */
  --step-body: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);  /* 17–20px */
  --step-lead: clamp(1.375rem, 1.1rem + 1.3vw, 2.125rem);/* 22–34px: statements */
  --step-tile: clamp(2.75rem, 6.5vw, 6.5rem);            /* fallback; tiles use cqw */
  --step-display: clamp(2.75rem, 1rem + 7.2vw, 7.5rem);   /* 44–120px: h1, chapter titles */

  --margin: 24px;
  --frame: 10px;
  --gap: 8px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.76, 0, 0.24, 1);
  --ease-soft: cubic-bezier(0.33, 1, 0.68, 1);
  --t-press: 140ms; --t-hover: 180ms; --t-ui: 240ms; --t-reveal: 800ms;
  --stagger-line: 90ms; --stagger-item: 70ms;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--text); font-size: var(--step-body); line-height: 1.5;
  overflow-x: clip;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, p, ul, figure { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; }
::selection { background: var(--acid); color: var(--night); }
:focus-visible { outline: 3px solid var(--acid); outline-offset: 3px; }
.field--acid :focus-visible { outline-color: var(--night); }

/* Display type */
.lines .line { display: block; overflow: hidden; padding-bottom: 0.1em; margin-bottom: -0.1em; }
.lines [data-line] { display: block; }
[data-lines] .line { display: block; overflow: clip; padding-bottom: 0.12em; margin-bottom: -0.12em; }
[data-lines] .line > span { display: block; }

.button {
  display: inline-block; font-family: var(--text); font-weight: 600; font-size: var(--step-body);
  line-height: 1; padding: 18px 28px; border: 0; border-radius: 0; cursor: pointer;
  background: var(--paper); color: var(--night); text-decoration: none;
  transition: transform var(--t-press) var(--ease-out), background-color var(--t-hover) ease, color var(--t-hover) ease;
}
.button:active { transform: scale(0.97); }
.link {
  text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 0.2em;
  text-decoration-thickness: 0.08em; transition: text-decoration-color var(--t-hover) ease;
}
@media (hover: hover) and (pointer: fine) {
  .button:hover { background: var(--acid); color: var(--night); }
  .link:hover { text-decoration-color: currentColor; }
}

/* ------------------------------------------------------------------ GATE */
.gate {
  position: fixed; inset: 0; z-index: 50; background: var(--night); color: var(--paper);
  display: grid; place-items: center; padding: var(--margin); overflow: hidden;
}
.gate.is-open { pointer-events: none; }
.gate__ring {
  position: absolute; left: 0; right: 0; top: 3vh; white-space: nowrap; overflow: hidden;
  font-family: var(--display); font-weight: 700; font-size: var(--step-display); line-height: 1;
  color: var(--acid); letter-spacing: -0.03em; display: flex; user-select: none;
}
.gate__ring span { display: inline-block; padding-right: 0.5em; }
.gate__form { width: min(100%, 720px); position: relative; z-index: 1; margin-top: 10vh; }
.gate__title {
  font-family: var(--display); font-weight: 700; font-size: var(--step-display);
  line-height: 0.88; letter-spacing: -0.04em; margin-bottom: 28px;
}
.gate__lead { font-size: var(--step-lead); line-height: 1.25; max-width: 24ch; margin-bottom: 40px; }
.gate__row { display: flex; flex-wrap: wrap; gap: var(--gap); align-items: stretch; }
.gate__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.gate__input {
  flex: 1 1 240px; min-width: 0; font: 600 var(--step-lead) var(--text); letter-spacing: 0.08em;
  padding: 14px 20px; border: 0; border-radius: 0; background: var(--paper); color: var(--night);
}
.gate__input::placeholder { color: #8a8a8a; letter-spacing: 0.2em; }
.gate__button { background: var(--acid); color: var(--night); font-size: var(--step-lead); padding: 14px 28px; }
.gate__button.button { font-family: var(--text); }
.gate__error { min-height: 1.6em; margin-top: 14px; color: var(--after); font-weight: 600; }
.gate__sound { display: inline-flex; align-items: center; gap: 10px; margin-top: 8px; font-size: var(--step-body); cursor: pointer; }
.gate__sound input { width: 22px; height: 22px; accent-color: var(--acid); margin: 0; }
.gate.is-shaking .gate__row { animation: shake 420ms var(--ease-out); }
@keyframes shake { 0%,100% { transform: none; } 20% { transform: translateX(-12px); } 40% { transform: translateX(10px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(4px); } }

/* ------------------------------------------------------------------ HERO */
.hero {
  background: var(--paper); color: var(--paper); padding: var(--frame);
  display: grid; grid-template-columns: 10fr 2fr; gap: var(--frame); min-height: 100svh;
}
.hero__panel {
  position: relative; overflow: clip; background: #4a4038; min-height: calc(100svh - 2 * var(--frame));
}
.hero__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; }
.hero__band {
  position: absolute; left: 0; right: 0; top: 16%; padding: 24px 28px 28px;
  background: rgba(10, 10, 10, 0.5); /* the one scrim, under the headline band only */
}
.hero__title {
  font-family: var(--display); font-weight: 700; font-size: var(--step-display); line-height: 0.88;
  letter-spacing: -0.04em; text-align: center; text-wrap: balance;
}
.hero__mark { position: absolute; top: 28px; left: 28px; font-weight: 600; font-size: var(--step-small); }
.hero__lead { margin: 32px auto 0; max-width: 34ch; text-align: center; font-size: var(--step-lead); line-height: 1.25; font-weight: 600; }
.hero__cta { position: absolute; left: 50%; bottom: 36px; transform: translateX(-50%); }
.hero__cta:active { transform: translateX(-50%) scale(0.97); }

.swatches { display: grid; grid-template-rows: repeat(5, 1fr); min-height: calc(100svh - 2 * var(--frame)); }
.swatch {
  display: block; padding: 20px; font-weight: 600; font-size: var(--step-small); line-height: 1.2;
  text-decoration: none; transition: filter var(--t-hover) ease, padding-left var(--t-ui) var(--ease-out);
}
.swatch--night { background: var(--night); color: var(--night-ink); }
.swatch--after { background: var(--after); color: var(--after-ink); }
.swatch--dawn  { background: var(--dawn);  color: var(--dawn-ink); }
.swatch--acid  { background: var(--acid);  color: var(--acid-ink); }
.swatch--sky   { background: var(--sky);   color: var(--sky-ink); }
@media (hover: hover) and (pointer: fine) {
  .swatch:hover { padding-left: 30px; }
}

/* ------------------------------------------------------------------ FIELDS */
.field { min-height: 90svh; padding: 120px var(--margin); position: relative; }
.field--night { background: var(--night); color: var(--night-ink); }
.field--after { background: var(--after); color: var(--after-ink); }
.field--dawn  { background: var(--dawn);  color: var(--dawn-ink); }
.field--acid  { background: var(--acid);  color: var(--acid-ink); }
.field--sky   { background: var(--sky);   color: var(--sky-ink); }

.chapter__title {
  font-family: var(--display); font-weight: 700; font-size: var(--step-display); line-height: 0.88;
  letter-spacing: -0.04em; max-width: 12ch; text-wrap: balance;
}
.chapter__title--small { font-size: var(--step-tile); max-width: 14ch; }

/* Night: title left, chips right, statement below */
.field--night {
  display: grid; grid-template-columns: 7fr 5fr; grid-template-rows: auto 1fr auto;
  column-gap: var(--margin); row-gap: 48px; align-items: start;
}
.field--night .chapter__title { grid-column: 1; grid-row: 1; }
.chips { grid-column: 2; grid-row: 1 / span 2; position: relative; min-height: 42vw; }
.chip { position: absolute; object-fit: cover; aspect-ratio: 4 / 5; }
.chip--a { width: 64%; left: 0; top: 4%; transform: rotate(-4deg); z-index: 1; }
.chip--b { width: 44%; right: 0; top: 46%; transform: rotate(5deg); z-index: 2; }
.chapter__statement {
  grid-column: 1; grid-row: 2; align-self: end;
  font-size: var(--step-lead); line-height: 1.2; max-width: 38ch; text-wrap: pretty; font-weight: 600;
}
.chapter__note { grid-column: 1 / -1; grid-row: 3; font-size: var(--step-small); max-width: 50ch; }

/* After party: wall of word tiles */
.field--after { padding: var(--gap); }
.wall { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); }
.tile {
  position: relative; aspect-ratio: 1; display: grid; place-items: center; overflow: clip; container-type: inline-size;
  transition: transform var(--t-ui) var(--ease-out);
}
.tile--k { background: var(--night); color: var(--paper); }
.tile--r { background: var(--after); color: var(--night); }
.tile--w { background: var(--paper); color: var(--after); }
.tile--o { background: var(--dawn); color: var(--night); }
.tile--photo { background: var(--night); }
.tile--photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 900ms var(--ease-soft); }
.tile--photo .tile__cap { color: var(--paper); background: var(--night); padding: 4px 10px; }
.tile__word {
  font-family: var(--display); font-weight: 700; font-size: var(--step-tile); line-height: 0.88;
  letter-spacing: -0.04em; text-align: center; margin: 0; width: 100%; padding: 0 6%;
}
@supports (font-size: 1cqw) { .tile__word { font-size: 27cqw; } }
.tile__cap { position: absolute; left: 0; right: 0; bottom: 18px; padding: 0 18px; text-align: center; font-size: var(--step-small); font-weight: 600; z-index: 1; }
@media (hover: hover) and (pointer: fine) {
  .tile--photo:hover img { transform: scale(1.05); }
}

/* Sunrise: two-column statement with highlights */
.field--dawn .chapter__title--small { margin-bottom: 56px; }
.story p {
  columns: 2; column-gap: 32px; font-size: clamp(1.25rem, 1rem + 0.9vw, 1.75rem); line-height: 1.2;
  text-align: justify; hyphens: auto; -webkit-hyphens: auto; font-weight: 400;
}
.story__name { font-weight: 600; }
.hl {
  padding: 0 0.1em; -webkit-box-decoration-break: clone; box-decoration-break: clone; color: var(--night);
  text-decoration: none; font-weight: 600;
}
.hl--red { background: var(--after); }
.hl--sky { background: var(--sky); }
.hl--acid { background: var(--acid); }
.hl--ink { background: var(--night); color: var(--dawn); transition: background-color var(--t-hover) ease, color var(--t-hover) ease; }
@media (hover: hover) and (pointer: fine) {
  .hl--ink:hover { background: var(--paper); color: var(--night); }
}

/* Dance: the whole band is one control */
.chapter--dance { padding: 0; min-height: 0; }
.dance {
  display: block; position: relative; min-height: 60svh; padding: 20px var(--margin) 24px;
  text-decoration: none; background: var(--acid); color: var(--night);
  transition: background-color var(--t-hover) ease, color var(--t-hover) ease;
}
.dance__note { position: absolute; top: 20px; left: var(--margin); font-size: var(--step-body); font-weight: 600; max-width: 34ch; }
.dance__arrow { position: absolute; top: 20px; right: var(--margin); transition: transform var(--t-ui) var(--ease-out); }
.dance__word {
  position: absolute; left: var(--margin); right: var(--margin); bottom: 24px;
  font-family: var(--display); font-weight: 700; font-size: 28vw; line-height: 0.78;
  letter-spacing: -0.05em; text-align: center; margin: 0; transform-origin: 50% 100%;
}
.dance:focus-visible, .body-party .dance { background: var(--night); color: var(--acid); }
@media (hover: hover) and (pointer: fine) {
  .dance:hover { background: var(--night); color: var(--acid); }
  .dance:hover .dance__arrow { transform: translate(4px, -4px); }
}

/* Close: notes top, display line low, meta row */
.chapter--close { display: grid; grid-template-rows: auto 1fr auto auto; row-gap: 48px; padding: 40px var(--margin) 32px; min-height: 100svh; }
.close__strip { grid-row: 2; position: relative; overflow: clip; min-height: 34svh; background: #6a5a3a; }
.close__strip img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 32%; }
.close__strip figcaption { position: absolute; left: 0; bottom: 0; padding: 6px 12px; background: var(--night); color: var(--paper); font-size: var(--step-small); font-weight: 600; }
.close__top { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--margin); row-gap: 16px; align-items: start; }
.close__note { grid-column: span 4; font-size: var(--step-small); line-height: 1.45; }
.close__up { grid-column: 12 / 13; justify-self: end; font-size: var(--step-small); font-weight: 600; white-space: nowrap; }
.close__line {
  grid-row: 3; font-family: var(--display); font-weight: 700; font-size: var(--step-display);
  line-height: 0.88; letter-spacing: -0.04em; margin: 0;
}
.close__meta { grid-row: 4; display: grid; grid-template-columns: 1fr auto 1fr; gap: var(--margin); font-size: var(--step-small); font-weight: 600; }
.close__meta > :nth-child(2) { text-align: center; }
.close__meta > :nth-child(3) { text-align: right; }

/* ------------------------------------------------------------------ PLAYER (the one pinned element; takes the chapter's ink) */
.player {
  position: fixed; right: var(--margin); bottom: var(--margin); z-index: 40;
  display: flex; flex-direction: column; align-items: flex-end; gap: 2px;
  font-size: var(--step-small); font-weight: 600;
  --pbg: var(--paper); --pink: var(--night);
  transition: transform 500ms var(--ease-out), opacity 300ms ease;
}
.js .player.is-hidden { transform: translateY(140%); opacity: 0; }
.player[data-ink="night"] { --pbg: var(--paper); --pink: var(--night); }
.player[data-ink="after"] { --pbg: var(--night); --pink: var(--after); }
.player[data-ink="dawn"]  { --pbg: var(--night); --pink: var(--dawn); }
.player[data-ink="acid"]  { --pbg: var(--night); --pink: var(--acid); }
.player[data-ink="sky"]   { --pbg: var(--night); --pink: var(--sky); }
.player button {
  font: inherit; border: 0; border-radius: 0; cursor: pointer; padding: 12px 16px; text-align: left;
  background: var(--pbg); color: var(--pink);
  transition: background-color 300ms ease, color 300ms ease, transform var(--t-press) var(--ease-out);
}
.player button:active { transform: scale(0.96); }
.player__toggle { width: 56px; height: 56px; display: grid; place-items: center; padding: 0 !important; }
.player__panel { display: none; flex-direction: column; gap: 2px; min-width: 200px; }
.player.is-open .player__panel { display: flex; }
.player__state { padding: 10px 16px; background: var(--pbg); color: var(--pink); transition: background-color 300ms ease, color 300ms ease; }
.player__track.is-on { background: var(--pink); color: var(--pbg); }
@media (hover: hover) and (pointer: fine) {
  .player button:hover { background: var(--pink); color: var(--pbg); }
}
.eq { display: inline-flex; align-items: flex-end; gap: 3px; height: 18px; }
.eq i { display: block; width: 4px; height: 4px; background: currentColor; transform-origin: bottom; transition: height 90ms linear; }

/* ------------------------------------------------------------------ PARTY MODE */
.strobe { display: none; position: fixed; inset: 0; z-index: 30; background: var(--paper); opacity: 0; pointer-events: none; }
.body-party .strobe { display: block; }
.strobe.is-flash { opacity: 0.85; transition: none; }
.strobe:not(.is-flash) { transition: opacity 110ms linear; }
.confetti { position: fixed; inset: 0; z-index: 31; pointer-events: none; width: 100%; height: 100%; display: none; }
.body-party .confetti { display: block; }
.body-party .dance__word { animation: thump 460ms var(--ease-out) infinite; }
@keyframes thump { 0% { transform: scale(1.04); } 100% { transform: scale(1); } }

/* ------------------------------------------------------------------ MOTION (entrances) */
@media (prefers-reduced-motion: no-preference) {
  .js .gate [data-line] { transform: translateY(105%); animation: line-up 800ms var(--ease-expo) forwards; animation-delay: calc(120ms + var(--i) * var(--stagger-line)); }
  .js .gate [data-load] { opacity: 0; transform: translateY(12px); animation: rise 500ms var(--ease-out) forwards; animation-delay: var(--d); }
  .js .gate__ring { animation: ring 26s linear infinite; }
  @keyframes ring { to { transform: translateX(-50%); } }

  /* gate exit: wipes up, revealing the hero */
  .js .gate.is-open { animation: gate-out 900ms var(--ease-in-out) forwards; }
  @keyframes gate-out { to { clip-path: inset(0 0 100% 0); } }

  /* hero load sequence, started when the gate opens (.is-live) */
  .js .hero [data-line] { transform: translateY(105%); }
  .js .hero [data-load] { opacity: 0; transform: translateY(12px); }
  .js .hero .hero__cta[data-load] { transform: translate(-50%, 12px); }
  .js .hero__img { transform: scale(1.08); }
  .js .swatch { transform: translateX(100%); }
  .js .is-live .hero [data-line] { animation: line-up 900ms var(--ease-expo) forwards; animation-delay: calc(200ms + var(--i) * 110ms); }
  .js .is-live .hero [data-load] { animation: rise 500ms var(--ease-out) forwards; animation-delay: var(--d); }
  .js .is-live .hero .hero__cta[data-load] { animation-name: rise-centred; }
  .js .is-live .hero__img { animation: settle 1400ms var(--ease-expo) 100ms forwards, drift 18s var(--ease-soft) 1500ms infinite alternate; }
  .js .is-live .swatch { animation: slide-in 700ms var(--ease-expo) forwards; animation-delay: calc(300ms + var(--i) * 80ms); }
  @keyframes line-up { to { transform: none; } }
  @keyframes rise { to { opacity: 1; transform: none; } }
  @keyframes rise-centred { to { opacity: 1; transform: translateX(-50%); } }
  @keyframes settle { to { transform: none; } }
  @keyframes drift { from { transform: scale(1.0) translateY(0); } to { transform: scale(1.06) translateY(-2%); } }
  @keyframes slide-in { to { transform: none; } }

  /* scroll entrances */
  .js [data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity 700ms var(--ease-out), transform 900ms var(--ease-out); }
  .js [data-reveal].is-in { opacity: 1; transform: none; }
  .js .chip[data-reveal] { transform: translateY(32px) rotate(0deg); }
  .js .chip--a[data-reveal].is-in { transform: rotate(-4deg); transition-delay: 120ms; }
  .js .chip--b[data-reveal].is-in { transform: rotate(5deg); transition-delay: 260ms; }
  .js .chapter__statement[data-reveal] { transition-delay: 200ms; }
  .js .chapter__note[data-reveal] { transition-delay: 320ms; }

  .js [data-lines] .line > span { transform: translateY(105%); transition: transform 900ms var(--ease-expo); transition-delay: calc(var(--i, 0) * var(--stagger-line)); }
  .js [data-lines].is-in .line > span { transform: none; }

  .js .tile { opacity: 0; transform: translateY(28px); transition: opacity 600ms var(--ease-out), transform 800ms var(--ease-out); transition-delay: calc(var(--i) * 45ms); }
  .js .wall.is-in .tile { opacity: 1; transform: none; }

  .js .dance__word { transform: translateY(12%); transition: transform 1100ms var(--ease-expo); }
  .js .dance.is-in .dance__word { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .strobe { display: none !important; }
  .body-party .dance__word { animation: none; }
}

/* ------------------------------------------------------------------ PHONE & TABLET */
@media (max-width: 900px) {
  :root { --margin: 18px; --frame: 8px; }
  .hero { grid-template-columns: 1fr; grid-template-rows: auto auto; min-height: 0; }
  .hero__panel { min-height: 64svh; }
  .hero__band { top: 10%; padding: 18px 16px; }
    .hero__mark { top: 18px; left: 16px; }
  .hero__lead { margin-top: 20px; font-size: 1.125rem; }
  .hero__cta { bottom: 24px; }
  .swatches { grid-template-rows: repeat(5, 52px); min-height: 0; }
  .swatch { padding: 0 16px; display: flex; align-items: center; }
  .js .swatch { transform: translateX(-100%); }

  .field { padding: 72px var(--margin); }
  .field--night { grid-template-columns: 1fr; grid-template-rows: auto auto auto auto; row-gap: 36px; }
  .field--night .chapter__title { grid-column: 1; grid-row: 1; max-width: 10ch; }
  .chips { grid-column: 1; grid-row: 2; min-height: 92vw; }
  .chip--a { width: 62%; }
  .chip--b { width: 46%; top: 40%; }
  .chapter__statement { grid-column: 1; grid-row: 3; align-self: start; font-size: 1.1875rem; line-height: 1.4; }
  .chapter__note { grid-row: 4; }

  .field--after { padding: 6px; }
  .wall { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .tile__cap { bottom: 12px; }

  .story p { columns: 1; text-align: left; hyphens: manual; -webkit-hyphens: manual; line-height: 1.3; }
  .story__link { display: block; margin-top: 24px; padding: 6px 0.2em; }

  .field--dawn { min-height: 0; }
  .chapter--dance { padding: 0; }
  .dance { min-height: 46svh; }
  .dance__note { max-width: 24ch; }
  .dance__arrow { width: 32px; height: 32px; }
  .dance__word { font-size: 34vw; }

  .chapter--close { min-height: 0; row-gap: 32px; }
  .close__strip { min-height: 46vw; }
  .close__top { grid-template-columns: 1fr; }
  .close__note { grid-column: 1; }
  .close__up { grid-column: 1; justify-self: start; }
    .close__meta { grid-template-columns: 1fr; gap: 6px; }
  .close__meta > * { text-align: left !important; }

  .chapter--close { padding-bottom: 96px; }
}
