/* ==========================================================================
   SUPERSEDED (18 Nov 2026, Codey): the home hero is now built from native
   Divi 5 modules (Heading/Text/Divider/Button/Image) under a new preset
   family "Hero: founder-led", saved as the Divi Library item of the same
   name — see Build Control, "Rebuild the home hero in native Divi modules"
   and the Website Factory spec's Hero component section. The Code-module
   hero this file styles is disabled (not deleted) on the live page, kept
   only as a fallback until John signs off, after which this file and the
   matching Customizer "--bbi-hero-image" binding should be deleted. Do not
   build new work against these classes.
   ========================================================================== */

/* ==========================================================================
   BBI - Editorial Cut hero (Direction B)
   Reusable layer. Contains no page copy. Phone portrait band + its own
   entrance added by the Phone hero task (18 Nov 2026) — sections 11-12,
   phone only (<=767px); desktop and tablet are untouched.

   Required hooks (supplied by Divi):
     .bbi-hero.bbi-hero--editorial   section
     .bbi-hero__media                full-bleed background media layer
     .bbi-hero__mask                 near-black polygonal mask
     .bbi-hero__keyline              2px orange diagonal
     .bbi-hero__content              copy wrapper
     [data-bbi-reveal]               motion children (+ --bbi-reveal-index)
     .bbi-hero__phone-portrait       phone-only portrait band (section 11)
     .bbi-hero__phone-portrait-image the <img> inside it

   Required custom property, set on the section:
     --bbi-hero-image: url("<uploads>/john_hockaday.png");
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */

:root {
	--bbi-black: #050505;
	--bbi-white: #f5f4f1;
	--bbi-muted: #c5c3bf;
	--bbi-orange: #ff5a00;

	--bbi-font: "Overpass", "Overpass Variable", -apple-system, BlinkMacSystemFont,
		"Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

	/* Composition */
	--bbi-hero-header-zone: 106px;
	--bbi-hero-inset: 76px;
	--bbi-hero-measure: 540px;

	/* Diagonal: top % / bottom % of the viewport width */
	--bbi-diagonal-top: 58%;
	--bbi-diagonal-bottom: 47%;
	--bbi-keyline-width: 2px;
}

/* --------------------------------------------------------------------------
   2. Section shell
   -------------------------------------------------------------------------- */

.bbi-hero--editorial {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	min-height: 900px;
	display: flex;
	align-items: center;
	background: var(--bbi-black);
	color: var(--bbi-white);
	font-family: var(--bbi-font);
}

/* Divi's dynamic/critical CSS sets `.et_pb_section { padding: 54px 0 }` with
   equal (0,1,0) specificity and, on the live site, loads after this
   stylesheet — so it wins the cascade and collapses the 106px header zone
   to 54px (Build Control, 23 October 2026, raised against the shared Global
   Header build). The doubled class raises this rule to (0,2,0), which
   reliably outranks Divi's single-class rule regardless of load order — the
   same technique used below for `position`. */
.bbi-hero.bbi-hero--editorial {
	padding-block: var(--bbi-hero-header-zone) 72px;
}

/* 0.4.2 wired up a REAL Global Header above the hero on every template —
   Divi marks this with `body.et-tb-has-header`. That header already
   occupies --bbi-hero-header-zone in normal flow, so the rule above
   reserved it a second time: eyebrow/H1/CTA all landed a full header-height
   lower than the approved composition, and on mobile the CTA was pushed
   further below the fold (Build Control, 24 October 2026, STOPPED at D2).
   When a real header is present, drop the hero's own top-padding copy of
   the zone; min-height is deliberately left alone (`min-height` here binds
   the flex CONTENT box, not the padded section — this is content-box, not
   border-box — so padding is never "inside" it) and that's exactly why
   removing 106px/88px of top padding alone restores the original combined
   header + hero height, with no further change needed. Scoping to
   body.et-tb-has-header keeps the hero's own component fixture (no header
   present) on the original rule above. Higher specificity than the
   doubled-class rule, so it always wins when present, regardless of source
   order. */
body.et-tb-has-header .bbi-hero.bbi-hero--editorial {
	padding-block: 0 72px;
}

/* Divi wraps modules in .et_pb_row / .et_pb_column; neutralise their max-widths and
   gutters so the media layer genuinely reaches every hero edge and the content
   percentages below resolve against the viewport. */
.bbi-hero--editorial .et_pb_row,
.bbi-hero--editorial .et_pb_column {
	width: 100%;
	max-width: none;
	padding: 0;
	margin: 0;
}

/* Divi sets position: relative on .et_pb_row, .et_pb_column, .et_pb_module and
   .et_pb_code_inner, which makes each one the containing block for the absolute
   layers below and pulls them off the hero edges. Return every wrapper to static
   so .bbi-hero--editorial is the nearest positioned ancestor. The doubled class
   outranks Divi's `.et_pb_row .et_pb_module` regardless of load order. */
.bbi-hero.bbi-hero--editorial .et_pb_row,
.bbi-hero.bbi-hero--editorial .et_pb_column,
.bbi-hero.bbi-hero--editorial .et_pb_module,
.bbi-hero.bbi-hero--editorial .et_pb_code_inner {
	position: static;
}

/* --------------------------------------------------------------------------
   3. Background layers
   -------------------------------------------------------------------------- */

.bbi-hero__media {
	position: absolute;
	inset: 0;
	z-index: -3;
	background: var(--bbi-hero-image, none) 72% 38% / cover no-repeat;
	background-color: var(--bbi-black);
}

.bbi-hero__mask {
	position: absolute;
	inset: 0;
	z-index: -2;
	background: rgba(5, 5, 5, 0.985);
	clip-path: polygon(
		0 0,
		var(--bbi-diagonal-top) 0,
		var(--bbi-diagonal-bottom) 100%,
		0 100%
	);
}

.bbi-hero__keyline {
	position: absolute;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	background: var(--bbi-orange);
	clip-path: polygon(
		var(--bbi-diagonal-top) 0,
		calc(var(--bbi-diagonal-top) + var(--bbi-keyline-width)) 0,
		calc(var(--bbi-diagonal-bottom) + var(--bbi-keyline-width)) 100%,
		var(--bbi-diagonal-bottom) 100%
	);
}

/* --------------------------------------------------------------------------
   4. Content wrapper - copy must not cross the diagonal
   -------------------------------------------------------------------------- */

/* The measure is capped at 540px AND held clear of the narrowest point of the
   diagonal (its bottom vertex) plus a 24px gap, so the copy can never cross the
   mask edge at any desktop width. At >= 1361px the 540px cap is what binds. */
.bbi-hero__content {
	position: relative;
	box-sizing: border-box;
	width: min(
		var(--bbi-hero-measure),
		calc(var(--bbi-diagonal-bottom) - var(--bbi-hero-inset) - 24px),
		calc(100% - 144px)
	);
	margin-left: var(--bbi-hero-inset);
}

/* --------------------------------------------------------------------------
   5. Typography (desktop reference: 1440 x 900)
   -------------------------------------------------------------------------- */

.bbi-hero__eyebrow {
	margin: 0 0 22px;
	font-size: 12px;
	line-height: 1.4;
	font-weight: 700;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--bbi-orange);
}

/* 51px/55px at the 1440 reference and above. Below 1440 the size tracks the
   shrinking measure so the four controlled lines never re-wrap.

   font-family is explicit here, not left to inherit from
   .bbi-hero--editorial's Overpass token, for the reason Build Control (5/7
   Nov) found when this rule had no font-family of its own: something more
   specific than plain inheritance (most likely Divi's own heading rule)
   wins the cascade on the live site, and the headline fell back to the
   browser's unloaded-serif default rather than the chosen font. Naming the
   Overpass token directly here removes that contest.

   This rule carried a deliberate "Noto Serif", Georgia, "Times New Roman",
   Times, serif stack from 8 Nov ("the serif headline John likes", Build
   Control 5/7/8 Nov) until John reversed that decision on 14 Nov: "I like
   the without serif. Nothing else is serif. Everything's all clean and
   decent." The doubled class matches this file's own convention (section 2)
   for outranking Divi's dynamic CSS regardless of load order. */
.bbi-hero.bbi-hero--editorial .bbi-hero__headline {
	margin: 0;
	font-size: clamp(38px, 3.55vw, 51px);
	line-height: 1.078;
	font-family: var(--bbi-font);
	font-weight: 800;
	letter-spacing: -0.01em;
	color: var(--bbi-white);
}

/* Composition-only line breaks. These spans carry the text itself, so nothing is
   duplicated for assistive technology. */
.bbi-hero__headline .bbi-hero__line {
	display: block;
}

/* Editorial rule between headline and body (reference artwork). Decorative only,
   so it needs no extra Divi hook. */
.bbi-hero__headline::after {
	content: "";
	display: block;
	width: 100%;
	height: 2px;
	margin-top: 44px;
	background: var(--bbi-orange);
}

.bbi-hero__body {
	margin: 38px 0 0;
	font-size: 17px;
	line-height: 1.45;
	font-weight: 400;
	color: var(--bbi-muted);
}

.bbi-hero__body p {
	margin: 0 0 18px;
}

.bbi-hero__body p:last-child {
	margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   6. CTA - text link with orange underline and arrow, never a filled button
   -------------------------------------------------------------------------- */

.bbi-hero__cta {
	display: inline-flex;
	align-items: center;
	gap: 44px;
	margin-top: 34px;
	padding-bottom: 12px;
	border-bottom: 2px solid var(--bbi-orange);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--bbi-white);
	background: none;
	transition: color 160ms ease, border-color 160ms ease;
}

.bbi-hero__cta:hover,
.bbi-hero__cta:focus-visible {
	color: var(--bbi-orange);
}

.bbi-hero__cta:focus-visible {
	outline: 2px solid var(--bbi-orange);
	outline-offset: 6px;
}

.bbi-hero__cta-arrow {
	color: var(--bbi-orange);
	font-size: 16px;
	line-height: 1;
	transition: transform 160ms ease;
}

.bbi-hero__cta:hover .bbi-hero__cta-arrow {
	transform: translateY(3px);
}

/* --------------------------------------------------------------------------
   7. Narrow desktop / large tablet (990-1100px)
   Diagonal steps right; headline steps down. Text and face stay separate.
   -------------------------------------------------------------------------- */

@media (min-width: 990px) and (max-width: 1100px) {
	.bbi-hero--editorial {
		--bbi-diagonal-top: 62%;
		--bbi-diagonal-bottom: 52%;
		--bbi-hero-inset: 48px;
	}

	.bbi-hero__mask {
		clip-path: polygon(0 0, 62% 0, 52% 100%, 0 100%);
	}

	.bbi-hero__headline {
		font-size: clamp(38px, 4.1vw, 46px);
		line-height: 1.09;
	}

	.bbi-hero__content {
		width: min(
			var(--bbi-hero-measure),
			calc(var(--bbi-diagonal-bottom) - var(--bbi-hero-inset) - 24px),
			calc(100% - 96px)
		);
		margin-left: var(--bbi-hero-inset);
	}
}

/* --------------------------------------------------------------------------
   8. Tablet and mobile (<= 989px)
   The diagonal is replaced by a top-to-bottom mask before text can meet the face.
   -------------------------------------------------------------------------- */

@media (max-width: 989px) {
	/* Set at :root, not scoped to .bbi-hero--editorial: assets/css/bbi-header.css
	   reads this same token to size the shared Global Header, and the header
	   lives outside the hero element, so the override must be visible beyond
	   the hero's own subtree. The 106px header zone is the desktop figure;
	   the mobile header is shorter, and reclaiming the difference keeps the
	   CTA inside the first viewport at 360x800 as well as 390x844. */
	:root {
		--bbi-hero-header-zone: 88px;
	}

	.bbi-hero--editorial {
		min-height: 100svh;
		align-items: flex-start;
	}

	/* See the doubled-class note in section 2 — same cascade-order hazard,
	   same fix, at this breakpoint's padding value. */
	.bbi-hero.bbi-hero--editorial {
		padding-block: var(--bbi-hero-header-zone) 48px;
	}

	/* Same real-header fix as section 2, at this breakpoint's values. Content
	   is flex-start here, not centred, so without this the whole block —
	   eyebrow through CTA — simply sits --bbi-hero-header-zone (88px) lower,
	   which is exactly what Build Control measured on 24 October 2026 (CTA
	   390/360: 884px -> 972px). min-height is left as 100svh on purpose (see
	   the content-box note in section 2): dropping the padding alone already
	   gives back the 88px the header now owns, which is what keeps the CTA
	   inside the first viewport, same as the header-less design. */
	body.et-tb-has-header .bbi-hero.bbi-hero--editorial {
		padding-block: 0 48px;
	}

	.bbi-hero__media {
		background-position: 64% 38%;
	}

	.bbi-hero__mask {
		background: linear-gradient(
			180deg,
			#050505 0 54%,
			rgba(5, 5, 5, 0.92) 68%,
			rgba(5, 5, 5, 0.25) 100%
		);
		clip-path: none;
	}

	.bbi-hero__keyline {
		display: none;
	}

	.bbi-hero__content {
		width: auto;
		margin: 0;
		padding-inline: clamp(24px, 5vw, 48px);
	}

	.bbi-hero__headline {
		font-size: clamp(38px, 11vw, 52px);
		line-height: 1.02;
	}

	/* Spec: mobile line breaks may differ from desktop. Releasing the desktop
	   breaks lets the headline wrap naturally instead of breaking mid-clause and
	   pushing the CTA below the fold. */
	.bbi-hero__headline .bbi-hero__line {
		display: inline;
	}

	.bbi-hero__headline::after {
		margin-top: 28px;
	}

	.bbi-hero__body {
		margin-top: 26px;
	}

	.bbi-hero__cta {
		gap: 28px;
		margin-top: 28px;
	}
}

/* Spec: 24px gutters at 360-390, 32px from 480 upward. */
@media (min-width: 480px) and (max-width: 989px) {
	.bbi-hero__content {
		padding-inline: 32px;
	}
}

/* Tablet measure cap. Without it the copy runs the full column width (704px at
   768px), which is too wide to read comfortably. 620px of text inside the 32px
   gutters; the block stays left-aligned. */
@media (min-width: 768px) and (max-width: 989px) {
	.bbi-hero__content {
		max-width: calc(620px + 64px);
	}
}

/* 6/8 Nov Codey brief, hero on phone: hide the eyebrow, CTA and portrait at
   this breakpoint only — desktop and the 768-989px tablet band above are
   unaffected. The portrait is the background-image pair (.bbi-hero__media,
   the photo, and .bbi-hero__mask, its contrast overlay) — hiding
   .bbi-hero__media alone would leave the mask's gradient painting over
   nothing-but-black, which is harmless but wasted paint, so both go.
   .bbi-hero__keyline is already display:none for the whole <=989px band
   (above), so it needs no mention here. This replaces the previous
   mobile-only focal-point tweaks for the now-hidden media/mask layers
   (background-position and the linear-gradient override) — dead once their
   elements no longer render, so removed rather than left as inert rules. */
@media (max-width: 767px) {
	.bbi-hero__eyebrow,
	.bbi-hero__cta,
	.bbi-hero__media,
	.bbi-hero__mask {
		display: none;
	}

	/* Tightened vertical rhythm so the body copy clears the fold on a
	   360 x 800 phone, the narrowest device in the spec's test matrix. The
	   CTA's own rhythm rule is gone with the CTA above. */
	.bbi-hero__headline::after {
		margin-top: 24px;
	}

	.bbi-hero__body {
		margin-top: 22px;
		font-size: 18px;
	}
}

/* --------------------------------------------------------------------------
   9. Motion - enhancement only (Task 3)
   The base state is the FINAL state. Nothing below can hide content: if the JS
   never runs, data-bbi-ready is never set and none of these rules apply.
   -------------------------------------------------------------------------- */

.bbi-hero--editorial [data-bbi-reveal] {
	opacity: 1;
	transform: none;
}

.bbi-hero--editorial[data-bbi-ready="true"] [data-bbi-reveal] {
	animation: bbi-reveal 0.65s both cubic-bezier(0.22, 0.8, 0.25, 1);
	animation-delay: calc(var(--bbi-reveal-index, 0) * 100ms);
}

@keyframes bbi-reveal {
	from {
		opacity: 0;
		transform: translateY(12px);
	}
}

/* The mask sweeps left to right, uncovering the portrait. The copy is never
   exposed over the bare photograph, and the end state comes from the cascade
   above, so the 990-1100px variant animates to its own geometry. */
.bbi-hero--editorial[data-bbi-ready="true"] .bbi-hero__mask {
	animation: bbi-mask-settle 820ms both cubic-bezier(0.22, 0.8, 0.25, 1);
}

@keyframes bbi-mask-settle {
	from {
		clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
	}
}

/* The keyline brightens once as the mask settles. No loop. */
.bbi-hero--editorial[data-bbi-ready="true"] .bbi-hero__keyline {
	animation: bbi-keyline-in 1020ms both ease-out;
}

@keyframes bbi-keyline-in {
	0%,
	55% {
		opacity: 0;
	}
	78% {
		opacity: 1;
		filter: brightness(1.55);
	}
	100% {
		opacity: 1;
		filter: none;
	}
}

/* The gradient mask has no diagonal to sweep. */
@media (max-width: 989px) {
	.bbi-hero--editorial[data-bbi-ready="true"] .bbi-hero__mask {
		animation: none;
	}
}

/* --------------------------------------------------------------------------
   10. Reduced motion - final state, immediately
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	.bbi-hero--editorial,
	.bbi-hero--editorial *,
	.bbi-hero--editorial *::before,
	.bbi-hero--editorial *::after {
		animation: none !important;
		transition: none !important;
	}

	.bbi-hero--editorial [data-bbi-reveal] {
		opacity: 1 !important;
		transform: none !important;
	}
}

/* --------------------------------------------------------------------------
   11. Phone portrait band (Phone hero task, 18 Nov 2026)
   Phones only (<=767px): the portrait comes back as its own band below the
   headline, hidden at every wider breakpoint so desktop and the 768-989px
   tablet band (section 8 above) stay exactly as they are. A real <img>,
   not another background layer, because it needs its own dedicated phone
   crop (not the desktop photo shrunk down) and its own `aspect-ratio` to
   reserve the band's height before the file loads, so nothing shifts under
   it — a CSS background can't do either of those on its own.
   -------------------------------------------------------------------------- */

.bbi-hero__phone-portrait {
	display: none;
}

@media (max-width: 767px) {
	.bbi-hero__phone-portrait {
		display: block;
		position: relative;
		margin-top: 24px;
		aspect-ratio: 1000 / 625;
		overflow: hidden;
	}

	.bbi-hero__phone-portrait-image {
		display: block;
		width: 100%;
		height: 100%;
		object-fit: cover;
	}

	/* Fades the photo's own dark backdrop into the hero black so there's no
	   visible card edge — the same --bbi-black token the mask and the hero
	   section background already use. */
	.bbi-hero__phone-portrait::before {
		content: "";
		position: absolute;
		inset: 0;
		z-index: 1;
		pointer-events: none;
		background: linear-gradient(180deg, transparent 72%, var(--bbi-black) 100%),
			linear-gradient(
				90deg,
				var(--bbi-black) 0%,
				transparent 12%,
				transparent 88%,
				var(--bbi-black) 100%
			);
	}
}

/* --------------------------------------------------------------------------
   12. Phone portrait entrance + headline stagger (Phone hero task)
   One-off, first-view-only motion driven by the same data-bbi-ready flag
   bbi-hero.js already sets (section 9 above) — no JS changes needed.
   Reduced motion is covered by section 10 above's blanket
   `animation: none !important`, same as every other hero animation; with
   it, the wipe/rim-light never run (image is simply visible, clip-path
   defaults to uncropped) and the headline lines render at their default
   opacity (1), so nothing is hidden.
   -------------------------------------------------------------------------- */

@media (max-width: 767px) {
	/* Mask wipe: the image reveals left-to-right instead of simply fading in. */
	.bbi-hero--editorial[data-bbi-ready="true"] .bbi-hero__phone-portrait-image {
		animation: bbi-portrait-wipe 600ms both cubic-bezier(0.22, 0.8, 0.25, 1);
	}

	@keyframes bbi-portrait-wipe {
		from {
			clip-path: inset(0 100% 0 0);
		}
	}

	/* One orange rim-light pass once the wipe lands. */
	.bbi-hero--editorial[data-bbi-ready="true"] .bbi-hero__phone-portrait::after {
		content: "";
		position: absolute;
		inset: 0;
		z-index: 2;
		pointer-events: none;
		opacity: 0;
		animation: bbi-rim-light 500ms ease-out both;
		animation-delay: 500ms;
	}

	@keyframes bbi-rim-light {
		0%,
		100% {
			opacity: 0;
			box-shadow: inset 0 0 0 1px var(--bbi-orange);
		}
		50% {
			opacity: 1;
			box-shadow: inset 0 0 0 1px var(--bbi-orange), 0 0 28px 2px rgba(255, 90, 0, 0.45);
		}
	}

	/* Headline lines fade up in turn instead of the whole block moving as one
	   (phone only — desktop and tablet keep section 5's single data-bbi-reveal
	   block animation on the <h1>, untouched). Transform is deliberately not
	   used here: .bbi-hero__line stays display:inline at this breakpoint
	   (section 8 above, so the headline can still wrap naturally), and CSS
	   transforms don't apply to non-replaced inline boxes — only opacity,
	   which does. */
	.bbi-hero--editorial[data-bbi-ready="true"] .bbi-hero__headline {
		animation: none;
	}

	.bbi-hero--editorial[data-bbi-ready="true"] .bbi-hero__headline .bbi-hero__line {
		animation: bbi-line-fade 400ms ease-out both;
	}

	.bbi-hero__headline .bbi-hero__line:nth-child(1) {
		animation-delay: 80ms;
	}

	.bbi-hero__headline .bbi-hero__line:nth-child(2) {
		animation-delay: 170ms;
	}

	.bbi-hero__headline .bbi-hero__line:nth-child(3) {
		animation-delay: 260ms;
	}

	.bbi-hero__headline .bbi-hero__line:nth-child(4) {
		animation-delay: 350ms;
	}

	@keyframes bbi-line-fade {
		from {
			opacity: 0;
		}
	}
}
