/*
 * halfpap.io — base styles: reset, layout, components, accessibility.
 * Consumes tokens.css. No JavaScript anywhere.
 */

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

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

* {
	margin: 0;
}

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
}

body {
	min-height: 100vh;
	background-color: var(--bg);
	color: var(--text);
	font-family: var(--font-body);
	font-size: var(--step-0);
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

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

a {
	color: var(--accent);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
}

a:hover {
	color: var(--accent-strong);
}

h1,
h2,
h3 {
	font-family: var(--font-display);
	font-weight: 700;
	line-height: 1.1;
	letter-spacing: -0.01em;
	text-wrap: balance;
}

h1 {
	font-size: var(--step-4);
}
h2 {
	font-size: var(--step-3);
	font-weight: 500;
}
h3 {
	font-size: var(--step-1);
	font-weight: 500;
}

p {
	max-width: var(--measure);
}

/* ---- Accessibility ------------------------------------------------------ */

/* Skip link — visible only when focused. */
.skip-link {
	position: absolute;
	top: 0;
	left: var(--space-m);
	transform: translateY(-130%);
	z-index: 100;
	padding: var(--space-xs) var(--space-m);
	background: var(--accent);
	color: var(--on-accent);
	border-radius: 0 0 var(--radius) var(--radius);
	text-decoration: none;
	font-weight: 600;
	transition: transform var(--transition);
}

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

/* Visible focus indicator for keyboard users. */
:focus-visible {
	outline: 3px solid var(--focus);
	outline-offset: 2px;
	border-radius: 4px;
}

/* Respect reduced-motion preference. */
@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
	*,
	*::before,
	*::after {
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.001ms !important;
	}
}

/* ---- Aurora backdrop (static, single-hue, decorative) ------------------- */

.aurora {
	position: fixed;
	inset: 0;
	z-index: -1;
	overflow: hidden;
	pointer-events: none;
	background-color: var(--bg);
	opacity: var(--aurora-opacity);
}

/* Two soft blue glows seated into the base with a vignette. */
.aurora::before {
	content: "";
	position: absolute;
	inset: -20%;
	background:
		radial-gradient(40% 38% at 18% 12%, var(--aurora-1) 0%, transparent 70%),
		radial-gradient(42% 40% at 82% 70%, var(--aurora-2) 0%, transparent 72%);
	filter: blur(70px);
}

/* Film grain for premium depth (data-URI → CSP img-src 'self' data:). */
.aurora::after {
	content: "";
	position: absolute;
	inset: 0;
	opacity: var(--grain-opacity);
	mix-blend-mode: overlay;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.4'/%3E%3C/svg%3E");
}

/* ---- Layout ------------------------------------------------------------- */

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

main {
	display: block;
}

section {
	padding-block: var(--space-2xl);
}

.flow > * + * {
	margin-top: var(--space-m);
}

/* ---- Notice bar (temporary announcements) ------------------------------- */

/*
 * Sits above the site header and carries a short, time-bound message — a
 * planned maintenance window, for instance. Deliberately built from the
 * existing tokens rather than a new warning colour: a personal site announcing
 * two hours of downtime does not need an alarm palette, and a new colour would
 * need its own dark and high-contrast variants to stay legible.
 *
 * The bar is static markup. It appears with a deploy and disappears with one —
 * there is no clock in it that could quietly keep it alive past its window.
 */
.notice-bar {
	background: var(--surface-2);
	border-bottom: 1px solid var(--border);
}

/*
 * Kein `margin: 0` hier — der Reset nullt es bereits, und die Regel waere
 * spezifischer als `.container` und wuerde dessen `margin-inline: auto`
 * kippen: die Zeile stuende dann linksbuendig statt auf der Textachse der
 * Seite. Genau so ist es beim ersten lokalen Blick am 04.08. ausgesehen.
 */
.notice-bar p {
	padding-block: var(--space-s);
	font-size: var(--step--1);
	color: var(--muted);
}

.notice-bar strong {
	color: var(--text);
	font-weight: 600;
}

/* ---- Site header / nav -------------------------------------------------- */

.site-header {
	border-bottom: 1px solid var(--border);
}

.site-header .container {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-m);
	padding-block: var(--space-m);
}

.brand {
	font-family: var(--font-display);
	font-weight: 700;
	font-size: var(--step-1);
	color: var(--text);
	text-decoration: none;
	letter-spacing: -0.02em;
}

.brand:hover {
	color: var(--text);
}

.site-nav {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-l);
}

.site-nav a {
	color: var(--muted);
	text-decoration: none;
	font-weight: 500;
	font-size: var(--step--1);
}

.site-nav a:hover {
	color: var(--text);
}

/* ---- Eyebrow label ------------------------------------------------------ */

.eyebrow {
	display: inline-flex;
	align-items: center;
	gap: var(--space-xs);
	font-size: var(--step--1);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.18em;
	color: var(--muted);
}

.eyebrow::before {
	content: "";
	width: 2rem;
	height: 1px;
	background: var(--accent);
}

/* ---- Hero --------------------------------------------------------------- */

.hero {
	padding-block: var(--space-3xl) var(--space-2xl);
}

.hero h1 {
	margin-top: var(--space-m);
}

.hero .lede {
	margin-top: var(--space-l);
	font-size: var(--step-1);
	color: var(--muted);
}

/* Hero with portrait: text + image side by side, stacks on narrow screens. */
.hero-card {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: var(--space-2xl);
	align-items: center;
}

@media (max-width: 48rem) {
	.hero-card {
		grid-template-columns: 1fr;
		gap: var(--space-xl);
	}
}

.portrait {
	width: clamp(9rem, 24vw, 14rem);
	aspect-ratio: 1;
	border-radius: var(--radius);
	border: 1px solid var(--border);
	object-fit: cover;
}

/* App-Icon-Render: Squircle-Form, Rand und Schatten stecken im Artwork
   (macOS-Icon-Grid) — kein Rahmen, dafür etwas größer als .portrait. */
.app-icon {
	width: clamp(10rem, 27vw, 16rem);
	aspect-ratio: 1;
}

.slogan {
	margin-top: var(--space-m);
	font-family: var(--font-display);
	font-weight: 500;
	color: var(--accent);
}

.section-lede {
	margin-top: var(--space-s);
	margin-bottom: var(--space-l);
	color: var(--muted);
}

.services-teaser {
	padding: var(--space-m) var(--space-l);
	border-left: 3px solid var(--accent);
	background: var(--surface-2);
	border-radius: 0 var(--radius) var(--radius) 0;
}

/* Contact links — horizontal, wrapping, dot-separated feel via gaps. */
.contact-list {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-m) var(--space-l);
	list-style: none;
	padding: 0;
	font-weight: 500;
}

/* ---- Buttons ------------------------------------------------------------ */

.btn {
	display: inline-flex;
	align-items: center;
	gap: var(--space-xs);
	padding: 0.7rem 1.4rem;
	border-radius: var(--radius-pill);
	border: 1px solid transparent;
	font-weight: 600;
	font-size: var(--step-0);
	text-decoration: none;
	cursor: pointer;
	transition: transform var(--transition), background-color var(--transition),
		color var(--transition), border-color var(--transition);
}

.btn-primary {
	background: var(--accent);
	color: var(--on-accent);
}

.btn-primary:hover {
	background: var(--accent-strong);
	color: var(--on-accent);
	transform: translateY(-1px);
}

.btn-ghost {
	background: transparent;
	color: var(--text);
	border-color: var(--border);
}

.btn-ghost:hover {
	background: var(--surface-2);
	color: var(--text);
}

.btn-group {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-m);
	margin-top: var(--space-xl);
}

/* ---- Cards / tiles ------------------------------------------------------ */

.tile-grid {
	display: grid;
	/* auto-fit ist hier richtig, nicht auto-fill (gemessen 2026-08-09): auto-fit
	   klappt nur LEERE Spuren ein. Bei 5 Projektkacheln in 4 Spalten ist keine
	   Spur leer, der befürchtete Voll-Breiten-Effekt tritt also nie auf. Wirksam
	   wird der Unterschied allein im 2-Kachel-Abschnitt „Aus der Werkstatt", und
	   dort füllt auto-fit die Reihe (2x 540px) statt sie halb leer zu lassen
	   (2x 258px). Die Empfehlung in docs/specs/2026-07-26 gilt für diese Seite
	   nicht. */
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
	gap: var(--space-l);
}

.card {
	display: flex;
	flex-direction: column;
	gap: var(--space-xs);
	padding: var(--space-l);
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	transition: transform var(--transition), border-color var(--transition);
}

a.card {
	text-decoration: none;
	color: var(--text);
}

a.card:hover {
	transform: translateY(-2px);
	border-color: var(--accent);
	color: var(--text);
}

.card h3 {
	color: var(--text);
}

.card p {
	color: var(--muted);
	font-size: var(--step--1);
	/* Guard: long tokens (e.g. hyphenated product names) must wrap, not spill. */
	overflow-wrap: break-word;
}

/* Genesis timelapse video: rounded to sit calmly inside its card. Playback is
   gated in /js/genesis.js (reduced-motion → poster only; play only when in view). */
.genesis-video {
	border-radius: calc(var(--radius) - 1px);
	background: var(--surface);
}

.hairline {
	border: 1px solid var(--border);
}

/* ---- Footer ------------------------------------------------------------- */

.site-footer {
	border-top: 1px solid var(--border);
	padding-block: var(--space-xl);
	color: var(--muted);
	font-size: var(--step--1);
}

.site-footer .container {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-m);
}

.footer-links {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-l);
	list-style: none;
	padding: 0;
}

.footer-links a {
	color: var(--muted);
	text-decoration: none;
}

.footer-links a:hover {
	color: var(--text);
	text-decoration: underline;
}

/* ---- Prose (legal / policy long-form text) ------------------------------ */

.prose {
	max-width: var(--measure);
}

.prose h2 {
	margin-top: var(--space-xl);
}

.prose h3 {
	margin-top: var(--space-l);
	margin-bottom: var(--space-2xs);
}

.prose ul {
	padding-left: 1.25rem;
}

.prose li + li {
	margin-top: var(--space-2xs);
}

.prose address {
	font-style: normal;
	color: var(--text);
}

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

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