/* ---------------------------------------------------------------- fonts */

@font-face {
    font-family: "IBM Plex Mono";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("/fonts/ibm-plex-mono-400-latin.woff2") format("woff2");
    unicode-range:
        U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
        U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
        U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "IBM Plex Mono";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("/fonts/ibm-plex-mono-400-latin-ext.woff2") format("woff2");
    unicode-range:
        U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
        U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
        U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "IBM Plex Mono";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("/fonts/ibm-plex-mono-500-latin.woff2") format("woff2");
    unicode-range:
        U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
        U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
        U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "IBM Plex Mono";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("/fonts/ibm-plex-mono-500-latin-ext.woff2") format("woff2");
    unicode-range:
        U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
        U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
        U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* --------------------------------------------------------------- tokens */

:root {
    --paper: #fbfbfa;
    --ink: #1a1a1a;
    --ink-2: #4a4a46;
    --ink-3: #6b6b66;
    --muted: #8b8b86;
    --faint: #a8a8a3;
    --line: #e3e2dd;
    --line-2: #d8d7d1;
    --line-3: #c9c8c2;
    --tile: #f2f1ec;

    --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
    --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

    --shell: 1240px;
    --gutter: clamp(20px, 6vw, 96px);
    --section-y: clamp(56px, 12vh, 120px);
    --section-gap: clamp(44px, 8vh, 96px);
}

/* ---------------------------------------------------------------- reset */

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

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

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    letter-spacing: -0.01em;
}

h1,
h2,
h3,
p,
ul {
    margin: 0;
}
ul {
    padding: 0;
    list-style: none;
}
img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

::selection {
    background: var(--ink);
    color: var(--paper);
}

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

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

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 10;
    background: var(--ink);
    color: var(--paper);
    font-family: var(--mono);
    font-size: 12px;
    padding: 10px 14px;
}

.skip-link:focus {
    left: var(--gutter);
    top: 12px;
}

/* --------------------------------------------------------------- layout */

.shell {
    min-height: 100vh;
    padding: 0 var(--gutter);
    overflow-x: clip;
}

.masthead,
.hero,
.section,
.colophon {
    max-width: var(--shell);
    margin: 0 auto;
}

.section {
    padding: var(--section-y) 0;
}

/* ------------------------------------------------------------ mono type */

.eyebrow,
.chips li,
.colophon,
.masthead,
.contact__mail {
    font-family: var(--mono);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.eyebrow {
    font-size: 12px;
    font-weight: 400;
    color: var(--muted);
}

.masthead {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 24px;
    padding: clamp(28px, 6vh, 56px) 0 0;
    font-size: 12px;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.masthead span {
    white-space: nowrap;
}

/* Nebeneinander wird es unter ~520px zu eng — dann lieber gestapelt als
   mitten im Wort umgebrochen. */
@media (max-width: 520px) {
    .masthead {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 24px;
    margin-bottom: var(--section-gap);
    letter-spacing: 0.08em;
}

.section-head .eyebrow {
    letter-spacing: 0.08em;
}

/* Sektionen ohne .section-head (Kontakt, Über mich) tragen die Überschrift
   direkt — dieselbe Luft darunter wie bei .section-head. */
.section > .eyebrow {
    display: block;
    margin-bottom: var(--section-gap);
    letter-spacing: 0.08em;
}

/* ----------------------------------------------------------------- hero */

.hero {
    padding: clamp(64px, 16vh, 160px) 0 clamp(56px, 10vh, 112px);
}

.hero h1 {
    font-size: clamp(44px, 9.5vw, 148px);
    line-height: 0.92;
    font-weight: 500;
    letter-spacing: -0.04em;
}

.hero__sub {
    max-width: 36ch;
    margin-top: clamp(24px, 4vh, 40px);
    font-size: clamp(19px, 2vw, 28px);
    line-height: 1.35;
    letter-spacing: -0.01em;
    color: var(--ink-2);
}

/* ------------------------------------------------------------ bildslots */

.slot {
    position: relative;
    overflow: hidden;
    background: var(--tile);
    border: 1px solid var(--line);
}

.slot--4x5 {
    aspect-ratio: 4 / 5;
}

/* ------------------------------------------------------------- projekte */

/* Jede Karte über die volle Breite: halbe Breite Bildkarussell, halbe
   Breite Text. Unter 760px gestapelt. */
.project {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(24px, 4vw, 56px);
    align-items: center;
}

.project + .project {
    margin-top: clamp(48px, 8vw, 96px);
}

@media (max-width: 760px) {
    .project {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

.project__meta {
    display: grid;
    gap: 14px;
    align-content: center;
}

.project__head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
}

.project h3 {
    font-size: clamp(22px, 2.2vw, 30px);
    font-weight: 500;
    letter-spacing: -0.02em;
}

.project p {
    max-width: 42ch;
    font-size: 16px;
    line-height: 1.55;
    color: var(--ink-2);
}

.project__meta a {
    border-bottom: 1px solid var(--line-3);
}
.project__meta a:hover {
    border-bottom-color: var(--ink);
}

/* --------------------------------------------------------- bildkarussell */

/* CSS-only, ohne JavaScript: scroll-snap für das Blättern, ::scroll-button()
   für vor/zurück, ::scroll-marker für die Punkte.
   https://developer.mozilla.org/en-US/docs/Web/CSS/Guides/Overflow/Carousels
   Browser ohne die Pseudo-Elemente behalten scroll-snap und die Scrollbar. */

.project__media {
    position: relative;
    anchor-scope: --shots;
}

.shots {
    display: flex;
    aspect-ratio: 16 / 9;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    background: var(--tile);
    border: 1px solid var(--line);
    transition: border-color 200ms;

    anchor-name: --shots;
    scroll-marker-group: after;
}

.project:hover .shots,
.shots:focus-visible,
.project__media:focus-within .shots {
    border-color: var(--ink);
}

/* Nur ein Bild: kein Karussell, also weder Pfeile noch Punkte. */
.shots:has(> .shot:only-child) {
    overflow: hidden;
}
.shots:has(> .shot:only-child)::scroll-button(*),
.shots:has(> .shot:only-child)::scroll-marker-group {
    display: none;
}

.shot {
    flex: 0 0 100%;
    height: 100%;
    scroll-snap-align: center;
    container-type: size;
    overflow: hidden;
}

/* Safari-Fenster, das von unten ins Bild ragt: oben und seitlich Luft,
   unten angeschnitten. Die Masse hängen an der Breite des Slides (cqw),
   damit der Rahmen auf dem Handy gleich aussieht wie auf dem Desktop. */
.browser {
    --bar: clamp(16px, 4.2cqw, 30px);
    width: 88cqw;
    margin: 6cqw auto 0;
    overflow: hidden;
    border: 1px solid var(--line-2);
    border-radius: clamp(6px, 1.4cqw, 10px);
    background: #fff;
    box-shadow: 0 1cqw 4cqw rgb(0 0 0 / 0.08);
}

.browser__bar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: var(--bar);
    background: #f0f0ee;
    border-bottom: 1px solid var(--line);
}

/* Die drei Fensterknöpfe als ein Element: zwei Kopien per box-shadow. */
.browser__dots {
    --d: calc(var(--bar) * 0.3);
    position: absolute;
    left: calc(var(--bar) * 0.45);
    width: var(--d);
    height: var(--d);
    border-radius: 50%;
    background: #ff5f57;
    box-shadow:
        calc(var(--d) * 1.6) 0 0 #febc2e,
        calc(var(--d) * 3.2) 0 0 #28c840;
}

.browser__url {
    width: 46%;
    padding: 0 1em;
    overflow: hidden;
    border-radius: calc(var(--bar) * 0.18);
    background: #e3e3e0;
    color: var(--ink-3);
    font-family: var(--sans);
    font-size: calc(var(--bar) * 0.4);
    line-height: calc(var(--bar) * 0.66);
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.browser img {
    height: auto;
    aspect-ratio: 16 / 10;
}

/* Die Scrollbar braucht es nur, solange der Browser keine Buttons stellt. */
@supports selector(::scroll-button(*)) {
    .shots {
        scrollbar-width: none;
    }
    .shots::-webkit-scrollbar {
        display: none;
    }
}

/* Die Chevrons liegen als data-URI im background, nicht in content: so
   behält der Button seine 34x34-Box und das Icon skaliert nicht mit ihr.
   Die Farbe steckt im SVG, currentColor greift dort nicht — darum je eine
   helle Variante für :disabled. */
.shots::scroll-button(*) {
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--line-2);
    background-color: var(--paper);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 18px 18px;
    cursor: pointer;
    transition: border-color 200ms;
}

.shots::scroll-button(*):hover {
    border-color: var(--ink);
}

.shots::scroll-button(*):disabled {
    border-color: var(--line);
    cursor: default;
}

.shots::scroll-button(left) {
    content: "" / "Vorheriges Bild";
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a1a1a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='15 18 9 12 15 6'/%3E%3C/svg%3E");
}

.shots::scroll-button(right) {
    content: "" / "Nächstes Bild";
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a1a1a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 18 15 12 9 6'/%3E%3C/svg%3E");
}

.shots::scroll-button(left):disabled {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a8a8a3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='15 18 9 12 15 6'/%3E%3C/svg%3E");
}
.shots::scroll-button(right):disabled {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a8a8a3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 18 15 12 9 6'/%3E%3C/svg%3E");
}

/* anchor-scope hält --shots pro Karte getrennt; ohne Unterstützung würden
   alle Buttons an dasselbe Karussell gehängt — dann bleiben sie im Fluss. */
@supports (anchor-scope: --a) {
    .shots::scroll-button(*) {
        position: absolute;
        position-anchor: --shots;
        bottom: calc(anchor(bottom) + 10px);
    }

    .shots::scroll-button(left) {
        left: calc(anchor(left) + 10px);
    }
    .shots::scroll-button(right) {
        left: calc(anchor(left) + 52px);
    }
}

.shots::scroll-marker-group {
    display: flex;
    justify-content: center;
    gap: 2px;
    margin-top: 8px;
}

/* Der Punkt selbst ist 7px, die Fläche 22px — sonst ist er auf dem Handy
   nicht zu treffen. Der Name steckt im content und wird per text-indent
   aus der Box geschoben: sichtbar bleibt der Punkt, hörbar der Name. */
.shot::scroll-marker {
    content: attr(data-accname);
    width: 22px;
    height: 22px;
    cursor: pointer;
    color: var(--line-3);
    background: radial-gradient(
        circle at center,
        currentColor 3.5px,
        transparent 4px
    );
    overflow: hidden;
    text-indent: 24px;
    white-space: nowrap;
    transition: color 200ms;
}

.shot::scroll-marker:hover {
    color: var(--ink-3);
}
.shot::scroll-marker:target-current {
    color: var(--ink);
}

/* ------------------------------------------------------------ über mich */

.about {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: clamp(32px, 5vw, 80px);
    align-items: start;
}

.about__photo {
    max-width: 420px;
}
.about__text {
    max-width: 46ch;
}

.statement {
    font-size: clamp(20px, 2.1vw, 30px);
    line-height: 1.35;
    font-weight: 500;
    letter-spacing: -0.02em;
}

.about__text p + p {
    margin-top: 20px;
    font-size: 16px;
    line-height: 1.65;
    color: var(--ink-2);
}

.about__text .statement + p {
    margin-top: 24px;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 10px;
    margin-top: 32px;
    font-size: 11px;
    color: var(--ink-3);
}

.chips li {
    border: 1px solid var(--line);
    padding: 6px 10px;
}

/* -------------------------------------------------------------- kontakt */

.contact__headline {
    max-width: 16ch;
    font-size: clamp(32px, 4.4vw, 60px);
    line-height: 1.02;
    font-weight: 500;
    letter-spacing: -0.03em;
}

.contact__mail {
    display: inline-block;
    margin-top: clamp(28px, 4vh, 44px);
    font-size: clamp(14px, 1.6vw, 20px);
    letter-spacing: 0.04em;
    text-transform: none;
    border-bottom: 1px solid var(--line-3);
    padding-bottom: 4px;
    transition: border-color 200ms;
}

.contact__mail:hover {
    border-bottom-color: var(--ink);
}

.contact__place {
    display: block;
    margin-top: clamp(20px, 3vh, 32px);
    font-family: var(--mono);
    font-style: normal;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

/* --------------------------------------------------------------- footer */

/* Schwarz über die volle Fensterbreite, obwohl der Footer in .shell sitzt:
   ::before zieht die Fläche seitlich bis an die Fensterränder, .shell
   schneidet den Überstand (Scrollbar-Breite) mit overflow-x: clip ab. */
.colophon {
    position: relative;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 64px;
    padding: 36px 0 44px;
    font-size: 11px;
    color: var(--faint);
}

.colophon::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0 calc(50% - 50vw);
    background: var(--ink);
}

/* Der Pinguin sitzt auf der Oberkante des Footers und steigt aus ihm auf,
   sobald der Footer ins Bild kommt. clip-path schneidet nur unten ab —
   so darf er beim Federn kurz über seine Box hinausragen. */
.colophon__pinguin {
    position: absolute;
    right: 0;
    bottom: 100%;
    width: 80px;
    clip-path: inset(-100% -100% 0 -100%);
    pointer-events: none;
}

.colophon__pinguin svg {
    display: block;
    width: 100%;
    height: auto;
    transition: transform 700ms cubic-bezier(0.34, 1.56, 0.64, 1) 120ms;
}

.js .colophon:not(.is-visible) .colophon__pinguin svg {
    transform: translateY(100%);
    transition-delay: 0ms;
}

/* --------------------------------------------------------------- reveal */

@keyframes riseIn {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.js .rv {
    opacity: 0;
}

.js .rv.in {
    animation: riseIn 900ms cubic-bezier(0.16, 0.84, 0.3, 1) forwards;
}

@media (prefers-reduced-motion: reduce) {
    .js .rv {
        opacity: 1;
    }
    .js .rv.in {
        animation: none;
    }
    * {
        transition-duration: 0.01ms !important;
    }
    .shots {
        scroll-behavior: auto;
    }
}
