/* Mood hero, full bleed: the studio's photo fills the screen, its cover words Visionary / Noir / Poetic
   sit over it and switch the mood, the tagline and the call to action hold the lower right.
   Works with CSS alone: native radios + :has() pick the photo, the caption and the mood styling.
   hero.js adds .hero--js and data-mood; hero-gl.js lays a WebGL canvas over the photos (.hero--gl);
   hero-cinema.js adds the grid lines, the polaroid, the slideshow badge and the aperture that opens it.
   Stacking inside the frame (isolated): photos auto (-3 to -1 while they crossfade); WebGL canvas 0;
   glow 1; letterbox 2; caption 3; develop.js puts its negative (3) and hint (4) on top. */

.hero {
  --word-ink: var(--paper);
  --bar: 11%;
  position: relative;
  height: calc(100svh - var(--masthead-h));
  min-height: 560px;
  padding: 0;
  overflow: hidden;
  border-top: 0;
  background: var(--ink);
  color: var(--paper);
  isolation: isolate;
}
/* the grid is not positioned, so the photo frame fills the whole section behind it */
.hero__grid {
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100%;
  padding-block: clamp(1.5rem, 5vh, 3.5rem);
}

/* shading for legibility over any photo, under the words */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(to top, rgba(17, 18, 20, 0.72), rgba(17, 18, 20, 0) 46%),
    linear-gradient(to right, rgba(17, 18, 20, 0.5), rgba(17, 18, 20, 0) 55%);
}

/* the three words: the studio's cover, set large over the photo. Native radios stay in charge:
   Tab reaches the group, the arrow keys move and select. */
.hero__moods {
  position: relative;
  z-index: 2;
  grid-row: 1;
  display: grid;
  justify-items: start;
  align-self: start;
  margin: 0;
  padding: 0;
  border: 0;
}
.hero__word {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--font-display);
  font-size: clamp(3rem, min(7vw, 11.5vh), 7rem);
  font-weight: 400;
  line-height: 0.92;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: transparent;
  -webkit-text-stroke: 1px rgba(246, 247, 244, 0.85);
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.6s var(--ease-out), -webkit-text-stroke-color 0.6s var(--ease-out);
}
@supports not (-webkit-text-stroke: 1px black) {
  .hero__word { color: rgba(246, 247, 244, 0.5); }
}
.hero__word::after {
  content: "";
  position: absolute;
  left: calc(100% + 0.3em);
  top: 50%;
  width: 0.9em;
  height: 1px;
  background: var(--paper);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.5s var(--ease-out);
}
.mood-input:checked + .hero__word { color: var(--paper); -webkit-text-stroke-color: var(--paper); }
.mood-input:checked + .hero__word::after { transform: scaleX(1); }
.mood-input:focus-visible + .hero__word { outline: 2px solid var(--paper); outline-offset: 4px; }
@media (hover: hover) and (pointer: fine) {
  .hero__word:hover { color: rgba(246, 247, 244, 0.22); }
  .mood-input:checked + .hero__word:hover { color: var(--paper); }
}

/* the photo frame fills the section */
.hero__frame {
  position: absolute;
  inset: 0;
  z-index: 0;
  margin: 0;
  overflow: hidden;
  isolation: isolate;
  background: var(--film);
}
.hero__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}
/* CSS only: the checked radio shows its photo */
.hero:has(#m-visionary:checked) .hero__img[data-mood="visionary"],
.hero:has(#m-noir:checked) .hero__img[data-mood="noir"],
.hero:has(#m-poetic:checked) .hero__img[data-mood="poetic"] { display: block; }
@supports not selector(:has(*)) {
  .hero__img[data-mood="visionary"] { display: block; }
  .hero:not(.hero--js) .hero__note [data-mood="visionary"] { display: inline; }
}
.hero--js .hero__img:not(.is-active):not(.is-leaving) { display: none; }
.hero--js .hero__img.is-active,
.hero--js .hero__img.is-leaving { display: block; }

/* WebGL dissolve (hero-gl.js): over the photos, under the glow, bars and caption */
.hero__gl {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
}
.hero__develop {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: var(--paper);
  pointer-events: none;
}

/* caption: top right, small caps */
.hero__note {
  position: absolute;
  right: max(16px, env(safe-area-inset-right, 0px), calc((100% - var(--max)) / 2 + 2.5vw));
  top: calc(var(--bar) + var(--space-5));
  z-index: 3;
  color: var(--paper);
  font-size: var(--step--2);
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-shadow: 0 1px 12px rgba(17, 18, 20, 0.5);
}
.hero__note span { display: none; }
.hero:is(:has(#m-visionary:checked), [data-mood="visionary"]) .hero__note [data-mood="visionary"],
.hero:is(:has(#m-noir:checked), [data-mood="noir"]) .hero__note [data-mood="noir"],
.hero:is(:has(#m-poetic:checked), [data-mood="poetic"]) .hero__note [data-mood="poetic"] { display: inline; }

/* Visionary: cinema letterbox bars */
.hero__bars { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.hero__bars::before, .hero__bars::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: var(--bar);
  background: var(--film);
  transform: scaleY(0);
  transition: transform var(--dur-reveal) var(--ease-out);
}
.hero__bars::before { top: 0; transform-origin: top; }
.hero__bars::after { bottom: 0; transform-origin: bottom; }
.hero:is(:has(#m-visionary:checked), [data-mood="visionary"]) .hero__bars::before,
.hero:is(:has(#m-visionary:checked), [data-mood="visionary"]) .hero__bars::after { transform: scaleY(1); }

/* Poetic: warm lamp light */
.hero__glow {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(60% 55% at 18% 12%, color-mix(in srgb, var(--tungsten) 60%, transparent), transparent 70%);
  mix-blend-mode: soft-light;
  opacity: 0;
  transition: opacity var(--dur-mood) var(--ease-inout);
}
.hero:is(:has(#m-poetic:checked), [data-mood="poetic"]) .hero__glow { opacity: 1; }

/* tagline and call to action, lower right */
.hero__copy {
  position: relative;
  z-index: 2;
  grid-row: 3;
  display: grid;
  gap: var(--space-5);
  justify-items: start;
  max-width: 34rem;
}
.hero h1 {
  margin: 0;
  font-size: clamp(1.7rem, 2.7vw, 2.6rem);
  font-weight: 400;
  line-height: 1.08;
  color: var(--paper);
  text-wrap: balance;
}
.hero h1 em { font-style: italic; }
.hero h1 .caps {
  display: block;
  margin-top: var(--space-3);
  font-family: var(--font-text);
  font-size: 0.42em;
  font-style: normal;
  font-weight: 500;
  letter-spacing: 0.18em;
  line-height: 1.6;
  text-transform: uppercase;
  color: rgba(246, 247, 244, 0.86);
}
.hero__line-mask { overflow: hidden; }

/* the call to action: a white pill and a round arrow beside it */
.hero__cta { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.hero__cta .button { background: var(--paper); border-color: var(--paper); color: var(--ink); border-radius: 999px; }
.hero__cta-arrow {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  font-size: 1.1rem;
  transition: transform 0.4s var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .hero__cta:hover .hero__cta-arrow { transform: rotate(-45deg); }
  .hero__cta .button:hover { background: #fff; border-color: #fff; }
}

/* motion off: no canvas and no developing paper, even if one was left behind */
html[data-motion="off"] .hero__gl,
html[data-motion="off"] .hero__develop { display: none; }

@media (min-width: 900px) {
  .hero { --bar: 12.5%; }
  .hero__grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-template-rows: 1fr auto;
    column-gap: var(--col-gap);
    padding-block: calc(var(--bar) + var(--space-5)) calc(var(--bar) + var(--space-5));
  }
  .hero__moods { grid-column: 1 / span 7; grid-row: 1; }
  .hero__copy { grid-column: 8 / -1; grid-row: 2; justify-self: end; }
}
@media (max-width: 899px) {
  .hero { --bar: 7%; }
  .hero__grid { padding-block: calc(var(--bar) + var(--space-4)) calc(var(--bar) + var(--space-5)); }
  .hero__word { font-size: clamp(2.6rem, 14vw, 5rem); }
}

/* ---------- hero-cinema.js: grid lines, wordmark, polaroid, slideshow badge, aperture ---------- */
.hero__lines { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.hero__rule { position: absolute; background: rgba(246, 247, 244, 0.2); }
.hero__rule--v1, .hero__rule--v2, .hero__rule--v3 { top: 0; bottom: 0; width: 1px; }
.hero__rule--v1 { left: 8.33%; }
.hero__rule--v2 { left: 58.33%; }
.hero__rule--v3 { left: 91.66%; }
.hero__rule--h1 { left: 0; right: 0; height: 1px; top: 58%; }

.hero__wordmark {
  position: absolute;
  left: 0;
  bottom: -0.2em;
  z-index: 1;
  margin: 0;
  padding-left: 1vw;
  font-family: var(--font-display);
  font-size: 19.5vw;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  white-space: nowrap;
  color: transparent;
  -webkit-text-stroke: 1px rgba(246, 247, 244, 0.28);
  pointer-events: none;
  user-select: none;
}

/* the polaroid of the first story: it opens that story */
.hero__polaroid {
  position: absolute;
  left: 39%;
  bottom: 1.75rem;
  z-index: 3;
  display: grid;
  gap: 6px;
  width: clamp(120px, 11vw, 170px);
  padding: 8px 8px 10px;
  border: 0;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.18), 0 24px 40px -18px rgba(0, 0, 0, 0.55);
  transform: rotate(-7deg);
  cursor: pointer;
  transition: transform 0.5s var(--ease-out);
}
.hero__polaroid img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.hero__polaroid-caption {
  font-family: var(--font-display);
  font-size: 1rem;
  font-style: italic;
  line-height: 1.1;
  color: var(--ink);
  text-align: left;
}
@media (hover: hover) and (pointer: fine) {
  .hero__polaroid:hover { transform: rotate(-2deg) translateY(-6px) scale(1.04); }
}
.hero__polaroid:focus-visible { outline: 2px solid var(--paper); outline-offset: 4px; }

/* the slideshow badge: the moods' names turning around a pause / play mark, a ring for the time left */
.hero__badge {
  position: absolute;
  right: max(16px, calc((100% - var(--max)) / 2 + 2.5vw));
  top: calc(var(--bar) + 3.25rem);
  z-index: 3;
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(17, 18, 20, 0.28);
  color: var(--paper);
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.hero__badge svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.hero__badge-turn { transform-origin: 50px 50px; animation: hero-badge-turn 22s linear infinite; }
.hero__badge.is-paused .hero__badge-turn { animation-play-state: paused; }
@keyframes hero-badge-turn { to { transform: rotate(360deg); } }
.hero__badge-text { font-family: var(--font-text); font-size: 8.4px; font-weight: 500; letter-spacing: 0.24em; text-transform: uppercase; fill: currentColor; }
.hero__badge-track { fill: none; stroke: rgba(246, 247, 244, 0.25); stroke-width: 1; }
.hero__badge-ring {
  fill: none;
  stroke: var(--paper);
  stroke-width: 1.5;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transform: rotate(-90deg);
  transform-origin: 50px 50px;
}
.hero__badge-icon { position: relative; width: 12px; height: 14px; }
.hero__badge-icon::before, .hero__badge-icon::after {
  content: "";
  position: absolute;
  top: 0;
  width: 4px;
  height: 14px;
  background: currentColor;
}
.hero__badge-icon::before { left: 0; }
.hero__badge-icon::after { right: 0; }
.hero__badge.is-paused .hero__badge-icon::before {
  left: 2px;
  width: 0;
  height: 0;
  background: none;
  border-style: solid;
  border-width: 7px 0 7px 11px;
  border-color: transparent transparent transparent currentColor;
}
.hero__badge.is-paused .hero__badge-icon::after { display: none; }
.hero__badge:focus-visible { outline: 2px solid var(--paper); outline-offset: 4px; }

/* the aperture that opens on the photo */
.hero__iris { position: absolute; inset: 0; z-index: 6; width: 100%; height: 100%; pointer-events: none; }

/* a slow drift on the photo, like a camera breathing */
html[data-motion="on"] .hero--cinema .hero__frame { animation: hero-drift 22s var(--ease-inout) infinite alternate; }
@keyframes hero-drift {
  from { transform: scale(1.02) translate3d(0, 0, 0); }
  to { transform: scale(1.09) translate3d(-1.2%, -1%, 0); }
}

@media (max-width: 899px) {
  .hero__rule--v1, .hero__rule--v3 { display: none; }
  .hero__rule--v2 { left: 66%; }
  .hero__polaroid { display: none; }
  .hero__badge { width: 76px; height: 76px; top: auto; bottom: calc(var(--bar) + 1.25rem); right: 16px; }
  .hero__copy { padding-right: 84px; }
  .hero__wordmark { font-size: 24vw; }
}
html[data-motion="off"] .hero__badge-turn { animation: none; }
