/* ==========================================================================
   MPUNKT38 – Haupt-Stylesheet
   Aufbau: 1 Schriften · 2 Tokens · 3 Basis · 4 Header · 5 Hero · 6 Karten
           7 Seiten · 8 Footer · 9 Hilfen · 10 Dunkelmodus · 11 Bewegung
   ========================================================================== */

/* 1 Schriften (lokal, DSGVO-konform) ------------------------------------ */
@font-face {
	font-family: "Inter";
	src: url("../fonts/inter-var.woff2") format("woff2");
	font-weight: 100 900;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "Oswald";
	src: url("../fonts/oswald-var.woff2") format("woff2");
	font-weight: 200 700;
	font-style: normal;
	font-display: swap;
}

/* 2 Tokens --------------------------------------------------------------- */
:root {
	--mp-brand: #14c691;
	--mp-brand-bright: #14e2a4;
	--mp-brand-deep: #0b7a58;
	--mp-ink: #23203f;
	--mp-muted: #716f87;
	--mp-bg: #ffffff;
	--mp-surface: #f1f1f1;
	--mp-line: #eaeaea;
	--mp-blue: #1469eb;
	--mp-blue-2: #4d8af0;
	--mp-sky: #6ec1e4;

	--mp-font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--mp-font-heading: "Poppins", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
	--mp-font-logo: "Oswald", "Arial Narrow", sans-serif;

	--mp-gutter: clamp(1rem, 4vw, 2rem);
	--mp-header-h: 6.25rem;
	--mp-ease: cubic-bezier(0.165, 0.84, 0.44, 1);

	color-scheme: light dark;
}

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

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

body {
	margin: 0;
	background: var(--mp-bg);
	color: var(--mp-ink);
	font-family: var(--mp-font-body);
	font-size: clamp(1rem, 0.3vw + 0.95rem, 1.0625rem);
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	overflow-x: clip;
}

img, svg, video { max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--mp-font-heading); line-height: 1.15; letter-spacing: -0.02em; }

/* Der Header liegt fest über dem Inhalt. Normale Seiten beginnen darunter; der
   Hero zieht sich um genau diese Höhe zurück und startet so am oberen Rand,
   direkt unter dem Header – ohne Naht und ohne Lücke. */
.mp-main { padding-top: var(--mp-header-h); }
.mp-main > .mp-hero:first-child { margin-top: calc(var(--mp-header-h) * -1); }

.mp-btn {
	display: inline-block;
	padding: 1.05rem 2.2rem;
	border: 1px solid var(--mp-ink);
	border-radius: 0.25rem;
	background: transparent;
	color: var(--mp-ink);
	font: 600 0.875rem/1.2 var(--mp-font-body);
	letter-spacing: 0.02em;
	text-decoration: none;
	transition: background-color 0.2s, border-color 0.2s, transform 0.2s var(--mp-ease);
}
.mp-btn:hover,
.mp-btn:focus-visible {
	border-color: var(--mp-brand);
	background: var(--mp-brand-bright);
	color: #14131f;
	transform: translateY(-2px);
}

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

/* 4 Header (sticky) ------------------------------------------------------ */
/* Fest am oberen Rand, im selben Grau wie der Hero: der Hero schiebt sich
   beim Scrollen unter den Header. */
.mp-header {
	position: fixed;
	top: 0;
	right: 0;
	left: 0;
	z-index: 1000;
	background: var(--mp-surface);
	transition: box-shadow 0.25s;
}
.admin-bar .mp-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .mp-header { top: 46px; } }
.mp-header.is-stuck { box-shadow: 0 8px 28px -14px rgba(0, 0, 0, 0.35); }

.mp-header__in {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: start;
	min-height: var(--mp-header-h);
	max-width: 1210px;
	margin-inline: auto;
	padding-inline: var(--mp-gutter);
}
.mp-header__logo { justify-self: center; padding-block: 0.35rem; line-height: 0; }
.mp-header__img { display: block; width: clamp(4.25rem, 6vw, 5.5rem); height: auto; transition: width 0.25s var(--mp-ease); }
.is-stuck .mp-header__img { width: clamp(3.5rem, 5vw, 4.25rem); }
.mp-header__nav { justify-self: end; }

.mp-menu { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0 0.25rem; margin: 0; padding: 0; list-style: none; }
.mp-menu a {
	display: block;
	padding: 0.95rem 0.8rem 0.5rem;
	border-top: 7.5px solid transparent;
	color: var(--mp-ink);
	font-size: 0.9375rem;
	text-decoration: none;
	transition: border-color 0.2s;
}
.mp-menu a:hover,
.mp-menu a:focus-visible,
.mp-menu .current-menu-item > a,
.mp-menu a[aria-current] { border-top-color: var(--mp-brand); }

@media (max-width: 600px) {
	.mp-header__in { grid-template-columns: auto 1fr; }
	.mp-header__logo { justify-self: start; }
	.mp-header__spacer { display: none; }
	.mp-menu { flex-wrap: nowrap; }
	.mp-menu a { padding: 0.8rem 0.45rem 0.4rem; font-size: 0.8125rem; white-space: nowrap; }
	.mp-header__img { width: 3.75rem; }
	.is-stuck .mp-header__img { width: 3.25rem; }
	:root { --mp-header-h: 5rem; }
}
@media (max-width: 360px) {
	.mp-menu a { padding-inline: 0.3rem; font-size: 0.75rem; }
}

/* 5 Hero ----------------------------------------------------------------- */
/* Alles misst sich an --u (Maßeinheit der Komposition: 100 u = volle Breite am
   Desktop). --u rechnet mit der Hero-Breite (cqw) für alle Kinder, --uh mit der
   Fensterbreite (vw) für die Höhe des Heros selbst.
   Auf Tablet und Handy „zoomt“ die Komposition hinein: u wird größer, die graue
   Schale ist dann breiter als der Bildschirm, ihr Rand und die unteren Kanten der
   Kreise liegen außerhalb des Bildes und werden angeschnitten. */
.mp-hero {
	--u: max(1cqw, 0.62rem);
	--uh: max(1vw, 0.62rem);
	position: relative;
	container-type: inline-size;
	width: 100%;
	max-width: 100%;
	height: calc(var(--uh) * 40);
	overflow: hidden;
	background: var(--mp-bg);
}
/* Tablet: 600–1100 px, stufenlos von 2,6 % (bei 600) auf 1 % (bei 1100). */
@media (min-width: 601px) and (max-width: 1100px) {
	.mp-hero {
		--u: max(1cqw, calc(21.1px - 0.92cqw));
		--uh: max(1vw, calc(21.1px - 0.92vw));
	}
}
/* Handy: starker Zoom, Karte ≈ 35 % der Breite. */
@media (max-width: 600px) {
	.mp-hero {
		--u: 2.6cqw;
		--uh: 2.6vw;
	}
}
/* Naht-Absicherung: ein graues „Schatten“-Feld über dem Hero füllt jeden Spalt
   zwischen Header und Hero im selben Grau. */
.mp-main > .mp-hero:first-child { box-shadow: 0 -14rem 0 0 var(--mp-surface); }
.mp-hero::after {
	content: "";
	position: absolute;
	inset: auto 12% 0;
	height: 1px;
	background: linear-gradient(90deg, transparent, var(--mp-line), transparent);
}

/* Die Schale ist mindestens 100 u breit, auch wenn der Bildschirm schmaler ist:
   Ihr Rand liegt dann außerhalb des Bildes, die Wölbung wirkt nie gestaucht. */
.mp-hero__bowl {
	position: absolute;
	top: 0;
	left: 50%;
	width: max(100%, calc(var(--u) * 100));
	translate: -50% 0;
	height: calc(var(--u) * 39);
	overflow: hidden;
	border-radius: 0 0 50% 50% / 0 0 calc(var(--u) * 24) calc(var(--u) * 24);
	background: var(--mp-surface);
	box-shadow: 0 18px 50px -24px rgba(35, 32, 63, 0.35);
}
/* Zweite, deckungsgleiche Schale vor der Karte: trägt Kreis 3 + 4, damit die
   Karte „zwischen Kreis 2 und 3 steckt“. */
.mp-hero__bowl--front {
	background: none;
	box-shadow: none;
	pointer-events: none;
}
/* Vier konzentrische Kreise: der Anker für die Profilkarte. Mittelpunkt liegt
   unterhalb des Heros, die Wölbung der Schale schneidet sie unten ab. */
.mp-hero__circle {
	position: absolute;
	left: 50%;
	top: calc(var(--u) * 57.8);
	aspect-ratio: 1;
	translate: -50% -50%;
	border-radius: 50%;
}
.mp-hero__circle--1 { width: calc(var(--u) * 61.6); background: #14e2a4; }
.mp-hero__circle--2 { width: calc(var(--u) * 56.8); background: #13d59b; }
.mp-hero__circle--3 { width: calc(var(--u) * 51.6); background: #14c691; }
.mp-hero__circle--4 { width: calc(var(--u) * 45.8); background: #12b183; }

/* Icon-Ring: gleicher Mittelpunkt wie die Kreise, dreht sich fortlaufend. */
.mp-hero__ring {
	position: absolute;
	left: 50%;
	top: calc(var(--u) * 57.8);
	width: calc(var(--u) * 76.6);
	aspect-ratio: 1;
	translate: -50% -50%;
	pointer-events: none;
	/* Umlaufzeit: hier einstellen (kleiner = schneller). */
	animation: mp-spin var(--mp-ring-speed, 80s) linear infinite;
	will-change: rotate;
}
.mp-hero__ring img { display: block; width: 100%; height: 100%; }
.mp-hero.is-offscreen .mp-hero__ring { animation-play-state: paused; }

.mp-hero__card {
	position: absolute;
	left: 50%;
	top: calc(var(--u) * 13.5);
	/* Das Kartenbild ist hoch (1:1,9); sein unterer, leerer Teil verschwindet
	   hinter Kreis 3. Sichtbare Karte ≈ 13,7 u breit, Bild inkl. Schatten 15,4 u.
	   -44,6 % zentriert die Karte selbst (der Schatten liegt rechts daneben). */
	width: calc(var(--u) * 15.4);
	margin: 0;
	translate: -44.6% 0;
}
.mp-hero__card img { display: block; width: 100%; height: auto; }

.mp-hero__down {
	position: absolute;
	left: 50%;
	top: calc(var(--u) * 38.4);
	display: grid;
	place-items: center;
	width: max(calc(var(--u) * 3.1), 2.75rem);
	aspect-ratio: 1;
	translate: -50% -50%;
	border-radius: 50%;
	background: linear-gradient(313deg, var(--mp-blue), var(--mp-blue-2));
	box-shadow: 0 10px 30px -6px rgba(20, 105, 235, 0.55);
	color: #fff;
	transition: transform 0.25s var(--mp-ease), box-shadow 0.25s;
}
.mp-hero__down:hover,
.mp-hero__down:focus-visible { transform: translateY(4px); box-shadow: 0 16px 36px -8px rgba(20, 105, 235, 0.65); }

.mp-anchor { display: block; height: 0; }

@keyframes mp-spin { to { rotate: 360deg; } }

/* 6 Karten (Wissen & Projekte) ------------------------------------------- */
.mp-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
	gap: clamp(1.25rem, 3vw, 2.25rem);
}
.mp-card {
	position: relative;
	overflow: hidden;
	aspect-ratio: 4 / 5;
	border-radius: clamp(1.5rem, 4vw, 3.125rem);
	background: var(--mp-surface);
	box-shadow: 10px 20px 80px rgba(7, 65, 154, 0.25);
	isolation: isolate;
}
.mp-card__link { position: absolute; inset: 0; display: block; color: #fff; text-decoration: none; }
.mp-card__media { position: absolute; inset: 0; }
.mp-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s var(--mp-ease); }
.mp-card__media::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(313deg, var(--mp-blue) 0%, var(--mp-blue-2) 100%);
	opacity: 0;
	transition: opacity 0.7s var(--mp-ease);
}
.mp-card__body {
	position: absolute;
	inset: auto 0 0;
	z-index: 2;
	display: grid;
	gap: 0.5rem;
	padding: clamp(1.25rem, 3vw, 2rem);
	background: linear-gradient(to top, rgba(20, 19, 31, 0.78), transparent);
}
.mp-card__title { margin: 0; font-size: clamp(1.15rem, 1vw + 0.9rem, 1.5rem); color: #fff; }
.mp-card__text { margin: 0; max-height: 0; overflow: hidden; opacity: 0; font-size: 0.9375rem; transition: max-height 0.7s var(--mp-ease), opacity 0.7s var(--mp-ease); }
.mp-card__more { font-size: 0.875rem; font-weight: 600; color: var(--mp-brand-bright); }
.mp-card__more::after { content: " \2192"; display: inline-block; transition: transform 0.25s var(--mp-ease); }

.mp-card:hover .mp-card__media img,
.mp-card:focus-within .mp-card__media img { transform: scale(1.05); }
.mp-card:hover .mp-card__media::after,
.mp-card:focus-within .mp-card__media::after { opacity: 0.85; }
.mp-card:hover .mp-card__text,
.mp-card:focus-within .mp-card__text { max-height: 8rem; opacity: 1; }
.mp-card:hover .mp-card__more::after { transform: translateX(4px); }
@media (hover: none) {
	.mp-card__text { max-height: 8rem; opacity: 1; }
}

/* 7 Seiten --------------------------------------------------------------- */
.mp-page,
.mp-archive { max-width: 62rem; margin: 0 auto; padding: clamp(2rem, 6vw, 5rem) var(--mp-gutter); }
.mp-archive { max-width: 1140px; }
.mp-page__head h1,
.mp-archive__head h1 { margin: 0 0 1.5rem; font-size: clamp(2rem, 4vw + 0.5rem, 3.25rem); }
.mp-page__skills { margin: 0 0 0.5rem; color: var(--mp-brand-deep); font-size: 0.875rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; }
.mp-page__skills a { text-decoration: none; }
.mp-page__media { margin: 0 0 2rem; }
.mp-page__media img { border-radius: clamp(1rem, 3vw, 2rem); }
.mp-prose { max-width: 44rem; }
.mp-prose a { color: var(--mp-blue); }
.pagination { margin-top: 2.5rem; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.pagination .page-numbers { padding: 0.5rem 0.9rem; border: 1px solid var(--mp-line); border-radius: 0.25rem; text-decoration: none; }
.pagination .current { border-color: var(--mp-brand); background: var(--mp-brand-bright); color: #14131f; }

/* 8 Footer & Nach-oben-Button -------------------------------------------- */
.mp-footer { border-top: 1px solid var(--mp-line); background: var(--mp-bg); }
.mp-footer__in {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem 2rem;
	max-width: 1140px;
	margin-inline: auto;
	padding: 1rem var(--mp-gutter);
	font-size: 0.875rem;
	color: var(--mp-muted);
}
.mp-footer__copy { margin: 0; }
.mp-menu--footer a { padding: 0.4rem 0.6rem; border-top: 0; color: var(--mp-muted); }
.mp-menu--footer a:hover { color: var(--mp-brand-deep); }

.mp-totop {
	position: fixed;
	right: clamp(1rem, 3vw, 1.75rem);
	bottom: clamp(1rem, 3vw, 1.75rem);
	z-index: 900;
	display: grid;
	place-items: center;
	width: 3rem;
	height: 3rem;
	border: 0;
	border-radius: 50%;
	background: var(--mp-brand);
	color: #fff;
	box-shadow: 0 10px 28px -8px rgba(11, 122, 88, 0.6);
	cursor: pointer;
	opacity: 0;
	translate: 0 0.75rem;
	transition: opacity 0.3s, translate 0.3s var(--mp-ease), background-color 0.2s;
}
.mp-totop[hidden] { display: none; }
.mp-totop.is-visible { opacity: 1; translate: 0 0; }
.mp-totop:hover { background: var(--mp-brand-deep); }

/* 9 Hilfen & Seitenübergang ---------------------------------------------- */
.mp-sr {
	position: absolute !important;
	width: 1px; height: 1px;
	margin: -1px; padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}
.mp-skip {
	position: fixed;
	left: 1rem;
	top: -4rem;
	z-index: 2000;
	padding: 0.75rem 1.25rem;
	border-radius: 0.25rem;
	background: var(--mp-ink);
	color: #fff;
	transition: top 0.2s;
}
.mp-skip:focus { top: 1rem; }

.mp-fx .mp-main { animation: mp-in 0.45s var(--mp-ease) 0.05s both; }
.mp-fx.is-leaving .mp-main { opacity: 0; transition: opacity 0.25s ease-in; }
@keyframes mp-in { from { opacity: 0; translate: 0 0.5rem; } }

/* 10 Dunkelmodus --------------------------------------------------------- */
@media (prefers-color-scheme: dark) {
	:root {
		--mp-bg: #14131f;
		--mp-surface: #1f1e2e;
		--mp-line: #2e2d42;
		--mp-ink: #f2f2f7;
		--mp-muted: #a9a7bd;
		--mp-brand-deep: #4fe0b6;
	}
	.mp-hero__bowl { box-shadow: 0 18px 50px -24px rgba(0, 0, 0, 0.7); }
	.mp-btn:hover, .mp-btn:focus-visible { color: #14131f; }
}

/* 11 Bewegung reduzieren ------------------------------------------------- */
@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; }
	.mp-hero__ring { animation: none; }
}
