:root {
    --bg: #fff;
    --fg: #111;
    --muted: #767676;
    --gap: 1.5rem;
    --radius: 4px;
    --font-name: 'Libre Baskerville', Georgia, 'Times New Roman', serif;
    --font-body: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    --max-width: 1000px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    overflow-anchor: none;
}

body {
    background: var(--bg);
    color: var(--fg);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }

/* Overall page frame */

.site-frame {
    max-width: var(--max-width);
    margin: 0 auto;
}

/* Header / nav */

.site-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
    padding: 1.5rem var(--gap) 1rem;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transform: translateY(0);
    transition: transform 0.2s ease;
}

.site-header--sticky {
    position: sticky;
    top: 0;
    z-index: 10;
}

.site-header--sticky.is-hidden {
    transform: translateY(-100%);
}

.site-header.is-measuring,
.site-header.is-measuring * {
    transition: none !important;
}

.site-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.2;
}

.site-name {
    display: block;
    font-family: var(--font-name);
    font-size: 4rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.01em;
    margin: 3rem 0 2rem;
    transition: font-size 0.2s ease, margin 0.2s ease;
}

.site-header.is-compact .site-name {
    font-size: 2rem;
    margin: 0.5rem 0;
}

.site-header.is-compact .site-quote {
    display: none;
}

.site-quote {
    margin: 0;
    max-width: 560px;
}

.site-quote p {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 300;
    line-height: 1.4;
}

.site-quote cite {
    display: block;
    margin-top: 0.35rem;
    font-style: normal;
    font-size: 0.75rem;
    font-weight: 300;
    color: var(--muted);
}

.site-nav {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.75rem;
    margin: 1rem 0 0.25rem;
    transition: margin 0.3s ease;
}

.site-nav a {
    position: relative;
    display: inline-block;
    padding-bottom: 0.2rem;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.site-nav a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 1px;
    background: currentColor;
    transition: width 0.25s ease;
}

.site-nav a:hover::after {
    width: 100%;
}

@media (max-width: 640px) {
    .site-nav {
        flex-direction: column;
        gap: 0.35rem;
    }
}

/* Main */

.site-main {
    padding: var(--gap);
}

/* Home: gallery covers */

.gallery-covers {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--gap);
}

.gallery-cover {
    position: relative;
    display: block;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    border-radius: var(--radius);
    background: #f2f1ef;
}

.gallery-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease, filter 0.4s ease;
}

.gallery-cover:hover img {
    transform: scale(1.04);
    filter: brightness(0.85);
}

.gallery-cover-name {
    position: absolute;
    top: 0;
    left: 0;
    padding: 1rem;
    color: #fff;
    font-size: 1.15rem;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

/* Gallery page */

.gallery-title {
    font-weight: 400;
    font-size: 1.8rem;
    margin: 0 0 var(--gap);
    text-align: center;
}

.gallery-item {
    margin: 0;
}

.gallery-item img {
    width: 100%;
    border-radius: var(--radius);
    background: #f0f0f0;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.gallery-item img.is-loaded {
    opacity: 1;
}

.gallery-item figcaption {
    margin-top: 0.6rem;
    font-size: 0.85rem;
    color: var(--muted);
}

.caption-name { display: block; color: var(--fg); font-weight: 700; font-size: 1rem; }

.caption-desc { display: block; margin-top: -0.15rem; }

.gallery-empty { color: var(--muted); }

/* Template: grid-verticals (rows of natural-ratio images, fixed height, no cropping) */

.gallery--grid-verticals {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: var(--gap);
}

.gallery--grid-verticals .gallery-item {
    text-align: center;
}

.gallery--grid-verticals .gallery-item img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: var(--grid-height, 280px);
}

/* Template: stack (full-width images, one after another, title + description below each) */

.gallery--stack {
    display: flex;
    flex-direction: column;
    gap: var(--gap);
}

/* Template: stack-max (vertical stack, each image capped to the viewport height minus 100px) */

.gallery--stack-max {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--gap);
}

.gallery--stack-max .gallery-item {
    text-align: center;
}

.gallery--stack-max .gallery-item img {
    width: auto;
    max-width: 100%;
    max-height: calc(100vh - 100px);
    margin: 0 auto;
}

/* Lightbox */

.gallery-item img { cursor: zoom-in; }

body.lightbox-open { overflow: hidden; }

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease;
}

.lightbox.is-open {
    opacity: 1;
    visibility: visible;
}

.lightbox-figure {
    margin: 0;
    max-width: 92vw;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-img {
    display: block;
    max-width: 92vw;
    max-height: 80vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: var(--radius);
}

.lightbox-caption {
    margin-top: 0.75rem;
    max-width: 92vw;
    text-align: center;
    color: #fff;
    font-size: 0.85rem;
}

.lightbox-caption .caption-name {
    display: block;
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
}

.lightbox-caption .caption-desc {
    display: block;
    margin-top: 0.15rem;
    color: rgba(255, 255, 255, 0.75);
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background: none;
    border: 0;
    color: #fff;
    cursor: pointer;
    line-height: 1;
    opacity: 0.75;
    transition: opacity 0.2s ease;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    opacity: 1;
}

.lightbox-close {
    top: 1rem;
    right: 1.25rem;
    font-size: 2.5rem;
}

.lightbox-prev,
.lightbox-next {
    top: 50%;
    transform: translateY(-50%);
    font-size: 3rem;
    padding: 0.5rem 1rem;
}

.lightbox-prev { left: 0.5rem; }

.lightbox-next { right: 0.5rem; }

@media (max-width: 640px) {
    .lightbox-close { font-size: 2rem; top: 0.5rem; right: 0.75rem; }
    .lightbox-prev, .lightbox-next { font-size: 2rem; padding: 0.5rem; }
}

/* Text pages */

.page--text {
    max-width: 640px;
}

.page--center {
    margin: 0 auto;
    text-align: center;
}

.button {
    display: inline-block;
    margin-top: 1rem;
    padding: 1rem 2.25rem;
    background: var(--fg);
    color: var(--bg);
    font-weight: 600;
    border-radius: 10px;
}

.button:hover {
    opacity: 0.85;
}

.site-footer {
    padding: var(--gap);
    text-align: center;
    color: var(--muted);
    font-size: 0.8rem;
}
