/* ─── Self-Hosted Fonts ─────────────────────────────── */
@font-face {
    font-family: 'JetBrains Mono';
    font-style: normal;
    font-weight: 100 800;
    font-display: swap;
    src: url(/fonts/JetBrainsMono.woff2) format('woff2');
}

/* ─── Reset & Base ──────────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'JetBrains Mono', monospace;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.4;
    color: #000;
    min-height: 100vh;
    background: #fff;
    overflow-x: hidden;
}

/* ─── Content Container ─────────────────────────────── */
.content-wrap {
    padding: 2rem;
    max-width: 60ch;
}
.content {
    word-wrap: break-word;
}

/* ─── Typography ────────────────────────────────────── */
h1 {
    font-family: inherit;
    font-size: inherit;
    font-weight: 700;
    line-height: inherit;
    text-align: right;
    padding: 0.5em;
    margin: -0.5em -0.5em 1.5em -0.5em;
}
@media (min-width: 990px) {
    h1 { text-align: left; }
}
h1 a { text-decoration: none !important; }
h1 a:hover { text-decoration: none !important; }
h2 {
    font-family: inherit;
    font-size: inherit;
    font-weight: 400;
    line-height: inherit;
    margin: 2em 0;
}

/* ─── Separators ────────────────────────────────────── */
.sep {
    display: block;
    height: 1px;
    margin: 0.6em 0;
    background: repeating-linear-gradient(
        to right,
        #000 0, #000 0.55em,
        transparent 0.55em, transparent 0.75em
    );
}
.sep[data-label] {
    display: flex;
    align-items: center;
    height: 1.8em;
    margin: 1.2em 0 0.4em;
    background-image: repeating-linear-gradient(
        to right,
        #000 0, #000 0.55em,
        transparent 0.55em, transparent 0.75em
    );
    background-size: 100% 1px;
    background-position: center;
    background-repeat: no-repeat;
}
.sep[data-label]::before {
    content: attr(data-label);
    margin-left: -1em;
    background: #000;
    color: #fff;
    padding: 0.15em 0.5em;
    font-size: 0.72em;
    letter-spacing: 0.1em;
    white-space: nowrap;
}

.block {
    display: block;
    padding: 0.8em 0;
}

/* ─── Sidebar Meta ──────────────────────────────────── */
.sidebar-meta .sep[data-label] {
    margin: 0.5em 0 0.1em;
}
.sidebar-meta .sep[data-label]:first-child {
    margin-top: 0;
}
.sidebar-meta .sep[data-label]::before {
    margin-left: 1em;
    background: #fff;
    color: #000;
    text-transform: uppercase;
    font-weight: 700;
}
.sidebar-meta .block {
    text-align: right;
    padding: 0.3em 0;
}

/* ─── Receipt Elements ─────────────────────────────── */
.receipt-meta {
    display: flex;
    justify-content: space-between;
}

.skills-list {
    display: block;
    margin: 2em 0;
}
.skill-line {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 1em;
    padding: 0.3em 0;
}
.skill-label {
    flex: 1 1 100%;
    font-size: 0.75em;
    letter-spacing: 0.04em;
    opacity: 0.6;
}
.skill-bar {
    flex: 0 0 auto;
    letter-spacing: 0.15em;
}
.skill-val {
    margin-left: auto;
    font-size: 0.8em;
    opacity: 0.6;
}

@media (min-width: 700px) {
    .skill-label {
        flex: 0 0 auto;
    }
}
.skill-cursor::after {
    content: '_';
    animation: blink 1s step-end infinite;
}
@keyframes blink {
    50% { opacity: 0; }
}

/* ─── Case Lines ───────────────────────────────────── */
.cases-list {
    display: block;
}
.case-line {
    display: flex;
    justify-content: space-between;
    gap: 1em;
    padding: 0.6em 0;
    background-image: repeating-linear-gradient(
        to right,
        #000 0, #000 0.55em,
        transparent 0.55em, transparent 0.75em
    );
    background-size: 100% 1px;
    background-position: bottom;
    background-repeat: no-repeat;
}
a.case-line {
    background-image: none;
}
.case-line.case-ellipsis {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    line-height: 1.2;
    padding: 0em 0 1.5em;
}
a.case-line {
    text-decoration: none;
    transition: transform 0.15s ease;
}
a.case-line:hover {
    text-decoration: none;
    transform: translateX(0.5em);
}
.case-line a.nav-link {
    text-decoration: none;
}
.cases-list > .case-line:last-child {
    background-image: none;
}

/* ─── CTA Block ─────────────────────────────────────── */
.cta {
}
.cta p {
    margin: 0 0 1em;
}
.cta a {
    display: inline-block;
    margin-top: 0.5em;
}

/* ─── Links ─────────────────────────────────────────── */
a { color: inherit; }
.nav-link { text-decoration: underline; }
.nav-link:hover { text-decoration: none; }

/* ─── Footer Nav (Impressum/Datenschutz) ────────────── */
.footer-nav {
    display: flex;
    justify-content: flex-end;
    gap: 2em;
    margin-top: 2em;
}

/* ─── Gallery (swipe on mobile) ────────────────────── */
.gallery,
.gallery-track,
.gallery-track img {
    touch-action: pan-y;
}

.gallery {
    overflow: hidden;
    position: relative;
    white-space: nowrap;
    font-size: 0;
    background-image: repeating-linear-gradient(to right, #000 0, #000 0.55em, transparent 0.55em, transparent 0.75em);
    background-size: 100% 1px;
    background-position: top;
    background-repeat: no-repeat;
    aspect-ratio: 1 / 1;
}
@media (min-width: 600px) {
    .gallery { aspect-ratio: 4 / 3; }
}
.gallery-track {
    display: flex;
    transition: transform 0.3s ease;
    cursor: grab;
}
.gallery-track:active {
    cursor: grabbing;
}
.gallery-track img {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}
.gallery-counter {
    font-size: 16px;
    line-height: 1.4;
    white-space: normal;
    text-align: center;
}
.gallery-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1em;
    margin-top: 1.2em;
    font-size: 1rem;
}
.gallery-alt {
    font-size: 0.8em;
    color: #767676;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.gallery-controls {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.gallery-btn {
    background: none;
    border: none;
    font-family: inherit;
    font-size: 1em;
    cursor: pointer;
    padding: 0.4em 0.8em;
    color: #767676;
    transition: color 0.15s;
}
.gallery-btn:hover { color: #000; }

/* ─── Lightbox ──────────────────────────────────────── */
#lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
#lightbox.lb-open {
    display: flex;
}
#lb-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.92);
}
#lb-img {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    display: block;
    cursor: zoom-out;
}
#lb-prev, #lb-next, #lb-close {
    position: absolute;
    background: none;
    border: none;
    color: #fff;
    font-family: inherit;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5em;
    line-height: 1;
    opacity: 0.7;
}
#lb-prev:hover, #lb-next:hover, #lb-close:hover { opacity: 1; }
#lb-prev  { left: 1rem;  top: 50%; transform: translateY(-50%); }
#lb-next  { right: 1rem; top: 50%; transform: translateY(-50%); }
#lb-close { top: 1rem;   right: 1rem; font-size: 2rem; }
.gallery-track img { cursor: zoom-in; }

/* ─── Desktop Layout ────────────────────────────────── */
@media (min-width: 700px) {
    body { font-size: 17px; }
    .content-wrap {
        padding: 3rem;
        max-width: 80ch;
    }
}

@media (min-width: 990px) {
    .content-wrap:has(.project-layout) {
        max-width: 1400px;
    }
    .project-layout {
        display: grid;
        grid-template-columns: 1fr 36ch;
        grid-template-areas: "content sidebar";
        gap: 2em;
        align-items: start;
    }
    .project-content {
        grid-area: content;
        min-width: 0;
    }
    .project-content .gallery {
        margin-bottom: 2em;
    }
    .project-sidebar {
        grid-area: sidebar;
        margin-top: -10px;
        padding-left: 1em;
    }
    .project-sidebar .sidebar-meta .block {
        font-size: 0.8em;
    }
    .project-sidebar .sidebar-meta .sep[data-label] {
        margin-top: 0.25em;
    }
    .project-sidebar .sidebar-meta .sep[data-label]:first-child {
        margin-top: 0;
    }
}

/* ─── Responsive ────────────────────────────────────── */
@media (max-width: 480px) {
    body { font-size: 14px; }
    .content-wrap { padding: 1rem; }
}
