/* Meggi Widmann – one-page redesign of astromw.de
   Colour, fonts and hairlines of the original; four chapters, a postcard deck, a contact form. */

/* ---------- Fonts (original webfonts, self-hosted) ---------- */
@font-face {
	font-family: "Open Sans Local";
	src: url("../fonts/OpenSans-Light-webfont.woff") format("woff");
	font-weight: 300;
	font-display: swap;
}
@font-face {
	font-family: "Open Sans Local";
	src: url("../fonts/OpenSans-Bold-webfont.woff") format("woff");
	font-weight: 700;
	font-display: swap;
}
/* Icon font of the original site: "t" = telephone, "m" = mail */
@font-face {
	font-family: "Widmann Icons";
	src: url("../fonts/widmann-webfont.woff") format("woff");
	font-display: block;
}

/* ---------- Tokens ---------- */
:root {
	--gruen: #00ab01;          /* the original green */
	--gruen-tief: #00700a;     /* green text on white, readable */
	--karten-gruen: #6fae5e;   /* ink colour of the postcards */
	--weiss: #fff;
	--weiss-leise: rgb(255 255 255 / 0.84);
	--linie: rgb(255 255 255 / 0.9);
	--schleier: rgb(255 255 255 / 0.12);

	--font: "Open Sans Local", "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;

	/* Type scale: perfect fourth (1.333) on a fluid base */
	--t-small: 0.8125rem;
	--t-base: clamp(1.125rem, 1.05rem + 0.35vw, 1.25rem);
	--t-lead: clamp(1.3rem, 1.1rem + 0.8vw, 1.67rem);
	--t-h2: clamp(2rem, 1.35rem + 2.8vw, 3.55rem);
	--t-h1: clamp(2.5rem, 1.5rem + 4vw, 4.5rem);
	--t-giant: clamp(4.5rem, 2rem + 11vw, 10.5rem);

	--gutter: clamp(20px, 5vw, 64px);
	--rail: 48px;
	--rail-gap: clamp(28px, 5vw, 80px);
	--max: 1240px;
	--section: clamp(88px, 12vw, 176px);
	--bar: 64px;              /* height of the mobile bottom bar */

	color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-behavior: smooth;
	scroll-padding-top: 24px;
}

body {
	font-family: var(--font);
	font-weight: 300;
	font-size: var(--t-base);
	line-height: 1.55;
	color: var(--weiss);
	background: var(--gruen);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;

}

img { max-width: 100%; height: auto; display: block; }
strong, .strong { font-weight: 700; }
a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
ul { padding: 0; list-style: none; }

:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
	border-radius: 2px;
}

.visually-hidden {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.skip-link {
	position: absolute;
	left: var(--gutter);
	top: -100px;
	z-index: 20;
	padding: 8px 14px;
	background: var(--weiss);
	color: var(--gruen-tief);
	font-weight: 700;
}
.skip-link:focus { top: 12px; }

.icon {
	font-family: "Widmann Icons", var(--font);
	font-variant: normal;
	letter-spacing: 0;
	margin-right: 0.55em;
}

/* The hero wheel bleeds past the right edge; clip it here, not on body */
main { overflow-x: clip; }

/* ---------- Top bar ---------- */
.topbar {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 16px;
	max-width: var(--max);
	margin-inline: auto;
	padding: calc(22px + env(safe-area-inset-top, 0px)) var(--gutter) 18px;
	border-bottom: 1px solid var(--linie);
	font-variant: small-caps;
	letter-spacing: 0.26em;
}
.topbar a { text-decoration: none; }
.topbar a:hover { text-decoration: underline; }
.topbar__name { font-size: 1.15rem; }
.topbar__phone { font-size: 0.95rem; }

/* ---------- Chapters with the numbered rail ---------- */
.chapters {
	max-width: var(--max);
	margin-inline: auto;
	padding-inline: var(--gutter);
	display: grid;
	grid-template-columns: var(--rail) minmax(0, 1fr);
	column-gap: var(--rail-gap);
}

.rail {
	grid-column: 1;
	grid-row: 1 / span 4;
	align-self: start;
	position: sticky;
	top: 32px;
	margin-top: clamp(48px, 8vw, 96px);
}
.rail ol { list-style: none; padding: 0; }
.rail li + li a { margin-top: -1px; }
.rail ol a {
	display: grid;
	place-items: center;
	width: var(--rail);
	height: 44px;
	border: 1px solid var(--weiss);
	font-size: 1.125rem;
	font-weight: 700;
	text-decoration: none;
	transition: background-color 0.25s ease, color 0.25s ease;
}
.rail ol a:hover { background: var(--schleier); }
.rail ol a[aria-current="true"] { background: var(--weiss); color: var(--gruen); }
.rail__call { display: none; }

.chapter {
	grid-column: 2;
	padding-block: var(--section) 0;
	scroll-margin-top: 0;
}
.chapter:last-of-type { padding-bottom: var(--section); }

.chapter h2 {
	font-size: var(--t-h2);
	font-weight: 700;
	line-height: 1.08;
	letter-spacing: -0.015em;
	text-wrap: balance;
}

.chapter p + p { margin-top: 1em; }

/* Heading left, short text right */
.split {
	display: grid;
	grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
	gap: clamp(24px, 5vw, 80px);
	align-items: end;
}
.split--top { align-items: start; }
.split__aside {
	font-size: var(--t-lead);
	padding-top: 14px;
	border-top: 1px solid var(--linie);
}

/* ---------- 1: Hero with the horoscope wheel ---------- */
.hero {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
	column-gap: clamp(24px, 5vw, 80px);
	padding-top: clamp(48px, 8vw, 96px);
}

.hero__text { grid-column: 1 / -1; grid-row: 1; position: relative; z-index: 1; }

.hero h1 {
	font-size: var(--t-h1);
	font-weight: 700;
	line-height: 1.04;
	max-width: 14ch;
	letter-spacing: -0.02em;
	text-wrap: balance;
}
.hero__sub {
	margin-top: 0.9em;
	font-size: var(--t-lead);
}

.hero__wheel {
	grid-column: 2;
	grid-row: 1 / span 2;
	align-self: start;
	width: min(640px, 48vw);
	margin-right: calc(var(--gutter) * -1 - 12vw);
	justify-self: end;
	pointer-events: none;
}
.hero__wheel svg { width: 100%; height: auto; display: block; overflow: visible; }
.hero__wheel :is(circle, line) {
	fill: none;
	stroke: var(--weiss);
	stroke-width: 1;
	vector-effect: non-scaling-stroke;
}
.hero__wheel .w-ticks line { stroke-opacity: 0.8; }
.hero__wheel .w-aspects line { stroke-opacity: 0.55; }
.hero__wheel .axis { stroke-width: 1.5; }
.hero__wheel .w-planets circle { fill: var(--weiss); stroke: none; }

.hero__body {
	grid-column: 1;
	max-width: 36ch;
	margin-top: clamp(40px, 6vw, 72px);
	margin-left: auto;
	margin-right: clamp(0px, 4vw, 48px);
	padding-top: 20px;
	border-top: 1px solid var(--linie);
}

/* The one orchestrated moment: the wheel draws itself on load */
@media (prefers-reduced-motion: no-preference) {
	.hero__wheel :is(circle, line)[pathLength] {
		stroke-dasharray: 1.05; /* a little longer than the path, so no gap stays at the seam */
		stroke-dashoffset: 1.05;
		animation: draw 1.6s cubic-bezier(0.6, 0, 0.2, 1) forwards;
	}
	.hero__wheel .w-rings circle { animation-duration: 1.8s; }
	.hero__wheel .w-ticks line { animation-delay: 0.5s; animation-duration: 0.9s; }
	.hero__wheel .w-houses line { animation-delay: 0.9s; }
	.hero__wheel .w-aspects line { animation-delay: 1.4s; }
	.hero__wheel .w-planets circle {
		opacity: 0;
		transform-box: fill-box;
		transform-origin: center;
		animation: appear 0.5s ease 2.2s forwards;
	}
	.hero__text { animation: rise 0.9s ease 0.1s both; }
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes appear { from { opacity: 0; scale: 0; } to { opacity: 1; scale: 1; } }
@keyframes rise { from { opacity: 0; translate: 0 14px; } to { opacity: 1; translate: 0 0; } }

/* ---------- 2: Three questions ---------- */
.questions {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: clamp(28px, 4vw, 56px);
	margin-top: clamp(56px, 8vw, 104px);
}

.question { container-type: inline-size; }
.question h3 {
	font-size: 1em;
	font-weight: 700;
	padding-bottom: 12px;
	margin-bottom: 14px;
	border-bottom: 1px solid var(--linie);
}
.question__word {
	display: block;
	font-size: 30cqi; /* sized to its column, so "Wohin" always fits */
	line-height: 0.9;
	letter-spacing: -0.035em;
	/* The font's glyphs have overlapping contours (the "e" bar). A green fill painted over
	   a double-width stroke hides the overlaps and leaves a clean 1.5px outline. */
	color: var(--gruen);
	-webkit-text-stroke: 3px var(--weiss);
	paint-order: stroke fill;
	margin-bottom: 0.12em;
	margin-left: -0.05em;
}
@supports not (-webkit-text-stroke: 1px white) {
	.question__word { color: var(--weiss); }
}
.question li { padding-left: 1.2em; text-indent: -1.2em; }
.question li::before { content: "… "; }
.question li + li { margin-top: 0.15em; }

/* ---------- 3: What I can do / birth data ---------- */
.offer li {
	padding-block: 10px;
	border-top: 1px solid var(--linie);
}
.offer li:last-child { border-bottom: 1px solid var(--linie); }

.birth {
	display: grid;
	grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
	gap: clamp(24px, 5vw, 80px);
	margin-top: clamp(56px, 8vw, 104px);
}
.birth__intro { font-size: var(--t-lead); line-height: 1.4; }

/* The three data points as squares, echoing the numbered rail */
.birth__data {
	grid-column: 2;
	grid-row: 1 / span 2;
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: clamp(8px, 1vw, 12px);
	align-self: start;
}
.birth__data div {
	aspect-ratio: 1;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	padding: clamp(12px, 1.6vw, 20px);
	border: 1px solid var(--weiss);
	background: var(--weiss);
	color: var(--gruen-tief);
}
.birth__data dt { font-weight: 700; font-size: clamp(0.95rem, 0.8rem + 0.6vw, 1.2rem); hyphens: auto; }
.birth__data dd { font-size: var(--t-small); line-height: 1.35; }

.birth__notes { grid-column: 1; max-width: 42ch; }
.footnote {
	font-size: var(--t-small);
	color: var(--weiss-leise);
	padding-left: 12px;
	border-left: 1px solid var(--linie);
}

/* ---------- 4: Personal ---------- */
.personal {
	display: grid;
	grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
	gap: clamp(28px, 5vw, 80px);
	align-items: end;
}
.personal__portrait img {
	width: 100%;
	max-width: 320px;
	aspect-ratio: 1;
	object-fit: cover;
	filter: saturate(0.95);
}
.personal__portrait figcaption {
	margin-top: 14px;
	font-style: italic;
}
.personal__quote h2 { margin-bottom: 0.5em; }
.personal__quote p {
	font-size: var(--t-lead);
	font-style: italic;
	line-height: 1.4;
}
.personal__quote p + p { margin-top: 0.6em; }

.terms {
	max-width: 58ch;
	margin-top: clamp(40px, 6vw, 72px);
	margin-left: auto;
	padding-top: 20px;
	border-top: 1px solid var(--linie);
}

/* ---------- Buttons ---------- */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 12px 26px;
	border: 1px solid currentColor;
	font: inherit;
	font-size: 1rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	text-decoration: none;
	cursor: pointer;
	background: none;
	color: inherit;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.btn:active { translate: 0 1px; }

/* ---------- Postcard deck (white section, inverted like the active square) ---------- */
.deck-section {
	background: var(--weiss);
	color: var(--gruen-tief);
	padding-block: var(--section);
	padding-inline: var(--gutter);
}
.deck-section__inner {
	max-width: calc(var(--max) - 2 * var(--gutter)); /* same text box as .chapters */
	margin-inline: auto;
	display: grid;
	grid-template-columns: minmax(0, 4fr) minmax(0, 6fr);
	gap: clamp(32px, 6vw, 96px);
	align-items: center;
}
.deck-section h2 {
	font-size: var(--t-h2);
	font-weight: 700;
	line-height: 1.08;
	letter-spacing: -0.015em;
	color: var(--gruen);
	margin-bottom: 0.5em;
}
.deck-section__text p { max-width: 34ch; }

.deck-section .btn--solid { background: var(--gruen); border-color: var(--gruen); color: var(--weiss); }
.deck-section .btn--solid:hover { background: var(--gruen-tief); border-color: var(--gruen-tief); }
.deck-section .btn--line:hover { background: var(--gruen-tief); color: var(--weiss); border-color: var(--gruen-tief); }

.deck { display: grid; justify-items: center; gap: 18px; }

.deck__stack {
	position: relative;
	width: min(calc(100% - 28px), 460px); /* room for the tilted cards underneath */
	aspect-ratio: 421 / 298;
	perspective: 1400px;
	margin-bottom: 8px;
}
.deck__back,
.deck__card {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	background: var(--weiss);
	box-shadow: 0 1px 2px rgb(0 60 0 / 0.12), 0 14px 34px -12px rgb(0 60 0 / 0.28);
}
.deck__back { border: 1px solid rgb(111 174 94 / 0.45); }
.deck__back:nth-child(1) { rotate: -4deg; translate: -10px 6px; }
.deck__back:nth-child(2) { rotate: 3deg; translate: 8px 4px; }
.deck__card {
	object-fit: cover;
	transform-origin: 50% 50%;
	backface-visibility: hidden;
}

.deck__count { font-size: var(--t-small); letter-spacing: 0.08em; }
.deck__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

.deck__browse { display: flex; gap: 8px; }
.deck__step {
	width: 44px;
	height: 44px;
	border: 1px solid rgb(0 112 10 / 0.35);
	background: none;
	color: inherit;
	font: inherit;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
	transition: border-color 0.2s ease;
}
.deck__step:hover { border-color: var(--gruen-tief); }

/* ---------- Contact ---------- */
.contact {
	padding-block: var(--section);
	padding-inline: var(--gutter);
}
.contact__inner {
	max-width: calc(var(--max) - 2 * var(--gutter));
	margin-inline: auto;
	display: grid;
	grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
	gap: clamp(40px, 6vw, 96px);
	align-items: start;
}

.contact__phone {
	display: inline-block;
	font-size: var(--t-h2);
	font-weight: 700;
	letter-spacing: -0.01em;
	line-height: 1.1;
	text-decoration: none;
	white-space: nowrap;
}
.contact__phone:hover { text-decoration: underline; text-decoration-thickness: 2px; }

.contact__address {
	margin-top: 28px;
	padding-top: 20px;
	border-top: 1px solid var(--linie);
	font-style: normal;
	font-variant: small-caps;
	letter-spacing: 0.22em;
	line-height: 1.8;
}
.contact__address a { text-decoration: none; }
.contact__address a:hover { text-decoration: underline; }

.form { display: grid; gap: 20px; }
.form__card {
	display: grid;
	grid-template-columns: minmax(0, 200px) auto;
	gap: 20px;
	align-items: end;
}
.form__card img { box-shadow: 0 14px 30px -12px rgb(0 0 0 / 0.35); }

.field { display: grid; gap: 6px; }
.field label { font-size: 0.95rem; }
.field input,
.field textarea {
	width: 100%;
	font: inherit;
	font-size: max(16px, 1rem); /* 16px+ stops iOS zooming into the field */
	font-weight: 300;
	color: var(--weiss);
	background: transparent;
	border: 0;
	border-bottom: 1px solid var(--linie);
	border-radius: 0;
	padding: 10px 2px;
	transition: background-color 0.2s ease;
}
.field textarea { border: 1px solid var(--linie); padding: 12px; resize: vertical; min-height: 9em; }
.field input:focus,
.field textarea:focus { outline: none; background: var(--schleier); }
.field--number input { width: 5.5ch; text-align: center; border: 1px solid var(--weiss); padding-inline: 4px; }

.contact .btn--solid {
	justify-self: start;
	background: var(--weiss);
	border-color: var(--weiss);
	color: var(--gruen-tief);
}
.contact .btn--solid:hover { background: transparent; color: var(--weiss); }
.form__status { font-weight: 700; }

/* ---------- Footer ---------- */
.footer {
	max-width: var(--max);
	margin-inline: auto;
	padding: 28px var(--gutter) calc(28px + env(safe-area-inset-bottom, 0px));
	border-top: 1px solid var(--linie);
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	gap: 16px 32px;
	font-size: var(--t-small);
}
.footer__dav {
	display: flex;
	align-items: center;
	gap: 16px;
	text-decoration: none;
	text-transform: uppercase;
	letter-spacing: 0.08em;
}
.footer__dav img { width: 84px; transition: rotate 0.5s ease; }
.footer__dav:hover img { rotate: -10deg; }
.footer__legal { display: flex; gap: 24px; font-variant: small-caps; letter-spacing: 0.22em; }
.footer__legal a { text-decoration: none; color: var(--weiss-leise); }
.footer__legal a:hover { color: var(--weiss); text-decoration: underline; }

/* ---------- Legal subpages ---------- */
.legal {
	max-width: calc(68ch + 2 * var(--gutter));
	margin-inline: auto;
	padding: clamp(48px, 8vw, 96px) var(--gutter) var(--section);
}
.legal h1 { font-size: var(--t-h2); font-weight: 700; line-height: 1.1; margin-bottom: 0.8em; }
.legal h2 { font-size: 1.1em; font-weight: 700; margin-top: 1.8em; margin-bottom: 0.4em; }
.legal p + p { margin-top: 0.8em; }
.legal ul { list-style: disc; padding-left: 1.2em; margin-block: 0.6em 0.8em; }
.legal .source { margin-top: 2em; font-size: 0.875em; color: var(--weiss-leise); }
.legal__back { display: inline-block; margin-bottom: 2em; font-weight: 700; }

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { transition: none !important; }
}

/* Deck and contact share the left edge of the chapter text */
@media (min-width: 768px) {
	.deck-section__inner,
	.contact__inner { padding-left: calc(var(--rail) + var(--rail-gap)); }
}

/* ---------- Tablet ---------- */
@media (max-width: 1023px) {
	.hero { grid-template-columns: minmax(0, 1fr); }
	.hero__wheel {
		position: absolute;
		top: 0;
		right: calc(var(--gutter) * -1 - 22vw);
		width: min(560px, 78vw);
		margin: 0;
		opacity: 0.45;
	}
	.hero h1 { max-width: 12ch; }
	.hero__body { margin-left: 0; margin-right: 0; max-width: 42ch; }

	.birth { grid-template-columns: minmax(0, 1fr); }
	.birth__data { grid-column: 1; grid-row: auto; max-width: 560px; }

	.deck-section__inner,
	.contact__inner { grid-template-columns: minmax(0, 1fr); }
	.deck-section__text { text-align: center; }
	.deck-section__text p { margin-inline: auto; }
}

/* ---------- Phone and small tablet: rail becomes a bottom bar ---------- */
@media (max-width: 767px) {
	.topbar__phone { display: none; }
	.topbar { justify-content: center; }

	.chapters { grid-template-columns: minmax(0, 1fr); }
	.chapter, .hero__text, .hero__body { grid-column: 1; }
	.hero h1 { max-width: none; }

	.rail {
		position: fixed;
		z-index: 10;
		inset: auto 0 0 0;
		margin: 0;
		display: flex;
		justify-content: space-between;
		align-items: center;
		gap: 12px;
		padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom, 0px));
		background: rgb(0 171 1 / 0.9);
		-webkit-backdrop-filter: blur(12px);
		backdrop-filter: blur(12px);
		border-top: 1px solid var(--linie);
	}
	.rail ol { display: flex; }
	.rail li + li a { margin-top: 0; margin-left: -1px; }
	.rail ol a { width: 44px; }
	.rail__call {
		display: inline-flex;
		align-items: center;
		min-height: 44px;
		padding-inline: 16px;
		background: var(--weiss);
		color: var(--gruen-tief);
		font-weight: 700;
		text-decoration: none;
	}
	.footer { padding-bottom: calc(28px + var(--bar) + env(safe-area-inset-bottom, 0px)); }

	.split,
	.personal { grid-template-columns: minmax(0, 1fr); align-items: start; }
	.questions { grid-template-columns: minmax(0, 1fr); }
	.personal__portrait img { max-width: 240px; }

	.form__card { grid-template-columns: minmax(0, 1fr); }
	.form__card img { max-width: 260px; }
	.contact__phone { font-size: clamp(1.9rem, 1rem + 5vw, 2.6rem); }
	.footer { justify-content: center; text-align: center; }
}
