
/* app.css — Dark theme only (beautified, 4-space indentation, modern nesting) */

:root {
    color-scheme: dark;
    --bg: #2f2f2f;
    --fg: #e6e6eb;
    --muted: #9aa3af;
    --link: #76a8ff;
    --border: #22252a;
}

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font: 16px/1.6 system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial, sans-serif;
    background: var(--bg);
    color: var(--fg);
}

a {
    color: var(--link);
    text-decoration: none;

    &:hover {
        text-decoration: underline;
    }
}

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

.container {
    max-width: 72rem;
    margin: 0 auto;
    padding: 1rem;
}

header, footer {
    border-block-end: 1px solid var(--border);
}

.brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
}

.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;
}

.breadcrumbs {
    font-size: .9rem;
    color: var(--muted);
}

main {
    padding-block: 2rem;
}

.card {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
}

input, textarea, button {
    font: inherit;
}

input, textarea {
    width: 100%;
    padding: .6rem .7rem;
    border: 1px solid var(--border);
    border-radius: .6rem;
    background: transparent;
    color: inherit;
}

button {
    padding: .6rem .9rem;
    border: 1px solid var(--border);
    border-radius: .6rem;
    background: var(--fg);
    color: var(--bg);
    cursor: pointer;

    &:hover {
        opacity: .92;
    }
}

.section {
    padding-block: clamp(2rem, 6vw, 5rem);
}

.section--text {
    background: transparent;
}

.section--media {
    padding-block: 0;
}

.hero {
    position: relative;
    display: grid;
    align-items: end;
    min-height: min(72vh, 820px);
    overflow: clip;

    &__media img {
        width: 100%;
        height: auto;
        display: block;
        object-fit: cover;
    }

    &__content {
        position: relative;
        margin-top: -20vh;
        background: color-mix(in oklab, var(--bg) 92%, transparent);
        border: 1px solid var(--border);
        border-radius: 16px;
        padding: clamp(1rem, 3vw, 2rem);
        box-shadow: 0 2px 12px rgba(0,0,0,.4);
    }

    &--tight {
        min-height: min(54vh, 600px);

        .hero__content {
            margin-top: -12vh;
        }
    }
}

.flow > * + * {
    margin-top: .75em;
}

.grid-2 {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.split {
    display: grid;
    gap: clamp(1rem, 3vw, 2rem);
    grid-template-columns: 1.2fr 1fr;
    align-items: start;

    @media (max-width: 960px) {
        grid-template-columns: 1fr;
    }

    &__media img {
        width: 100%;
        height: auto;
        border-radius: 12px;
    }
}

.media {
    margin: 0;

    img {
        width: 100%;
        height: auto;
        display: block;
    }

    figcaption {
        text-align: center;
        color: var(--muted);
        font-size: .9rem;
        padding: .75rem 1rem;
    }
}

.meta {
    display: flex;
    gap: 1rem;
    padding: 0;
    margin: .5rem 0 0;
    list-style: none;

    li {
        color: var(--muted);
    }
}

.gallery {
    --min: 260px;
    display: grid;
    gap: .75rem;
    grid-template-columns: repeat(auto-fill, minmax(var(--min), 1fr));
    padding: 1rem clamp(.5rem, 2vw, 1rem);

    &__item {
        display: block;
        border: 1px solid var(--border);
        border-radius: 12px;
        overflow: clip;
        transition: transform .08s ease;

        &:hover {
            transform: translateY(-2px);
        }

        img {
            display: block;
            width: 100%;
            height: auto;
        }
    }
}

.lightbox {
    position: fixed;
    inset: 0;
    display: none;
    place-items: center;
    background: color-mix(in oklab, var(--bg) 30%, rgba(0,0,0,.8));
    padding: clamp(1rem, 3vw, 2rem);
    z-index: 999;

    img {
        max-width: 96vw;
        max-height: 92vh;
        border-radius: 12px;
        box-shadow: 0 10px 40px rgba(0,0,0,.5);
    }

    &__close {
        position: fixed;
        top: .5rem;
        right: .75rem;
        font-size: 2.2rem;
        line-height: 1;
        text-decoration: none;
        color: var(--fg);
        background: color-mix(in oklab, var(--bg) 86%, transparent);
        border: 1px solid var(--border);
        width: 44px;
        height: 44px;
        border-radius: 8px;
        display: grid;
        place-items: center;
    }

    &:target {
        display: grid;
    }
}

.anchornav {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: color-mix(in oklab, var(--bg) 92%, transparent);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--border);

    &__inner {
        max-width: 72rem;
        margin: 0 auto;
        padding: .6rem 1rem;
        display: flex;
        gap: 1rem;
        align-items: center;
    }

    a {
        padding: .4rem .7rem;
        border-radius: .5rem;
        border: 1px solid transparent;

        &:hover {
            border-color: var(--border);
            text-decoration: none;
        }

        &.right {
            margin-left: auto;
        }
    }
}

[id] {
    scroll-margin-top: 72px;
}

.section--project.alt {
    background: color-mix(in oklab, var(--bg) 98%, var(--border));
}

.to-top {
    text-align: right;
    margin-top: -1rem;

    a {
        font-size: .95rem;
    }
}
