/*
 * Gombeke base layer -- reset, chassis, base typography, utilities.
 * Reads tokens only. Everything degrades to a legible static state with JS off
 * and under prefers-reduced-motion.
 */

/* -- Reset -- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; color-scheme: dark; scroll-behavior: smooth; }
img, picture, svg, video, canvas { display: block; max-width: 100%; }
svg { height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
:where(a) { color: inherit; text-decoration: none; }

/* -- Chassis -- */
html, body { height: 100%; }
body {
	background-color: var(--gmb-ground);
	color: var(--gmb-ink);
	font-family: var(--gmb-font-sans);
	font-size: var(--gmb-text-base);
	font-weight: 400;
	line-height: 1.62;
	font-synthesis: none;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	overflow-x: hidden;
}

/* The engraved-grid backdrop sits behind everything at low contrast. */
body::before {
	content: "";
	position: fixed;
	inset: 0;
	z-index: -2;
	background:
		radial-gradient(120% 80% at 80% -10%, var(--gmb-signal-a12), transparent 60%),
		var(--gmb-ground);
	pointer-events: none;
}

::selection { background: var(--gmb-signal); color: var(--gmb-ground-deep); }

/* -- Typography -- */
h1, h2, h3, h4 {
	font-family: var(--gmb-font-sans);
	font-weight: 800;
	line-height: 1.04;
	letter-spacing: -0.02em;
	text-wrap: balance;
	color: var(--gmb-ink);
}
h1 { font-size: var(--gmb-text-3xl); }
h2 { font-size: var(--gmb-text-2xl); }
h3 { font-size: var(--gmb-text-xl); }
h4 { font-size: var(--gmb-text-lg); }
p { max-width: var(--gmb-measure); }
strong, b { font-weight: 700; }

a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
	outline: none;
	box-shadow: var(--gmb-focus);
	border-radius: var(--gmb-r-sm);
}

/* -- Mono / instrument type -- */
.gmb-mono {
	font-family: var(--gmb-font-mono);
	font-size: var(--gmb-text-xs);
	font-weight: 500;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--gmb-ink-mute);
}
.gmb-mono--signal { color: var(--gmb-signal); }

/* -- Kicker: one strong mono label allowed per section -- */
.gmb-kicker {
	display: inline-flex;
	align-items: center;
	gap: var(--gmb-space-2);
	font-family: var(--gmb-font-mono);
	font-size: var(--gmb-text-xs);
	font-weight: 500;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--gmb-signal);
}
.gmb-kicker::before {
	content: "";
	width: 1.5rem;
	height: 1px;
	background: var(--gmb-signal);
}

/* -- Text link with amber underline wipe -- */
.gmb-link {
	position: relative;
	color: var(--gmb-ink);
	background-image: linear-gradient(var(--gmb-signal), var(--gmb-signal));
	background-position: 0 100%;
	background-repeat: no-repeat;
	background-size: 0% 1px;
	transition: background-size var(--gmb-dur-state) var(--gmb-ease-out-quart), color var(--gmb-dur-state) ease;
	padding-bottom: 2px;
}
.gmb-link:hover { background-size: 100% 1px; color: var(--gmb-signal-hi); }

/* -- Layout containers -- */
.gmb-wrap {
	width: 100%;
	max-width: var(--gmb-maxw);
	margin-inline: auto;
	padding-inline: var(--gmb-gutter);
}
.gmb-wrap--wide { max-width: var(--gmb-maxw-wide); }
.gmb-section { padding-block: var(--gmb-section); position: relative; }

/* -- Any wide element scrolls inside its own container, page never does -- */
.gmb-scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* -- Skip link -- */
.gmb-skip-link {
	position: absolute;
	left: var(--gmb-space-4);
	top: -4rem;
	z-index: 100;
	padding: var(--gmb-space-3) var(--gmb-space-4);
	background: var(--gmb-signal);
	color: var(--gmb-ground-deep);
	font-family: var(--gmb-font-mono);
	font-size: var(--gmb-text-xs);
	letter-spacing: 0.12em;
	text-transform: uppercase;
	border-radius: var(--gmb-r-sm);
	transition: top var(--gmb-dur-state) var(--gmb-ease-out-quart);
}
.gmb-skip-link:focus { top: var(--gmb-space-4); }

/* -- Visually hidden but available to assistive tech -- */
.gmb-visually-hidden {
	position: absolute !important;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
	white-space: nowrap; border: 0;
}

/* -- Reveal / power-on.
   Content is ALWAYS visible in CSS. When motion is allowed, GSAP sets the
   from-state at runtime and animates elements in (see hero.js / scroll.js), so
   JS-off and reduced-motion users always land on the final, legible content.
   The only CSS here is a performance hint while motion is active. -- */
html[data-gmb-motion="on"] [data-gmb-po],
html[data-gmb-motion="on"] [data-gmb-reveal] { will-change: opacity, transform; }

/* -- Reduced motion: hard accessibility gate -- */
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}
