:root {
    --bg: #f5f1e8;
    --bg-deep: #eee8dc;
    --ink: #0e233d;
    --muted: #746b61;
    --gold: #ad7b2b;
    --line: rgba(14, 35, 61, 0.13);
    --header-height: 116px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Arial, Helvetica, sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
body.menu-open,
body.lightbox-open { overflow: hidden; }
a { color: inherit; }
img { display: block; max-width: 100%; }
button { font: inherit; }
.screen-reader-text {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0);
    white-space: nowrap; border: 0;
}

/* Strona główna */
.pc2466-front { background: #07121d; }
.landing-page {
    position: relative;
    min-height: 100svh;
    overflow: hidden;
    isolation: isolate;
}
.landing-picture,
.landing-picture img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}
.landing-picture { z-index: -2; }
.landing-picture img { object-fit: cover; object-position: center center; }
.landing-page::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(180deg, rgba(3,8,15,.03), rgba(3,8,15,.14));
    pointer-events: none;
}
.landing-logo-link {
    position: absolute;
    left: 50%;
    top: 58%;
    transform: translate(-50%, -50%);
    width: min(58vw, 860px);
    outline-offset: 12px;
}
.landing-logo {
    width: 100%;
    height: auto;
    opacity: 0;
    animation: pc2466-logo-fade 6s ease-in-out forwards;
    filter: drop-shadow(0 4px 16px rgba(0,0,0,.22));
}
@keyframes pc2466-logo-fade { from { opacity: 0; } to { opacity: 1; } }
.landing-copyright {
    position: absolute;
    right: clamp(16px, 2.1vw, 42px);
    bottom: clamp(12px, 1.7vw, 28px);
    margin: 0;
    color: rgba(255,255,255,.93);
    font-size: clamp(8px, .66vw, 12px);
    font-weight: 400;
    letter-spacing: .01em;
    white-space: nowrap;
    text-shadow: 0 1px 4px rgba(0,0,0,.4);
}

/* Wspólny nagłówek podstron */
.site-header {
    height: var(--header-height);
    padding: 28px clamp(24px, 4vw, 72px) 16px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    position: relative;
    z-index: 20;
}
.brand-link { display: inline-flex; width: clamp(150px, 14vw, 230px); }
.brand-logo { width: 100%; height: auto; }
.menu-toggle {
    width: 48px;
    height: 48px;
    border: 0;
    background: transparent;
    display: grid;
    place-content: center;
    gap: 6px;
    cursor: pointer;
    color: var(--ink);
}
.menu-toggle span {
    width: 28px;
    height: 2px;
    background: currentColor;
    display: block;
    transition: transform .25s ease, opacity .25s ease;
}

/* Strona wszystkich galerii */
.gallery-index {
    min-height: calc(100svh - var(--header-height) - 76px);
    padding: clamp(20px, 3vw, 46px) clamp(24px, 6vw, 110px) 72px;
}
.gallery-cards {
    max-width: 1260px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(28px, 3vw, 54px);
    align-items: start;
}
.gallery-card a { text-decoration: none; display: block; }
.gallery-card-image {
    aspect-ratio: 4 / 5;
    border-radius: 15px;
    overflow: hidden;
    background: var(--bg-deep);
    box-shadow: 0 10px 28px rgba(23, 30, 38, .07);
}
.gallery-card-image img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform .65s cubic-bezier(.2,.7,.2,1), filter .35s ease;
}
.gallery-card a:hover .gallery-card-image img,
.gallery-card a:focus-visible .gallery-card-image img { transform: scale(1.025); }
.gallery-card-placeholder { display: block; width: 100%; height: 100%; }
.gallery-card-caption {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding-top: 18px;
    text-align: center;
}
.gallery-card-name {
    font-size: clamp(15px, 1.15vw, 20px);
    letter-spacing: .025em;
    text-transform: uppercase;
}
.gallery-card-year {
    font-size: 14px;
    color: var(--muted);
    padding-bottom: 8px;
    border-bottom: 1px solid var(--gold);
}

/* Pojedyncza galeria */
.single-gallery {
    min-height: calc(100svh - var(--header-height) - 76px);
    padding: 0 clamp(20px, 4.5vw, 82px) 66px;
}
.single-gallery-heading { text-align: center; margin: 0 auto 34px; }
.single-gallery-heading h1 {
    margin: 0;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(28px, 2.8vw, 48px);
    font-weight: 400;
    letter-spacing: .02em;
    text-transform: uppercase;
}
.single-gallery-heading h1::after {
    content: "";
    display: block;
    width: 66px;
    height: 1px;
    background: var(--gold);
    margin: 18px auto 0;
}
.single-gallery-heading p {
    margin: 20px 0 0;
    color: var(--muted);
    font-size: 13px;
}
.photo-grid {
    max-width: 1480px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}
.photo-thumb {
    border: 0;
    padding: 0;
    margin: 0;
    border-radius: 12px;
    overflow: hidden;
    background: #e5ded2;
    cursor: zoom-in;
    aspect-ratio: 4 / 3;
}
.photo-thumb img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform .5s cubic-bezier(.2,.7,.2,1), opacity .25s ease;
}
.photo-thumb:hover img,
.photo-thumb:focus-visible img { transform: scale(1.025); }

/* Lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(4, 8, 12, .96);
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
}
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox-stage { position: relative; width: 100%; height: 100%; display: grid; place-items: center; }
.lightbox img { max-width: 94vw; max-height: 90vh; object-fit: contain; user-select: none; }
.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    z-index: 2;
    border: 0;
    color: #fff;
    background: rgba(0,0,0,.15);
    cursor: pointer;
}
.lightbox-close { top: 18px; right: 22px; font-size: 42px; line-height: 1; width: 48px; height: 48px; }
.lightbox-prev,
.lightbox-next { top: 50%; transform: translateY(-50%); width: 58px; height: 80px; font-size: 64px; line-height: .8; }
.lightbox-prev { left: 8px; }
.lightbox-next { right: 8px; }
.lightbox-counter { position: absolute; top: 24px; left: 26px; color: #fff; font-size: 14px; }

/* Stopka */
.site-footer {
    min-height: 76px;
    padding: 20px clamp(24px, 4vw, 72px);
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
}
.site-footer p {
    margin: 0;
    font-size: 10px;
    color: var(--muted);
    white-space: nowrap;
}

/* Menu */
.menu-layer {
    position: fixed;
    inset: 0;
    z-index: 900;
    visibility: hidden;
    pointer-events: none;
}
.menu-layer.is-open { visibility: visible; pointer-events: auto; }
.menu-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(6, 14, 24, .55);
    opacity: 0;
    transition: opacity .3s ease;
}
.menu-layer.is-open .menu-backdrop { opacity: 1; }
.menu-panel {
    position: absolute;
    top: 0; right: 0;
    width: min(430px, 100%);
    height: 100%;
    background: var(--bg);
    padding: 28px 34px 42px;
    transform: translateX(100%);
    transition: transform .35s cubic-bezier(.22,.78,.22,1);
    display: flex;
    flex-direction: column;
}
.menu-layer.is-open .menu-panel { transform: translateX(0); }
.menu-panel-top { display: flex; justify-content: space-between; align-items: flex-start; }
.menu-logo { width: 170px; }
.menu-close { border: 0; background: transparent; color: var(--ink); font-size: 40px; line-height: 1; cursor: pointer; }
.menu-nav { margin-top: clamp(76px, 13vh, 140px); display: grid; gap: 34px; }
.menu-nav a {
    display: grid;
    grid-template-columns: 36px 1fr;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    font-size: 14px;
    letter-spacing: .025em;
}
.menu-icon { color: var(--gold); font-size: 24px; text-align: center; }
.grid-icon { font-size: 26px; }
.menu-email {
    margin: 38px 0 0 50px;
    color: var(--gold);
    font-size: 14px;
    text-decoration: none;
}

/* Strony awaryjne */
.fallback-page { min-height: calc(100svh - var(--header-height) - 76px); max-width: 960px; margin: 0 auto; padding: 40px 28px 80px; }
.fallback-page h1 { font-family: Georgia, serif; font-weight: 400; }
.not-found { text-align: center; }

@media (max-width: 980px) {
    :root { --header-height: 98px; }
    .site-header { padding-top: 22px; }
    .brand-link { width: 165px; }
    .gallery-cards { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .photo-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
    .landing-logo-link { width: min(70vw, 760px); }
}

@media (max-width: 640px) {
    :root { --header-height: 84px; }
    .site-header { padding: 16px 16px 8px; align-items: flex-start; }
    .brand-link { width: 128px; }
    .menu-toggle { width: 42px; height: 42px; }
    .menu-toggle span { width: 25px; }
    .gallery-index { padding: 18px 18px 52px; }
    .gallery-cards { grid-template-columns: 1fr; gap: 34px; }
    .gallery-card { max-width: 440px; width: 100%; margin: 0 auto; }
    .gallery-card-image { aspect-ratio: 16 / 9; }
    .gallery-card-caption { padding-top: 12px; gap: 6px; }
    .single-gallery { padding: 10px 14px 48px; }
    .single-gallery-heading { margin-bottom: 26px; }
    .single-gallery-heading h1 { font-size: 26px; }
    .single-gallery-heading p { font-size: 11px; }
    .photo-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; }
    .photo-thumb { border-radius: 9px; }
    .site-footer { min-height: 62px; padding: 14px 16px; }
    .site-footer p { font-size: 8px; }
    .landing-logo-link { width: 82vw; top: 58%; }
    .landing-copyright { right: 12px; bottom: 11px; font-size: 7.5px; }
    .menu-panel { padding: 20px 22px 34px; }
    .menu-logo { width: 138px; }
    .menu-nav { margin-top: 82px; }
    .lightbox img { max-width: 100vw; max-height: 86vh; }
    .lightbox-prev, .lightbox-next { width: 42px; font-size: 48px; background: rgba(0,0,0,.28); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
    .landing-logo { opacity: 1; }
}
