/* ==========================================================================
   Hero (ref: Warisa Lie cover)

   Two layouts (chosen in the admin):
   · center — the photo fills the first screen: a group in the middle holding a round
              board; the SVG logo is drawn on the board and is the page heading; the text
              follows the photo. Upright screens can get their own, taller photo.
   · side   — one dancer on the left, the name on the right over a light veil
              (stacked on portrait phones and tablets: photo box on top, text below).

   Art direction: every breakpoint sets WHERE the key point of the photo should be
   (--subject-at-x / --subject-at-y, in % of the photo box). hero.js crops the photo
   so its key point (set in the admin) lands there, and in the center layout tells the
   logo where the board ended up (--photo-x/y/w/h). Without JS the CSS fallback uses
   the key point directly as object-position and the logo stays hidden.

   Breakpoints
   1. phones, portrait ............ ≤ 560px            4:5 photo box
   2. tablets, portrait ........... 561–820px portrait 5:4 photo box
   3. phones, landscape ........... height ≤ 520px     compact
   4. tablets landscape / small ... 821–1199px
   5. laptops ..................... 1200–1599px        base values
   6. large / ultra-wide .......... ≥ 1600px
   ========================================================================== */

.hero {
	--subject-at-x: 25;
	--subject-at-y: 52;
	--header-h: 0px;
	position: relative; overflow: hidden;
}
.hero__photo {
	width: 100%; height: 100%; object-fit: cover;
	object-position: calc(var(--focus-x, 30) * 1%) calc(var(--focus-y, 55) * 1%);
}
.hero__text { display: grid; justify-items: center; text-align: center; gap: 14px; }
.hero__eyebrow {
	font-family: var(--f-display); font-size: clamp(13px, 1.2vw, 15px);
	letter-spacing: .34em; margin-right: -.34em; text-transform: uppercase; color: var(--c-muted);
	text-wrap: balance;
}
.hero__title {
	font-family: var(--f-script); font-size: var(--fs-script);
	text-transform: none; letter-spacing: 0; line-height: 1;
	margin-block: 4px -6px; color: var(--c-heading);
}
.hero__lead {
	font-family: var(--f-serif); font-style: italic; font-size: clamp(21px, 2vw, 25px);
	line-height: var(--lh-snug); max-width: 28ch; margin-top: 8px; text-wrap: balance;
}
.hero__links { justify-content: center; margin-top: 6px; }

/* Transparent site header on top: text/photo clear the header, soft veil for the site name */
.hero--under-header { --header-h: 88px; }
.hero--under-header::before {
	content: ""; position: absolute; z-index: 1; inset: 0 0 auto; height: 180px; pointer-events: none;
	background: linear-gradient(rgba(var(--c-hero-veil), .55), rgba(var(--c-hero-veil), 0));
}

/* ---------- center: photo on the whole first screen, logo on the board, text after it ---------- */

.hero--center { --subject-at-x: 50; --subject-at-y: 54; background: var(--c-paper); }
.hero--center .hero__media {
	position: relative; overflow: hidden; background: var(--c-studio);
	height: 100vh; height: 100svh; min-height: 420px;
}
.hero__picture { display: contents; }
.hero--center .hero__photo { position: absolute; inset: 0; }
/* the studio floor melts into the page colour (eased, so there is no visible edge) */
.hero--center .hero__media::after {
	content: ""; position: absolute; inset: auto 0 0; height: 26%; pointer-events: none;
	background: linear-gradient(to bottom,
		rgba(var(--c-hero-veil), 0) 0%,
		rgba(var(--c-hero-veil), .08) 30%,
		rgba(var(--c-hero-veil), .3) 56%,
		rgba(var(--c-hero-veil), .66) 78%,
		rgba(var(--c-hero-veil), .92) 92%,
		rgb(var(--c-hero-veil)) 100%);
}
.hero__logo {
	position: absolute; z-index: 1; margin: 0;
	left: calc(var(--photo-x, 0px) + var(--photo-w, 0px) * var(--focus-x) / 100);
	top: calc(var(--photo-y, 0px) + var(--photo-h, 0px) * var(--focus-y) / 100);
	width: calc(var(--photo-w, 0px) * var(--logo-size) / 100);
	aspect-ratio: 867 / 862;
	transform: translate(-50%, -50%);
	opacity: 0; transition: opacity .4s var(--ease);
}
.hero.is-placed .hero__logo { opacity: 1; }
.hero__logo-mark {
	display: block; width: 100%; height: 100%; background-color: var(--c-mark);
	-webkit-mask: url("../../assets/img/logo.svg") center / contain no-repeat;
	mask: url("../../assets/img/logo.svg") center / contain no-repeat;
}
.hero--center .hero__text { padding: clamp(24px, 3vw, 36px) var(--gutter) clamp(40px, 5vw, 64px); gap: 10px; }
.hero--center .hero__lead { margin-top: 2px; }

/* ---------- side: one dancer on the left, the name on the right ---------- */

.hero--side {
	display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center;
	/* the box never gets wider than 2.3:1, so a dancer ~70% of the photo height always fits */
	min-height: max(clamp(560px, 82vh, 820px), calc(100vw / 2.3));
	background: var(--c-studio);
}
.hero--side.hero--under-header { min-height: max(clamp(640px, 92vh, 920px), calc(100vw / 2.3)); }
.hero--side .hero__media { display: contents; }
.hero--side .hero__photo { position: absolute; inset: 0; }
.hero--side::after {
	content: ""; position: absolute; inset: 0; pointer-events: none;
	background: linear-gradient(90deg,
		rgba(var(--c-hero-veil), 0) 38%,
		rgba(var(--c-hero-veil), .78) 62%,
		rgba(var(--c-hero-veil), .9) 100%);
}
.hero--side .hero__text {
	position: relative; z-index: 1; grid-column: 2;
	padding: calc(56px + var(--header-h)) var(--gutter) 56px;
}

/* 6. large and ultra-wide */
@media (min-width: 1600px) {
	.hero--side { --subject-at-x: 27; }
}

/* 5. laptops — base values */

/* 4. tablets landscape / small laptops */
@media (max-width: 1199px) and (min-width: 821px) {
	.hero--side { --subject-at-x: 24; grid-template-columns: minmax(0, 1fr) minmax(0, .9fr); }
	.hero__lead { font-size: 20px; }
}

/* 3. phones in landscape: compact type */
@media (max-height: 520px) and (orientation: landscape) {
	.hero--under-header { --header-h: 56px; }
	.hero--side, .hero--side.hero--under-header { min-height: 100svh; --subject-at-x: 24; --subject-at-y: 54; }
	.hero--side .hero__text { gap: 6px; padding-block: calc(12px + var(--header-h)) 16px; }
	.hero--center .hero__media { min-height: 300px; }
	.hero--center .hero__text { gap: 6px; padding-block: 16px 28px; }
	.hero__eyebrow { font-size: 11px; letter-spacing: .2em; margin-right: -.2em; }
	.hero__title { font-size: clamp(44px, 17svh, 76px); margin-block: 0; }
	.hero__lead { font-size: 16px; margin-top: 0; }
	.hero__links { margin-top: 0; gap: 0 24px; }
}

/* 1–2. portrait phones and tablets: photo box on top, text below */
@media (max-width: 820px) and (orientation: portrait), (max-width: 560px) {
	.hero--side, .hero--side.hero--under-header {
		--subject-at-x: 50; --subject-at-y: 56;
		grid-template-columns: 1fr; min-height: 0; background: var(--c-paper);
	}
	.hero--side .hero__photo { position: static; aspect-ratio: 5 / 4; }
	.hero--side::after { display: none; }
	.hero--side .hero__text { grid-column: 1; padding: 28px var(--gutter) 40px; }

	.hero--center { --subject-at-y: 50; }
	.hero--center .hero__text { padding: 24px var(--gutter) 40px; }
}

/* 1. phones, portrait: tall box so the people are big */
@media (max-width: 560px) {
	.hero--side .hero__photo { aspect-ratio: 4 / 5; max-height: 72svh; }
	.hero__title { font-size: clamp(60px, 19vw, 84px); }
	.hero__lead { font-size: 19px; }
}
