:root {
    color-scheme: dark;
    --bg: #141413;
    --fg: #e9e4da;
    --muted: #8f897f;
    --line: #34322e;
    --accent: #c4a676;

    --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
    --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    --breath: 12s;
}

/* Hell nur auf Wunsch über den Schalter im Footer. */
:root[data-theme="light"] {
    color-scheme: light;
    --bg: #f4f1ec;
    --fg: #2b2a27;
    --muted: #8a857c;
    --line: #d9d3c8;
    --accent: #9a7b4f;
}

body { transition: background-color 0.6s ease, color 0.6s ease; }

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

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

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--fg);
    font-family: var(--sans);
    font-weight: 300;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration-color: var(--line);
    text-underline-offset: 0.25em;
    transition: color 0.3s, text-decoration-color 0.3s;
}
a:hover,
a:focus-visible { color: var(--accent); text-decoration-color: currentColor; }

/* ---------- Kopfzeile (Unterseiten) ---------- */

.header { padding: 1.5rem; }
.home .header { display: none; }

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    font-size: 0.78rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    text-decoration: none;
}
.brand__logo { width: 28px; height: 28px; }

.logo__point { fill: var(--accent); }

/* ---------- Hintergrund-Wirbel ---------- */

.vortex,
.veil {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}
.vortex { opacity: 0; transition: opacity 3s ease-out; }
.vortex.is-ready { opacity: 1; }
.veil {
    background: radial-gradient(ellipse 50% 38% at 50% 46%,
        color-mix(in srgb, var(--bg) 80%, transparent) 0%,
        color-mix(in srgb, var(--bg) 45%, transparent) 55%,
        transparent 100%);
}

/* ---------- Startseite ---------- */

.hero {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4rem 1.5rem 2rem;
    padding-top: max(4rem, env(safe-area-inset-top));
    animation: fade-in 2.4s ease-out both;
}

.hero__logo {
    width: clamp(64px, 14vw, 92px);
    height: auto;
    margin-bottom: 2.5rem;
    animation: breathe var(--breath) ease-in-out infinite;
}

.eyebrow {
    margin: 0 0 1.25rem;
    font-size: 0.72rem;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--muted);
}

h1 {
    margin: 0;
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(2.6rem, 8vw, 4.5rem);
    letter-spacing: 0.02em;
    line-height: 1.1;
}
h1 span {
    display: block;
    margin-top: 0.9rem;
    font-family: var(--sans);
    font-size: 0.24em;
    font-weight: 400;
    letter-spacing: 0.5em;
    text-transform: uppercase;
    color: var(--muted);
}

.tagline {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.2rem 0;
    margin: 1.25rem 0 0;
    font-size: clamp(0.8rem, 2.4vw, 0.95rem);
    letter-spacing: 0.14em;
    color: var(--muted);
}
.tagline span + span::before {
    content: "·";
    margin: 0 0.7em;
    opacity: 0.6;
}

.lead {
    max-width: 34rem;
    margin: 2.5rem 0 0;
    font-size: 1.05rem;
}

.contact {
    margin-top: 2.5rem;
    padding-bottom: 0.3rem;
    font-size: 0.95rem;
    letter-spacing: 0.04em;
    text-decoration: none;
    border-bottom: 1px solid var(--line);
    transition: color 0.3s, border-color 0.3s;
}
.contact:hover,
.contact:focus-visible { border-color: currentColor; }

.motto {
    display: grid;
    margin: 4rem 0 0;
    font-family: var(--serif);
    font-size: 1.15rem;
    font-style: italic;
    color: var(--muted);
}
.motto span {
    grid-area: 1 / 1;
    opacity: 0;
    filter: blur(4px);
    transition: opacity 1.6s ease, filter 1.6s ease;
}
.motto span.is-active { opacity: 1; filter: none; }

/* ---------- Textseiten ---------- */

.text {
    flex: 1;
    width: 100%;
    max-width: 40rem;
    margin: 0 auto;
    padding: 3rem 1.5rem 3rem;
}
.text h1 { font-size: clamp(2rem, 6vw, 2.8rem); margin-bottom: 2.5rem; }
.text h2 {
    margin: 2.25rem 0 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted);
}
.text p { margin: 0; }

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

.footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.75rem 1.5rem;
    padding: 1.5rem;
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    color: var(--muted);
    border-top: 1px solid var(--line);
}
.home .footer { border-top-color: transparent; }
.footer nav { display: flex; gap: 1.5rem; }
.footer a { text-decoration: none; }

.footer__end { display: flex; align-items: center; gap: 1.5rem; }

.theme-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    cursor: pointer;
    transition: color 0.3s;
}
.theme-switch:hover,
.theme-switch:focus-visible { color: var(--accent); }
.theme-switch:focus-visible { outline: 1px solid currentColor; outline-offset: 4px; border-radius: 999px; }

.theme-switch__track {
    position: relative;
    width: 30px;
    height: 16px;
    border: 1px solid var(--muted);
    border-radius: 999px;
    transition: border-color 0.3s;
}
.theme-switch__track::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--muted);
    transition: transform 0.35s ease, background-color 0.3s;
}
.theme-switch[aria-checked="true"] .theme-switch__track { border-color: var(--accent); }
.theme-switch[aria-checked="true"] .theme-switch__track::after {
    transform: translateX(14px);
    background: var(--accent);
}

@media (max-width: 600px) {
    .hero { padding: 3rem 1.25rem 1.5rem; }
    .hero__logo { width: 56px; margin-bottom: 1.75rem; }
    .eyebrow { margin-bottom: 1rem; font-size: 0.66rem; }
    h1 { font-size: clamp(2.3rem, 11vw, 2.8rem); }
    h1 span { font-size: 0.3em; letter-spacing: 0.42em; }
    .tagline { font-size: 0.74rem; letter-spacing: 0.08em; }
    .tagline span + span::before { margin: 0 0.5em; }
    .lead { margin-top: 1.75rem; font-size: 0.98rem; line-height: 1.65; }
    .contact { margin-top: 1.75rem; font-size: 0.9rem; overflow-wrap: anywhere; }
    .motto { margin-top: 2.5rem; font-size: 1.05rem; }
    .text { padding: 2rem 1.25rem; }
    .header { padding: 1.25rem; }
    .footer { flex-direction: column; align-items: center; gap: 0.75rem; padding: 1.25rem; }
    .footer__end { flex-direction: column; gap: 0.75rem; }
}

@media (max-width: 600px) and (max-height: 700px) {
    .hero__logo { display: none; }
    .lead { font-size: 0.92rem; }
}

/* ---------- Bewegung ---------- */

@keyframes breathe {
    0%, 100% { transform: scale(0.92); }
    50%      { transform: scale(1); }
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .motto span:not(:first-child) { display: none; }
}
