
/* ---------- 1. Design Tokens ---------- */
:root {
    --color-bg: #000;
    --color-text: #fff;
    --color-muted: rgba(255, 255, 255, 0.72);
    --color-dim: rgba(255, 255, 255, 0.48);
    /* 0.30 ergab nur 2.5:1 Kontrast und lag damit unter der Grenze von
       4.5:1 fuer normalen Text (WCAG AA). 0.46 erreicht 4.6:1. */
    --color-faint: rgba(255, 255, 255, 0.46);
    --color-rule: rgba(255, 255, 255, 0.85);
    --line-fade: rgba(255, 255, 255, 0);
    --color-hairline: rgba(255, 255, 255, 0.12);

    --font-display: 'Baskervville', Georgia, serif;
    --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

    --size-title: clamp(2.5rem, 9vw, 6.25rem);

    --logo-height: 120px;

    --space-sm: 16px;
    --space-md: 32px;
    --space-lg: 56px;

    --bg-image: url('../img/backgrounds/bg.svg');
    --page-lift: rgba(255, 255, 255, 0);
}

/* ---------- 2. Reset / Base ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    height: 100%;
}

body {
    min-height: 100dvh;
    margin: 0;
    font-family: var(--font-body);
    color: var(--color-text);
    background: var(--bg-image) center center / 100% 100% no-repeat, var(--color-bg);
}

img {
    max-width: 100%;
}

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

a:focus-visible {
    outline: 2px solid var(--color-text);
    outline-offset: 3px;
}

/* ---------- 3. Layout ---------- */
body {
    position: relative;
    display: flex;
    flex-direction: column;
}

/* ---------- 4. Hero ---------- */
.hero {
    flex: 1;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: var(--space-md) var(--space-sm);
}

h1 {
    font-family: var(--font-display);
    font-size: var(--size-title);
    font-weight: 500;
    margin: 0;
}

.logo-line-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    width: min(70vw, 1100px);
    height: var(--logo-height);
}

.logo-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, var(--line-fade), var(--color-rule) 45%, var(--color-rule));
}

.logo-line:last-of-type {
    background: linear-gradient(to right, var(--color-rule), var(--color-rule) 55%, var(--line-fade));
}

/* Das Logo liegt als inline-SVG in der Seite, damit die Zeichen-Animation
   an die einzelnen Pfade herankommt. Ein inline-SVG ohne width/height
   klappt im Flex-Container auf 0 zusammen - die Hoehe muss deshalb hier
   gesetzt werden, die Breite ergibt sich aus der viewBox. */
.logo {
    height: var(--logo-height);
    width: auto;
    flex: none;
    overflow: visible;
}

/* ---------- 5. Footer ---------- */
.site-footer {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    text-align: center;
    padding: var(--space-md) 0 0;
}

.site-footer::before {
    content: "";
    display: block;
    width: 64px;
    height: 1px;
    margin: 0 auto var(--space-md);
    background: rgba(255, 255, 255, 0.22);
}

.footer-label {
    margin: 0 0 var(--space-md);
    padding-inline: var(--space-md);
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.28em;
    text-indent: 0.28em;
    text-transform: uppercase;
    color: var(--color-dim);
}

.footer-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: baseline;
    padding-inline: var(--space-md);
    font-style: normal;
}

.footer-item {
    padding: 0 26px;
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--color-muted);
    font-variant-numeric: tabular-nums lining-nums;
    white-space: nowrap;
}

.footer-item + .footer-item {
    border-left: 1px solid rgba(255, 255, 255, 0.16);
}

.footer-row a {
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-row a:hover,
.footer-row a:focus-visible {
    color: var(--color-text);
    text-decoration: underline;
    text-underline-offset: 0.35em;
    text-decoration-thickness: 1px;
}

.footer-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    margin-top: var(--space-lg);
    padding: 16px var(--space-md);
    border-top: 1px solid var(--color-hairline);
    text-align: left;
}

.footer-nav {
    display: flex;
    gap: 24px;
    font-size: 0.8rem;
}

.footer-nav a {
    color: var(--color-dim);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-nav a:hover,
.footer-nav a:focus-visible {
    color: var(--color-text);
}

.footer-nav a[aria-current="page"] {
    color: var(--color-text);
}

.copyright {
    margin: 0;
    font-size: 0.75rem;
    color: var(--color-faint);
}

.page {
    display: block;
    min-height: 100svh;
    background: var(--color-bg);
}

.page::before {
    content: "";
    position: fixed;
    inset: 0 0 auto 0;
    height: 100vh;
    height: 100lvh;
    z-index: -1;
    background:
        linear-gradient(var(--page-lift), var(--page-lift)),
        var(--bg-image) center center / 100% 100% no-repeat,
        var(--color-bg);
}

.navbar {
    border-bottom: 1px solid var(--color-hairline);
}

.navbar-inner {
    display: flex;
    justify-content: center;
    padding: 14px var(--space-md);
}

.navbar-brand {
    display: block;
    line-height: 0;
}

.navbar-brand img {
    display: block;
    height: 48px;
    width: auto;
}

.page-body {
    max-width: 68ch;
    margin: 0 auto;
    padding: var(--space-lg) var(--space-md) var(--space-md);
}

.page-body h1 {
    font-size: clamp(1.9rem, 5vw, 2.75rem);
    margin-bottom: var(--space-lg);
    text-align: center;
}

.page-body h2 {
    margin: var(--space-lg) 0 var(--space-sm);
    padding-top: var(--space-md);
    border-top: 1px solid var(--color-hairline);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--color-dim);
}

.page-body p,
.page-body li {
    font-size: 1rem;
    font-weight: 450;
    line-height: 1.75;
    color: var(--color-muted);
}

.page-body ul {
    padding-left: 1.2em;
}

.page-body li {
    margin-bottom: 6px;
}

.page-body a {
    color: var(--color-text);
    text-decoration: underline;
    text-underline-offset: 0.2em;
    text-decoration-color: rgba(255, 255, 255, 0.35);
}

.page-body a:hover {
    text-decoration-color: var(--color-text);
}

.daten {
    display: grid;
    grid-template-columns: minmax(11rem, auto) 1fr;
    gap: 8px var(--space-md);
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.6;
}

.daten dt {
    color: var(--color-dim);
}

.daten dd {
    margin: 0;
    color: var(--color-muted);
}

.stand {
    margin-top: var(--space-lg);
    padding-top: var(--space-md);
    border-top: 1px solid var(--color-hairline);
    font-size: 0.8rem;
    color: var(--color-faint);
}

.page-footer {
    margin-top: var(--space-lg);
}

/* Der Abstand nach oben kommt schon von .page-footer - sonst zaehlt er
   doppelt. Die Innenabstaende bleiben bewusst identisch zur Startseite. */
.page-footer .footer-bar {
    margin-top: 0;
}

/* ---------- 7. Responsive ---------- */
@media (max-height: 760px) {
    .hero {
        min-height: 0;
        padding-block: var(--space-lg);
    }

    .site-footer {
        position: static;
    }
}

@media (max-width: 980px) {
    .footer-row {
        gap: 10px 36px;
    }

    .footer-item {
        padding: 0;
    }

    .footer-item + .footer-item {
        border-left: none;
    }
}

/* Tablet */
@media (max-width: 900px) {
    :root {
        --logo-height: 80px;
    }
}

@media (max-width: 620px) {
    .daten {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .daten dt {
        margin-top: 14px;
        font-size: 0.78rem;
        letter-spacing: 0.06em;
        text-transform: uppercase;
    }

    .daten dt:first-of-type {
        margin-top: 0;
    }
}

/* Mobile */
@media (max-width: 450px) {
    :root {
        --logo-height: 60px;
    }

    .site-footer {
        padding-bottom: 0;
    }

    .site-footer::before {
        display: none;
    }

    .footer-label {
        margin-bottom: 14px;
    }

    .footer-bar {
        margin-top: 18px;
    }

    .logo-line-wrapper {
        width: 100%;
    }

    .footer-row {
        flex-direction: column;
        align-items: center;
        gap: 6px;
        padding-inline: var(--space-sm);
    }

    .footer-item {
        white-space: normal;
    }

    .footer-bar {
        flex-direction: column-reverse;
        align-items: center;
        gap: 10px;
        padding: 12px var(--space-sm);
        text-align: center;
    }

    .footer-nav {
        gap: 20px;
    }

    .navbar-inner {
        padding: 12px var(--space-sm);
    }

    .navbar-brand img {
        height: 36px;
    }

    .page-body {
        padding-left: var(--space-sm);
        padding-right: var(--space-sm);
    }
}

/* ---------- 8. Bewegung ---------- */
@media (prefers-reduced-motion: no-preference) {

    @keyframes auftauchen {
        from {
            opacity: 0;
        }
    }

    @keyframes aufsteigen {
        from {
            opacity: 0;
            transform: translateY(12px);
        }
    }

    @keyframes linie-ausfahren {
        from {
            transform: scaleX(0);
        }
    }

    /* Jede Linie traegt pathLength="1", die Strichlaenge ist damit
       unabhaengig von ihrer echten Laenge auf 1 normiert. Ein Versatz von
       1 heisst unsichtbar, 0 heisst fertig gezeichnet - deshalb genuegt
       eine einzige Regel fuer alle 54 Pfade. */
    @keyframes zeichnen {
        from {
            stroke-dashoffset: 1;
        }
    }

    .hero h1 {
        animation: aufsteigen 850ms cubic-bezier(0.22, 1, 0.36, 1) both;
    }

    /* --x ist die waagrechte Lage der Linie (0 links, 1 rechts), vom
       Build-Skript eingesetzt.
       Die einzelne Linie ist bewusst kurz, der Versatz ueber die Breite
       dagegen lang. Dadurch wandert eine Zeichenfront von links nach
       rechts, statt dass alle Linien gleichzeitig aufwachsen - es liest
       sich als Stift, der die Skyline zieht. Umgekehrte Werte ergaeben ein
       gleichzeitiges Erscheinen, was den Effekt zerstoert.
       Ohne Grundverzoegerung: die erste Linie startet mit dem Seitenaufbau. */
    .logo .bau {
        stroke-dasharray: 1;
        animation: zeichnen 230ms ease-out both;
        animation-delay: calc(var(--x, 0) * 1000ms);
    }

    /* Das A ist eine gefuellte Flaeche - die laesst sich nicht zeichnen.
       Sie setzt sich, sobald die Zeichenfront durch ist. */
    .logo .mark {
        animation: auftauchen 350ms ease-out 1080ms both;
    }

    .logo-line {
        transform-origin: right center;
        animation: linie-ausfahren 900ms cubic-bezier(0.22, 1, 0.36, 1) 150ms both;
    }

    .logo-line:last-of-type {
        transform-origin: left center;
    }

    .site-footer {
        animation: auftauchen 750ms ease-out 200ms both;
    }

    .navbar,
    .page-body,
    .page-footer {
        animation: auftauchen 450ms ease-out both;
    }

    .page-body {
        animation-delay: 60ms;
    }

    .page-footer {
        animation-delay: 120ms;
    }
}
