/**
 * Zestino designsystem – base.
 * Reset, typografi, layoutprimitiver og hjelpeklasser.
 */

/* ============================================================
   1. Reset
   ============================================================ */

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

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

body {
	margin: 0;
	background-color: var(--z-ink);
	color: var(--z-text);
	font-family: var(--z-font-body);
	font-size: var(--z-fs-body);
	font-weight: var(--z-fw-normal);
	line-height: var(--z-lh-normal);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	overflow-x: hidden;
}

body.z-no-scroll {
	overflow: hidden;
}

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

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

button {
	cursor: pointer;
}

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

ul,
ol {
	margin: 0 0 var(--z-space-sm);
	padding-left: 1.25rem;
}

table {
	border-collapse: collapse;
	width: 100%;
}

hr {
	border: 0;
	border-top: var(--z-border);
	margin: var(--z-space-lg) 0;
}

/* ============================================================
   2. Typografi
   ============================================================ */

h1,
h2,
h3,
h4,
h5,
h6,
.z-h1,
.z-h2,
.z-h3,
.z-h4 {
	margin: 0 0 var(--z-space-sm);
	font-family: var(--z-font-display);
	font-weight: var(--z-fw-black);
	line-height: var(--z-lh-snug);
	letter-spacing: var(--z-ls-display);
	text-transform: uppercase;
	color: var(--z-text);
}

h1,
.z-h1 {
	font-size: var(--z-fs-h1);
	line-height: var(--z-lh-tight);
}

h2,
.z-h2 {
	font-size: var(--z-fs-h2);
	line-height: var(--z-lh-tight);
}

h3,
.z-h3 {
	font-size: var(--z-fs-h3);
}

h4,
.z-h4 {
	font-size: var(--z-fs-h4);
}

h5 {
	font-size: var(--z-fs-h5);
}

h6 {
	font-size: var(--z-fs-small);
	letter-spacing: var(--z-ls-label);
}

/* Den skrå «racing»-varianten fra logoen. Brukes på hero og seksjonstitler. */
.z-display,
.z-title--racing {
	font-family: var(--z-font-display);
	font-weight: var(--z-fw-black);
	font-style: italic;
	text-transform: uppercase;
	line-height: var(--z-lh-tight);
	letter-spacing: var(--z-ls-display);
}

.z-display {
	font-size: var(--z-fs-display);
}

p {
	margin: 0 0 var(--z-space-sm);
}

p:last-child {
	margin-bottom: 0;
}

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

a {
	color: var(--z-text);
	text-decoration: none;
	transition: color var(--z-dur-fast) var(--z-ease);
}

a:hover {
	color: var(--z-red);
}

.z-prose a:not(.z-btn) {
	color: var(--z-red);
	text-decoration: underline;
	text-underline-offset: 0.2em;
	text-decoration-thickness: 1px;
}

.z-prose a:not(.z-btn):hover {
	color: var(--z-red-hover);
}

/* Synlig fokusring – aldri fjern denne. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 2px solid var(--z-red);
	outline-offset: 3px;
	border-radius: var(--z-radius-xs);
}

::selection {
	background: var(--z-red);
	color: #fff;
}

/* «Eyebrow» – liten rød etikett over en overskrift. */
.z-eyebrow {
	display: inline-flex;
	align-items: center;
	gap: var(--z-space-2xs);
	margin: 0 0 var(--z-space-xs);
	font-family: var(--z-font-body);
	font-size: var(--z-fs-tiny);
	font-weight: var(--z-fw-bold);
	letter-spacing: var(--z-ls-label);
	text-transform: uppercase;
	color: var(--z-red);
}

.z-eyebrow::before {
	content: "";
	width: 24px;
	height: 2px;
	background: var(--z-red);
}

.z-lead {
	font-size: clamp(1.0625rem, 1rem + 0.5vw, 1.3125rem);
	line-height: var(--z-lh-relaxed);
	color: var(--z-text-muted);
}

.z-muted {
	color: var(--z-text-muted);
}

.z-dim {
	color: var(--z-text-dim);
}

.z-accent {
	color: var(--z-red);
}

/* ============================================================
   3. Layout
   ============================================================ */

.z-container {
	width: 100%;
	max-width: var(--z-container);
	margin-inline: auto;
	padding-inline: var(--z-gutter);
}

.z-container--wide {
	max-width: var(--z-container-wide);
}

.z-container--narrow {
	max-width: var(--z-container-narrow);
}

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

.z-section--tight {
	padding-block: calc(var(--z-section-y) * 0.6);
}

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

.z-section-head {
	max-width: 62ch;
	margin-bottom: var(--z-space-xl);
}

.z-section-head--center {
	margin-inline: auto;
	text-align: center;
}

.z-section-head--center .z-eyebrow {
	justify-content: center;
}

.z-grid {
	display: grid;
	gap: var(--z-space-md);
}

.z-grid--2 {
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
}

.z-grid--3 {
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}

.z-grid--4 {
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}

.z-stack > * + * {
	margin-top: var(--z-space-sm);
}

.z-cluster {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--z-space-sm);
}

/* ============================================================
   4. Dekor: soloppgang-motivet fra merkevaren
   ============================================================ */

.z-rays {
	position: absolute;
	inset: 0;
	overflow: hidden;
	pointer-events: none;
	z-index: 0;
}

.z-rays::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 160vmax;
	height: 160vmax;
	transform: translate(-50%, -50%);
	background: repeating-conic-gradient(
		from 0deg,
		var(--z-red-deep) 0deg 6deg,
		transparent 6deg 14deg
	);
	opacity: 0.18;
	mask-image: radial-gradient(circle at center, #000 0%, transparent 62%);
	-webkit-mask-image: radial-gradient(circle at center, #000 0%, transparent 62%);
}

.z-rays--left::before {
	left: 0;
}

.z-rays--right::before {
	left: 100%;
}

/* Rød glød bak innhold. */
.z-glow {
	position: absolute;
	width: 46rem;
	height: 46rem;
	border-radius: 50%;
	background: radial-gradient(circle, var(--z-red-glow) 0%, transparent 68%);
	filter: blur(40px);
	opacity: 0.5;
	pointer-events: none;
	z-index: 0;
}

/* Diagonal «speed»-strek som skiller seksjoner. */
.z-rule {
	height: 3px;
	width: 72px;
	background: var(--z-red);
	border: 0;
	margin: 0 0 var(--z-space-md);
	transform: skewX(-20deg);
}

.z-noise {
	position: absolute;
	inset: 0;
	pointer-events: none;
	opacity: 0.035;
	z-index: 1;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

.z-relative {
	position: relative;
	z-index: var(--z-z-base);
}

/* ============================================================
   5. Hjelpeklasser
   ============================================================ */

.z-sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.z-skip-link {
	position: absolute;
	top: -100px;
	left: var(--z-space-sm);
	z-index: var(--z-z-toast);
	padding: var(--z-space-2xs) var(--z-space-sm);
	background: var(--z-red);
	color: #fff;
	font-weight: var(--z-fw-bold);
	transition: top var(--z-dur) var(--z-ease);
}

.z-skip-link:focus {
	top: var(--z-space-sm);
	color: #fff;
}

.z-text-center {
	text-align: center;
}

.z-hide {
	display: none !important;
}

@media (max-width: 1024px) {
	.z-hide\@lg {
		display: none !important;
	}
}

@media (min-width: 1025px) {
	.z-show\@lg-only {
		display: none !important;
	}
}
