/*
 * Header — top bar, header row, mega menu.
 * Design: TopBar / NavBurger / MegaPanel in src-v2/nav.jsx.
 *
 * Tokens and the .wrap, .eyebrow, .btn, .iconbtn, .link-arrow atoms come from
 * global.css; only header-specific layout lives here.
 */

/* ------------------------------------------------------- Admin bar ---- */

/*
 * WordPress pins its admin bar to the top of the viewport and pushes the
 * document down by the same amount: 32px, 46px below 782px, and below 600px it
 * turns absolute and scrolls away with the page. Everything sticky in the
 * header reads this one value rather than restating those breakpoints — which
 * is also what had stopped working: the mobile block came later in the file
 * than the 600px rule and silently overrode it.
 */
:root {
	--fmt-admin-bar: 0px;
}

.admin-bar {
	--fmt-admin-bar: 32px;
}

@media screen and (max-width: 782px) {
	.admin-bar {
		--fmt-admin-bar: 46px;
	}
}

@media screen and (max-width: 600px) {
	.admin-bar {
		--fmt-admin-bar: 0px;
	}
}

/* --------------------------------------------------------- Skip link ---- */

.screen-reader-text {
	border: 0;
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	white-space: nowrap;
	width: 1px;
}

.skip-link:focus {
	background: var(--paper);
	clip-path: none;
	color: var(--ink);
	height: auto;
	left: 8px;
	padding: 12px 20px;
	top: 8px;
	width: auto;
	z-index: 100;
}

/* ------------------------------------------------------------ Top bar ---- */

.fmt-topbar {
	background: var(--bg);
	border-bottom: 1px solid var(--line);
	color: var(--ink-soft);
	font-size: 12px;
}

.fmt-topbar__inner {
	align-items: center;
	display: flex;
	height: 36px;
	justify-content: space-between;
}

.fmt-topbar__left {
	align-items: center;
	display: flex;
	gap: 18px;
}

.fmt-topbar__phone {
	align-items: center;
	display: inline-flex;
	gap: 6px;
}

.fmt-topbar__phone a {
	color: var(--ink);
}

.fmt-topbar__mute,
.fmt-topbar__sep {
	color: var(--ink-mute);
}

.fmt-topbar__dot {
	align-items: center;
	display: inline-flex;
	gap: 6px;
}

.fmt-topbar__dot::before {
	background: var(--red);
	border-radius: 50%;
	content: '';
	height: 6px;
	width: 6px;
}

/*
 * .fmt-topbar__phone and .fmt-topbar__dot set display, which outranks the
 * [hidden] rule in normalize — without this the ticker cannot hide them.
 */
.fmt-topbar__item[hidden] {
	display: none;
}

/* -------------------------------------------------------- Header row ---- */

.fmt-page-header {
	/* Row height. The homepage drives it from the scroll position (Logo intro). */
	--fmt-header-h: 96px;

	background: var(--bg);
	border-bottom: 1px solid var(--line);
	position: sticky;
	top: var(--fmt-admin-bar);
	z-index: 50;
}

/* Progressive blur — only where it does not cost the solid fallback. */
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
	.fmt-page-header {
		-webkit-backdrop-filter: blur(14px) saturate(140%);
		backdrop-filter: blur(14px) saturate(140%);
		background: rgba(251, 250, 246, .92);
	}
}

.fmt-header__row {
	align-items: center;
	display: flex;
	gap: 6px;
	height: var(--fmt-header-h);
	position: relative;
}

/* 6px row gap + 12px = the 18px the design puts between burger and Baubuch. */
.fmt-burger {
	margin-right: 12px;
}

/* Everything after this is pushed to the right edge. */
.fmt-header__baubuch {
	margin-right: auto;
}

/* Burger */

.fmt-burger {
	align-items: center;
	background: var(--paper);
	border: 1px solid var(--line);
	border-radius: 8px;
	box-shadow: 0 1px 2px rgba(20, 18, 12, .04);
	color: var(--ink);
	cursor: pointer;
	display: inline-flex;
	font-family: inherit;
	font-size: 14px;
	font-weight: 500;
	gap: 12px;
	line-height: 1;
	padding: 11px 18px 11px 14px;
	position: relative;
	transition: background .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.fmt-page-header.is-open .fmt-burger {
	background: var(--ink-2);
	border-color: var(--ink-2);
	box-shadow: none;
	color: #fff;
}

.fmt-burger__bars {
	display: inline-flex;
	flex-direction: column;
	gap: 4px;
	width: 18px;
}

.fmt-burger__bars span {
	background: currentColor;
	border-radius: 2px;
	height: 2px;
	transform-origin: 50% 50%;
	transition: transform .2s ease, opacity .15s ease;
}

.fmt-page-header.is-open .fmt-burger__bars span:nth-child(1) {
	transform: translateY(6px) rotate(45deg);
}

.fmt-page-header.is-open .fmt-burger__bars span:nth-child(2) {
	opacity: 0;
}

.fmt-page-header.is-open .fmt-burger__bars span:nth-child(3) {
	transform: translateY(-6px) rotate(-45deg);
}

/* Baubuch link */

.fmt-header__baubuch {
	align-items: center;
	color: var(--ink-soft);
	display: inline-flex;
	font-size: 14px;
	font-weight: 500;
	gap: 7px;
	transition: color .18s ease;
}

.fmt-header__baubuch:hover {
	color: var(--red);
}

/* Logo — centred over the row, so the two side groups can size freely. */

.fmt-header__logo {
	left: 50%;
	position: absolute;
	transform: translateX(-50%);
}

/*
 * One grid cell, so the homepage's two logos stack on the same centre and the
 * link is always as large as the larger of them.
 */
.fmt-logo {
	display: grid;
	place-items: center;
}

.fmt-logo img {
	display: block;
	grid-area: 1 / 1;
	max-width: none;
	width: auto;
}

.fmt-logo__simple {
	height: 56px;
}

/* Only the scripted homepage header shows it; see Logo intro below. */
.fmt-logo__detail {
	display: none;
}

/* Actions */

.fmt-header__login,
.fmt-header__cta {
	flex: none;
	padding: 9px 14px;
	white-space: nowrap;
}

.fmt-header__search {
	flex: none;
}

/* Signed in: the login button becomes the member's name and opens a menu. */

.fmt-header__user {
	flex: none;
	position: relative;
}

.fmt-header__user-menu {
	background: var(--paper);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: var(--shadow-card);
	min-width: 180px;
	padding: 6px;
	position: absolute;
	right: 0;
	top: calc(100% + 8px);
	z-index: 120;
}

.fmt-header__user-link {
	border-radius: var(--radius-sm);
	color: var(--ink);
	display: block;
	font-size: 14px;
	padding: 9px 12px;
	transition: background .15s ease;
}

.fmt-header__user-link:hover {
	background: var(--bg-2);
}

/* Mobile-only overlay chrome. */
.fmt-mega__mobile-head,
.fmt-mega__mobile-foot {
	display: none;
}

/* The tab carries both affordances; each mode shows the one that fits. */
.fmt-mega__tab-arrow {
	display: inline-flex;
}

.fmt-mega__tab-chevron {
	display: none;
}

/* ---------------------------------------------------------- Mega menu ---- */

/*
 * Unscripted: the panel sits in normal flow, fully open, every category
 * visible. .fmt-js switches it to the overlay behaviour below.
 */
.fmt-mega__backdrop {
	display: none;
}

.fmt-js .fmt-mega__backdrop {
	background: rgba(20, 18, 12, .32);
	display: block;
	height: 100vh;
	left: 0;
	opacity: 0;
	pointer-events: none;
	position: absolute;
	right: 0;
	top: 100%;
	transition: opacity .22s ease;
	z-index: 1;
}

.fmt-page-header.is-open .fmt-mega__backdrop {
	opacity: 1;
	pointer-events: auto;
}

.fmt-mega {
	background: var(--paper);
	border-bottom: 1px solid var(--line);
}

.fmt-js .fmt-mega {
	box-shadow: 0 30px 60px -20px rgba(20, 18, 12, .25);
	left: 0;
	max-height: calc(100vh - var(--fmt-admin-bar) - var(--fmt-header-h));
	opacity: 0;
	overflow-y: auto;
	pointer-events: none;
	position: absolute;
	right: 0;
	top: 100%;
	transform: translateY(-12px);
	transition: transform .25s ease, opacity .22s ease;
	z-index: 2;
}

.fmt-page-header.is-open .fmt-mega {
	opacity: 1;
	pointer-events: auto;
	transform: translateY(0);
}

.fmt-mega__inner {
	display: grid;
	gap: 72px;
	grid-template-columns: 260px 1fr;
	padding-bottom: 44px;
	padding-top: 36px;
}

/* Rail */

.fmt-mega__rail {
	border-right: 1px solid var(--line);
	padding-right: 20px;
}

.fmt-mega__rail-title {
	margin-bottom: 14px;
}

.fmt-mega__tabs {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

/* Shortcuts */

.fmt-mega__shortcuts {
	border-top: 1px solid var(--line);
	margin-top: 28px;
	padding-top: 20px;
}

.fmt-mega__shortcuts-title {
	margin-bottom: 10px;
}

.fmt-mega__shortcuts-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.fmt-mega__shortcuts-list a {
	align-items: center;
	color: var(--ink);
	display: inline-flex;
	font-size: 13.5px;
	gap: 8px;
	transition: color .15s ease;
}

.fmt-mega__shortcuts-list .icon {
	flex: none;
	vertical-align: 0;
}

.fmt-mega__shortcuts-list a:hover {
	color: var(--red);
}

.fmt-mega__tab {
	align-items: center;
	background: transparent;
	border: 0;
	border-radius: 6px;
	color: var(--ink);
	cursor: pointer;
	display: flex;
	font-family: inherit;
	font-size: 15px;
	font-weight: 500;
	gap: 8px;
	justify-content: space-between;
	padding: 12px 14px;
	text-align: left;
	transition: background .15s ease, color .15s ease;
}

.fmt-mega__tab .icon {
	flex: none;
	opacity: .4;
}

.fmt-mega__tab:hover {
	background: var(--bg-2);
}

.fmt-mega__tab.is-active {
	background: var(--ink-2);
	color: #fff;
}

.fmt-mega__tab.is-active .icon {
	opacity: .9;
}

/* Panels */

.fmt-mega__panel-head {
	align-items: baseline;
	display: flex;
	gap: 24px;
	justify-content: space-between;
	margin-bottom: 26px;
}

.fmt-mega__panel-title {
	font-size: 34px;
	font-weight: 500;
	letter-spacing: -0.022em;
	line-height: 1.1;
	margin: 0;
}

.fmt-mega__panel-head .link-arrow {
	flex: none;
	text-decoration: none;
}

.fmt-mega__intro {
	color: var(--ink-soft);
	font-size: 15px;
	margin: 0 0 32px;
	max-width: 560px;
}

.fmt-mega__cols {
	display: grid;
	gap: 48px;
	grid-template-columns: 1fr 1fr;
}

.fmt-mega__col-title {
	border-bottom: 1px solid var(--line);
	margin-bottom: 14px;
	padding-bottom: 12px;
}

.fmt-mega__list {
	display: flex;
	flex-direction: column;
	gap: 4px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.fmt-mega__list > li > a,
.fmt-mega__list > li > span {
	color: var(--ink);
	display: block;
	font-size: 15px;
	padding: 11px 0;
	transition: color .15s ease;
}

.fmt-mega__list > li > a:hover {
	color: var(--red);
}

/* Highlighted overview entry ("Alle Massivhäuser"). */
.fmt-mega__list > li.is-highlight {
	margin-bottom: 6px;
}

.fmt-mega__list > li.is-highlight > a {
	align-items: center;
	display: flex;
	font-size: 15.5px;
	font-weight: 500;
	gap: 10px;
	justify-content: space-between;
	letter-spacing: -0.005em;
}

.fmt-mega__item-label {
	align-items: center;
	display: inline-flex;
	font-weight: 600;
	gap: 10px;
}

.fmt-mega__item-dot {
	background: var(--red);
	border-radius: 50%;
	flex: none;
	height: 5px;
	width: 5px;
}

.fmt-mega__list > li.is-highlight .icon {
	flex: none;
	vertical-align: 0;
}

/* Unscripted fallback: stack the categories instead of overlapping them. */
.fmt-mega__panel + .fmt-mega__panel {
	border-top: 1px solid var(--line);
	margin-top: 40px;
	padding-top: 40px;
}

.fmt-js .fmt-mega__panel + .fmt-mega__panel {
	border-top: 0;
	margin-top: 0;
	padding-top: 0;
}

/* Closing band */

.fmt-mega__band {
	background: var(--bg-2);
	border-top: 1px solid var(--line);
	padding: 14px 0;
}

.fmt-mega__band-inner {
	align-items: center;
	color: var(--ink-soft);
	display: flex;
	font-size: 13px;
	gap: 24px;
	justify-content: space-between;
}

.fmt-mega__band-link {
	border-bottom: 1px solid var(--ink-mute);
	color: var(--ink);
}

.fmt-mega__legal {
	display: inline-flex;
	gap: 14px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.fmt-mega__legal a {
	color: var(--ink-soft);
}

.fmt-mega__legal a:hover {
	color: var(--ink);
}

/* ------------------------------------------------------- Scroll lock ---- */

.fmt-nav-locked {
	overflow: hidden;
}

/* -------------------------------------------------------- Responsive ---- */

/*
 * Two layouts, one structure. The design draws them as separate pages
 * (Startseite.html vs Startseite Mobil.html), so this is where they meet:
 *
 *   901px and up   desktop panel — rail of tabs, one category shown at a time
 *                  (901–1100 keeps the panel but lays the rail out as a
 *                  horizontal tab row, since 260px of rail no longer fits)
 *   900px and down full screen overlay sliding in from the left, categories as
 *                  a single-open accordion
 *
 * header.js switches the widget semantics at the same 900px line and moves the
 * category buttons from the rail into their panels.
 */

@media (max-width: 1100px) {
	.fmt-mega__inner {
		display: block;
	}

	.fmt-mega__rail {
		border-bottom: 1px solid var(--line);
		border-right: 0;
		margin-bottom: 28px;
		padding-bottom: 20px;
		padding-right: 0;
	}

	.fmt-mega__tabs {
		flex-direction: row;
		flex-wrap: wrap;
	}

	.fmt-mega__tab {
		gap: 10px;
	}

	.fmt-mega__panel-title {
		font-size: 28px;
	}
}

@media (max-width: 900px) {

	/* --- Top bar: one rotating line instead of three side by side --- */

	.fmt-topbar {
		position: sticky;
		top: var(--fmt-admin-bar);
		z-index: 51;
	}

	.fmt-topbar__inner {
		gap: 8px;
		height: 34px;
		justify-content: flex-start;
	}

	/* Lift the items out of their two groups so the ticker can cycle them. */
	.fmt-topbar__left,
	.fmt-topbar__right {
		display: contents;
	}

	.fmt-topbar__sep {
		display: none;
	}

	.fmt-topbar__item {
		transition: opacity .3s ease, transform .3s ease;
	}

	.fmt-topbar__item.is-leaving {
		opacity: 0;
		transform: translateY(-4px);
	}

	/* --- Header row: 60px, actions as icon buttons --- */

	/* Sits directly under the sticky top bar, which is 34px tall here. */
	.fmt-page-header {
		--fmt-header-h: 60px;

		top: calc(var(--fmt-admin-bar) + 34px);
	}

	/*
	 * backdrop-filter makes the header a containing block for fixed children,
	 * which would trap the overlay inside the 60px row. The mobile design has no
	 * blur anyway.
	 */
	.fmt-page-header {
		-webkit-backdrop-filter: none;
		backdrop-filter: none;
		background: var(--bg);
	}

	/*
	 * The rail survives here for the Kurzwege alone, so the column has to be
	 * orderable: panels first, shortcuts underneath.
	 */
	.fmt-mega__panels {
		order: 1;
	}

	.fmt-mega__rail {
		border-bottom: 0;
		margin-bottom: 0;
		order: 2;
		padding-bottom: 0;
	}

	.fmt-mega__rail-nav {
		display: none;
	}

	.fmt-mega__shortcuts {
		border-top: 0;
		margin-top: 22px;
		padding-top: 0;
	}

	.fmt-mega__shortcuts-title {
		margin-bottom: 12px;
	}

	.fmt-mega__shortcuts-list {
		gap: 12px;
	}

	.fmt-mega__shortcuts-list a {
		font-size: 15px;
		gap: 10px;
	}

	.fmt-mega__shortcuts-list .icon {
		height: 16px;
		width: 16px;
	}

	/* 20px matches the design's mobile container (.mwrap). */
	.wrap.fmt-header__row {
		gap: 4px;
		padding: 0 20px;
	}

	.fmt-burger {
		margin-right: auto;
		order: 1;
		padding: 9px 14px 9px 11px;
	}

	.fmt-burger__bars {
		gap: 4px;
		width: 16px;
	}

	/* Out of flow; at 86px wide the logo fits between burger and buttons. */
	.fmt-header__logo {
		order: 2;
	}

	.fmt-logo__simple {
		height: 48px;
	}

	.fmt-header__baubuch {
		margin-right: 0;
		order: 3;
	}

	.fmt-header__login,
	.fmt-header__user {
		order: 4;
	}

	.fmt-header__search {
		order: 5;
	}

	/* The red CTA moves into the overlay foot, where it gets full width. */
	.fmt-header__cta {
		display: none;
	}

	/* Baubuch and Anmelden become icon buttons; their labels stay for
	   assistive tech so both keep an accessible name. */
	.fmt-header__baubuch,
	.fmt-header__login {
		background: transparent;
		border: 0;
		border-radius: 6px;
		color: var(--ink);
		flex: none;
		height: 40px;
		justify-content: center;
		padding: 0;
		width: 40px;
	}

	.fmt-header__baubuch:hover,
	.fmt-header__login:hover {
		background: rgba(0, 0, 0, .06);
		box-shadow: none;
		color: var(--ink);
		transform: none;
	}

	.fmt-header__baubuch > span,
	.fmt-header__login > span {
		clip-path: inset(50%);
		height: 1px;
		overflow: hidden;
		position: absolute;
		white-space: nowrap;
		width: 1px;
	}

	/* --- Overlay --- */

	.fmt-page-header.is-open {
		z-index: 90;
	}

	/* The overlay fills the viewport, so there is nothing left to dim. */
	.fmt-js .fmt-mega__backdrop {
		display: none;
	}

	.fmt-js .fmt-mega {
		background: var(--bg);
		border-bottom: 0;
		bottom: 0;
		box-shadow: none;
		display: flex;
		flex-direction: column;
		left: 0;
		max-height: none;
		opacity: 1;
		overflow: hidden;
		position: fixed;
		right: 0;
		/* Cleared by the admin bar; header.js measures what is on screen. */
		top: var(--fmt-admin-offset, 0px);
		transform: translateX(-100%);
		transition: transform .3s cubic-bezier(.16, 1, .3, 1), visibility .3s;
		visibility: hidden;
		z-index: 90;
	}

	.fmt-page-header.is-open .fmt-mega {
		transform: translateX(0);
		visibility: visible;
	}

	.fmt-mega__mobile-head {
		align-items: center;
		border-bottom: 1px solid var(--line);
		display: flex;
		flex: none;
		justify-content: space-between;
		padding: 16px 20px;
	}

	.fmt-mega__mobile-logo .fmt-logo__simple {
		height: 38px;
	}

	.fmt-mega__close {
		align-items: center;
		background: var(--paper);
		border: 1px solid var(--line);
		border-radius: 8px;
		color: var(--ink);
		cursor: pointer;
		display: flex;
		flex: none;
		height: 40px;
		justify-content: center;
		width: 40px;
	}

	.fmt-mega__scroll {
		flex: 1;
		overflow-y: auto;
	}

	.wrap.fmt-mega__inner {
		display: flex;
		flex-direction: column;
		/* The 72px column gap of the desktop grid carries over into flex. */
		gap: 0;
		padding: 8px 20px 24px;
	}

	/* --- Accordion --- */

	.fmt-mega__panel {
		border-bottom: 1px solid var(--line);
	}

	.fmt-mega__panel + .fmt-mega__panel {
		border-top: 0;
		margin-top: 0;
		padding-top: 0;
	}

	.fmt-mega__panel-head {
		display: none;
	}

	.fmt-mega__tab,
	.fmt-mega__tab:hover,
	.fmt-mega__tab.is-active {
		background: transparent;
		border-radius: 0;
		color: var(--ink);
	}

	.fmt-mega__tab {
		font-size: 17px;
		padding: 16px 0;
		width: 100%;
	}

	.fmt-mega__tab-arrow {
		display: none;
	}

	.fmt-mega__tab-chevron {
		color: var(--ink-mute);
		display: inline-flex;
		transition: transform .2s ease;
	}

	.fmt-mega__tab[aria-expanded="true"] .fmt-mega__tab-chevron {
		transform: rotate(180deg);
	}

	.fmt-mega__tab .icon {
		opacity: 1;
	}

	.fmt-mega__panel-body {
		padding-bottom: 14px;
	}

	.fmt-mega__intro {
		font-size: 13px;
		margin: 0 0 14px;
	}

	.fmt-mega__cols {
		display: block;
	}

	.fmt-mega__col {
		margin-bottom: 16px;
	}

	.fmt-mega__col-title {
		border-bottom: 0;
		margin-bottom: 8px;
		padding-bottom: 0;
	}

	.fmt-mega__list {
		gap: 2px;
	}

	.fmt-mega__list > li > a,
	.fmt-mega__list > li > span {
		color: var(--ink-soft);
		padding: 9px 0;
	}

	/* Mobile keeps dot and weight but drops the arrow and the larger size. */
	.fmt-mega__list > li.is-highlight {
		margin-bottom: 0;
	}

	.fmt-mega__list > li.is-highlight > a {
		color: var(--ink);
		font-size: 15px;
		font-weight: 400;
		justify-content: flex-start;
	}

	.fmt-mega__item-label {
		gap: 8px;
	}

	.fmt-mega__list > li.is-highlight .icon {
		display: none;
	}

	/* The closing band is desktop only — its links live in the footer too. */
	.fmt-mega__band {
		display: none;
	}

	.fmt-mega__mobile-foot {
		border-top: 1px solid var(--line);
		display: flex;
		flex: none;
		flex-direction: column;
		gap: 10px;
		padding: 16px 20px;
	}

	.fmt-mega__mobile-foot .btn {
		justify-content: center;
	}
}

/*
 * Narrow phones. A centred logo plus a burger plus three icon buttons does not
 * fit 375px, so two things give way: the burger label, and the search button —
 * the least load-bearing of the three actions.
 */
@media (max-width: 400px) {
	.fmt-header__search {
		display: none;
	}

	.fmt-burger {
		gap: 0;
		padding: 11px 13px;
	}

	.fmt-burger__label {
		clip-path: inset(50%);
		height: 1px;
		overflow: hidden;
		position: absolute;
		white-space: nowrap;
		width: 1px;
	}
}

/* -------------------------------------------------------- Logo intro ---- */

/*
 * Homepage only (includes/logo-intro.php). Everything keys off .fmt-js, so a
 * visitor without JavaScript gets the plain 96px header with the slim logo.
 *
 * logo-intro.js writes two numbers onto the root element as the page
 * scrolls: --fmt-intro-p, the shrink progress from 0 (top of page) to 1, and
 * --fmt-intro-fade, the same progress eased into the window where the two
 * logos cross-fade. The root, not the header, because the page content next to
 * the header needs them too and custom properties only reach descendants.
 * Every size below is a straight line between the design's tall and slim
 * header (src-v2/logo-intro.jsx, src-v2/mobile.jsx).
 */
:root {
	--fmt-intro-p: 0;
	--fmt-intro-fade: 0;
}

.fmt-js .fmt-page-header--intro {
	--fmt-header-h: calc(144px - 54px * var(--fmt-intro-p));
}

.fmt-js .fmt-page-header--intro .fmt-logo img {
	filter: drop-shadow(0 6px 18px rgba(20, 18, 12, .12));
}

.fmt-js .fmt-page-header--intro .fmt-logo__detail {
	display: block;
	height: calc(108px - 12px * var(--fmt-intro-p));
	opacity: calc(1 - var(--fmt-intro-fade));
}

.fmt-js .fmt-page-header--intro .fmt-logo__simple {
	height: calc(48px + 8px * var(--fmt-intro-p));
	opacity: var(--fmt-intro-fade);
}

/*
 * The header is sticky and in flow, so every pixel it loses would pull the page
 * up under the reader's eye. The margin hands those pixels back: the content
 * keeps the position it has under the tall header — fully below it at the top
 * of the page — and simply scrolls underneath as the header shrinks. Spelled
 * out as the tall height minus the current one.
 */
.fmt-js .fmt-page-header--intro + .fmt-page-content {
	margin-top: calc(54px * var(--fmt-intro-p));
}

@media (max-width: 900px) {
	.fmt-js .fmt-page-header--intro {
		--fmt-header-h: calc(96px - 36px * var(--fmt-intro-p));
	}

	/* Nudged left as in the design, clear of the three icon buttons. */
	.fmt-js .fmt-page-header--intro .fmt-logo__detail {
		height: calc(62px - 16px * var(--fmt-intro-p));
		transform: translateX(-14px);
	}

	.fmt-js .fmt-page-header--intro .fmt-logo__simple {
		height: 48px;
	}

	.fmt-js .fmt-page-header--intro + .fmt-page-content {
		margin-top: calc(36px * var(--fmt-intro-p));
	}
}

/*
 * The intro itself. The head script sets .fmt-intro-play before the first
 * paint; logo-intro.js then adds .fmt-intro-ready once it has moved the logo to
 * the middle of the screen, .fmt-intro-fly when the logo heads for the header,
 * and removes all three when it is done.
 *
 * The overlay hides the page. The header is lifted above it rather than the
 * logo pulled out of it, so the logo flies into the exact spot it rests in;
 * the rest of the header fades in together with the page.
 */
.fmt-intro-overlay {
	display: none;
}

.fmt-intro-play body {
	overflow: hidden;
}

.fmt-intro-play .fmt-intro-overlay {
	background: var(--bg);
	display: block;
	inset: 0;
	position: fixed;
	transition: opacity .9s ease;
	z-index: 2000;
}

.fmt-intro-play .fmt-page-header {
	background: transparent;
	border-bottom-color: transparent;
	transition: background-color .9s ease, border-color .9s ease;
	z-index: 2001;
}

.fmt-intro-play .fmt-header__row > :not(.fmt-header__logo) {
	opacity: 0;
	transition: opacity .9s ease;
}

/* Until the script has placed it, the logo would show at its resting size. */
.fmt-intro-play:not(.fmt-intro-ready) .fmt-logo {
	visibility: hidden;
}

.fmt-intro-play .fmt-logo {
	pointer-events: none;
	transform-origin: center center;
}

.fmt-intro-fly .fmt-intro-overlay {
	opacity: 0;
	pointer-events: none;
}

.fmt-intro-fly .fmt-page-header {
	background: rgba(251, 250, 246, .92);
	border-bottom-color: var(--line);
}

.fmt-intro-fly .fmt-header__row > :not(.fmt-header__logo) {
	opacity: 1;
}

@media (max-width: 900px) {
	.fmt-intro-play .fmt-intro-overlay,
	.fmt-intro-play .fmt-page-header,
	.fmt-intro-play .fmt-header__row > :not(.fmt-header__logo) {
		transition-duration: .8s;
	}

	.fmt-intro-fly .fmt-page-header {
		background: var(--bg);
	}
}
