/* ==========================================================================
   Mario Karasch – main.css
   ========================================================================== */

@font-face {
	font-family: "Inter Tight";
	src: url("../fonts/inter-tight-latin-wght-normal.woff2") format("woff2-variations"),
	     url("../fonts/inter-tight-latin-wght-normal.woff2") format("woff2");
	font-weight: 100 900;
	font-style: normal;
	font-display: swap;
}

:root {
	--bg: #0b0b0c;
	--fg: #f3f1ec;
	--muted: rgba(243, 241, 236, 0.55);
	--faint: rgba(243, 241, 236, 0.32);
	--line: rgba(243, 241, 236, 0.08);
	--line-strong: rgba(243, 241, 236, 0.16);
	--signal: #9be7b4;

	--gutter: clamp(20px, 3.6vw, 56px);
	--inset: 16px; /* Abstand des Contents zu jeder Rasterlinie */
	--cols: 4;
	--ease: cubic-bezier(0.16, 1, 0.3, 1);

	/* Höhe der WP-Admin-Bar (nur eingeloggt), siehe .admin-bar */
	--mk-top: 0px;

	--font: "Inter Tight", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

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

body {
	margin: 0;
	min-height: calc(100vh - var(--mk-top));
	min-height: calc(100svh - var(--mk-top));
	background:
		radial-gradient(120% 80% at 70% 110%, #17171a 0%, transparent 60%),
		var(--bg);
	color: var(--fg);
	font-family: var(--font);
	font-size: 15px;
	font-weight: 400;
	line-height: 1.5;
	letter-spacing: -0.005em;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	font-feature-settings: "ss01", "cv11";
}

/* WordPress Admin-Bar: html bekommt margin-top, fixierte Ebenen rücken nach. */
body.admin-bar { --mk-top: var(--wp-admin--admin-bar--height, 32px); }

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

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

:focus-visible {
	outline: 1px solid var(--fg);
	outline-offset: 4px;
	border-radius: 2px;
}

/* --------------------------------------------------------------------------
   Raster – sichtbare Spaltenlinien als Strukturelement
   ----------------------------------------------------------------------- */

.mk-guides {
	position: fixed;
	inset: var(--mk-top) var(--gutter) 0;
	z-index: 1;
	display: grid;
	grid-template-columns: repeat(var(--cols), 1fr);
	pointer-events: none;
}

.mk-guides span {
	border-left: 1px solid var(--line);
	transform-origin: top;
	animation: mk-line 1.6s var(--ease) both;
}

.mk-guides span:last-child { border-right: 1px solid var(--line); }
.mk-guides span:nth-child(2) { animation-delay: 0.08s; }
.mk-guides span:nth-child(3) { animation-delay: 0.16s; }
.mk-guides span:nth-child(4) { animation-delay: 0.24s; }

@keyframes mk-line {
	from { transform: scaleY(0); }
	to   { transform: scaleY(1); }
}

/* --------------------------------------------------------------------------
   WebGL-Szene
   ----------------------------------------------------------------------- */

.mk-scene {
	position: fixed;
	inset: var(--mk-top) 0 0;
	z-index: 0;
	width: 100%;
	height: calc(100% - var(--mk-top));
	display: block;
	opacity: 0;
	transition: opacity 2s ease;
}

.mk-scene.is-ready { opacity: 1; }

.mk-shade {
	position: fixed;
	inset: var(--mk-top) 0 0;
	z-index: 0;
	pointer-events: none;
	background:
		linear-gradient(180deg, var(--bg) 0%, rgba(11, 11, 12, 0) 28%),
		linear-gradient(0deg, rgba(11, 11, 12, 0.85) 0%, rgba(11, 11, 12, 0) 38%),
		linear-gradient(90deg, rgba(11, 11, 12, 0.7) 0%, rgba(11, 11, 12, 0) 55%);
}

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

.mk-shell {
	position: relative;
	z-index: 2;
	min-height: calc(100vh - var(--mk-top));
	min-height: calc(100svh - var(--mk-top));
	display: grid;
	grid-template-rows: auto 1fr auto;
	padding: 0 var(--gutter);
}

.mk-bar,
.mk-details,
.mk-foot {
	display: grid;
	grid-template-columns: repeat(var(--cols), 1fr);
}

/* Kopfzeile ------------------------------------------------------------- */

.mk-bar {
	padding: 22px 0 20px;
	border-bottom: 1px solid var(--line);
}

.mk-cell {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 0 var(--inset);
	min-width: 0;
	font-size: 14px;
}

.mk-cell--end { align-items: flex-end; text-align: right; }

.mk-home {
	display: flex;
	align-items: center;
	gap: 14px;
}

.mk-logo {
	flex: none;
	width: auto;
	height: 30px;
	color: var(--fg);
	transition: transform 0.6s var(--ease);
}

.mk-home:hover .mk-logo { transform: translateX(-2px); }

.mk-home-text {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.mk-brand { font-weight: 600; letter-spacing: -0.01em; }

.mk-label {
	color: var(--muted);
	font-size: 13px;
}

/* Inline-Linklisten: Sprachumschalter & Profile */
.mk-lang,
.mk-profiles {
	display: flex;
	gap: 4px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.mk-lang li + li::before,
.mk-profiles li + li::before {
	content: "/";
	margin-right: 4px;
	color: var(--faint);
}

/* Sprachumschalter (TranslatePress) */
.mk-lang a {
	color: var(--faint);
	transition: color 0.3s;
}

.mk-lang a:hover,
.mk-lang a.is-current { color: var(--fg); }

.mk-status {
	display: inline-flex;
	align-items: center;
	gap: 9px;
}

.mk-dot {
	position: relative;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--signal);
	flex: none;
}

.mk-dot::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 50%;
	background: var(--signal);
	animation: mk-pulse 2.4s ease-out infinite;
}

@keyframes mk-pulse {
	0%   { transform: scale(1); opacity: 0.7; }
	80%, 100% { transform: scale(3.4); opacity: 0; }
}

.mk-link {
	position: relative;
	display: inline-block;
}

.mk-link::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: -1px;
	height: 1px;
	background: currentColor;
	transform: scaleX(0);
	transform-origin: right;
	transition: transform 0.5s var(--ease);
}

.mk-link:hover::after {
	transform: scaleX(1);
	transform-origin: left;
}

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

.mk-hero {
	align-self: end;
	padding: clamp(48px, 12vh, 140px) 0 clamp(36px, 7vh, 72px);
}

.mk-headline {
	margin: 0 0 clamp(36px, 6vh, 64px);
	padding: 0 var(--inset);
	max-width: 12ch;
	font-size: clamp(52px, 9.4vw, 168px);
	font-weight: 500;
	line-height: 0.94;
	letter-spacing: -0.052em;
	text-wrap: balance;
}

/* Bis ui.js die Headline in Wörter zerlegt hat, unsichtbar –
   mit Fallback, falls das Skript nicht lädt. */
.mk-js .mk-headline:not(.is-split) {
	opacity: 0;
	animation: mk-unhide 0.6s ease 2s forwards;
}

@keyframes mk-unhide { to { opacity: 1; } }

.mk-word {
	display: inline-block;
	overflow: hidden;
	vertical-align: top;
	/* Luft für Ober-/Unterlängen (ä, ü, g, j), ohne die Zeilenhöhe zu ändern. */
	padding: 0.08em 0.04em 0.22em;
	margin: -0.08em -0.04em -0.22em;
}

.mk-word > span {
	display: inline-block;
	/* Komplett unterhalb der Maske starten (inkl. 0.22em Unterlängen-Puffer). */
	transform: translate3d(0, calc(100% + 0.3em), 0);
	animation: mk-rise 1.3s var(--ease) both;
	animation-delay: calc(0.45s + var(--i) * 0.09s);
}

.mk-em {
	font-weight: 200;
	letter-spacing: -0.045em;
}

@keyframes mk-rise {
	to { transform: translate3d(0, 0, 0); }
}

.mk-details {
	align-items: end;
	padding-top: 22px;
	border-top: 1px solid var(--line);
}

.mk-intro {
	grid-column: 1 / span 2;
	margin: 0;
	max-width: 38ch;
	padding: 0 var(--inset);
	color: var(--muted);
	font-size: clamp(16px, 1.25vw, 19px);
	line-height: 1.5;
	text-wrap: pretty;
}

.mk-services {
	padding: 0 var(--inset);
	align-self: start;
}

.mk-services ul {
	margin: 8px 0 0;
	padding: 0;
	list-style: none;
	font-size: 14px;
	line-height: 1.75;
}

.mk-actions {
	padding: 0 var(--inset);
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 14px;
}

/* Button ---------------------------------------------------------------- */

.mk-button {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 14px;
	padding: 17px 22px 17px 26px;
	border-radius: 999px;
	background: var(--fg);
	color: var(--bg);
	font-size: 15px;
	font-weight: 500;
	overflow: hidden;
	isolation: isolate;
	transition: transform 0.5s var(--ease);
}

.mk-button::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: #fff;
	border-radius: inherit;
	transform: scale(0.2);
	opacity: 0;
	transition: transform 0.6s var(--ease), opacity 0.3s;
}

.mk-button svg { transition: transform 0.5s var(--ease); }
.mk-button:hover::before { transform: scale(1); opacity: 1; }
.mk-button:hover svg { transform: translateX(4px); }
.mk-button:active { transform: scale(0.98); }

.mk-copy {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 4px 0;
	border: 0;
	background: none;
	color: var(--muted);
	font: inherit;
	font-size: 13px;
	cursor: pointer;
	transition: color 0.3s;
}

.mk-copy:hover { color: var(--fg); }
.mk-copy.is-copied { color: var(--signal); }

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

.mk-foot {
	align-items: center;
	padding: 18px 0 22px;
	border-top: 1px solid var(--line);
	color: var(--muted);
	font-size: 13px;
}

.mk-foot > span { padding: 0 var(--inset); }

.mk-nowrap { white-space: nowrap; }

.mk-legal {
	grid-column: 3 / -1;
	display: flex;
	justify-content: flex-end;
	gap: 28px;
	margin: 0;
	padding: 0 var(--inset);
	list-style: none;
}

.mk-legal a { transition: color 0.3s; }
.mk-legal a:hover { color: var(--fg); }

/* --------------------------------------------------------------------------
   Unterseiten (Impressum, Datenschutz …)
   ----------------------------------------------------------------------- */

.mk-page { padding: clamp(48px, 10vh, 120px) 0; }

.mk-article {
	max-width: 760px;
	margin-left: calc(100% / var(--cols));
	padding-left: var(--inset);
}

.mk-back {
	display: inline-block;
	margin-bottom: 32px;
	color: var(--muted);
	font-size: 14px;
	transition: color 0.3s;
}

.mk-back:hover { color: var(--fg); }

.mk-page-title {
	margin: 8px 0 40px;
	font-size: clamp(40px, 5vw, 72px);
	font-weight: 500;
	line-height: 1;
	letter-spacing: -0.045em;
}

.mk-content {
	color: rgba(243, 241, 236, 0.78);
	font-size: 16px;
	line-height: 1.7;
}

.mk-content h2,
.mk-content h3 {
	margin: 2.2em 0 0.6em;
	color: var(--fg);
	font-weight: 500;
	letter-spacing: -0.02em;
	line-height: 1.2;
}

.mk-content h2 { font-size: 24px; }
.mk-content h3 { font-size: 18px; }
.mk-content a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--faint); }
.mk-content a:hover { text-decoration-color: var(--fg); }

/* --------------------------------------------------------------------------
   Einblenden
   ----------------------------------------------------------------------- */

.mk-reveal {
	animation: mk-fade 1.2s var(--ease) both;
	animation-delay: calc(0.15s + var(--d, 0) * 0.08s);
}

@keyframes mk-fade {
	from { opacity: 0; transform: translate3d(0, 12px, 0); }
	to   { opacity: 1; transform: none; }
}

/* --------------------------------------------------------------------------
   Responsive
   ----------------------------------------------------------------------- */

@media (max-width: 1024px) {
	.mk-details { row-gap: 32px; }
	.mk-intro { grid-column: 1 / -1; }
	.mk-services { grid-column: 1 / span 2; }
	.mk-actions { grid-column: 3 / -1; }
}

@media (max-width: 720px) {
	:root { --cols: 2; --inset: 12px; }

	.mk-guides span:nth-child(n + 3) { display: none; }
	.mk-guides span:nth-child(2) { border-right: 1px solid var(--line); }

	.mk-shade {
		background:
			linear-gradient(180deg, var(--bg) 0%, rgba(11, 11, 12, 0) 22%),
			linear-gradient(0deg, rgba(11, 11, 12, 0.7) 0%, rgba(11, 11, 12, 0) 30%);
	}

	.mk-bar { row-gap: 16px; grid-template-columns: 1fr auto; }
	.mk-home { gap: 12px; }
	.mk-logo { height: 26px; }
	.mk-cell { font-size: 13px; }
	.mk-cell--lang { grid-column: 2; grid-row: 1; align-items: flex-end; text-align: right; }
	.mk-cell--status { grid-column: 1; grid-row: 2; }
	.mk-cell--profiles { grid-column: 2; grid-row: 2; align-items: flex-end; text-align: right; }

	.mk-headline { font-size: clamp(44px, 14vw, 88px); }

	.mk-services { grid-column: 1 / -1; }
	.mk-actions { grid-column: 1 / -1; align-items: stretch; }
	.mk-button { justify-content: space-between; }
	.mk-copy { justify-content: center; }

	.mk-legal { grid-column: 2; gap: 18px; }

	.mk-article { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-delay: 0s !important;
		transition-duration: 0.01ms !important;
	}
}
