/* Schrift: Nimbus Mono von URW++ (Lizenz: GNU GPL, siehe font/nimbus-mono/).
   @font-face sagt dem Browser, wo die Schriftdatei liegt und welcher Schnitt welcher ist.
   Derselbe Block steht in style.css, html/style.css und html/text.css,
   weil nicht alle Seiten dieselbe CSS-Datei laden.
   Die Oblique-Datei ist als font-style: italic angemeldet. So nutzen alle
   Hover-Effekte mit font-style: italic automatisch die echte schräge Variante.
   font-display: swap zeigt den Text sofort in einer Ersatzschrift,
   bis Nimbus Mono geladen ist, statt ihn unsichtbar zu lassen. */
@font-face {
    font-family: "Nimbus Mono";
    src: url("font/nimbus-mono/NimbusMono-Regular.woff") format("woff");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Nimbus Mono";
    src: url("font/nimbus-mono/NimbusMono-Oblique.woff") format("woff");
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

/* Echter fetter Schnitt, z. B. für das Cursor-Wort «pause» auf Artistic Practice.
   Ohne diesen Block würde der Browser die Regular nur künstlich verdicken.
   Es gibt ihn nur als .otf, darum format("opentype"). */
@font-face {
    font-family: "Nimbus Mono";
    src: url("font/nimbus-mono/NimbusMono-Bold.otf") format("opentype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* 1. Variablen */
:root {
    --farbe-flaeche: #fff;
    --farbe-text: #111;
    --schrift-groesse: 1rem;
    /* Grössere Stufe für Navigation und Projekttitel */
    --schrift-gross: 1.125rem;
    /* Lauftexte auf allen Seiten (14 px) */
    --schrift-text: 0.875rem;
    --abstand-klein: 0.75rem;
    --abstand-raster: 1.25rem;
}

/* 2. Basis */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--farbe-flaeche);
    color: var(--farbe-text);
    font-family: "Nimbus Mono", "Courier New", monospace;
    font-size: var(--schrift-groesse);
}

/* Die rosafarbene Ebene verbindet den Seitenwechsel mit dem Projekt-Intro. */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 10000;
    pointer-events: none;
    background: transparent;
    opacity: 0;
    backdrop-filter: blur(0);
    transition: opacity 0.3s ease, backdrop-filter 0.3s ease;
}

body.is-leaving::before,
body.is-entering::before {
    opacity: 1;
    backdrop-filter: blur(8px);
}

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

/* 3. Layout */
.seitenrahmen {
    min-height: 100vh;
    background: var(--farbe-flaeche);
}

.projektliste {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 3rem var(--abstand-raster);
    padding: 0 var(--abstand-raster) 4rem;
}

/* 4. Komponenten */
.kopfbereich {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 4rem;
    padding: 0 var(--abstand-raster);
}

.kopfbereich__name,
.kopfbereich__about {
    font-size: var(--schrift-gross);
    letter-spacing: 0.04em;
}

.kopfbereich__name:hover {
    font-style: italic;
}

.kopfbereich__about:hover {
    font-style: italic;
}

.projekt {
    display: flex;
    flex-direction: column;
    min-width: 0;
    margin: 0;
}

body.is-project-entry .projekt {
    animation: projekt-erscheinen 0.5s ease both;
}

body.is-project-entry .projekt:nth-child(2) { animation-delay: 0.06s; }
body.is-project-entry .projekt:nth-child(3) { animation-delay: 0.12s; }
body.is-project-entry .projekt:nth-child(4) { animation-delay: 0.18s; }
body.is-project-entry .projekt:nth-child(5) { animation-delay: 0.24s; }
body.is-project-entry .projekt:nth-child(6) { animation-delay: 0.3s; }
body.is-project-entry .projekt:nth-child(7) { animation-delay: 0.36s; }
body.is-project-entry .projekt:nth-child(8) { animation-delay: 0.42s; }

@keyframes projekt-erscheinen {
    from { opacity: 0; filter: blur(8px); }
    to { opacity: 1; filter: blur(0); }
}

.projekt__bild,
.projekt__video {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
    background: #171717;
}

.projekt__titel {
    padding-top: var(--abstand-klein);
    text-align: center;
}

/* Fährt man über ein Projekt (Bild oder Titel), wird der Titel kursiv.
   :hover sitzt auf dem ganzen Projekt (.projekt), darum reagiert Bild und Titel. */
.projekt:hover .projekt__titel {
    font-style: italic;
}

.projekt--hours .projekt__titel {
    margin-bottom: 1.2rem;
}

/* 5. Hilfsklassen */
@media (min-width: 40rem) {
    .projektliste {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 64rem) {
    .projektliste {
        /* 23 Reihen mit fester Höhe, danach eine Reihe mit automatischer Höhe.
           Die letzte Reihe passt sich dem Plakat «type experiment» an.
           So endet die Seite immer direkt unter seinem Titel, egal wie breit der Bildschirm ist.
           Achtung: Kein anderes Projekt darf unter Reihe 23 reichen. */
        grid-template-rows: repeat(23, 3.25rem) auto;
        grid-template-columns: repeat(12, minmax(0, 1fr));
        grid-auto-rows: 3.25rem;
        column-gap: 6.2vw;
        row-gap: 1rem;
        /* Abstand unten zwischen letztem Titel und Seitenende (ca. 5 mm) */
        padding: 0 0 var(--abstand-raster);
    }

    .projekt__bild,
    .projekt__video {
        flex: none;
        min-height: 0;
    }

    .projekt {
        align-self: start;
        justify-self: stretch;
    }

    /* Im Desktop-Raster erscheinen zuerst die Projekte nahe der Seitenmitte. */
    body.is-project-entry .projekt--bauhaus { animation-delay: 0s; }
    body.is-project-entry .projekt--corner { animation-delay: 0.06s; }
    body.is-project-entry .projekt--erfraulich { animation-delay: 0.12s; }
    body.is-project-entry .projekt--newspaper { animation-delay: 0.18s; }
    body.is-project-entry .projekt--hours { animation-delay: 0.24s; }
    body.is-project-entry .projekt--tissage { animation-delay: 0.3s; }
    body.is-project-entry .projekt--closeup { animation-delay: 0.36s; }
    body.is-project-entry .projekt--typeexperiment { animation-delay: 0.42s; }

    .projekt--tissage {
        grid-column: 1 / span 4;
        grid-row: 1 / span 7;
    }

    .projekt--newspaper {
        grid-column: 5 / span 4;
        grid-row: 1 / span 5;
    }

    .projekt--closeup {
        grid-column: 9 / span 4;
        grid-row: 1 / span 5;
    }

    .projekt--erfraulich {
        grid-column: 1 / span 4;
        grid-row: 13 / span 9;
    }

    .projekt--bauhaus {
        grid-column: 5 / span 3;
        grid-row: 11 / span 4;
    }

    .projekt--corner {
        grid-column: 9 / span 4;
        grid-row: 10 / span 5;
    }

    .projekt--hours {
        grid-column: 8 / span 5;
        grid-row: 18 / span 6;
    }

    /* Unten in der Mitte, unter bauhaus und links neben 24 hours.
       Das Plakat ist hochformatig, darum schmal (3 Spalten). */
    .projekt--typeexperiment {
        grid-column: 5 / span 3;
        grid-row: 21 / span 4; /* Reihen 21–23 fest, Reihe 24 automatisch */
    }
}

.cursor-ball {
    display: none;
    position: fixed;
    top: -1rem;
    left: -1rem;
    z-index: 9999;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #FF3300;
    pointer-events: none;
    transform: translate(-50%, -50%);
    scale: 1;
    transition: scale 0.3s ease;
}

.cursor-ball.is-hovering {
    scale: 1.875;
}

@media (prefers-reduced-motion: reduce) {
    body::before { transition: none; }
    body.is-project-entry .projekt { animation: none; }
}

@media (hover: hover) and (pointer: fine) {
    body,
    body * {
        cursor: none;
    }

    .cursor-ball {
        display: block;
    }
}

