body {
    font-family: "Courier New", "IBM Plex Mono", "SF Mono", Menlo, Monaco, "DejaVu Sans Mono", monospace;
    background: #fff;
    color: #000;
}

.site-wrapper {
    max-width: 720px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

header {
    border-bottom: 4px solid #000;
    padding-bottom: 1.5rem;
    margin-bottom: 3rem;
}

.site-title {
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.site-title a {
    text-decoration: none;
    color: #000;
}

nav {
    font-size: 1rem;
    font-weight: 700;
}

nav a {
    color: #000;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

nav a:hover {
    background: #000;
    color: #fff;
}

main.content {
    margin-bottom: 4rem;
}

main.content h1 {
    font-size: 3rem;
    font-weight: 900;
    border-bottom: 4px solid #000;
    padding-bottom: 0.5rem;
    margin-bottom: 2rem;
}

main.content h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-top: 3rem;
    margin-bottom: 1rem;
}

main.content h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 2rem;
}

main.content p {
    margin-bottom: 1.5rem;
}

main.content a {
    color: #000;
    font-weight: 700;
    text-decoration: underline;
    text-decoration-thickness: 3px;
    text-underline-offset: 3px;
}

main.content a:hover {
    background: #000;
    color: #fff;
}

main.content ul, main.content ol {
    margin-bottom: 1.5rem;
}

main.content li {
    margin-bottom: 0.5rem;
}

main.content blockquote {
    border-left: 4px solid #000;
    margin: 2rem 0;
    padding: 1rem 1.5rem;
    font-style: italic;
}

main.content blockquote p:last-child {
    margin-bottom: 0;
}

main.content code {
    background: #000;
    color: #fff;
    padding: 0.1em 0.3em;
    font-size: 0.9em;
}

main.content pre {
    background: #000;
    color: #fff;
    padding: 1.5rem;
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

main.content pre code {
    background: none;
    padding: 0;
}

main.content hr {
    border: none;
    border-top: 4px solid #000;
    margin: 3rem 0;
}

main.content img,
main.content video,
main.content audio {
    border: 3px solid #000;
    margin-bottom: 1.5rem;
}

/* Summary line clamp for blog listing */
.summary-clamped {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: var(--summary-lines, 3);
    overflow: hidden;
}

footer {
    border-top: 4px solid #000;
    padding-top: 1.5rem;
    font-size: 0.9rem;
}

footer a {
    font-weight: 700;
    text-decoration: underline;
}

@media (max-width: 600px) {
    .site-wrapper {
        padding: 1.5rem 1rem;
    }

    .site-title {
        font-size: 1.8rem;
    }

    main.content h1 {
        font-size: 2rem;
    }

    main.content h2 {
        font-size: 1.5rem;
    }

    nav {
        font-size: 0.9rem;
    }
}

/* === Media gallery v2 — square grid + :target lightbox === */

/* ─── Gallery section ─────────────────────────────────── */
.gallery {
    margin: 2rem 0;
}

.gallery__title {
    font-size: 2rem;
    font-weight: 700;
    text-transform: uppercase;
    border-bottom: 4px solid #000;
    padding-bottom: 0.5rem;
    margin-top: 3rem;
    margin-bottom: 1rem;
}

/* ─── Grid ────────────────────────────────────────────── */
.gallery__grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(var(--cols, 3), 1fr);
}

[data-columns="2"] .gallery__grid { --cols: 2; }
[data-columns="3"] .gallery__grid { --cols: 3; }
[data-columns="4"] .gallery__grid { --cols: 4; }
[data-columns="5"] .gallery__grid { --cols: 5; }

/* ─── Tiles ───────────────────────────────────────────── */
.gallery .gallery-tile {
    display: block;
    position: relative;
    aspect-ratio: 1 / 1;
    border: 3px solid #000;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    background: #fff;
}

.gallery .gallery-tile:hover,
.gallery .gallery-tile:focus-visible {
    outline: 4px solid #000;
    outline-offset: 2px;
}

.gallery-tile .gallery-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border: none;
    margin: 0;
}

/* Badge: play glyph or count indicator */
.gallery-tile__badge {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    background: #000;
    color: #fff;
    font-weight: 900;
    font-size: 0.9rem;
    padding: 0.2rem 0.5rem;
    line-height: 1;
    font-family: "Courier New", "IBM Plex Mono", monospace;
}

/* Audio tile: typographic square, no image */
.gallery-tile--audio {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    text-align: center;
}

.gallery-tile__title {
    font-weight: 900;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1.3;
    word-break: break-word;
    font-family: "Courier New", "IBM Plex Mono", monospace;
}

/* ─── Overlay (lightbox) ──────────────────────────────── */
.gallery-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.97);
    padding: 3rem 2rem 2rem;
    overflow-y: auto;
    scroll-margin-top: 100vh;
}

.gallery-overlay:target {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Invisible full-screen click target for closing */
.gallery-overlay .gallery-overlay__backdrop {
    position: fixed;
    inset: 0;
    z-index: 0;
    cursor: zoom-out;
    display: block;
    background: transparent;
}

.gallery-overlay .gallery-overlay__backdrop:hover {
    background: transparent;
}

/* Close button: fixed top-right corner */
.gallery-overlay .gallery-overlay__close {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    background: #000;
    color: #fff;
    font-size: 1.5rem;
    font-weight: 900;
    text-decoration: none;
    line-height: 1;
    font-family: "Courier New", "IBM Plex Mono", monospace;
}

.gallery-overlay .gallery-overlay__close:hover {
    background: #333;
    color: #fff;
}

/* Content panel */
.gallery-overlay__content {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    border: 4px solid #000;
    background: #fff;
}

/* Tap-close (photos) and tap-next (sequences) — wrap the content figure */
.gallery-overlay .gallery-overlay__tap-close,
.gallery-overlay .gallery-overlay__tap-next {
    display: block;
    text-decoration: none;
    color: inherit;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Full-size image in overlay */
.gallery-overlay .gallery-full {
    display: block;
    width: 100%;
    height: auto;
    border: none;
    margin: 0;
}

/* Caption in overlay */
.gallery-overlay__caption {
    display: block;
    padding: 0.75rem 1.25rem;
    background: #000;
    color: #fff;
    font-size: 0.9rem;
    line-height: 1.5;
    font-family: "Courier New", "IBM Plex Mono", monospace;
}

/* Audio-specific overlay */
.gallery-overlay__content--audio {
    padding: 2rem;
    text-align: center;
}

.gallery-overlay__title {
    font-size: 1.5rem;
    font-weight: 900;
    text-transform: uppercase;
    margin: 0 0 1.5rem;
    border-bottom: 3px solid #000;
    padding-bottom: 0.5rem;
}

.gallery-overlay .gallery-full-audio {
    display: block;
    width: 100%;
    margin: 0 auto 1rem;
}

/* ─── Sequence navigation ─────────────────────────────── */
.gallery-overlay__nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.25rem;
    border-bottom: 3px solid #000;
    background: #fff;
    position: relative;
    z-index: 1;
}

.gallery-overlay .gallery-overlay__prev,
.gallery-overlay .gallery-overlay__next {
    font-weight: 900;
    font-size: 1.25rem;
    text-decoration: none;
    color: #000;
    padding: 0.25rem 0.75rem;
    border: 2px solid #000;
    font-family: "Courier New", "IBM Plex Mono", monospace;
}

.gallery-overlay .gallery-overlay__prev:hover,
.gallery-overlay .gallery-overlay__next:hover {
    background: #000;
    color: #fff;
}

.gallery-overlay__counter {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    font-family: "Courier New", "IBM Plex Mono", monospace;
}

/* ─── Responsive ──────────────────────────────────────── */
@media (max-width: 600px) {
    .gallery__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .gallery-tile__title {
        font-size: 0.75rem;
    }

    .gallery-overlay {
        padding: 3.5rem 1rem 1rem;
    }
}

/* ─── Reduced motion ──────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .gallery-tile,
    .gallery-tile:hover,
    .gallery-tile:focus-visible {
        transition: none;
        outline-offset: 0;
    }
}
