/*
 * base.css
 * Design tokens, reset and base element styles.
 *
 * Everything visual in the theme should resolve back to a token declared
 * here. Avoid one-off values in component files.
 */

:root {
	/* ---------------------------------------------------------------
	 * Colour — placeholder brand palette. Swap these five values to
	 * re-skin the site; nothing downstream hardcodes a colour.
	 * --------------------------------------------------------------- */
	--color-bg: #0a0a0a;
	--color-bg-raised: #141414;
	--color-fg: #f2f2f0;
	--color-muted: #8c8c88;
	--color-line: rgb(242 242 240 / 14%);
	--color-accent: #f2f2f0;

	--color-selection-bg: var(--color-fg);
	--color-selection-fg: var(--color-bg);
	--color-focus: #6fa8ff;

	/* ---------------------------------------------------------------
	 * Typography — placeholder stacks. A self-hosted display face can
	 * be dropped into --font-display without touching components.
	 * --------------------------------------------------------------- */
	--font-display: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
	--font-body: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
	--font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

	--text-xs: clamp(0.75rem, 0.73rem + 0.1vw, 0.8125rem);
	--text-sm: clamp(0.8125rem, 0.79rem + 0.15vw, 0.9375rem);
	--text-md: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
	--text-lg: clamp(1.25rem, 1.1rem + 0.7vw, 1.75rem);
	--text-xl: clamp(1.75rem, 1.4rem + 1.6vw, 3rem);
	--text-2xl: clamp(2.5rem, 1.85rem + 3.2vw, 5rem);
	--text-display: clamp(3.25rem, 0.5rem + 12vw, 13rem);

	--leading-tight: 0.92;
	--leading-snug: 1.15;
	--leading-normal: 1.5;
	--leading-loose: 1.7;

	--tracking-tight: -0.03em;
	--tracking-normal: 0;
	--tracking-wide: 0.08em;
	--tracking-wider: 0.16em;

	--weight-normal: 400;
	--weight-medium: 500;
	--weight-bold: 700;

	/* ---------------------------------------------------------------
	 * Space — one fluid scale used for padding, gaps and rhythm.
	 * --------------------------------------------------------------- */
	--space-2xs: clamp(0.25rem, 0.23rem + 0.1vw, 0.375rem);
	--space-xs: clamp(0.5rem, 0.45rem + 0.25vw, 0.75rem);
	--space-sm: clamp(0.75rem, 0.65rem + 0.5vw, 1.25rem);
	--space-md: clamp(1.25rem, 1rem + 1.2vw, 2.5rem);
	--space-lg: clamp(2.5rem, 2rem + 2.4vw, 5rem);
	--space-xl: clamp(4.5rem, 3.5rem + 5vw, 9rem);
	--space-2xl: clamp(7rem, 5rem + 8vw, 14rem);

	/* ---------------------------------------------------------------
	 * Layout
	 * --------------------------------------------------------------- */
	--content-width: 1680px;
	--content-width-narrow: 68ch;
	--page-padding: clamp(1.25rem, 0.9rem + 2.6vw, 4rem);
	--header-height: clamp(4.25rem, 3.75rem + 2vw, 6rem);

	/* ---------------------------------------------------------------
	 * Motion
	 * --------------------------------------------------------------- */
	--ease-out: cubic-bezier(0.33, 1, 0.68, 1);
	--ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
	--ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

	--transition-fast: 160ms var(--ease-out);
	--transition-normal: 320ms var(--ease-out);
	--transition-slow: 640ms var(--ease-out-expo);

	/* Layers */
	--z-header: 100;
	--z-nav: 90;
	--z-skip-link: 200;
}

/* -------------------------------------------------------------------
 * Reset
 * ------------------------------------------------------------------- */

*,
*::before,
*::after {
	box-sizing: border-box;
}

* {
	margin: 0;
}

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
	scroll-padding-top: calc(var(--header-height) + var(--space-md));
}

body {
	min-height: 100vh;
	background-color: var(--color-bg);
	color: var(--color-fg);
	font-family: var(--font-body);
	font-size: var(--text-md);
	line-height: var(--leading-normal);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

img,
picture,
video,
canvas,
svg {
	display: block;
	max-width: 100%;
	height: auto;
}

input,
button,
textarea,
select {
	font: inherit;
	color: inherit;
}

button {
	background: none;
	border: 0;
	padding: 0;
	cursor: pointer;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
	overflow-wrap: break-word;
}

ul,
ol {
	padding: 0;
	list-style: none;
}

a {
	color: inherit;
	text-decoration: none;
}

::selection {
	background-color: var(--color-selection-bg);
	color: var(--color-selection-fg);
}

/* -------------------------------------------------------------------
 * Focus and skip link
 * ------------------------------------------------------------------- */

:focus-visible {
	outline: 2px solid var(--color-focus);
	outline-offset: 3px;
}

.skip-link {
	position: absolute;
	top: var(--space-xs);
	left: var(--space-xs);
	z-index: var(--z-skip-link);
	padding: var(--space-xs) var(--space-sm);
	background-color: var(--color-fg);
	color: var(--color-bg);
	font-size: var(--text-sm);
	transform: translateY(-200%);
	transition: transform var(--transition-fast);
}

.skip-link:focus {
	transform: translateY(0);
}

/* -------------------------------------------------------------------
 * Utilities
 * ------------------------------------------------------------------- */

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

.screen-reader-text:focus {
	position: static;
	width: auto;
	height: auto;
	margin: 0;
	overflow: visible;
	clip-path: none;
	white-space: normal;
}

/* Locks background scrolling while the mobile menu is open. */
body.is-nav-open {
	overflow: hidden;
}

/* -------------------------------------------------------------------
 * Reduced motion
 * ------------------------------------------------------------------- */

@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;
	}
}
