/*--------------------------------------------------
Hero type specimen (index.html #hero.ht-hero). Script: js/hero-type.js

Modeled on the andreshunger.com hero, played in reverse with the scroll:
at the top the composition is finished (headline on the baseline, the logo
with the guides of its construction drawing); scrolling down takes it apart
and bends the baseline into a Bezier curve with its anchors, handles and
coordinates. Scrolling up rebuilds it. The JS measures the stage and places
everything in px through the custom properties below; this file only holds
the look.
---------------------------------------------------*/

#hero.ht-hero {
	--ht-accent: #FFD400;                      /* same as data-primary-color */
	--ht-text: #fff;
	--ht-line: rgba(255, 255, 255, 0.9);
	--ht-guide: rgba(255, 255, 255, 0.34);
	--ht-faint: rgba(255, 255, 255, 0.16);
	--ht-label: rgba(255, 255, 255, 0.62);
	--ht-label-font: 'Geologica', sans-serif;
	position: relative;
	width: 100%;
	height: calc(var(--ht-vh, 100vh) + var(--ht-pin, 0px));
	z-index: 0;
}

/* The stage is one screen tall. While the hero is pinned, the JS moves it
   with the smooth scrollbar; with native scrolling (phones) it is sticky. */
#hero.ht-hero #hero-styles.ht-stage {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: var(--ht-vh, 100vh);
	overflow: hidden;
	will-change: transform;
}

#hero.ht-hero.ht-sticky #hero-styles.ht-stage {
	position: sticky;
	position: -webkit-sticky;
}

.ht-svg,
.ht-fx {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
	overflow: visible;
}

.ht-fx {
	z-index: 3;
}

/* The pixel trail behind the cursor (fine pointers), under everything else */
.ht-px {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
}

/* Lines, guides and points */
.ht-svg line,
.ht-svg path,
.ht-svg rect,
.ht-svg circle {
	vector-effect: non-scaling-stroke;
}

.ht-svg .ht-rule      { stroke: var(--ht-faint); stroke-width: 1; }
.ht-svg .ht-guide     { stroke: var(--ht-guide); stroke-width: 1; fill: none; }
.ht-svg .ht-ring,
.ht-svg .ht-diag      { stroke: var(--ht-faint); }
.ht-svg .ht-axis      { stroke: var(--ht-faint); stroke-dasharray: 3 5; }

/* Crosshair and plus (inverted against what's under them, like the reference) */
.ht-svg .ht-crosshair { mix-blend-mode: difference; }
.ht-svg .ht-cross     { stroke: #d3d3d3; stroke-opacity: 0.14; stroke-width: 1; }
.ht-svg .ht-plus      { stroke: #fff; stroke-width: 1; }
.ht-svg .ht-crosshair.is-link { mix-blend-mode: normal; }
.ht-svg .ht-crosshair.is-link .ht-cross { stroke: var(--ht-accent); stroke-opacity: 0.5; }
.ht-svg .ht-crosshair.is-link .ht-plus  { stroke: var(--ht-accent); }
.ht-svg .ht-main      { stroke: var(--ht-line); stroke-width: 1.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.ht-svg .ht-handle    { stroke: rgba(255, 255, 255, 0.5); stroke-width: 1; }
.ht-svg .ht-knob      { fill: #1D31FF; stroke: rgba(255, 255, 255, 0.85); stroke-width: 1.2; }
.ht-svg .ht-anchor    { fill: var(--ht-accent); }
.ht-svg .ht-glyph-fill { fill: var(--ht-text); }
.ht-svg .ht-glyph-line { fill: none; stroke: rgba(255, 255, 255, 0.85); stroke-width: 1.2; stroke-linejoin: round; }
.ht-svg .ht-gpoint    { fill: var(--ht-accent); }
.ht-svg .ht-ghandle   { stroke: rgba(255, 255, 255, 0.9); stroke-width: 1; }   /* drawn at 60% opacity */
.ht-svg .ht-gknob     { fill: #1D31FF; stroke: #fff; stroke-width: 1; }

.ht-svg text {
	font-family: var(--ht-label-font);
	font-variant-numeric: tabular-nums;
	font-size: 12px;
	letter-spacing: 0.04em;
	fill: var(--ht-label);
}

.ht-svg .ht-num {
	font-size: 12px;
	fill: rgba(255, 255, 255, 0.78);
}

.ht-svg .ht-coord {
	fill: rgba(255, 255, 255, 0.82);
}

/* Copy */
.ht-copy {
	position: absolute;
	inset: 0;
	z-index: 2;
	pointer-events: none;
}

.ht-meta {
	position: absolute;
	left: var(--ht-meta-x, 80px);
	top: var(--ht-meta-y, 50%);
	display: flex;
	gap: 28px;
	margin: 0;
	font-family: var(--ht-label-font);
	font-variant-numeric: tabular-nums;
	font-size: 12px;
	line-height: 16px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--ht-label);
	white-space: nowrap;
}

.ht-meta span {
	display: inline-block;
}

.ht-meta span::before {
	content: "[ ";
}

.ht-meta span::after {
	content: " ]";
}

.ht-title {
	position: absolute;
	left: var(--ht-title-x, 80px);
	top: var(--ht-title-y, 40%);
	margin: 0;
	padding: 0;
	font-size: var(--ht-title-size, 120px);
	font-weight: 600;
	line-height: 1;
	letter-spacing: -0.03em;
	color: var(--ht-text);
	white-space: nowrap;
}

/* The letters sit on the baseline and drop below it, out of this mask */
.ht-title-mask {
	display: block;
	overflow: hidden;
	height: var(--ht-mask-h, 1em);
	padding-top: var(--ht-mask-pad, 0.15em);
	box-sizing: border-box;
}

.ht-title-text {
	display: block;
	line-height: 1;
}

.ht-word,
.ht-ch {
	display: inline-block;
}

.ht-ch {
	will-change: transform;
}

/* "Design with Purpose" over the curve: one mask per line (the JS splits it
   on narrow screens), lines a little closer than the masks are tall */
.ht-title-alt .ht-title-mask + .ht-title-mask {
	margin-top: -0.2em;
}

.ht-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.ht-sub {
	position: absolute;
	left: var(--ht-sub-x, 80px);
	top: var(--ht-sub-y, 70%);
	max-width: var(--ht-sub-w, 520px);
	margin: 0;
	font-size: var(--ht-sub-size, 20px);
	line-height: 1.3;
	color: var(--ht-text);
}

.ht-sub-line {
	display: block;
	overflow: hidden;
	padding-bottom: 0.08em;
}

.ht-sub-line > span {
	display: inline-block;
	will-change: transform;
}

.ht-sub-accent {
	color: var(--ht-accent);
	font-style: italic;
	pointer-events: auto;
}

/* The template's hero footer stays on the stage, above the drawing */
.ht-hero #hero-footer {
	z-index: 4;
}

/* Where the scroll thread starts: the end of the curve once the pin ends */
.ht-origin {
	position: absolute;
	left: var(--ht-origin-x, 50%);
	top: var(--ht-origin-y, 100%);
	width: 1px;
	height: 1px;
	pointer-events: none;
}

/* No JS yet (or it failed): a plain, readable hero */
.ht-hero:not(.ht-ready) .ht-title {
	left: 50%;
	top: 38%;
	transform: translate(-50%, -50%);
	font-size: clamp(64px, 14vw, 220px);
}

.ht-hero:not(.ht-ready) .ht-sub {
	left: 50%;
	top: 62%;
	transform: translateX(-50%);
	text-align: center;
	width: calc(100% - 48px);
	font-size: 20px;
}

.ht-hero:not(.ht-ready) .ht-meta,
.ht-hero:not(.ht-ready) .ht-title-alt {
	display: none;
}

/* JS is on but the hero is not set up yet (e.g. right after clicking Index
   in the menu, while the new page swaps in): show nothing rather than the
   plain fallback headline. The composition builds itself once it's ready. */
.js .ht-hero:not(.ht-ready) .ht-copy {
	visibility: hidden;
}

@media only screen and (max-width: 767px) {
	.ht-meta {
		gap: 18px;
		font-size: 10px;
	}

	.ht-svg text {
		font-size: 10px;
	}

	.ht-svg .ht-num {
		font-size: 10px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ht-ch,
	.ht-sub-line > span {
		transform: none !important;
	}
}

/* Marker for the template's "We're reynald ..." sentence (js/common.js, New Hero
   Title): its scroll effects start from the screen right before the sentence,
   the last screen of the hero, moved down past any rows added in between
   (--ht-caption-shift, measured by js/hero-type.js; 0 when there are none) */
#hero #hero-caption.ht-caption-marker {
	position: absolute;
	left: 0;
	top: calc(var(--ht-pin, 0px) + var(--ht-caption-shift, 0px));
	width: 100%;
	height: var(--ht-vh, 100vh);
	padding: 0;
	visibility: hidden;
	pointer-events: none;
}

/* The thread starts on the curve's last anchor, which already marks the
   spot: its own start dot would float up the screen during the pin */
body:has(#hero.ht-hero) .thread-origin {
	opacity: 0;
}

/* "We're reynald ...": the word now sits in the sentence from the start (no
   Flip from the hero), so it grows from its left edge and stays on screen */
body:has(#hero.ht-hero) .hero-title-placeholder span {
	transform-origin: left top;
}
