/* ==========================================================================
   01 · HERO  — an interactive art poster
   The poster lives in one square "stage". Every layer is placed by three numbers:
     --x / --y  centre of the layer, in % of the stage      --w  width in % of the stage
     --h        height in % (only for non-square pieces: clouds .56 × w, danglers 8.33 × w)
   so each breakpoint re-composes the poster just by changing numbers.
   The lotus centre is the anchor of the whole composition: (37, 51) on the desktop stage.
   ========================================================================== */
.hero {
  --hero-pin: 70vh;                                   /* scroll distance of the desktop assembly (hero.js) */
  --hero-stage: min(62vw, calc(100svh - var(--nav-h) + 5.5svh));
  --hero-cx: 66vw;                                    /* where the lotus centre sits across the viewport */
  position: relative;
  z-index: 3;                                         /* the art overlaps the dark strip that follows */
  overflow-x: clip;                                   /* art bleeds off the right edge; the bottom stays open */
}
.hero__frame {
  position: relative;
  display: grid;
  align-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding-block: calc(var(--nav-h) + clamp(.25rem, 1.5svh, 1.5rem)) clamp(1.75rem, 5.5svh, 4.5rem);
}
/* desktop "pin": pure CSS sticky — hero.js adds .hero--pin and scrubs a timeline over --hero-pin */
.hero--pin { height: calc(100svh + var(--hero-pin)); }
.hero--pin .hero__frame { position: sticky; top: 0; height: 100svh; min-height: 0; }

/* ---------- words ---------- */
.hero__inner { position: relative; z-index: 2; }
.hero__content { position: relative; display: grid; justify-items: start; max-width: 46rem; }

.hero__label {
  display: inline-flex; align-items: center; gap: .9em;
  margin-bottom: clamp(1rem, 2.6svh, 2rem);
  color: var(--ink-80);
}
.hero__label::before { content: ""; width: clamp(1.75rem, 3vw, 3rem); height: 1px; background: var(--line-strong); }
.hero__label i { font-style: normal; color: var(--vermillion); }

.hero__title {
  font-size: clamp(5rem, min(12.2vw, 19.5svh), 13.5rem);
  font-weight: 560;
  font-variation-settings: "opsz" 22;                 /* sturdier hairlines than the auto 96pt cut — closer to the approved poster */
  line-height: .9;
  margin-left: -.035em;                               /* optical: the A's hairline leg sits on the grid line */
  text-wrap: nowrap;
}
.hero__line {
  display: block; overflow: hidden;
  padding: .05em .12em .1em .04em; margin: -.05em -.12em -.1em -.04em;   /* mask with breathing room for serifs */
}
.hero.is-in .hero__line { overflow: visible; }
.hero__line-in { display: block; transform-origin: 0 100%; }
.hero__line--accent { color: var(--vermillion); }

.hero__copy {
  margin-top: clamp(1.1rem, 3svh, 2.2rem);
  font-size: clamp(1.0625rem, 1.32vw, 1.45rem);
  line-height: 1.45;
  max-width: none;
}
.hero__copy-line { display: block; }
.hero__copy-line:first-child { color: var(--ink); font-weight: 500; }

.hero__actions {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: clamp(1.1rem, 2.2vw, 2.4rem);
  margin-top: clamp(1.4rem, 3.6svh, 2.75rem);
}
.hero__explore { min-height: 2.9rem; }

/* vertical phrase — only where the spine rail is absent */
.hero__jp {
  position: absolute; z-index: 2; pointer-events: none;
  font-size: clamp(.95rem, 2.2vw, 1.15rem); color: var(--ink);
}
@media (min-width: 1200px) { .hero__jp { display: none; } }

/* scroll cue */
.hero__cue { display: none; }
@media (min-width: 1024px) and (hover: hover) and (orientation: landscape) {
  .hero__cue {
    position: absolute; z-index: 2; left: calc(var(--gutter) + var(--rail-w)); bottom: clamp(.9rem, 2.6svh, 1.8rem);
    display: inline-flex; align-items: center; gap: 1em; font-size: .6rem; color: var(--ink-60);
  }
  .hero__cue i { position: relative; display: block; width: 3.5rem; height: 1px; background: var(--line-strong); overflow: hidden; }
  .hero__cue i::after { content: ""; position: absolute; inset: 0; background: var(--ink); transform: translateX(-101%); }
  .hero.is-live .hero__cue i::after { animation: hero-cue 2.8s var(--ease-in-out) infinite; }
}
@media (min-width: 1600px) { .hero__cue { left: max(calc(var(--gutter) + var(--rail-w)), calc((100vw - var(--maxw)) / 2 + var(--gutter) + var(--rail-w))); } }
@keyframes hero-cue { 0% { transform: translateX(-101%); } 55%, 100% { transform: translateX(101%); } }

/* ---------- the poster ---------- */
.hero__stage {
  position: absolute; z-index: 1;
  width: var(--hero-stage); aspect-ratio: 1;
  left: calc(var(--hero-cx) - var(--hero-stage) * .37);
  /* height-limited: hangs from the nav and drops into the value strip · width-limited: floats around 58% */
  top: max(calc(var(--nav-h) + .5rem), calc(58svh - var(--hero-stage) * .51));
  pointer-events: none; user-select: none; -webkit-user-select: none;
}
.hero__layer {
  position: absolute;
  left: calc((var(--x) - var(--w) / 2) * 1%);
  top: calc((var(--y) - var(--h, var(--w)) / 2) * 1%);
  width: calc(var(--w) * 1%);
}
.hero__piece, .hero__in { position: relative; display: block; }
.hero__stage .art { color: var(--ink); }

/* final poster — desktop numbers (lotus centre = 37 / 51) */
.hero__layer--mandala   { --x: 37;   --y: 54.9; --w: 88; }
.hero__layer--orbits    { --x: 48;   --y: 52;   --w: 92; }
.hero__layer--stars     { --x: 58;   --y: 44;   --w: 92; }
.hero__layer--sun       { --x: 33.5; --y: 14;   --w: 27.5; }
.hero__layer--moon      { --x: 54;   --y: 23.5; --w: 19.5; }
.hero__layer--cloud-a   { --x: 12.5; --y: 21;   --w: 27;   --h: 15.1; }
.hero__layer--cloud-b   { --x: 74;   --y: 56;   --w: 29;   --h: 16.2; }
.hero__layer--cloud-c   { --x: 60;   --y: 94;   --w: 30;   --h: 16.8; }
.hero__layer--wave      { --x: 71.5; --y: 81.5; --w: 31; }
.hero__layer--dangler-a { --x: 70;   --y: 21;   --w: 3.9;  --h: 32.5; }
.hero__layer--dangler-b { --x: 86.5; --y: 27.5; --w: 4.5;  --h: 37.5; }
.hero__layer--sparkle-1 { --x: 72.5; --y: 43;   --w: 3.6; }
.hero__layer--sparkle-2 { --x: 3;    --y: 45;   --w: 2.4; }
.hero__layer--sparkle-3 { --x: 93;   --y: 68;   --w: 2.2; }
.hero__layer--spatter   { --x: 13;   --y: 64;   --w: 22; }
.hero__layer--seal      { --x: 50.5; --y: 83.5; --w: 0; width: auto; }

.hero__orbits, .hero__mandala { aspect-ratio: 1; }
.hero__sun { aspect-ratio: 1; border-radius: 50%; }

/* dark discs (moon + wave): a local "night" theme without the global .theme-dark hooks */
.hero__disc {
  position: relative; aspect-ratio: 1; border-radius: 50%; overflow: hidden;
  background: var(--night); color: var(--parchment);
  --art-paper: var(--night); --art-accent: var(--ochre); --art-sun: var(--ochre);
}
.hero__stage .hero__crescent {
  position: absolute; inset: 9%;
  color: var(--night);                                /* dot-work shading reads on the lit body */
  --art-crescent-fill: var(--parchment);
}
.hero__wave-img {
  position: absolute; left: -9%; top: -9%; width: 118%; height: 118%; max-width: none;
  object-fit: cover; object-position: 41% 50%;
}
/* hairline ring floating just outside the wave disc + a bead riding it */
.hero__layer--wave .hero__in::before {
  content: ""; position: absolute; inset: -5%; border-radius: 50%;
  border: 1px solid var(--line-strong); pointer-events: none;
}
.hero__layer--wave .hero__in::after {
  content: ""; position: absolute; left: 8.4%; top: 4.6%; width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px;
  border-radius: 50%; background: var(--vermillion); pointer-events: none;
}

/* danglers unroll downward: a counter-translated mask (transform only) */
.hero__mask { overflow: hidden; }
.hero__mask, .hero__mask-in { display: block; }

.hero__seal { font-size: clamp(1.05rem, 1.5vw, 1.55rem); transform-origin: 50% 50%; transform: rotate(-4deg); }

/* no-JS: procedural art cannot mount — keep the discs of the woodblock composition */
.hero:not(.hero--js) .hero__sun { background: var(--vermillion-deep); }

/* the mandala / orbits are split into stacked whole-svg layers by hero.js (GPU-cheap) */
.hero__split { position: absolute; inset: 0; }
.hero__split > svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }

/* ---------- ambient life (only while .is-live, only if motion is welcome) ---------- */
.hero__motes { position: absolute; inset: 0; }
.hero__mote {
  position: absolute; width: 3px; height: 3px; border-radius: 50%; background: var(--ink); opacity: 0;
}
.hero__mote:nth-child(1) { left: 4%;  top: 33%; }
.hero__mote:nth-child(2) { left: 18%; top: 78%; background: var(--vermillion); }
.hero__mote:nth-child(3) { left: 66%; top: 7%; }
.hero__mote:nth-child(4) { left: 92%; top: 52%; background: var(--vermillion); width: 4px; height: 4px; }
.hero__mote:nth-child(5) { left: 0%;  top: 58%; width: 2px; height: 2px; }
.hero__mote:nth-child(6) { left: 44%; top: 97%; }
.hero__mote:nth-child(7) { left: 97%; top: 30%; width: 2px; height: 2px; }
.hero__mote:nth-child(8) { left: 24%; top: 4%; background: var(--vermillion); width: 4px; height: 4px; }

@media (prefers-reduced-motion: no-preference) {
  .hero.is-live .hero__mote { animation: hero-mote 9s ease-in-out infinite; }
  .hero.is-live .hero__mote:nth-child(2) { animation-duration: 11s; animation-delay: -3s; }
  .hero.is-live .hero__mote:nth-child(3) { animation-duration: 13s; animation-delay: -7s; }
  .hero.is-live .hero__mote:nth-child(4) { animation-duration: 8s;  animation-delay: -2s; }
  .hero.is-live .hero__mote:nth-child(5) { animation-duration: 12s; animation-delay: -5s; }
  .hero.is-live .hero__mote:nth-child(6) { animation-duration: 10s; animation-delay: -8s; }
  .hero.is-live .hero__mote:nth-child(7) { animation-duration: 14s; animation-delay: -1s; }
  .hero.is-live .hero__mote:nth-child(8) { animation-duration: 12s; animation-delay: -6s; }

  .hero.is-live .hero__cloud { animation: hero-drift 16s ease-in-out infinite alternate; }
  .hero.is-live .hero__cloud--b { animation-duration: 21s; animation-direction: alternate-reverse; }
  .hero.is-live .hero__cloud--c { animation-duration: 26s; animation-delay: -6s; }
  .hero.is-live .hero__wave-img { animation: hero-swell 19s ease-in-out infinite alternate; }
  .hero.is-live .hero__layer--sparkle .art { animation: hero-twinkle 5.5s ease-in-out infinite; }
  .hero.is-live .hero__layer--sparkle-2 .art { animation-duration: 7s; animation-delay: -2s; }
  .hero.is-live .hero__layer--sparkle-3 .art { animation-duration: 8.5s; animation-delay: -4s; }
  .hero.is-live .hero__stars { animation: hero-breathe 9s ease-in-out infinite; }
  /* everything pauses while the hero is off screen */
  .hero.is-away *, .hero.is-away *::after { animation-play-state: paused !important; }
}
@keyframes hero-mote {
  0%, 100% { opacity: 0; transform: translate3d(0, 10px, 0); }
  35% { opacity: .75; }
  60% { opacity: .5; }
  85% { opacity: 0; transform: translate3d(6px, -16px, 0); }
}
@keyframes hero-drift { from { transform: translate3d(-8px, 0, 0); } to { transform: translate3d(10px, 0, 0); } }
@keyframes hero-swell { from { transform: translate3d(-1.2%, .6%, 0) scale(1); } to { transform: translate3d(1.2%, -.6%, 0) scale(1.025); } }
@keyframes hero-twinkle { 0%, 100% { opacity: 1; transform: scale(1) rotate(0deg); } 50% { opacity: .35; transform: scale(.78) rotate(18deg); } }
@keyframes hero-breathe { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }

/* ==========================================================================
   Small laptop 1024–1199 (landscape): same poster, no rail
   ========================================================================== */
@media (min-width: 1024px) and (max-width: 1199px) {
  .hero__jp { display: none; }
}

/* ==========================================================================
   Tablet + phone (and portrait windows up to 1199): the poster is re-composed, never squeezed
   ========================================================================== */
@media (max-width: 1023px), (max-width: 1199px) and (orientation: portrait) {
  .hero { --hero-stage: 100vw; }
  .hero__frame { align-items: start; min-height: 0; padding-bottom: 0; }
  .hero__stage { left: 0; top: 0; }
}

/* ---------- Tablet 768+: words top-left, the lotus grows to ~118vw and hangs off the right edge ---------- */
@media (min-width: 768px) and (max-width: 1023px), (min-width: 768px) and (max-width: 1199px) and (orientation: portrait) {
  .hero__frame { min-height: max(100svh, 138vw); padding-top: calc(var(--nav-h) + clamp(1.5rem, 4vw, 3rem)); }
  .hero__title { font-size: clamp(7rem, 17.5vw, 12.5rem); }
  .hero__copy { font-size: clamp(1.2rem, 2.5vw, 1.5rem); }
  .hero__actions { flex-direction: column; align-items: flex-start; gap: 1.4rem; }

  .hero__layer--mandala   { --x: 79;  --y: 95;   --w: 118; }
  .hero__layer--orbits    { --x: 79;  --y: 93;   --w: 156; }
  .hero__layer--stars     { --x: 58;  --y: 70;   --w: 100; }
  .hero__layer--sun       { --x: 71;  --y: 43;   --w: 37; }
  .hero__layer--moon      { --x: 96;  --y: 55.5; --w: 21; }
  .hero__layer--cloud-a   { --x: 50;  --y: 53;   --w: 36; --h: 20.2; }
  .hero__layer--cloud-b   { --x: 22;  --y: 112;  --w: 40; --h: 22.4; }
  .hero__layer--cloud-c   { --x: 40;  --y: 135;  --w: 40; --h: 22.4; }
  .hero__layer--wave      { --x: 18;  --y: 127;  --w: 33; }
  .hero__layer--dangler-a { --x: 93;  --y: 21;   --w: 4.2; --h: 35; }
  .hero__layer--dangler-b { display: none; }
  .hero__layer--sparkle-1 { --x: 84;  --y: 30;   --w: 4.6; }
  .hero__layer--sparkle-2 { --x: 60;  --y: 24;   --w: 3; }
  .hero__layer--sparkle-3 { --x: 6;   --y: 103;  --w: 3; }
  .hero__layer--spatter   { --x: 42;  --y: 104;  --w: 26; }
  .hero__layer--seal      { --x: 45;  --y: 124; }
  .hero__seal { font-size: 1.5rem; }
  .hero__jp { right: 1.5rem; top: calc(var(--nav-h) + 1.25rem); display: none; }
}

/* ---------- Phone ≤767: the poster crowns the headline — the lotus hangs off the right edge beside ART,
   the sun rises behind it, the wave disc tucks against the full stop of STAYS. ---------- */
@media (max-width: 767px) {
  .hero__frame { padding-top: calc(var(--nav-h) + 53vw); }
  .hero__content { max-width: none; }
  .hero__label { position: absolute; left: 0; top: calc(-53vw + .35rem); margin: 0; font-size: .625rem; }
  .hero__label::before { width: 1.5rem; }
  .hero__label-text { white-space: nowrap; letter-spacing: .15em; }   /* the h1 is longer than a label: keep it on one line above the art */
  .hero__label-area { display: none; }                                /* phones: only ~250px clear of the moon — Chhattarpur stays in the copy below */
  .hero__title { font-size: clamp(4.2rem, 24.6vw, 10.5rem); line-height: .89; font-variation-settings: "opsz" 18; }
  .hero__copy { margin-top: 1.15rem; font-size: clamp(.95rem, 4.3vw, 1.25rem); }
  .hero__actions { flex-direction: column; align-items: stretch; width: 100%; gap: .85rem; margin-top: 1.4rem; }
  .hero__cta { justify-content: space-between; min-height: 3.75rem; }
  .hero__explore { justify-content: space-between; min-height: 3rem; padding-left: .2rem; }

  .hero__layer--mandala   { --x: 80;  --y: 58;   --w: 118; }
  .hero__layer--orbits    { --x: 78;  --y: 56;   --w: 150; }
  .hero__layer--stars     { --x: 50;  --y: 50;   --w: 110; }
  .hero__layer--sun       { --x: 36;  --y: 40;   --w: 35; }
  .hero__layer--moon      { --x: 96;  --y: 24;   --w: 20; }
  .hero__layer--cloud-a   { --x: 17;  --y: 56;   --w: 40; --h: 22.4; }
  .hero__layer--cloud-b   { display: none; }
  .hero__layer--cloud-c   { display: none; }
  .hero__layer--wave      { --x: 101; --y: 132;  --w: 42; }
  .hero__layer--dangler-a { display: none; }
  .hero__layer--dangler-b { display: none; }
  .hero__layer--sparkle-1 { --x: 8;   --y: 34;   --w: 5; }
  .hero__layer--sparkle-2 { --x: 60;  --y: 22;   --w: 3.4; }
  .hero__layer--sparkle-3 { --x: 93;  --y: 104;  --w: 3.4; }
  .hero__layer--spatter   { --x: 40;  --y: 66;   --w: 30; }
  .hero__layer--seal      { --x: 88;  --y: 166; }
  .hero__seal { font-size: 1.1rem; }
  .hero__jp { display: none; }
}

/* small phones ≤379: the h1 label drops its leading rule and tightens, so it stays clear of the moon disc */
@media (max-width: 379px) {
  .hero__label::before { display: none; }
  .hero__label-text { letter-spacing: .08em; }
}
