/* codheim — design system
   Brand blue (#58a6ff, from the logo) for surfaces, graphics and accents.
   Text accent #1f4e79: 8.7:1 on white (WCAG AAA).
   No external requests: fonts served from this origin, no CDNs, no JS. */

@font-face {
	font-family: 'Inter';
	font-style: normal;
	font-weight: 100 900;
	font-display: swap;
	src: url('/fonts/inter-latin-ext.woff2') format('woff2');
	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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
	font-family: 'Inter';
	font-style: normal;
	font-weight: 100 900;
	font-display: swap;
	src: url('/fonts/inter-latin.woff2') format('woff2');
	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: 'Space Grotesk';
	font-style: normal;
	font-weight: 300 700;
	font-display: swap;
	src: url('/fonts/space-grotesk-latin-ext.woff2') format('woff2');
	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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
	font-family: 'Space Grotesk';
	font-style: normal;
	font-weight: 300 700;
	font-display: swap;
	src: url('/fonts/space-grotesk-latin.woff2') format('woff2');
	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;
}

:root {
	--bg: #ffffff;
	--surface: #f4f8fd;
	--fg: #0e1116;
	--muted: #57606a;
	--border: #dce4ee;
	--accent: #1f4e79;
	--blue: #58a6ff;
	--blue-soft: rgba(88, 166, 255, 0.12);
	--dark: #0e1116;
	--dark-2: #161b22;
	--on-dark: rgba(230, 237, 243, 0.78);
	--on-dark-muted: rgba(230, 237, 243, 0.55);
	--line-dark: rgba(240, 246, 252, 0.12);
	--radius: 14px;
	--shadow: 0 8px 28px rgba(14, 17, 22, 0.08);
	--font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	--font-display: 'Space Grotesk', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
	--mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* Display font (Space Grotesk) for headlines, brand, buttons, badges,
   eyebrows and column headings — Inter remains the body/reading font. */
h1, h2, h3, .brand, .btn, .badge, .section-eyebrow, .product-name, .product-tag, .footer-col h3, .lang-switch {
	font-family: var(--font-display);
}

* { box-sizing: border-box; }

html, body {
	margin: 0;
	padding: 0;
	background: var(--bg);
	color: var(--fg);
	font-family: var(--font);
	min-height: 100vh;
}

body {
	display: flex;
	flex-direction: column;
	font-size: 1rem;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
}

::selection {
	background: var(--blue);
	color: #ffffff;
}

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

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

.skip-link {
	position: absolute;
	left: -999px;
	top: 0;
	background: var(--blue);
	color: var(--dark);
	padding: 0.5rem 1rem;
	border-radius: 0 0 8px 0;
	font-weight: 600;
	z-index: 100;
}
.skip-link:focus { left: 0; color: var(--dark); }

.container {
	max-width: 1080px;
	margin: 0 auto;
	padding: 0 1.5rem;
	width: 100%;
}

/* ---------- Header (all pages) ---------- */

.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: rgba(255, 255, 255, 0.86);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border-bottom: 1px solid var(--border);
}

.header-inner {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.25rem 1.5rem;
	min-height: 64px;
}

.brand {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	color: var(--fg);
	text-decoration: none;
	font-weight: 700;
	font-size: 1.05rem;
	letter-spacing: -0.01em;
	padding: 0.5rem 0;
}
.brand:hover { color: var(--fg); }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
/* App pages: logo link plus a separate "an app by codheim" line.
   Two sibling links (no nested <a>); the logo sits left of both lines. */
.brand-lockup {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-height: 48px;
	padding: 0.4rem 0 0.4rem calc(32px + 0.65rem);
}
.brand-lockup .brand { padding: 0; line-height: 1.3; }
.brand-lockup .brand img {
	position: absolute;
	left: 0;
	top: 50%;
	margin-top: -16px;
}
.brand-sub {
	display: flex;
	align-items: center;
	gap: 0.3rem;
	font-family: var(--font-display);
	font-size: 0.7rem;
	font-weight: 500;
	color: var(--muted);
	line-height: 1.2;
	margin-top: 2px;
}
/* "an app by" + the small codheim "CH" logo, which is the link */
.brand-sub-logo {
	display: inline-flex;
	border-radius: 4px;
	text-decoration: none;
	transition: opacity 0.15s ease;
}
.brand-sub-logo img { display: block; width: 17px; height: 17px; border-radius: 4px; }
.brand-sub-logo:hover { opacity: 0.75; }
.brand-sub-logo:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.main-nav {
	display: flex;
	align-items: center;
	gap: 0.25rem;
	margin-left: auto;
}
.main-nav a {
	color: var(--muted);
	text-decoration: none;
	font-size: 0.95rem;
	padding: 0.45rem 0.8rem;
	border-radius: 8px;
}
.main-nav .nav-short { display: none; }
.main-nav a:hover {
	color: var(--accent);
	background: var(--blue-soft);
}

.lang-switch {
	display: inline-flex;
	align-items: center;
	border: 1px solid var(--border);
	background: var(--bg);
	border-radius: 999px;
	overflow: hidden;
	font-size: 0.8rem;
	font-weight: 600;
}
.lang-switch a {
	color: var(--muted);
	text-decoration: none;
	padding: 0.25rem 0.75rem;
}
.lang-switch a:hover { color: var(--fg); background: var(--blue-soft); }
.lang-switch a[aria-current] { background: var(--accent); color: #ffffff; }

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

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 0.75rem 1.5rem;
	border-radius: 9px;
	font-weight: 600;
	font-size: 0.85rem;
	text-transform: uppercase;
	letter-spacing: 0.09em;
	text-decoration: none;
	border: 1px solid transparent;
	transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.btn-primary {
	background: var(--blue);
	color: var(--dark);
	box-shadow: 0 4px 20px rgba(88, 166, 255, 0.35);
}
.btn-primary:hover {
	background: #7cb8ff;
	color: var(--dark);
	box-shadow: 0 6px 28px rgba(88, 166, 255, 0.55);
	transform: translateY(-1px);
}
.btn-ghost {
	border-color: #b9cee4;
	color: var(--accent);
}
.btn-ghost:hover {
	border-color: var(--blue);
	color: var(--accent);
	background: var(--blue-soft);
}
.btn-dark {
	background: var(--dark);
	color: #ffffff;
}
.btn-dark:hover {
	background: #2a3038;
	color: #ffffff;
	box-shadow: var(--shadow);
	transform: translateY(-1px);
}

/* ---------- Hero (homepage) ---------- */

/* Dark hero: the sci-fi scene stays dark overall. A navy veil on the left
   keeps the white text readable, a soft blue glow lightens the right side
   just a bit. The background position is shifted so the golem sits
   further right in the frame. */
.hero {
	background:
		linear-gradient(90deg, rgba(14, 17, 22, 0.62) 0%, rgba(14, 17, 22, 0.3) 40%, rgba(14, 17, 22, 0) 62%),
		radial-gradient(ellipse 760px 560px at 86% 40%, rgba(88, 166, 255, 0.16), transparent 70%),
		url('/codheim-hero.jpg') 45% center / cover no-repeat;
	color: var(--fg);
	position: relative;
	overflow: hidden;
	flex: none;
}
.hero-inner {
	position: relative;
	max-width: 660px;
	margin: 0 auto 0 6%;
	padding: 4rem 1.5rem 5rem;
	text-align: left;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: center;
}

.badge {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	border: 1px solid rgba(88, 166, 255, 0.45);
	background: rgba(255, 255, 255, 0.7);
	color: var(--accent);
	font-size: 0.82rem;
	font-weight: 600;
	padding: 0.3rem 0.85rem;
	border-radius: 999px;
	letter-spacing: 0.02em;
}

.hero h1 {
	font-size: clamp(2.6rem, 6vw, 4rem);
	font-weight: 800;
	letter-spacing: -0.03em;
	line-height: 1.08;
	margin: 1.4rem 0 1.2rem;
	color: var(--fg);
}
.hero h1 .hl { color: #1f6feb; }

.hero .lead {
	color: var(--muted);
	font-size: 1.2rem;
	line-height: 1.6;
	max-width: 560px;
	margin: 0;
}

.hero-actions {
	display: flex;
	justify-content: flex-start;
	flex-wrap: wrap;
	gap: 0.9rem;
	margin-top: 2.2rem;
}

.hero-meta {
	display: flex;
	justify-content: flex-start;
	flex-wrap: wrap;
	gap: 1.25rem 3rem;
	margin-top: 3.4rem;
}
.hero-meta div { text-align: left; }
.hero-meta strong {
	display: block;
	color: var(--fg);
	font-size: 0.95rem;
	letter-spacing: -0.01em;
}
.hero-meta span {
	color: var(--muted);
	font-size: 0.82rem;
}

/* Dark-hero overrides: white text on the navy scene (placed after the
   base hero rules so they win the cascade) */
.hero h1 {
	color: #ffffff;
}
.hero h1 .hl { color: var(--blue); }
.hero .lead {
	color: rgba(230, 237, 243, 0.78);
}
.hero .badge {
	background: rgba(88, 166, 255, 0.14);
	border-color: rgba(88, 166, 255, 0.5);
	color: #a8d0ff;
}
.hero .btn-ghost {
	border-color: rgba(240, 246, 252, 0.35);
	color: #ffffff;
}
.hero .btn-ghost:hover {
	border-color: var(--blue);
	color: var(--blue);
	background: rgba(88, 166, 255, 0.12);
}
.hero-meta strong {
	color: #ffffff;
}
.hero-meta span {
	color: rgba(230, 237, 243, 0.55);
}
.scroll-hint {
	border: 1px solid rgba(240, 246, 252, 0.25);
	background: rgba(255, 255, 255, 0.07);
	color: #a8d0ff;
}
.scroll-hint:hover {
	border-color: var(--blue);
	color: var(--blue);
}

.scroll-hint {
	position: absolute;
	left: 6%;
	bottom: 1.4rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	border-radius: 999px;
	text-decoration: none;
	transition: border-color 0.15s, color 0.15s, transform 0.15s;
}
.scroll-hint:hover {
	transform: translateY(3px);
}
.scroll-hint svg { width: 18px; height: 18px; }

/* ---------- Sections ---------- */

.section {
	padding: 5.5rem 0;
	scroll-margin-top: 76px;
}
.section-alt {
	background: var(--surface);
}

.section-head {
	max-width: 660px;
	margin: 0 auto 2.75rem;
	text-align: center;
}
.section-eyebrow {
	display: block;
	color: var(--accent);
	font-size: 0.78rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.14em;
	margin-bottom: 0.7rem;
}
.section-head h2 {
	font-size: clamp(1.7rem, 3.5vw, 2.25rem);
	font-weight: 750;
	letter-spacing: -0.02em;
	line-height: 1.2;
	margin: 0 0 0.7rem;
}
.section-head p {
	color: var(--muted);
	margin: 0;
}

.grid-3 {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1.25rem;
}
.grid-2 {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 1.25rem;
}

.card {
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 1.75rem;
	transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.card:hover {
	border-color: rgba(88, 166, 255, 0.7);
	box-shadow: var(--shadow);
	transform: translateY(-2px);
}
.card .icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	border-radius: 11px;
	background: var(--blue-soft);
	color: var(--accent);
}
.card .icon svg { width: 22px; height: 22px; }
.card h3 {
	font-size: 1.12rem;
	font-weight: 700;
	letter-spacing: -0.01em;
	margin: 0.9rem 0 0.45rem;
}
.card p {
	color: var(--muted);
	font-size: 0.95rem;
	margin: 0;
}

/* Minimalist variant (services): no border, centered, quiet hover */
.card.bare {
	background: transparent;
	border: none;
	text-align: center;
	padding: 1rem 1.5rem;
}
.card.bare:hover {
	border: none;
	box-shadow: none;
	transform: none;
	background: transparent;
}
.card.bare .icon {
	width: 56px;
	height: 56px;
	border-radius: 16px;
	transition: background-color 0.15s, transform 0.15s;
}
.card.bare .icon svg { width: 26px; height: 26px; }
.card.bare:hover .icon {
	background: rgba(88, 166, 255, 0.22);
	transform: translateY(-3px);
}
.card.bare h3 { margin-top: 1.2rem; }
.card.bare p { max-width: 340px; margin: 0 auto; }

/* ---------- Product card ---------- */

.product-card {
	border-top: 3px solid var(--blue);
	display: flex;
	flex-direction: column;
}
.product-head {
	display: flex;
	align-items: center;
	gap: 1rem;
}
a.product-head { color: inherit; text-decoration: none; }
a.product-head:hover .product-name,
a.product-head:focus-visible .product-name { color: var(--accent); }
.product-head img {
	width: 56px;
	height: 56px;
	border-radius: 13px;
}
.product-name { font-size: 1.12rem; font-weight: 700; margin: 0; letter-spacing: -0.01em; line-height: 1.15; }
.product-tag {
	display: block;
	width: fit-content;
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--accent);
	background: var(--blue-soft);
	border-radius: 999px;
	padding: 0.15rem 0.6rem;
	line-height: 1.2;
	margin-top: 0.25rem;
	margin-bottom: 0.6rem;
}
.product-card p {
	color: var(--muted);
	font-size: 0.95rem;
	flex: 1;
}
.product-links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem 1.4rem;
	margin-top: 1.25rem;
	padding-top: 1rem;
	border-top: 1px solid var(--border);
	font-size: 0.92rem;
	font-weight: 600;
}
.product-links a { text-decoration: none; }
.product-links a:hover { text-decoration: underline; }

/* ---------- About ---------- */

.about-grid {
	display: grid;
	grid-template-columns: 1.4fr 1fr;
	gap: 3rem;
	align-items: start;
}
.about-grid h2, .about-h2 {
	font-size: clamp(1.7rem, 3.5vw, 2.25rem);
	font-weight: 750;
	letter-spacing: -0.02em;
	margin: 0 0 1.75rem;
}
.about-grid .about-text p { color: var(--muted); margin: 0 0 1rem; }
.about-grid .about-text p:last-child { margin-bottom: 0; }
.about-grid .about-text p strong { color: var(--fg); }

.fact-list {
	display: flex;
	flex-direction: column;
	gap: 0.9rem;
	margin: 0;
	padding: 0;
	list-style: none;
}
.fact-list li {
	display: flex;
	align-items: flex-start;
	gap: 0.75rem;
	color: var(--muted);
	font-size: 0.95rem;
}
.fact-list li::before {
	content: "";
	flex: none;
	width: 20px;
	height: 20px;
	margin-top: 2px;
	border-radius: 999px;
	background: var(--blue-soft);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231f4e79' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12.5l5 5L20 6.5'/%3E%3C/svg%3E");
	background-size: 12px;
	background-position: center;
	background-repeat: no-repeat;
}

/* ---------- CTA band ---------- */

.cta-band {
	background: linear-gradient(135deg, #e3f0ff 0%, #d8e9ff 60%, #edf4ff 100%);
	border: 1px solid rgba(88, 166, 255, 0.35);
	border-radius: 20px;
	padding: 3.5rem 2rem;
	text-align: center;
	position: relative;
	overflow: hidden;
}
.cta-band::before {
	content: "";
	position: absolute;
	inset: 0;
	background: radial-gradient(480px 240px at 75% 0%, rgba(255, 255, 255, 0.75), transparent 70%);
	pointer-events: none;
}
.cta-band > * { position: relative; }
.cta-band h2 {
	color: var(--fg);
	font-size: clamp(1.6rem, 3vw, 2.1rem);
	font-weight: 750;
	letter-spacing: -0.02em;
	margin: 0 0 0.6rem;
}
.cta-band p {
	color: var(--muted);
	max-width: 520px;
	margin: 0 auto 1.8rem;
}
.cta-band .hero-actions { margin-top: 0; }

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

.site-footer {
	background: var(--surface);
	border-top: 1px solid var(--border);
	color: var(--muted);
	margin-top: auto;
}

.footer-contact-row {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1.5rem 2rem;
	padding: 3rem 0 2.5rem;
}
.footer-contact-item { text-align: center; }
.footer-contact-item .contact-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	border-radius: 999px;
	background: var(--blue-soft);
	color: var(--accent);
	margin-bottom: 0.85rem;
}
.footer-contact-item .contact-icon svg { width: 22px; height: 22px; }
.footer-contact-item strong {
	display: block;
	color: var(--fg);
	font-size: 0.85rem;
	margin-bottom: 0.35rem;
}
.footer-contact-item a {
	display: block;
	color: #2f363d;
	text-decoration: none;
	font-size: 0.92rem;
	line-height: 1.7;
}
.footer-contact-item a:hover { color: var(--accent); }
.footer-contact-item .info {
	display: block;
	color: var(--muted);
	font-size: 0.92rem;
	line-height: 1.7;
}

.footer-grid {
	display: grid;
	/* Uneven columns: the Legal (App) column carries the widest label
	   ("Nutzungsbedingungen / EULA") and must not wrap its links */
	grid-template-columns: 1.9fr 1.15fr 1.2fr 1.55fr 2.2fr;
	gap: 2rem;
	padding: 2.5rem 0 2rem;
	border-top: 1px solid var(--border);
}
.footer-col a { white-space: nowrap; }
.footer-brand .brand { margin-bottom: 0.9rem; }
.footer-brand p {
	color: var(--muted);
	font-size: 0.9rem;
	max-width: 300px;
	margin: 0;
}
.footer-col h3 {
	color: var(--muted);
	font-size: 0.72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	margin: 0 0 0.9rem;
}
.footer-col ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.55rem;
}
.footer-col a {
	color: #2f363d;
	text-decoration: none;
	font-size: 0.92rem;
}
.footer-col a:hover { color: var(--accent); }

.footer-bottom {
	padding: 1.4rem 0 1.7rem;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.9rem;
	font-size: 0.85rem;
	color: var(--muted);
	text-align: center;
}
.footer-bottom nav { display: flex; gap: 1.25rem; flex-wrap: wrap; justify-content: center; }
.footer-bottom a { color: var(--muted); text-decoration: none; }
.footer-bottom a:hover { color: var(--accent); }

/* ---------- Legal pages ---------- */

main.legal {
	flex: 1;
	width: 100%;
	max-width: 780px;
	margin: 0 auto;
	padding: 3rem 1.5rem 4rem;
}
main.legal .legal-meta {
	color: var(--muted);
	font-size: 0.9rem;
	margin: 0 0 2rem;
}
main.legal h1 {
	font-size: 2.1rem;
	font-weight: 750;
	letter-spacing: -0.02em;
	margin: 0.5rem 0 0;
}
main.legal h2 {
	font-size: 1.25rem;
	font-weight: 700;
	letter-spacing: -0.01em;
	margin-top: 2.25rem;
	padding-bottom: 0.35rem;
	border-bottom: 1px solid var(--border);
}
main.legal p, main.legal ul, main.legal ol { color: #2f363d; }
main.legal .muted { color: var(--muted); }
main.legal .backlink {
	display: inline-block;
	margin-top: 2.5rem;
	font-weight: 600;
	text-decoration: none;
}
main.legal .backlink:hover { text-decoration: underline; }

/* ---------- App pages ---------- */

/* App hero: same pattern as the homepage hero — full-bleed artwork
   (logo on a glowing rounded square, dark scene) with a left-to-right
   scrim so the left-aligned text stays readable; the bright logo
   sits in the image center and peeks through on the right. */
.app-hero {
	background:
		linear-gradient(90deg, rgba(14, 17, 22, 0.78) 0%, rgba(14, 17, 22, 0.42) 45%, rgba(14, 17, 22, 0) 72%),
		radial-gradient(ellipse 760px 560px at 62% 40%, rgba(88, 166, 255, 0.14), transparent 70%),
		url('/apps/page-tree-sorter/page-tree-sorter-hero.jpg') 50% center / cover no-repeat;
	color: var(--fg);
	position: relative;
	overflow: hidden;
}
.app-hero-inner {
	position: relative;
	max-width: 660px;
	margin: 0 auto 0 6%;
	padding: 4rem 1.5rem 5rem;
	text-align: left;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: center;
}
.app-hero-inner h1 {
	font-size: clamp(1.9rem, 4vw, 2.6rem);
	font-weight: 800;
	letter-spacing: -0.02em;
	margin: 1.2rem 0 0.7rem;
	color: #ffffff;
}
.app-hero-inner .lead {
	color: rgba(230, 237, 243, 0.78);
	font-size: 1.1rem;
	max-width: 620px;
	margin: 0;
}
.app-hero .badges {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 1.4rem;
}
.app-hero .badge {
	background: rgba(88, 166, 255, 0.14);
	border-color: rgba(88, 166, 255, 0.5);
	color: #a8d0ff;
}
.app-hero .hero-actions { margin-top: 2rem; }
.app-hero .btn-ghost {
	border-color: rgba(240, 246, 252, 0.35);
	color: #ffffff;
}
.app-hero .btn-ghost:hover {
	border-color: var(--blue);
	color: var(--blue);
	background: rgba(88, 166, 255, 0.12);
}

/* App tour: one real screenshot per feature, text beside it. Rows
   alternate sides on wide screens and stack (text first) on narrow ones.
   Each screenshot links to its full-size PNG; lightbox.js opens it in a
   dialog instead when JS is available. */
.tour {
	background: var(--surface);
	padding: 4.5rem 1.5rem 5rem;
}
.tour-inner {
	max-width: 1160px;
	margin: 0 auto;
}
.tour-head {
	max-width: 680px;
	margin: 0 auto 3.5rem;
	text-align: center;
}
.tour-head h2 {
	font-size: clamp(1.6rem, 3.2vw, 2.1rem);
	font-weight: 750;
	letter-spacing: -0.02em;
	line-height: 1.2;
	margin: 0 0 0.7rem;
}
.tour-head p { color: var(--muted); margin: 0; }
.tour-step {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
	gap: 2.75rem;
	align-items: center;
	scroll-margin-top: 90px;
}
.tour-step + .tour-step { margin-top: 4.5rem; }
.tour-step:nth-child(even) { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.tour-step:nth-child(even) .tour-text { order: 2; }
.tour-text h3 {
	font-size: 1.3rem;
	font-weight: 700;
	letter-spacing: -0.01em;
	line-height: 1.3;
	margin: 0 0 0.65rem;
}
.tour-text p {
	color: #2f363d;
	margin: 0 0 0.8rem;
}
.tour-text p:last-child { margin-bottom: 0; }
.tour code, .shot-note code {
	background: var(--blue-soft);
	padding: 0.1em 0.35em;
	border-radius: 4px;
	font-family: var(--mono);
	font-size: 0.88em;
	color: var(--accent);
	white-space: nowrap;
}

/* Screenshot frame (tour and documentation) */
.shot { margin: 0; }
.shot a {
	display: block;
	border-radius: 12px;
}
.shot img {
	display: block;
	width: 100%;
	height: auto;
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: 12px;
	box-shadow: 0 1px 2px rgba(14, 17, 22, 0.06), 0 18px 44px rgba(14, 17, 22, 0.12);
	transition: transform 0.2s, box-shadow 0.2s;
}
.shot a:hover img {
	transform: translateY(-2px);
	box-shadow: 0 1px 2px rgba(14, 17, 22, 0.06), 0 24px 56px rgba(14, 17, 22, 0.16);
}
.shot a:focus-visible {
	outline: 3px solid var(--blue);
	outline-offset: 4px;
	border-radius: 14px;
}
.shot figcaption {
	color: var(--muted);
	font-size: 0.85rem;
	margin-top: 0.7rem;
}
.doc .shot { margin: 1.5rem 0; }

/* Screenshot lightbox (apps/page-tree-sorter/lightbox.js). The dialog fills the
   viewport; the stage centres the image, a click on the stage closes it. */
html.lightbox-open { overflow: hidden; }
.lightbox {
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: #e6edf3;
	overflow: auto;
	overscroll-behavior: contain;
	touch-action: pan-x pan-y pinch-zoom;
}
.lightbox::backdrop { background: rgba(8, 10, 14, 0.94); }
.lightbox[open] { animation: lightbox-fade 0.16s ease-out; }
.lightbox[open]::backdrop { animation: lightbox-fade 0.16s ease-out; }
@keyframes lightbox-fade { from { opacity: 0; } }
.lightbox-stage {
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 100%;
	margin: 0;
	padding: 3vh 4vw;
}
.lightbox-stage picture { display: contents; }
.lightbox-img {
	display: block;
	width: auto;
	height: auto;
	max-width: 92vw;
	max-height: 88vh;
	object-fit: contain;
	background: #fff;
	border-radius: 10px;
	box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
	touch-action: pan-x pan-y pinch-zoom;
}
.lightbox-caption {
	max-width: 92vw;
	margin-top: 0.8rem;
	padding: 0.35rem 0.8rem;
	border-radius: 8px;
	background: rgba(8, 10, 14, 0.9);
	color: rgba(230, 237, 243, 0.92);
	font-size: 0.9rem;
	text-align: center;
}
.lightbox-close {
	position: fixed;
	top: max(14px, env(safe-area-inset-top));
	right: max(14px, env(safe-area-inset-right));
	z-index: 1;
	width: 44px;
	height: 44px;
	display: grid;
	place-items: center;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, 0.35);
	border-radius: 50%;
	background: rgba(14, 17, 22, 0.72);
	color: #fff;
	font: 400 30px/1 var(--font);
	cursor: pointer;
}
.lightbox-close:hover { background: rgba(14, 17, 22, 0.95); }
.lightbox-close:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
/* while pinch-zoomed, lightbox.js pins the button to the visual viewport */
.lightbox-close.is-zoomed { top: 0; right: auto; left: 0; transform-origin: 0 0; }

@media (max-width: 700px) {
	.lightbox { background: #000; }
	.lightbox::backdrop { background: #000; }
	.lightbox-stage { padding: 0; }
	.lightbox-img {
		width: 100%;
		max-width: 100%;
		max-height: 100dvh;
		border-radius: 0;
		box-shadow: none;
	}
	.lightbox-caption { display: none; }
	.lightbox-close {
		top: max(8px, env(safe-area-inset-top));
		right: max(8px, env(safe-area-inset-right));
		width: 48px;
		height: 48px;
		border-color: rgba(255, 255, 255, 0.6);
		background: rgba(0, 0, 0, 0.75);
	}
}

@media (max-width: 860px) {
	.tour { padding: 3rem 1rem 3.5rem; }
	.tour-head { margin-bottom: 2.5rem; }
	.tour-step,
	.tour-step:nth-child(even) { grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
	.tour-step:nth-child(even) .tour-text { order: 0; }
	.tour-step + .tour-step { margin-top: 3rem; }
	.shot img { border-radius: 8px; }
}

.doc {
	display: block;
	max-width: 780px;
	margin: 0 auto;
	padding: 2.5rem 1.5rem 4rem;
	text-align: left;
	line-height: 1.65;
	width: 100%;
}
.doc h1 { font-size: 2.1rem; line-height: 1.2; font-weight: 750; letter-spacing: -0.02em; margin: 0.5rem 0 1rem; hyphens: auto; overflow-wrap: break-word; }
.doc h2 { scroll-margin-top: 90px; }
.doc h2 {
	font-size: 1.35rem;
	margin-top: 2.5rem;
	border-bottom: 1px solid var(--border);
	padding-bottom: 0.35rem;
	letter-spacing: -0.01em;
}
.doc h3 { font-size: 1.08rem; margin-top: 1.75rem; }
.doc p, .doc ul, .doc ol { color: #2f363d; }
.doc a { color: var(--accent); }
.doc .muted { color: var(--muted); }
.doc code {
	background: var(--blue-soft);
	padding: 0.1em 0.35em;
	border-radius: 4px;
	font-family: var(--mono);
	font-size: 0.88em;
	overflow-wrap: anywhere;
	color: var(--accent);
}
.doc pre {
	background: var(--surface);
	border: 1px solid var(--border);
	padding: 1rem;
	border-radius: 10px;
	overflow-x: auto;
	line-height: 1.4;
}
.doc pre code { background: none; padding: 0; overflow-wrap: normal; }
.doc .table-wrap { overflow-x: auto; margin: 1.25rem 0; border-radius: 10px; border: 1px solid var(--border); }
.doc table { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
.doc th, .doc td { border: none; padding: 0.6rem 0.8rem; text-align: left; vertical-align: top; }
.doc th { background: var(--surface); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.doc tr + tr td, .doc tr + tr th { border-top: 1px solid var(--border); }
.doc .callout {
	border-left: 3px solid var(--blue);
	background: var(--surface);
	padding: 0.6rem 1.1rem;
	margin: 1.25rem 0;
	border-radius: 0 8px 8px 0;
}
.doc .logo-title { display: flex; align-items: center; gap: 1rem; }
.doc .logo-title img { width: 72px; height: 72px; border-radius: 16px; }
.doc .lang-switch { margin: 0.5rem 0 1rem; }
.doc .lead { font-size: 1.08rem; color: #2f363d; }
/* in-page table of contents of the documentation pages */
.doc .toc {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 10px;
	padding: 1rem 1.25rem;
	margin: 1.5rem 0 0.5rem;
}
.doc .toc h2 {
	font-size: 0.82rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--muted);
	border: none;
	margin: 0 0 0.5rem;
	padding: 0;
}
.doc .toc ol { margin: 0; padding-left: 1.4rem; columns: 2; column-gap: 2rem; }
.doc .toc li { break-inside: avoid; padding: 0.1rem 0; }
.doc .toc a { text-decoration: none; }
.doc .toc a:hover { text-decoration: underline; }
.doc h3 { scroll-margin-top: 90px; }
@media (max-width: 560px) {
	.doc .toc ol { columns: 1; }
	/* the header is two rows on phones */
	.doc h2, .doc h3 { scroll-margin-top: 130px; }
}

/* ---------- Contact pages (form posts to /api/v1/contact) ---------- */
.contact-page {
	display: block;
	max-width: 640px;
	margin: 0 auto;
	padding: 4.5rem 1.5rem 5rem;
	width: 100%;
}
.contact-page h1 {
	font-size: clamp(1.8rem, 4vw, 2.3rem);
	font-weight: 800;
	letter-spacing: -0.02em;
	margin: 0 0 1rem;
}
.contact-lead {
	color: var(--muted);
	line-height: 1.65;
	margin: 0 0 1.1rem;
}
.contact-lead + .contact-lead { margin-top: -0.4rem; }
.contact-form {
	display: grid;
	gap: 1.1rem;
	margin-top: 1.9rem;
	text-align: left;
}
.contact-form label {
	display: block;
	font-weight: 600;
	font-size: 0.92rem;
	margin-bottom: 0.35rem;
}
.contact-form .form-hint {
	font-weight: 400;
	font-size: 0.8rem;
	color: var(--muted);
}
.contact-form input,
.contact-form select,
.contact-form textarea {
	width: 100%;
	padding: 0.6rem 0.8rem;
	border: 1px solid var(--border);
	border-radius: 10px;
	font: inherit;
	color: var(--fg);
	background: var(--bg);
}
.contact-form textarea { min-height: 150px; resize: vertical; }
.contact-form .btn { justify-self: start; }
/* Honeypot: invisible to humans and assistive tech, irresistible to bots */
.hp-field {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}
.form-note {
	font-size: 0.85rem;
	color: var(--muted);
	line-height: 1.55;
	margin-top: 1.2rem;
}
.form-note a { color: var(--accent); }
/* Inline submit-time validation errors (contact-form.js) */
.form-error {
	color: #b3261e;
	font-size: 0.85rem;
	font-weight: 500;
	margin: 0.35rem 0 0;
}
.contact-form [aria-invalid="true"] {
	border-color: #b3261e;
}

/* ---------- Parked page ---------- */

main.parked {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 3rem 1.5rem;
}
main.parked .parked-code {
	font-size: 7.5rem;
	font-weight: 800;
	color: var(--blue);
	letter-spacing: -0.04em;
	line-height: 1;
	margin-bottom: 1rem;
}
main.parked h1 { font-size: 2rem; margin: 0 0 1rem; }
main.parked .tagline { color: var(--on-dark, var(--muted)); }
main.parked .parked-hint {
	max-width: 520px;
	color: var(--muted);
	margin-top: 1.5rem;
	font-size: 0.95rem;
}
main.parked code {
	background: var(--blue-soft);
	padding: 0.1em 0.35em;
	border-radius: 4px;
	font-family: var(--mono);
	color: var(--accent);
}

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

/* Overlay header (pages with a full-bleed hero): invisible at the top of
   the page, fades in and compacts while the first pixels are scrolled.
   Uses CSS scroll-driven animations; browsers without support keep the
   regular sticky solid header. */
.site-header--overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	background: rgba(255, 255, 255, 0);
	border-bottom: 1px solid transparent;
	backdrop-filter: blur(0px);
	-webkit-backdrop-filter: blur(0px);
	animation: header-fade-in linear both;
	animation-timeline: scroll();
	animation-range: 0px 220px;
}
@keyframes header-fade-in {
	from {
		background: rgba(255, 255, 255, 0);
		border-bottom-color: transparent;
		backdrop-filter: blur(0px);
	}
	60% { border-bottom-color: var(--border); }
	to {
		background: rgba(255, 255, 255, 0.88);
		border-bottom-color: var(--border);
		backdrop-filter: blur(12px);
	}
}
.site-header--overlay .header-inner {
	min-height: 80px;
	animation: header-compact linear both;
	animation-timeline: scroll();
	animation-range: 0px 220px;
}
@keyframes header-compact {
	from { min-height: 80px; }
	to { min-height: 64px; }
}

/* Variant for pages whose hero is dark (homepage with the golem scene):
   menu starts light-on-dark and turns into the regular dark-on-light
   header while fading in. Child elements inherit the animated color. */
.site-header--overlay.on-dark {
	animation-name: header-fade-in-dark;
}
@keyframes header-fade-in-dark {
	from {
		background: rgba(255, 255, 255, 0);
		border-bottom-color: transparent;
		backdrop-filter: blur(0px);
		color: rgba(240, 246, 252, 0.94);
	}
	60% { border-bottom-color: var(--border); }
	to {
		background: rgba(255, 255, 255, 0.88);
		border-bottom-color: var(--border);
		backdrop-filter: blur(12px);
		color: #1f2328;
	}
}
.site-header--overlay.on-dark .brand,
.site-header--overlay.on-dark .brand:hover,
.site-header--overlay.on-dark .main-nav a,
.site-header--overlay.on-dark .lang-switch,
.site-header--overlay.on-dark .lang-switch a,
.site-header--overlay.on-dark .brand-sub {
	color: inherit;
}
.site-header--overlay.on-dark .brand-sub { opacity: 0.75; }
.site-header--overlay.on-dark .main-nav a:hover {
	color: inherit;
	background: rgba(148, 163, 184, 0.22);
}
.site-header--overlay.on-dark .lang-switch {
	animation: langswitch-in-dark linear both;
	animation-timeline: scroll();
	animation-range: 0px 220px;
}
@keyframes langswitch-in-dark {
	from {
		background: rgba(14, 17, 22, 0.42);
		border-color: rgba(240, 246, 252, 0.3);
	}
	to {
		background: var(--bg);
		border-color: var(--border);
	}
}

@supports not (animation-timeline: scroll()) {
	.site-header--overlay {
		position: sticky;
		background: rgba(255, 255, 255, 0.86);
		border-bottom: 1px solid var(--border);
		backdrop-filter: blur(12px);
	}
	.hero-inner, .app-hero-inner { min-height: calc(100vh - 65px); }
}

@media (max-width: 1080px) {
	.footer-grid { grid-template-columns: 1fr 1fr; padding: 2rem 0 1.5rem; }
}

@media (max-width: 900px) {
	.grid-3 { grid-template-columns: 1fr; }
	.grid-2 { grid-template-columns: 1fr; }
	.main-nav {
		order: 3;
		width: 100%;
		justify-content: center;
		flex-wrap: wrap;
		padding-bottom: 0.75rem;
		margin-left: 0;
	}
	.header-cta { margin-left: auto; }
	.brand-lockup ~ .lang-switch { margin-left: auto; }
}

@media (max-width: 700px) {
	.footer-contact-row { grid-template-columns: 1fr; gap: 1.9rem; }
	/* vertical scrim so the hero text stays readable over the image */
	.hero {
		background:
			linear-gradient(180deg, rgba(14, 17, 22, 0.55) 0%, rgba(14, 17, 22, 0.28) 45%, rgba(14, 17, 22, 0) 75%),
			radial-gradient(ellipse 760px 560px at 86% 40%, rgba(88, 166, 255, 0.16), transparent 70%),
			url('/codheim-hero.jpg') 45% center / cover no-repeat;
	}
	.app-hero {
		background:
			linear-gradient(180deg, rgba(14, 17, 22, 0.62) 0%, rgba(14, 17, 22, 0.35) 45%, rgba(14, 17, 22, 0) 78%),
			radial-gradient(ellipse 760px 560px at 62% 40%, rgba(88, 166, 255, 0.14), transparent 70%),
			url('/apps/page-tree-sorter/page-tree-sorter-hero.jpg') 50% center / cover no-repeat;
	}
}

/* tablets: the text column spans the bright monitor in the artwork, so a
   left-to-right scrim keeps the lead readable while the golem stays visible */
@media (min-width: 561px) and (max-width: 900px) {
	.hero {
		background:
			linear-gradient(90deg, rgba(14, 17, 22, 0.88) 0%, rgba(14, 17, 22, 0.72) 55%, rgba(14, 17, 22, 0.2) 100%),
			url('/codheim-hero.jpg') 60% center / cover no-repeat;
	}
	.hero .lead { color: rgba(230, 237, 243, 0.9); }
}

@media (max-width: 560px) {
	.footer-grid { grid-template-columns: 1fr; }
	.about-grid { grid-template-columns: 1fr; gap: 2rem; }
	/* homepage hero starts below the two-row header (brand + language, then nav) */
	.hero-inner { min-height: 0; padding: 8rem 1.25rem 3rem; }
	/* links that repeat the hero buttons or the logo link are dropped so
	   the header stays at two rows: brand + language, then the nav */
	.main-nav .nav-optional { display: none; }
	/* long German labels get a short form so the nav stays one row */
	.main-nav .nav-full { display: none; }
	.main-nav .nav-short { display: inline; }
	.main-nav { gap: 0; }
	.main-nav a { padding: 0.35rem 0.4rem; font-size: 0.85rem; }
	.app-hero-inner { min-height: 0; padding-top: 9rem; padding-bottom: 3.5rem; }
	/* the artwork is busy behind full-width text: an even dark scrim keeps
	   lead, badges and buttons at WCAG AA contrast on phones */
	.app-hero {
		background:
			linear-gradient(180deg, rgba(14, 17, 22, 0.86) 0%, rgba(14, 17, 22, 0.8) 70%, rgba(14, 17, 22, 0.66) 100%),
			url('/apps/page-tree-sorter/page-tree-sorter-hero.jpg') 50% center / cover no-repeat;
	}
	.app-hero-inner .lead { color: rgba(230, 237, 243, 0.9); }
	.app-hero .badge { background: rgba(14, 17, 22, 0.55); }
	.scroll-hint { display: none; }

	/* homepage: the header CTA repeats the hero's "Get in touch", so it is
	   dropped to keep the header at two rows */
	.header-cta { display: none; }
	.brand ~ .lang-switch { margin-left: auto; }
	/* same even scrim as the app hero, so the full-width text stays readable */
	.hero {
		background:
			linear-gradient(180deg, rgba(14, 17, 22, 0.86) 0%, rgba(14, 17, 22, 0.78) 65%, rgba(14, 17, 22, 0.7) 100%),
			url('/codheim-hero.jpg') 60% center / cover no-repeat;
	}
	.hero h1 { font-size: 2.35rem; line-height: 1.1; }
	.hero .lead { font-size: 1.05rem; color: rgba(230, 237, 243, 0.9); }
	.hero .badge { background: rgba(14, 17, 22, 0.55); }
	.hero-actions { flex-direction: column; align-items: stretch; gap: 0.7rem; }
	.hero-actions .btn { text-align: center; }
	.hero-meta { gap: 0.9rem; margin-top: 2rem; }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		transition: none !important;
		animation: none !important;
	}
	.shot a:hover img { transform: none; }
	/* scroll-driven animations are disabled above, so the overlay header
	   would stay transparent forever — force the solid state */
	.site-header--overlay {
		position: sticky;
		background: rgba(255, 255, 255, 0.86);
		border-bottom: 1px solid var(--border);
		backdrop-filter: blur(12px);
	}
	.site-header--overlay .header-inner { min-height: 64px; }
	.hero-inner, .app-hero-inner { min-height: calc(100vh - 65px); }
}
