/* --- Grundlagen ---------------------------------------------------------------
 * Eine Seite, kein Build. Wie bei den andern Kunden-Seiten auch: kein
 * Framework, keine Vorkompilierung, nur CSS das der Browser kennt.
 * Farben und Abstaende stehen als Variablen oben, damit sich die Seite an einer
 * Stelle umstellen laesst.
 * ------------------------------------------------------------------------- */

/* --- Exo 2 als Schrift ------------------------------------------------------
 * Selbst gehostet und als Variable Font: EIN Block je Richtung deckt den
 * ganzen Gewichtbereich 100 bis 900 ab, sonst nimmt der Browser nur die
 * Default-Instanz der Datei. Der zweite Block liefert die echte Kursive,
 * weil im Text <em> vorkommt und eine Synthese bei ganzen Absaetzen
 * schlechter aussieht. Beide Dateien stammen aus dem Originalpaket in
 * Exo_2/ und wurden nach woff2 konvertiert. Exo 2 steht unter der SIL Open
 * Font License, die als OFL-exo2.txt mitgeliefert wird. Selbsthosten ist
 * erlaubt, die Lizenz verlangt nur, dass die Datei mitgeliefert wird.
 * -------------------------------------------------------------------- */
@font-face {
    font-family: 'Exo 2'; src: url('../fonts/exo2-var.woff2') format('woff2');
    font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Exo 2'; src: url('../fonts/exo2-var-italic.woff2') format('woff2');
    font-weight: 100 900; font-style: italic; font-display: swap;
}

:root {
    --papier: #f7f4ee;
    --papier-hoch: #fffdf9;
    --ton: #efe9df;
    --tinte: #1a1a1c;
    --tinte-leise: #55524d;
    --akzent: #a8482a;
    --linie: rgba(26, 26, 28, 0.14);
    --linie-weich: rgba(26, 26, 28, 0.07);

    /* Beide Variablen zeigen auf dieselbe Familie: Exo 2 ist die einzige
     * Schrift der Seite. Die Ueberschriften holen sich ihre Staerke aus dem
     * Gewicht (siehe h1, h2), nicht aus einer zweiten Schrift. Wer speter
     * fuer die Titel doch eine eigene Familie will, aendert nur diese
     * eine Zeile. */
    --schrift-titel: 'Exo 2', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --schrift-text: 'Exo 2', 'Segoe UI', system-ui, -apple-system, sans-serif;

    --breite: 1240px;
    --radius: 2px;
}

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

html {
    scroll-behavior: smooth;
    /* Anker springen sonst unter den klebenden Kopf. */
    scroll-padding-top: 90px;
}

body {
    margin: 0;
    background: var(--papier);
    color: var(--tinte);
    font-family: var(--schrift-text);
    font-size: 1.0625rem;
    line-height: 1.75;
    font-weight: 350;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }
figure { margin: 0; }

h1, h2, h3 {
    font-family: var(--schrift-titel);
    font-weight: 400;
    line-height: 1.08;
    letter-spacing: -0.015em;
    margin: 0 0 0.5em;
}

h1 { font-size: clamp(3.4rem, 11vw, 8.5rem); }
h2 { font-size: clamp(2rem, 4.6vw, 3.4rem); }
h3 { font-size: 1.0625rem; font-family: var(--schrift-text); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }

p { margin: 0 0 1.1em; }
a { color: inherit; }

.klein { font-size: 0.875rem; color: var(--tinte-leise); }
.punkt { color: var(--akzent); padding: 0 0.35em; }

.kicker {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--akzent);
    margin: 0 0 1.4rem;
}

.wrap {
    width: 100%;
    max-width: var(--breite);
    margin: 0 auto;
    padding: 0 clamp(1.25rem, 5vw, 4rem);
}

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
    position: absolute; top: -100px; left: 1rem; z-index: 200;
    background: var(--tinte); color: var(--papier);
    padding: 0.7rem 1.1rem; text-decoration: none; font-size: 0.9rem;
    transition: top 0.15s ease;
}
.skip-link:focus { top: 1rem; }

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

/* --- Kopf -------------------------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(247, 244, 238, 0.86);
    backdrop-filter: saturate(1.4) blur(12px);
    -webkit-backdrop-filter: saturate(1.4) blur(12px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}
/* Die Linie erscheint erst beim Scrollen; ohne das klebt oben ein Rand, obwohl
   im oberen Bereich noch gar nichts gescrollt wurde. */
.site-header.ist-klebrig { border-bottom-color: var(--linie); }

.header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    min-height: 76px;
}

.brand {
    text-decoration: none;
    line-height: 1.15;
    display: flex;
    flex-direction: column;
}
.brand-name { font-family: var(--schrift-titel); font-size: 1.3rem; }
.brand-sub {
    font-size: 0.68rem; letter-spacing: 0.24em; text-transform: uppercase;
    color: var(--tinte-leise);
}

.site-nav { display: flex; gap: 2rem; }
.site-nav a {
    text-decoration: none;
    font-size: 0.92rem;
    letter-spacing: 0.04em;
    padding-bottom: 2px;
    border-bottom: 1px solid transparent;
    transition: border-color 0.18s ease, color 0.18s ease;
}
.site-nav a:hover { border-bottom-color: var(--akzent); color: var(--akzent); }

.nav-toggle {
    display: none;
    width: 44px; height: 44px;
    border: 1px solid var(--linie);
    background: none;
    cursor: pointer;
    position: relative;
    border-radius: var(--radius);
}
.nav-toggle-balken,
.nav-toggle-balken::before,
.nav-toggle-balken::after {
    position: absolute; left: 50%; top: 50%;
    width: 20px; height: 1.5px; background: var(--tinte);
    content: ''; transform: translate(-50%, -50%);
    transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle-balken::before { top: -6px; }
.nav-toggle-balken::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-balken { transform: translate(-50%, -50%) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-balken::before { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-balken::after { transform: translate(-50%, -50%) rotate(-90deg); }

/* --- Hero -------------------------------------------------------------------- */
.hero { padding: clamp(3rem, 8vw, 7rem) 0 clamp(3.5rem, 9vw, 7rem); }

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: clamp(2rem, 5vw, 5rem);
    align-items: center;
}

.hero-sub {
    font-family: var(--schrift-titel);
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    font-style: italic;
    color: var(--tinte-leise);
    margin: 0 0 1.8rem;
}
.hero-text-abschnitt { max-width: 42ch; font-size: 1.1rem; }

.hero-knoepfe { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 2rem; }

.knopf {
    display: inline-block;
    padding: 0.85rem 1.6rem;
    border: 1px solid var(--tinte);
    border-radius: var(--radius);
    text-decoration: none;
    font-size: 0.9rem;
    letter-spacing: 0.06em;
    cursor: pointer;
    background: none;
    font-family: inherit;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.knopf:hover { background: var(--tinte); color: var(--papier); }
.knopf-haupt { background: var(--tinte); color: var(--papier); }
.knopf-haupt:hover { background: var(--akzent); border-color: var(--akzent); }

/* Zwei uebereinander gelegte Bilder. position:absolute und nth-child sind hier
   nur die kuerzeste Loesung: die Tiefe entsteht aus der Ueberlagerung, nicht
   aus dem Layout. */
.hero-bilder {
    position: relative;
    aspect-ratio: 4 / 3.4;
    margin: 0;
}
.hero-bild {
    position: absolute;
    overflow: hidden;
    border-radius: var(--radius);
    box-shadow: 0 26px 60px -30px rgba(26, 26, 28, 0.55);
}
.hero-bild img { width: 100%; height: 100%; object-fit: cover; }
.hero-bild-hinten {
    top: 0; right: 0; width: 74%;
    transform: rotate(2.5deg);
    box-shadow: none;
    outline: 1px solid var(--linie-weich);
}
.hero-bild-vorne {
    bottom: 0; left: 0; width: 68%;
    aspect-ratio: 4 / 3;
}

/* --- Abschnitte -------------------------------------------------------------- */
.abschnitt { padding: clamp(4rem, 10vw, 8.5rem) 0; }
.abschnitt-ton { background: var(--ton); }

.abschnitt-kopf { max-width: 46ch; margin-bottom: clamp(2rem, 4vw, 3.5rem); }
.abschnitt-lead { font-size: 1.08rem; color: var(--tinte-leise); }

/* --- Filter ------------------------------------------------------------------ */
.filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-bottom: 2.2rem;
    border-bottom: 1px solid var(--linie);
    margin-bottom: 2.6rem;
}
.filter-knopf {
    font-family: inherit;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.55rem 1.05rem;
    border: 1px solid var(--linie);
    border-radius: 999px;
    background: none;
    color: var(--tinte-leise);
    cursor: pointer;
    transition: all 0.18s ease;
}
.filter-knopf:hover { border-color: var(--tinte); color: var(--tinte); }
.filter-knopf.ist-aktiv { background: var(--tinte); border-color: var(--tinte); color: var(--papier); }

.filter-meldung {
    font-size: 0.9rem;
    color: var(--tinte-leise);
    padding: 1.2rem 0 0;
}

/* --- Galerie ----------------------------------------------------------------- */
/* Kein Masonry-Paket: die Bilder haben verschiedene Formate, ein echtes
   Masonry braucht JavaScript und verlangt hier zusaetzlich Resize-Observer.
   Stattdessen rasten die Bilder ueber die Zeile ein (align-items: start) und
   die Bildunterschrift sitzt unter dem Bild, nicht in einer fixen Hoehe. */
.galerie {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: clamp(1.6rem, 3vw, 2.8rem) clamp(1.2rem, 2.5vw, 2rem);
    align-items: start;
}

.werk { margin: 0; }
.werk.ist-aus { display: none; }

.werk-knopf {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: none;
    cursor: zoom-in;
    overflow: hidden;
    border-radius: var(--radius);
    position: relative;
}
.werk-knopf img {
    width: 100%;
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
}
/* Beim Ueberfahren wird das Bild leicht gross. transform auf dem img, nicht
   auf dem button: sonst wackelt die ganze Kachel in der Zeile. */
.werk-knopf:hover img { transform: scale(1.035); }

.werk-knopf::after {
    content: '';
    position: absolute; inset: 0;
    border: 1px solid var(--linie-weich);
    pointer-events: none;
}

.werk figcaption {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding-top: 0.85rem;
}
.werk-titel { font-family: var(--schrift-titel); font-size: 1.15rem; }
.werk-angaben { font-size: 0.82rem; color: var(--tinte-leise); letter-spacing: 0.02em; }

/* Bilder, die eine Zeile breiter sind als ihre Nachbarn. */
.werk-breit { grid-column: span 2; }
.werk-breit .werk-knopf img { aspect-ratio: 16 / 10; object-fit: cover; }

/* --- Ueber mich -------------------------------------------------------------- */
.ueber-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    gap: clamp(2rem, 6vw, 5.5rem);
    align-items: start;
}
.ueber-bild { position: sticky; top: 110px; }
.ueber-bild img { border-radius: var(--radius); }
.ueber-text p { max-width: 58ch; }

.daten {
    margin: 2.6rem 0 0;
    border-top: 1px solid var(--linie);
}
.daten-paar {
    display: grid;
    grid-template-columns: 12rem minmax(0, 1fr);
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--linie);
    margin: 0;
}
.daten dt {
    font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--tinte-leise); padding-top: 0.25rem;
}
.daten dd { margin: 0; }

/* --- Kontakt ----------------------------------------------------------------- */
.kontakt-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    gap: clamp(2rem, 5vw, 4.5rem);
    align-items: start;
}

.kontakt-block { margin-bottom: 2rem; }
.kontakt-block h3 { color: var(--tinte-leise); margin-bottom: 0.5rem; }
.kontakt-block p { margin: 0; }
.kontakt-block a { text-decoration-color: var(--linie); text-underline-offset: 3px; }
.kontakt-block a:hover { color: var(--akzent); }

.formular {
    background: var(--papier-hoch);
    border: 1px solid var(--linie-weich);
    border-radius: var(--radius);
    padding: clamp(1.4rem, 3vw, 2.4rem);
}
.formular-feld { margin-bottom: 1.2rem; }
.formular-feld label {
    display: block;
    font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--tinte-leise);
    margin-bottom: 0.4rem;
}
.formular-feld input,
.formular-feld select,
.formular-feld textarea {
    width: 100%;
    font-family: inherit;
    font-size: 1rem;
    color: inherit;
    padding: 0.7rem 0.85rem;
    background: var(--papier);
    border: 1px solid var(--linie);
    border-radius: var(--radius);
}
.formular-feld textarea { resize: vertical; min-height: 8rem; }
.formular-feld :is(input, select, textarea):focus-visible {
    border-color: var(--akzent);
    outline-offset: 1px;
}
.formular-feld.ist-fehlerhaft :is(input, textarea) { border-color: #a02020; }

.fehler {
    margin: 0.35rem 0 0;
    font-size: 0.85rem;
    color: #a02020;
}
.fehler:empty { display: none; }

.formular-knopf { width: 100%; }
.formular-status { margin: 1rem 0 0; font-size: 0.9rem; }
.formular-status.ist-fehler { color: #a02020; }
.formular-status a {
    color: var(--akzent);
    text-underline-offset: 3px;
    white-space: nowrap;
}
.formular-hinweis { margin: 0.8rem 0 0; }

/* --- Fuss -------------------------------------------------------------------- */
.site-footer {
    background: var(--tinte);
    color: var(--papier);
    padding: clamp(2.5rem, 6vw, 4rem) 0 2.5rem;
}
.footer-zeile {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: baseline;
    justify-content: space-between;
    padding-bottom: 2rem;
}
.footer-marke { margin: 0; font-family: var(--schrift-titel); font-size: 1.25rem; }
.site-footer .punkt { color: var(--akzent); }
.zurueck {
    font-size: 0.85rem; letter-spacing: 0.1em; text-transform: uppercase;
    text-decoration: none; color: var(--papier); opacity: 0.75;
    border-bottom: 1px solid transparent; padding-bottom: 2px;
}
.zurueck:hover { opacity: 1; border-bottom-color: var(--akzent); }

.impressum { border-top: 1px solid rgba(247, 244, 238, 0.18); padding-top: 1.2rem; }
.impressum summary {
    cursor: pointer;
    font-size: 0.8rem; letter-spacing: 0.16em; text-transform: uppercase;
    opacity: 0.7;
}
.impressum summary:hover { opacity: 1; }
.impressum-inhalt { max-width: 62ch; font-size: 0.9rem; opacity: 0.8; padding-top: 1rem; }
.impressum-inhalt p { margin-bottom: 0.9em; }
.impressum-inhalt code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.85em;
    background: rgba(247, 244, 238, 0.1);
    padding: 0.1em 0.35em;
    border-radius: 2px;
}

/* --- Lightbox ---------------------------------------------------------------- */
.lightbox {
    border: 0;
    padding: 0;
    background: rgba(20, 19, 17, 0.96);
    color: var(--papier);
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
}
.lightbox::backdrop { background: rgba(20, 19, 17, 0.9); }

.lightbox-inhalt {
    margin: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 3.5rem 4.5rem 3rem;
}
.lightbox-inhalt img {
    max-width: 100%;
    /* Die Bildhöhe ist begrenzt, sonst schiebt ein Hochformat den Text
       aus dem Fenster und die Pfeile liegen auf dem Bild. */
    max-height: calc(100vh - 190px);
    width: auto;
    object-fit: contain;
    box-shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.9);
}
.lightbox-inhalt figcaption { text-align: center; display: flex; flex-direction: column; gap: 0.2rem; }
.lightbox-titel { font-family: var(--schrift-titel); font-size: 1.4rem; }
.lightbox-angaben { font-size: 0.85rem; opacity: 0.7; }

.lightbox-schliessen,
.lightbox-pfeil {
    position: absolute;
    background: none;
    border: 1px solid rgba(247, 244, 238, 0.28);
    color: var(--papier);
    width: 48px; height: 48px;
    border-radius: 50%;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background 0.18s ease, border-color 0.18s ease;
}
.lightbox-schliessen:hover,
.lightbox-pfeil:hover { background: rgba(247, 244, 238, 0.14); border-color: var(--papier); }
.lightbox-schliessen { top: 1.1rem; right: 1.1rem; font-size: 1.9rem; }
.lightbox-zurueck { left: 1.1rem; top: 50%; transform: translateY(-50%); }
.lightbox-vor { right: 1.1rem; top: 50%; transform: translateY(-50%); }

.lightbox-zaehler {
    position: absolute;
    bottom: 1rem; left: 50%;
    transform: translateX(-50%);
    margin: 0;
    font-size: 0.8rem;
    letter-spacing: 0.14em;
    opacity: 0.6;
}

/* --- Handy und Tablet -------------------------------------------------------- */
@media (max-width: 1000px) {
    .hero-grid,
    .ueber-grid,
    .kontakt-grid { grid-template-columns: minmax(0, 1fr); }

    .ueber-bild { position: static; max-width: 380px; }
    .hero-bilder { max-width: 560px; }
}

@media (max-width: 860px) {
    .nav-toggle { display: block; }
    .site-nav {
        position: absolute;
        top: 100%; left: 0; right: 0;
        flex-direction: column;
        gap: 0;
        background: var(--papier);
        border-bottom: 1px solid var(--linie);
        padding: 0.5rem clamp(1.25rem, 5vw, 4rem) 1rem;
        /* Ohne max-height waere die Navigation beim Aufklappen nicht als
           Overlay erkennbar und der Text darunter bliebe sichtbar. */
        display: none;
    }
    .site-nav.ist-offen { display: flex; }
    .site-nav a { padding: 0.8rem 0; border-bottom: 1px solid var(--linie-weich); }
}

@media (max-width: 720px) {
    .werk-breit { grid-column: span 1; }
    .galerie { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
    .daten-paar { grid-template-columns: minmax(0, 1fr); gap: 0.15rem; }
    .lightbox-inhalt { padding: 3.5rem 1rem 3rem; }
    .lightbox-inhalt img { max-height: calc(100vh - 220px); }
    .lightbox-schliessen { top: 0.6rem; right: 0.6rem; }
    .lightbox-zurueck { left: 0.4rem; }
    .lightbox-vor { right: 0.4rem; }
    .hero-knoepfe .knopf { flex: 1 1 100%; text-align: center; }
}

@media (max-width: 480px) {
    .galerie { grid-template-columns: minmax(0, 1fr); }
}

/* --- Einblenden beim Scrollen -------------------------------------------------
 * Die Klassen setzt allein das Skript, und nur wenn IntersectionObserver
 * vorhanden ist. Deshalb steht hier keine Voreinstellung, die etwas
 * verstecken wuerde: faellt das Skript aus, ist die Seite sofort in voller
 * Laenge zu sehen.
 * ------------------------------------------------------------------------- */
.blendet-ein {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.ist-sichtbar { opacity: 1; transform: none; }

/* --- Bewegung ---------------------------------------------------------------
 * Wer im System reduzierte Bewegung eingestellt hat, bekommt keine Animation
 * und keine glatte Scrollfahrt. Der JS-Teil fragt dieselbe Einstellung ab und
 * ueberspringt dann auch das Einblenden.
 * ------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
    }
    .werk-knopf:hover img { transform: none; }
    .blendet-ein { opacity: 1; transform: none; }
}

/* --- Druck ------------------------------------------------------------------
 * Auf Papier hilft kein Rahmen um jedes Bild, und die Lightbox hat dort
 * nichts zu suchen.
 * ------------------------------------------------------------------------- */
@media print {
    .site-header, .lightbox, .filter, .skip-link, .hero-knoepfe { display: none !important; }
    body { background: #fff; color: #000; font-size: 11pt; }
    .abschnitt { padding: 1.5rem 0; page-break-inside: avoid; }
    .werk.ist-aus { display: block !important; }
    a { text-decoration: none; }
}