/*
Theme Name: appduo
Theme URI: https://appduo.de
Description: Child-Theme von Ollie für appduo.de
Author: Leon Labbow, Nico Schönberg
Template: ollie
Version: 0.3.0
Requires at least: 6.5
Requires PHP: 8.1
Text Domain: appduo
License: GPL-2.0-or-later
*/

/*
 * Farben und Schriften kommen aus theme.json (Presets). Hier nur, was Blöcke allein nicht können:
 * Blätter mit Reiter, Maskottchen-Bühne, Scroll-Effekte.
 */

:root {
	--ad-paper: var(--wp--preset--color--base);
	--ad-paper-2: var(--wp--preset--color--main-accent);
	--ad-ink: var(--wp--preset--color--main);
	--ad-ink-2: var(--wp--preset--color--ink-2);
	--ad-spark: var(--wp--preset--color--primary);
	--ad-muted-light: var(--wp--preset--color--secondary);
	--ad-muted-dark: var(--wp--preset--color--muted-dark);
	--ad-display: var(--wp--preset--font-family--display);
	--ad-hand: var(--wp--preset--font-family--hand);

	--ad-gutter: clamp(16px, 4vw, 40px);
	--ad-content: 1180px;
	--ad-sheet-radius: clamp(24px, 4vw, 44px);
	--ad-tab-h: clamp(52px, 6vw, 68px);
	--ad-ease: cubic-bezier(.2, .8, .2, 1);
}

/* Startseite: dunkler Grund, damit unter dem letzten Blatt nichts Helles aufblitzt */
body.home { background: var(--ad-ink); }
.wp-site-blocks > main,
.wp-site-blocks > footer { margin-block-start: 0; }

.ad-wrap {
	width: 100%;
	max-width: calc(var(--ad-content) + 2 * var(--ad-gutter));
	margin-inline: auto;
	padding-inline: var(--ad-gutter);
}
/* WordPress setzt Abstände zwischen Blöcken; in unseren Rastern und Karten regeln wir sie selbst */
body .ad-sheet > *,
body .ad-wrap > *,
body .ad-hero-grid > * { margin-block: 0; }

/* ---------- Kopfleiste */
.ad-top { padding-block: 18px; position: relative; z-index: 30; }
.home .ad-top { position: absolute; inset: 0 0 auto 0; }
.ad-top-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.ad-brand { margin: 0; font-family: var(--ad-display); font-weight: 800; font-size: 1.6rem; letter-spacing: -.035em; line-height: 1; }
.ad-brand a { text-decoration: none; color: var(--ad-ink); }
.ad-brand span { color: var(--ad-spark); }
.ad-nav { margin: 0; display: flex; gap: 6px; }
.ad-nav a { text-decoration: none; font-weight: 600; padding: 10px 14px; border-radius: 999px; color: var(--ad-ink); transition: background .2s, color .2s; }
.ad-nav a:hover { background: var(--ad-paper-2); }
.ad-nav .ad-nav-cta { background: var(--ad-ink); color: var(--ad-paper); }
.ad-nav .ad-nav-cta:hover { background: var(--ad-spark); color: var(--ad-ink); }
@media (max-width: 640px) { .ad-nav a:not(.ad-nav-cta) { display: none; } }

/* ---------- Blätter: jede Sektion schiebt sich mit Reiter über die vorherige */
.ad-sheets > .ad-sheet,
.is-root-container > .ad-sheet {
	position: relative;
	isolation: isolate;
	margin-block: calc(-1 * var(--ad-sheet-radius)) 0;
	border-radius: var(--ad-sheet-radius) var(--ad-sheet-radius) 0 0;
	padding-block: calc(var(--ad-sheet-radius) + clamp(56px, 9vw, 120px)) calc(var(--ad-sheet-radius) + clamp(64px, 10vw, 140px));
	background: var(--bg);
	color: var(--fg);
}
.ad-sheets > .ad-sheet:first-child,
.is-root-container > .ad-sheet:first-child { margin-block-start: 0; border-radius: 0; }
.ad-sheets > .ad-sheet.ad-has-tab,
.is-root-container > .ad-sheet.ad-has-tab { border-top-left-radius: 0; }
.ad-paper { --bg: var(--ad-paper); --fg: var(--ad-ink); --muted: var(--ad-muted-light); --line: rgba(19, 18, 17, .12); }
.ad-ink { --bg: var(--ad-ink); --fg: var(--ad-paper); --muted: var(--ad-muted-dark); --line: rgba(242, 239, 231, .14); }
.ad-spark { --bg: var(--ad-spark); --fg: var(--ad-ink); --muted: rgba(19, 18, 17, .72); --line: rgba(19, 18, 17, .18); }
.ad-sheet h1, .ad-sheet h2, .ad-sheet h3 { color: inherit; }

/* Der Reiter oben links, mit weicher Innenrundung rechts unten */
.ad-sheet > .ad-tab {
	position: absolute; left: 0; top: calc(-1 * var(--ad-tab-h) + 1px);
	height: var(--ad-tab-h);
	min-width: clamp(200px, 30vw, 340px);
	margin: 0;
	padding: 0 32px 0 var(--ad-gutter);
	display: flex; align-items: center; gap: 14px;
	background: var(--bg); color: var(--fg);
	border-radius: 0 24px 0 0;
	font-family: var(--ad-display); font-weight: 700; font-size: clamp(1.05rem, 1.8vw, 1.35rem); letter-spacing: -.02em;
}
.ad-sheet > .ad-tab::after {
	content: ''; position: absolute; right: -24px; bottom: 0; width: 24px; height: 24px;
	background: radial-gradient(circle at 100% 0, transparent 23.5px, var(--bg) 24px);
}
.ad-tab-num {
	display: inline-grid; place-items: center; width: 1.9em; height: 1.9em; border-radius: 50%;
	border: 2px solid currentColor; font-size: .7em; font-variant-numeric: tabular-nums; opacity: .55;
}

/* Typografie in den Blättern */
.ad-sheet h1 { font-size: clamp(2.6rem, 8.5vw, 6.4rem); line-height: 1.02; font-variation-settings: 'opsz' 96; }
.ad-sheet h2 { font-size: clamp(2rem, 5.5vw, 3.8rem); line-height: 1.02; font-variation-settings: 'opsz' 72; }
.ad-sheet h3 { font-size: 1.35rem; letter-spacing: -.01em; line-height: 1.15; }
.ad-lead { font-size: clamp(1.08rem, 1.8vw, 1.3rem); line-height: 1.5; max-width: 34ch; color: var(--muted); }
.ad-lead strong { color: var(--fg); font-weight: 600; }

/* Buttons: auf dunklen Blättern hell, Kontur-Variante in Textfarbe */
.ad-sheet .wp-block-buttons { gap: 12px; }
.ad-sheet .wp-element-button { min-height: 52px; display: inline-flex; align-items: center; gap: 10px; transition: transform .2s var(--ad-ease), background .2s, color .2s; }
.ad-sheet .wp-element-button:hover { transform: translateY(-2px); }
.ad-ink .wp-block-button:not(.is-style-outline) .wp-element-button { background: var(--ad-paper); color: var(--ad-ink); }
.ad-ink .wp-block-button:not(.is-style-outline) .wp-element-button:hover { background: var(--ad-spark); color: var(--ad-ink); }
.ad-sheet .is-style-outline .wp-element-button { background: transparent; color: var(--fg); border-color: currentColor; }
.ad-sheet .is-style-outline .wp-element-button:hover { background: var(--fg); color: var(--bg); }
.ad-arrow .wp-element-button::after {
	content: ''; width: 18px; height: 18px; background: currentColor; transition: transform .2s var(--ad-ease);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
}
.ad-arrow .wp-element-button:hover::after { transform: translateX(3px); }

/* Abschnittskopf: Überschrift links, Erklärung rechts */
.ad-section-head { display: grid; gap: 20px; margin-bottom: clamp(40px, 6vw, 64px) !important; }
body .ad-section-head > * { margin: 0; }
.ad-section-head p { color: var(--muted); max-width: 44ch; }
@media (min-width: 900px) { .ad-section-head { grid-template-columns: 1fr 1fr; align-items: end; } }

/* ---------- Hero */
.ad-sheets > .ad-hero,
.is-root-container > .ad-hero { padding-top: calc(120px + 6vw); min-height: min(100svh, 980px); display: flex; align-items: center; }
.ad-hero-grid { display: grid; gap: clamp(40px, 6vw, 72px); align-items: center; }
@media (min-width: 960px) { .ad-hero-grid { grid-template-columns: 1.15fr .85fr; } }
body .ad-hero-text > * { margin: 0; }
.ad-hero-text .ad-lead { margin-top: 28px; }
.ad-hero-text .wp-block-buttons { margin-top: 36px; }
.ad-mark { position: relative; white-space: nowrap; }
.ad-mark::after {
	content: ''; position: absolute; left: -.04em; right: -.06em; bottom: .06em; height: .28em; z-index: -1;
	background: var(--ad-spark); border-radius: 4px; transform: skewX(-12deg) scaleX(0); transform-origin: left;
	animation: ad-mark .9s .35s var(--ad-ease) forwards;
}
@keyframes ad-mark { to { transform: skewX(-12deg) scaleX(1); } }

/* Maskottchen links, Silhouette (der Kunde) rechts, dahinter die orange Form.
   Maskottchen und Silhouette sind normale Bild-Blöcke, „+ Du?“ ein normaler Absatz: alles im Editor austauschbar. */
.ad-duo-visual { position: relative; width: 100%; max-width: 520px; aspect-ratio: 1 / 1.05; justify-self: center; }
body .ad-duo-visual > * { margin: 0; }
.ad-duo-shape {
	position: absolute; left: 24%; top: 26%; width: 62%; height: 54%;
	background: var(--ad-spark); border-radius: 36px; transform: rotate(-14deg) skewX(-6deg);
}
.ad-duo-visual .wp-block-image { position: absolute; bottom: 0; }
.ad-duo-visual .wp-block-image img { display: block; height: 100%; width: auto; max-width: none; }
.ad-duo-visual .ad-duo-mascot { left: 4%; height: 96%; z-index: 2; }
.ad-duo-mascot img { filter: url(#ad-clean); }
.ad-duo-visual .ad-duo-guest { right: 2%; height: 84%; z-index: 1; transform: scaleX(-1); }
.ad-duo-guest img { filter: url(#ad-silhouette) drop-shadow(2px 0 0 var(--ad-spark)) drop-shadow(0 0 22px rgba(255, 91, 36, .45)); }
.ad-duo-floor {
	position: absolute; left: 8%; bottom: -1%; width: 34%; height: 5%; z-index: 1; border-radius: 50%;
	background: radial-gradient(closest-side, rgba(19, 18, 17, .28), transparent);
}
.ad-duo-visual .ad-duo-note {
	position: absolute; right: -2%; top: -2%; z-index: 3;
	font-family: var(--ad-hand); font-weight: 700; font-size: clamp(2.2rem, 5vw, 3.4rem); line-height: 1;
	transform: rotate(-8deg); color: var(--ad-ink); padding-bottom: 18px;
}
/* Handgezeichneter Strich unter „+ Du?“, zeichnet sich einmal von links nach rechts */
.ad-duo-note::after {
	content: ''; position: absolute; left: 0; right: -10%; bottom: 0; height: 16px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 30' preserveAspectRatio='none'%3E%3Cpath d='M4 22 C 60 10, 130 8, 196 4' fill='none' stroke='%23ff5b24' stroke-width='5' stroke-linecap='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
	clip-path: inset(0 100% 0 0); animation: ad-draw .8s 1s var(--ad-ease) forwards;
}
@keyframes ad-draw { to { clip-path: inset(0 0 0 0); } }
@media (max-width: 959px) { .ad-duo-visual { max-width: 420px; } }
.ad-svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------- Apps */
.ad-apps { display: grid; gap: 16px; }
@media (min-width: 900px) { .ad-apps { grid-template-columns: 1.4fr 1fr; } }
.ad-app {
	border-radius: 28px; padding: clamp(24px, 3.5vw, 40px); background: var(--ad-ink-2);
	border: 1px solid var(--line); display: flex; flex-direction: column; gap: 18px; min-height: 340px;
}
body .ad-app > * { margin: 0; }
.ad-app p { color: var(--muted); max-width: 46ch; }
.ad-app .wp-block-buttons { margin-top: auto; }
.ad-app-icon { width: 64px; height: 64px; border-radius: 18px; background: var(--ad-ink); border: 1px solid var(--line); display: grid; place-items: center; color: #f5b041; }
.ad-app-icon svg { width: 30px; height: 30px; fill: currentColor; }
.ad-status { display: inline-flex; align-items: center; gap: 8px; font-size: .85rem; font-weight: 600; color: #7ee2a8; }
.ad-status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px rgba(126, 226, 168, .18); }
.ad-chips { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
body .ad-chips li { margin: 0; font-size: .85rem; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); }
.ad-app-next { background: transparent; border-style: dashed; justify-content: center; }
.ad-app-next h3 { font-size: 1.6rem; }
.ad-stack { display: flex; }
.ad-stack i { width: 40px; height: 40px; border-radius: 12px; border: 2px dashed var(--line); margin-right: -10px; background: var(--ad-ink); }
.ad-stack i:last-child { background: var(--ad-spark); border: 0; }

/* ---------- So arbeiten wir */
.ad-steps { border-top: 2px solid var(--ad-ink); }
.ad-step { display: grid; gap: 10px 32px; padding: 28px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
body .ad-step > * { margin: 0; }
@media (min-width: 800px) { .ad-step { grid-template-columns: 120px 1fr 1.2fr; padding: 36px 0; } }
.ad-step-n { font-family: var(--ad-display); font-size: 2.6rem; font-weight: 800; line-height: 1; letter-spacing: -.04em; transition: color .2s; }
.ad-step:hover .ad-step-n { color: var(--ad-spark); }
.ad-sheet .ad-step h3 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); }
.ad-step p:not(.ad-step-n) { color: var(--muted); max-width: 48ch; }

/* ---------- Wir zwei */
.ad-duo { display: grid; gap: 16px; }
@media (min-width: 800px) { .ad-duo { grid-template-columns: 1fr 1fr; } }
.ad-person { background: var(--ad-paper); border-radius: 28px; padding: clamp(24px, 3.5vw, 40px); display: grid; gap: 14px; }
body .ad-person > * { margin: 0; }
.ad-avatar { width: 84px; height: 84px; border-radius: 26px; background: var(--ad-ink); color: var(--ad-paper); display: grid; place-items: center; font-family: var(--ad-display); font-weight: 800; font-size: 2rem; letter-spacing: -.04em; }
.ad-person:nth-child(2) .ad-avatar { border-radius: 50%; }
.ad-person p:not(.ad-avatar) { color: var(--ad-muted-light); }
.ad-role { font-weight: 600; }
.ad-claim { margin-top: clamp(40px, 6vw, 72px) !important; font-family: var(--ad-display); font-weight: 700; font-size: clamp(1.6rem, 4vw, 2.8rem); line-height: 1.1; letter-spacing: -.03em; max-width: 24ch; }

/* ---------- Kontakt */
.ad-contact h2 { font-size: clamp(2.4rem, 8vw, 6rem); max-width: 14ch; }
.ad-contact .ad-lead { margin-top: 24px; }
.ad-contact .ad-mail { margin-top: 40px; font-family: var(--ad-display); font-weight: 700; font-size: clamp(1.4rem, 4.5vw, 3rem); letter-spacing: -.03em; line-height: 1.2; }
.ad-mail a { text-decoration: none; background: linear-gradient(var(--ad-spark), var(--ad-spark)) left bottom / 100% 4px no-repeat; padding-bottom: 4px; }

/* ---------- Fußzeile */
.ad-footer { background: var(--ad-ink); color: var(--ad-muted-dark); padding-block: 28px 36px; font-size: .92rem; }
.ad-footer-inner { display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between; border-top: 1px solid rgba(242, 239, 231, .14); padding-top: 28px; }
body .ad-footer-inner > * { margin: 0; }
.ad-footer a { text-decoration: none; color: inherit; }
.ad-footer a:hover { color: var(--ad-paper); }
.ad-footer-links { display: flex; gap: 20px; }

/* ---------- Bewegung: nur wo der Browser Scroll-Animationen kann und niemand reduzierte Bewegung möchte */
@supports (animation-timeline: view()) {
	@media (prefers-reduced-motion: no-preference) {
		/* Inhalt tritt zurück, während sich das nächste Blatt darüberschiebt */
		.ad-sheets > .ad-sheet > .ad-wrap {
			animation: ad-sink linear both;
			animation-timeline: view();
			animation-range: exit 45% exit 100%;
			transform-origin: 50% 100%;
		}
		@keyframes ad-sink { to { transform: scale(.95); opacity: .4; } }

		.ad-reveal { animation: ad-rise linear both; animation-timeline: view(); animation-range: entry 0% entry 60%; }
		@keyframes ad-rise { from { opacity: 0; transform: translateY(32px); } }
	}
}
@media (prefers-reduced-motion: reduce) {
	.ad-mark::after { animation: none; transform: skewX(-12deg); }
	.ad-duo-note::after { animation: none; clip-path: none; }
}