/*
 * Site header and footer. Design: Home.dc.html (header, footer), Database.dc.html (active nav state).
 * Tokens only (tokens.css). Breakpoint: the menu collapses below 900px.
 * Additions not in the design (listed in the hand-back): nav hover tint, lime focus ring on dark,
 * 44px touch targets on touch screens, the Menu button for phones.
 */

/* Shared ---------------------------------------------------------------- */

.sr-header,
.sr-footer {
	background: var(--sr-color-surface-dark);
	color: var(--sr-color-on-dark);
	font-family: var(--sr-font-ui);
	font-variant-numeric: tabular-nums;
	--sr-focus-ring: var(--sr-color-lime); /* dark area: lime focus ring */
}

.sr-header a,
.sr-footer a {
	color: inherit;
	text-decoration: none;
}

/* Focus on dark: lime ring (lime is allowed as a mark on dark backgrounds). */
.sr-header :focus-visible,
.sr-footer :focus-visible {
	outline: 2px solid var(--sr-focus-ring);
	outline-offset: 2px;
}

/* Logo */
.sr-logo {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	color: var(--sr-color-on-dark);
	flex: none;
}

.sr-logo__mark {
	flex: none;
	display: block;
}

.sr-logo__word {
	font-size: 30px;
	font-weight: 800;
	letter-spacing: -0.04em;
	line-height: 1;
}

.sr-logo__word-light {
	color: var(--sr-color-casper);
	font-weight: 500;
}

.sr-logo__sweep {
	transform-box: view-box;
	transform-origin: 16px 16px;
}

.sr-logo:hover .sr-logo__sweep {
	animation: sr-spin 1.4s cubic-bezier(0.5, 0, 0.2, 1);
}

@keyframes sr-spin {
	to { transform: rotate(360deg); }
}

/* Header button: the shared .sr-button base lives in components.css */
.sr-header .sr-button--signal {
	background: var(--sr-color-lime);
	color: var(--sr-color-ink);
}

.sr-header .sr-button--signal:hover {
	background: var(--sr-color-off-white);
}

/* Icon motion: rests still, animates while its control is hovered or focused */
.h-scany {
	opacity: 0;
}

.sr-hov:hover .h-scany,
.sr-hov:focus-visible .h-scany {
	animation: i-scany 1.4s ease-in-out infinite;
}

@keyframes i-scany {
	0% { transform: translateY(-5px); opacity: 0; }
	20%, 80% { opacity: 1; }
	100% { transform: translateY(6px); opacity: 0; }
}

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

.sr-header {
	position: relative;
	z-index: 2;
	padding: 16px 24px;
}

.sr-header__inner {
	max-width: 1280px;
	margin: 0 auto;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
}

.sr-nav {
	display: flex;
	flex-wrap: wrap;
	gap: 2px;
	padding: 5px;
	border-radius: var(--sr-radius-control);
	background: var(--sr-color-dark-control);
	box-shadow: inset 0 0 0 1px var(--sr-color-dark-control-border);
}

.sr-nav__link {
	display: inline-flex;
	align-items: center;
	min-height: 40px;
	padding: 0 16px;
	border-radius: var(--sr-radius-control);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	white-space: nowrap;
	color: var(--sr-color-on-dark);
}

.sr-header .sr-nav__link:hover {
	background: rgba(254, 255, 249, 0.08);
}

/* Current section: off-white tab, dark text */
.sr-header .sr-nav__link[aria-current="page"] {
	background: var(--sr-color-off-white);
	color: var(--sr-color-ink);
}

.sr-header__actions {
	display: flex;
	align-items: center;
	gap: 8px;
}

.sr-header__search {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: var(--sr-radius-control);
	color: var(--sr-color-on-dark);
}

.sr-header__search[aria-current="page"] {
	background: var(--sr-color-off-white);
	color: var(--sr-color-ink);
}

/* Menu button: only shown (by nav.js) on narrow screens */
.sr-header .sr-header__toggle {
	display: none;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	padding: 0 14px;
	border: 0;
	border-radius: var(--sr-radius-control);
	background: var(--sr-color-dark-control);
	box-shadow: inset 0 0 0 1px var(--sr-color-dark-control-border);
	color: var(--sr-color-on-dark);
	font: 600 12px/1 var(--sr-font-ui);
	letter-spacing: 0.06em;
	text-transform: uppercase;
	cursor: pointer;
}

.sr-header .sr-header__toggle:hover,
.sr-header .sr-header__toggle:focus,
.sr-header .sr-header__toggle:active {
	background: var(--sr-color-dark-control);
	color: var(--sr-color-on-dark);
	box-shadow: inset 0 0 0 1px var(--sr-color-dark-control-border-hover);
}

.sr-header__toggle-close,
.sr-header__toggle[aria-expanded="true"] .sr-header__toggle-open {
	display: none;
}

.sr-header__toggle[aria-expanded="true"] .sr-header__toggle-close {
	display: inline;
}

/* Menu button up to 1279px: the six links plus search and tip need about 1,260px on one line.
   Logo, search, tip and menu button stay on the first line; the opened menu drops below (2026-11-22). */
@media (max-width: 1279px) {
	/* Only when the script is running: without it the menu simply stays visible. */
	.sr-header.has-menu-toggle .sr-header__toggle {
		display: inline-flex;
		order: 3;
	}

	.sr-header.has-menu-toggle .sr-nav {
		display: none;
	}

	.sr-header.has-menu-toggle.is-open .sr-nav {
		display: flex;
		flex-direction: column;
		order: 3;
		width: 100%;
	}

	.sr-header.has-menu-toggle.is-open .sr-nav__link {
		min-height: 44px;
	}

	.sr-header.has-menu-toggle .sr-nav {
		order: 4;
	}

	.sr-header.has-menu-toggle .sr-header__inner {
		flex-wrap: wrap;
	}

	.sr-header.has-menu-toggle .sr-header__actions {
		order: 2;
		margin-left: auto;
	}
}

/* Compact one-row header on phones and small tablets (to 639px; was 479px, Tim 2026-11-22). */
@media (max-width: 639px) {
	.sr-header.has-menu-toggle .sr-header__inner {
		gap: 6px;
	}

	.sr-header.has-menu-toggle .sr-header__toggle {
		padding: 0 12px;
	}

	/* Icon only; the word stays for screen readers. */
	.sr-header.has-menu-toggle .sr-header__toggle-label {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
		white-space: nowrap;
	}

	.sr-header__actions {
		gap: 2px;
	}

	.sr-header__actions .sr-button {
		min-height: 40px;
		padding: 0 8px;
		font-size: 10.5px;
		letter-spacing: 0.04em;
	}

	/* Compact logo so logo, search, tip and menu fit one row on phones (2026-11-22). */
	.sr-header.has-menu-toggle .sr-logo {
		gap: 6px;
	}

	.sr-header.has-menu-toggle .sr-logo .sr-logo__mark {
		width: 30px;
		height: 30px;
	}

	.sr-header.has-menu-toggle .sr-logo__word {
		font-size: 19px;
	}

	.sr-header.has-menu-toggle .sr-header__toggle {
		padding: 0 10px;
	}

	.sr-header.has-menu-toggle .sr-header__search {
		width: 40px;
	}
}

@media (max-width: 479px) {
	.sr-header {
		padding: 12px 16px;
	}

	.sr-logo .sr-logo__mark {
		width: 40px;
		height: 40px;
	}

	.sr-logo__word {
		font-size: 24px;
	}
}

/* Footer ---------------------------------------------------------------- */

.sr-footer__inner {
	max-width: 1280px;
	margin: 0 auto;
	box-sizing: content-box; /* design: the side padding sits outside the max-width */
	padding: 64px 24px 28px;
	display: flex;
	flex-direction: column;
	gap: 48px;
}

.sr-footer__top {
	display: flex;
	flex-wrap: wrap;
	gap: 40px;
}

.sr-footer__brand {
	flex: 2 1 280px;
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.sr-logo--footer .sr-logo__word {
	font-size: 26px;
}

.sr-footer__tagline {
	margin: 0;
	font-family: var(--sr-font-display);
	font-size: 34px;
	line-height: 1;
}

.sr-footer__note {
	margin: 0;
	max-width: 320px;
	font-size: 13px;
	line-height: 1.6;
	color: var(--sr-color-on-dark-soft);
}

.sr-footer__col {
	flex: 1 1 160px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.sr-footer__heading {
	margin: 0;
	font-family: var(--sr-font-ui);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.14em;
	line-height: 1.4;
	text-transform: uppercase;
	color: var(--sr-color-casper);
}

.sr-footer__list {
	margin: 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.sr-footer__link {
	font-size: 14px;
	line-height: 1.4;
}

.sr-footer__link:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.sr-footer__bottom {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 12px;
	border-top: 1px solid var(--sr-color-on-dark-rule);
	padding-top: 20px;
	font-size: 12px;
	color: var(--sr-color-casper);
}

.sr-footer .sr-footer__release {
	color: var(--sr-color-casper);
	text-decoration: underline;
	text-underline-offset: 3px;
}

@media (max-width: 479px) {
	.sr-footer__inner {
		padding: 48px 16px 24px;
	}
}

/* Touch screens: 44px targets without changing the desktop look */
@media (pointer: coarse) {
	.sr-nav__link {
		min-height: 44px;
	}

	.sr-footer__list {
		gap: 0;
	}

	.sr-footer__link {
		display: inline-flex;
		align-items: center;
		min-height: 44px;
	}
}

/* Reduced motion: everything settles */
@media (prefers-reduced-motion: reduce) {
	.sr-header *,
	.sr-footer * {
		animation: none !important;
		transition: none !important;
	}
}

/* Smallest phones (under 375px): one more step so the header stays on one row. */
@media (max-width: 374px) {
	.sr-header.has-menu-toggle .sr-logo .sr-logo__mark {
		width: 26px;
		height: 26px;
	}

	.sr-header.has-menu-toggle .sr-logo__word {
		font-size: 17px;
	}

	.sr-header__actions .sr-button {
		padding: 0 6px;
	}

	.sr-header.has-menu-toggle .sr-header__search {
		width: 36px;
	}
}
