/* ==========================================================================
   PRINTEREI – BASE
   Fonts, reset, typography, layout primitives, motion utilities.
   Uses tokens.css only.
   ========================================================================== */

/* Inter – self-hosted (no Google request, nDSG/GDPR friendly) */
@font-face {
	font-family: "Inter Variable";
	font-style: normal;
	font-display: swap;
	font-weight: 100 900;
	src: url("../fonts/inter-latin-opsz-normal.woff2") format("woff2-variations");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: "Inter Variable";
	font-style: normal;
	font-display: swap;
	font-weight: 100 900;
	src: url("../fonts/inter-latin-ext-opsz-normal.woff2") format("woff2-variations");
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

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

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

body {
	margin: 0;
	font-family: var(--font-sans);
	font-size: var(--fs-base);
	font-weight: var(--fw-regular);
	line-height: var(--lh-base);
	color: var(--color-text);
	background: var(--color-bg);
	font-optical-sizing: auto;
	font-feature-settings: "cv11", "ss03";
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

html.is-locked,
html.is-locked body {
	overflow: hidden;
}

img,
svg,
video {
	display: block;
	max-width: 100%;
}

img {
	height: auto;
}

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

button {
	cursor: pointer;
}

/* :where() = zero specificity, so any component class can set its own
   margin/padding on a list without fighting this reset. */
:where(ul, ol)[role="list"] {
	list-style: none;
	margin: 0;
	padding: 0;
}

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
	margin: 0;
	color: var(--color-heading);
	font-weight: var(--fw-bold);
	line-height: var(--lh-snug);
	letter-spacing: var(--ls-snug);
	text-wrap: balance;
}

h1 { font-size: var(--fs-4xl); line-height: var(--lh-tight); letter-spacing: var(--ls-tight); font-weight: var(--fw-black); }
h2 { font-size: var(--fs-3xl); line-height: var(--lh-tight); letter-spacing: var(--ls-tight); font-weight: var(--fw-black); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }

p {
	margin: 0;
	text-wrap: pretty;
}

a {
	color: var(--color-link);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
	transition: color var(--dur-fast) var(--ease-out);
}

a:hover {
	color: var(--color-link-hover);
}

strong,
b {
	font-weight: var(--fw-bold);
}

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

/* Focus – one visible ring for every interactive element */
:focus {
	outline: none;
}

:focus-visible {
	outline: none;
	box-shadow: var(--focus-ring);
	border-radius: var(--radius-xs);
}

/* --------------------------------------------------------------------------
   Layout primitives
   -------------------------------------------------------------------------- */
.container {
	width: min(100% - (var(--gutter) * 2), var(--container));
	margin-inline: auto;
}

.section {
	padding-block: var(--section-y);
}

.section--alt {
	background: var(--color-surface-alt);
}

.section--dark {
	background: var(--color-dark);
	color: var(--color-on-dark);
}

.section--dark :is(h1, h2, h3, h4) {
	color: var(--color-on-dark);
}

/* Section head: eyebrow + title + lead (+ optional action on the right) */
.section-head {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: var(--space-6) var(--space-10);
	margin-bottom: var(--section-head-gap);
}

.section-head__text {
	display: grid;
	gap: var(--space-4);
	max-width: 46rem;
}

/* Phones: the «see all» link sits on the eyebrow line, top right */
@media (max-width: 767px) {
	.section-head:has(> .more-link) {
		position: relative;
	}

	.section-head > .more-link {
		position: absolute;
		top: -0.5rem;
		right: 0;
	}

	.section-head > .more-link .more-link__rest {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
		white-space: nowrap;
	}
}

.section-head--center {
	justify-content: center;
	text-align: center;
}

.section-head--center .section-head__text {
	justify-items: center;
}

.lead {
	font-size: var(--fs-lg);
	line-height: var(--lh-base);
	color: var(--color-text-muted);
	max-width: var(--measure);
}

.section--dark .lead {
	color: var(--color-on-dark-muted);
}

.text-accent {
	color: var(--color-primary-text);
}

/* Auto-fit grids – children never get narrower than --min */
.grid {
	display: grid;
	gap: var(--grid-gap);
	grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--min, 260px)), 1fr));
}

/* Grids with a fixed item count use explicit columns so rows are always even:
   8 products → 1 / 2 / 4 columns · 3 featured services → 1 / 3 columns */
.grid--products,
.grid--featured,
.grid--refs {
	grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 560px) {
	.grid--products,
	.grid--refs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 768px) {
	.grid--featured,
	.grid--refs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
	.grid--products { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Simple content pages (until page templates exist) */
.prose {
	max-width: 48rem;
}

.prose > * + * {
	margin-top: var(--space-4);
}

.page-title {
	margin-bottom: var(--space-6);
	font-size: var(--fs-3xl);
}

/* --------------------------------------------------------------------------
   Accessibility helpers
   -------------------------------------------------------------------------- */
.screen-reader-text,
.visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.skip-link {
	position: absolute;
	top: var(--space-2);
	left: var(--space-2);
	z-index: var(--z-drawer);
	padding: var(--space-3) var(--space-5);
	background: var(--color-secondary);
	color: var(--color-on-secondary);
	border-radius: var(--radius-control);
	font-weight: var(--fw-semibold);
	transform: translateY(-200%);
	transition: transform var(--dur-base) var(--ease-out);
}

.skip-link:focus {
	transform: none;
	color: var(--color-on-secondary);
}

/* --------------------------------------------------------------------------
   Motion – scroll reveal (JS adds .is-visible; without JS everything shows)
   -------------------------------------------------------------------------- */
.js [data-reveal] {
	opacity: 0;
	transform: translateY(var(--reveal-shift));
	transition:
		opacity var(--dur-reveal) var(--ease-out),
		transform var(--dur-reveal) var(--ease-out);
	transition-delay: calc(var(--i, 0) * var(--stagger));
}

.js [data-reveal="fade"] {
	transform: none;
}

.js [data-reveal="scale"] {
	transform: scale(0.96);
}

.js [data-reveal].is-visible {
	opacity: 1;
	transform: none;
}

/* Reduced motion: every duration comes from tokens, so we switch the tokens
   off here – no !important needed anywhere. Components with keyframe
   animations (marquee) handle their own fallback. */
@media (prefers-reduced-motion: reduce) {
	:root {
		--dur-fast: 1ms;
		--dur-base: 1ms;
		--dur-slow: 1ms;
		--dur-reveal: 1ms;
		--stagger: 0ms;
		--reveal-shift: 0px;
		--hover-lift: 0px;
		--field-lift: 0px;
		--dur-field: 1ms;
		--dur-notch-open: 1ms;
		--dur-notch-close: 1ms;
		--delay-notch: 0ms;
		--dur-flip: 1ms;
		--dur-sweep: 0ms;
	}

	html {
		scroll-behavior: auto;
	}
}
