/* ============================================================================
   BASE — element defaults, focus, wrappers, skip link
   ============================================================================ */

@layer base {

html {
	background: var(--color-surface);
	/* In-page anchors and focus-scrolling land clear of the fixed header. */
	scroll-padding-top: var(--header-height);
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

/* No `scroll-behavior: smooth` on html. It also animates the router's reset
   to the top on every navigation, so a new page arrived mid-scroll and slid
   up (and broke the homepage-to-PDP morph). In-page jumps that want to glide
   — the snap dots, the PDP filmstrip — ask for it themselves, and check
   reduced motion when they do. */

body {
	min-height: 100svh;
	background: var(--color-surface);
	color: var(--color-text-1);
	display: flex;
	flex-direction: column;
	/* Font smoothing is left at the platform default on purpose: gotham 400
	   on cream is the house voice, and antialiased thins it further. */
}

main {
	flex: 1 0 auto;
}

/* Keyboard focus. :focus-visible only — never a blanket `*:focus { outline: 0 }`.
   2px at 2px offset: the offset is what puts the ring on the page ground
   (13.81) rather than on a yellow button. Keep it. */
:focus-visible {
	outline: 2px solid var(--color-focus);
	outline-offset: 2px;
	border-radius: var(--radius-xs);
}

::selection {
	background: var(--color-action);
	color: var(--color-on-action);
}

img, video {
	background: var(--color-media-ground);
}

hr {
	border: 0;
	border-top: 1px solid var(--color-rule);
}

/* ── Wrappers ─────────────────────────────────────────────────────────────── */

/* Each wrapper is its measure less the edge inset on both sides, centred —
   the same box the header's well and the snap sections' well draw, so at
   any width the wordmark, a page head, a product grid and a section's copy
   all start on one vertical line. (They were 90% wide, which drifted from
   the header's inset by a few pixels on a phone and 30 at 1440.) */
.wrap,
.wrapWide,
.wrapNarrow {
	width: calc(min(100%, var(--measure)) - var(--inset-edge-x) * 2);
	margin-inline: auto;
}

.wrap       { --measure: var(--wrap); }
.wrapWide   { --measure: var(--wrap-wide); }
.wrapNarrow { --measure: var(--wrap-narrow); }

/* ── Skip link ────────────────────────────────────────────────────────────────
   The first focusable element on every page. Off-screen until focused, then a
   yellow chip above everything including the header. */

.skipLink {
	position: fixed;
	top: var(--space-s);
	left: var(--space-s);
	z-index: 100;
	padding: var(--space-xs) var(--space-s);
	border-radius: var(--radius-sm);
	background: var(--color-action);
	color: var(--color-on-action);
	translate: 0 calc(-100% - var(--space-l));

	&:focus-visible {
		translate: 0 0;
	}
}

/* The page-content landing target for the skip link. A focused <main> has no
   ring of its own — it would outline the whole page. */
#main:focus {
	outline: none;
}

} /* @layer base */


@layer utilities {

/* The [hidden] attribute must beat any component's `display`. In the reset
   layer it would lose to every component that sets display: flex. */
[hidden] {
	display: none;
}

/* Present to assistive tech, absent from the layout. */
.visuallyHidden {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

} /* @layer utilities */
