/**
 * AWR homepage intro + hero. Builds on brand.css (tokens + .awr-lockup).
 *
 * Intro modes are set on <html> before first paint (see functions.php):
 *   .awr-intro--full   intro plays (hero-intro.js drives it)
 *   .awr-intro--short  repeat visit: quick CSS-only hero reveal
 *   .awr-intro--none   reduced motion: everything visible immediately
 * No class (JS disabled): intro hidden, hero visible.
 *
 * Full sequence: the lockup assembles on a white screen, moves onto the header
 * logo (top-left), then the white wipes upward to reveal the dark hero.
 */

:root {
	--awr-intro-bg: var(--awr-white);
}

/* ===========================================================
   Intro overlay
   =========================================================== */
.awr-intro {
	display: none;
}

.awr-intro--full .awr-intro {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	background: var(--awr-intro-bg);
	contain: strict;
	cursor: default;
}

/* The overlay is the first child of .wp-site-blocks; keep the header from picking up a block gap. */
.awr-intro + .wp-block-template-part {
	margin-block-start: 0;
}

/* Intro size of the shared lockup. Same proportions as the header lockup, so the
   hand-off to the header is a uniform scale. Hidden until hero-intro.js has set
   the starting pose (.awr-intro--playing). */
.awr-intro .awr-lockup {
	--awr-lockup-size: clamp(44px, 12.5vw, 128px);
	--awr-logo-ink: var(--awr-slate);
	visibility: hidden;
	transform-origin: 0 0;
	will-change: transform, opacity;
}

.awr-intro--playing .awr-intro .awr-lockup {
	visibility: visible;
}

.awr-intro__mark {
	will-change: transform;
}

.awr-intro__wordmark {
	opacity: 0;
}

/* Temporary outline used to "draw" the A. Created and removed by JS. */
.awr-intro__outline,
.awr-intro__outline * {
	fill: none !important;
	stroke-linejoin: round;
}

/* Development placeholder marker. Disappears once the real SVG is in place. */
.awr-intro__mark[data-placeholder]::after {
	content: "DEV PLACEHOLDER LOGO";
	position: absolute;
	bottom: 100%;
	left: 50%;
	margin-bottom: 0.75rem;
	transform: translateX(-50%);
	padding: 0.2em 0.5em;
	border: 1px dashed currentColor;
	font: 600 10px/1.4 monospace;
	letter-spacing: 0.08em;
	white-space: nowrap;
	color: #b26b00;
}

/* Key or pointer press before hero-intro.js has taken over (flag set by the
   <head> script): drop the overlay at once so focus is never hidden behind it. */
.awr-intro--skip:not(.awr-intro--running) .awr-intro {
	display: none;
}

/* Failsafe: if hero-intro.js never takes control, clear the intro after ~5s.
   The hero itself is never hidden; the overlay just covers it. */
.awr-intro--full:not(.awr-intro--running) .awr-intro {
	animation: awr-failsafe-out 0.4s ease 5s forwards;
}

@keyframes awr-failsafe-out {

	to {
		opacity: 0;
		visibility: hidden;
	}
}

/* ===========================================================
   Hero
   =========================================================== */
.awr-hero-wrap {
	margin-block: 0;
}

/* Remove the gap between the hero and the page content that follows it. */
.awr-hero-wrap + .wp-block-post-content {
	margin-block-start: 0;
}

/* While the old stock hero is still in the page content, stop Extendable
   pulling it up under the header; only the AWR hero should overlap. */
body:has(.ext-header-overlay) .awr-hero-wrap ~ .entry-content > .ext-hero-section.ext-hero-section--full-screen:first-child {
	margin-top: 0 !important;
}

.awr-hero {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-height: 100vh;
	min-height: 100svh;
	margin-block: 0;
	padding-top: calc(var(--ext-header-height, 96px) + clamp(2rem, 6vh, 4rem));
	padding-bottom: clamp(3rem, 10vh, 6rem);
	background:
		radial-gradient(120% 80% at 85% 20%, rgb(1 120 255 / 0.10) 0%, rgb(1 120 255 / 0) 60%),
		var(--awr-slate);
	color: var(--awr-white);
}

.awr-hero > .awr-hero__bg {
	position: absolute;
	inset: 0;
	z-index: -1;
	max-width: none;
	margin: 0;
	opacity: 0;
	pointer-events: none;
	transition: opacity 1.2s ease;
}

.awr-hero__bg.is-active {
	opacity: 1;
}

/* Text column. On desktop its children are limited to ~52% of the wide
   container; hero-system.js measures them and draws the visual in the free
   space to the right (>= 1024px) or below them (narrower screens).
   Sizes use container units (cqi) of this element, so the headline wraps the
   same way at any desktop width. */
.awr-hero__content {
	--awr-hero-col: 100cqi;
	position: relative;
	width: 100%;
	container-type: inline-size;
}

.awr-hero__content > * {
	max-width: var(--awr-hero-col);
}

/* Desktop: 52% of the wide container from ~1280px; between 1024px and 1280px
   the column widens smoothly to ~58% so the headline keeps growing with the
   viewport (and stays clearly above the section headings) instead of shrinking. */
@media (min-width: 1024px) {

	.awr-hero__content {
		--awr-hero-col: max(52cqi, min(58cqi, calc(557px + (100cqi - 960px) * 0.293)));
	}
}

.awr-hero .awr-hero__title {
	margin: 0;
	/* Stacked layout (< 1024px): at most 3rem, and limited by screen height so
	   landscape phones keep the CTA on the first screen. */
	font-size: clamp(2rem, min(calc(var(--awr-hero-col) * 0.088), 11svh), 3rem);
	font-weight: 600;
	line-height: 1.08;
	letter-spacing: -0.02em;
	color: var(--awr-white);
	text-wrap: balance;
	/* Never split a word (Extendable sets hyphens: auto on headings). */
	hyphens: manual;
	-webkit-hyphens: manual;
}

/* Desktop: ~3 lines in the text column; scales with the column. */
@media (min-width: 1024px) {

	.awr-hero .awr-hero__title {
		font-size: clamp(2rem, calc(var(--awr-hero-col) * 0.088), 4rem);
	}
}

.awr-hero .awr-hero__lede {
	max-width: min(var(--awr-hero-col), 34rem);
	margin: clamp(1.25rem, 2.2vw, 1.75rem) 0 0;
	font-size: clamp(1.0625rem, 1.3vw, 1.1875rem);
	line-height: 1.6;
	color: color-mix(in srgb, var(--awr-light-gray) 88%, var(--awr-slate));
	text-wrap: pretty;
}

.awr-hero .awr-hero__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem 1.75rem;
	margin: clamp(2rem, 3.5vw, 2.75rem) 0 0;
}

.awr-hero .awr-btn .wp-block-button__link {
	display: inline-block;
	text-decoration: none;
	transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, text-decoration-color 0.2s ease;
}

/* Primary: the dominant action. 19px bold = WCAG "large text", so white on
   the exact brand blue (4.09:1) passes AA. */
.awr-hero .awr-btn--primary .wp-block-button__link {
	padding: 0.85em 1.6em;
	border: 1px solid var(--awr-blue);
	border-radius: 4px;
	background: var(--awr-blue);
	color: var(--awr-white);
	font-size: 1.1875rem;
	font-weight: 700;
	line-height: 1.2;
}

.awr-hero .awr-btn--primary .wp-block-button__link:hover,
.awr-hero .awr-btn--primary .wp-block-button__link:focus-visible {
	border-color: color-mix(in srgb, var(--awr-blue) 85%, #000);
	background: color-mix(in srgb, var(--awr-blue) 85%, #000);
}

/* Secondary: an understated text link with an arrow, so it never competes
   with the primary button. Vertical padding keeps a comfortable tap target. */
.awr-hero .awr-btn--link .wp-block-button__link {
	padding: 0.75em 0;
	border: 0;
	border-radius: 0;
	background: none;
	color: var(--awr-light-gray);
	font-size: 1.0625rem;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-decoration-color: rgb(224 223 226 / 0.5);
	text-underline-offset: 0.4em;
}

.awr-hero .awr-btn--link .wp-block-button__link::after {
	content: "→";
	content: "→" / "";
	display: inline-block;
	margin-left: 0.5em;
	text-decoration: none;
	transition: transform 0.2s ease;
}

.awr-hero .awr-btn--link .wp-block-button__link:hover,
.awr-hero .awr-btn--link .wp-block-button__link:focus-visible {
	color: var(--awr-white);
	text-decoration-color: var(--awr-white);
}

.awr-hero .awr-btn--link .wp-block-button__link:hover::after {
	transform: translateX(3px);
}

.awr-hero .awr-btn .wp-block-button__link:focus-visible {
	outline: 2px solid var(--awr-white);
	outline-offset: 3px;
}

/* Below 1024px the visual sits under the text, so the text starts at the top.
   The room reserved under the CTAs belongs to hero-system.css. */
@media (max-width: 1023.98px) {

	.awr-hero {
		justify-content: flex-start;
	}
}

@media (max-width: 767px) {

	.awr-hero {
		padding-top: calc(var(--ext-header-height, 80px) + 2.5rem);
	}
}

/* Very narrow phones: a slightly smaller headline keeps "business decisions."
   together (4 lines instead of 5 with two single-word lines). */
@media (max-width: 359px) {

	.awr-hero .awr-hero__title {
		font-size: 1.7rem;
	}
}

/* Short landscape screens (phones on their side): tighten the vertical rhythm
   so "Talk to AWR" reaches the first screen. */
@media (max-height: 500px) and (orientation: landscape) {

	.awr-hero {
		padding-top: calc(var(--ext-header-height, 64px) + 1rem);
	}

	.awr-hero .awr-hero__lede {
		margin-top: 0.75rem;
		line-height: 1.45;
	}

	.awr-hero .awr-hero__actions {
		margin-top: 1rem;
	}
}

/* ===========================================================
   Repeat visit: short reveal (CSS only, ~0.5s)
   =========================================================== */
.awr-intro--short .awr-hero__content > * {
	animation: awr-hero-rise 0.4s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.awr-intro--short .awr-hero__content > :nth-child(2) {
	animation-delay: 0.05s;
}

.awr-intro--short .awr-hero__content > :nth-child(3) {
	animation-delay: 0.1s;
}

/* Transform only: the headline (LCP element) is never at opacity 0. */
@keyframes awr-hero-rise {

	from {
		transform: translateY(8px);
	}
}

/* ===========================================================
   Reduced motion
   =========================================================== */
.awr-intro--none .awr-hero__bg {
	opacity: 1;
	transition: none;
}

/* No prefers-reduced-motion override: the intro plays for every visitor
   (owner's decision, 2026-10-15; see awr_print_intro_mode_script()). */
