/* =====================
   Reset & Root Vars
   ===================== */
:root {
    --font-sans: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --color-text: #111;
    --color-bg: #fff;
    --color-accent: #111;
    --color-contrast: #fff;
    --heading-color: #111;
    --color-muted: #555;
    --color-muted-2: #888;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }

body {
    font-family: var(--font-sans);
    color: var(--color-text);
    background: var(--color-bg);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
}

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

h1, h2, h3, h4, h5, h6 {
    color: var(--heading-color);
    margin: 0 0 0.5rem;
    line-height: 1.2;
}
p  { margin: 0 0 1rem; }
ul { margin: 0 0 1rem; padding-left: 1.25rem; }

/* =====================
   Hero
   ===================== */
.hero {
    height: 100vh;
    min-height: 600px;
    background-image: url('../images/43_tatry-czorsztyn-panorama-rozowe-niebo-mgla.jpg');
    background-size: cover;
    background-position: center 40%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0,0,0,0.48) 0%,
        rgba(0,0,0,0.12) 50%,
        rgba(0,0,0,0.55) 100%
    );
}

.hero-nav {
    position: absolute;
    top: 0; left: 0; right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.8rem 3rem;
    z-index: 1;
}

.hero-logo {
    color: #fff;
    font-size: 0.75rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    font-weight: 600;
}

.hero-nav ul {
    list-style: none;
    display: flex;
    gap: 2.5rem;
    margin: 0;
    padding: 0;
}

.hero-nav ul li a {
    color: rgba(255,255,255,0.82);
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    transition: color 0.2s;
    cursor: pointer;
}
.hero-nav ul li a:hover { color: #fff; }

.hero-nav ul li a.nav-active {
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,0.6);
    padding-bottom: 2px;
}

.hero-center {
    position: relative;
    z-index: 1;
    text-align: center;
    color: #fff;
    padding: 0 1rem;
}

.hero-center h1 {
    font-size: clamp(2.6rem, 6vw, 5.2rem);
    font-weight: 300;
    letter-spacing: 0.06em;
    color: #fff;
    margin: 0 0 0.5rem;
    line-height: 1.1;
}

.hero-tagline {
    font-size: 0.78rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.65);
    margin: 0 0 2.8rem;
}

.hero-cta {
    display: inline-block;
    padding: 0.75rem 2.4rem;
    border: 1px solid rgba(255,255,255,0.6);
    color: #fff;
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    transition: all 0.3s;
    cursor: pointer;
}
.hero-cta:hover {
    background: rgba(255,255,255,0.14);
    border-color: rgba(255,255,255,0.9);
}

/* =====================
   Main / Section transitions
   ===================== */
main { min-height: 100vh; }

/* Fade-out: content is about to be replaced */
#content.content-exit {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

/* Fade-in: fresh content just injected */
@keyframes sectionEnter {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}

#content.content-enter {
    animation: sectionEnter 0.4s ease both;
}

/* =====================
   Accessibility utility
   ===================== */
/* Visually hidden but readable by screen readers and search crawlers */
.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;
}

/* =====================
   Gallery
   ===================== */
#portfolio { padding: 0; }

/* Filter bar */
.filter-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 2.8rem 2rem 1.6rem;
    justify-content: center;
}

.filter-btn {
    background: none;
    border: 1px solid #d4d4d4;
    padding: 5px 18px;
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 100px;
    transition: all 0.2s;
    color: #999;
    font-family: var(--font-sans);
}
.filter-btn:hover         { border-color: #777; color: #444; }
.filter-btn.active        { background: #111; border-color: #111; color: #fff; }

/* CSS Grid — editorial mosaic layout.
   Portrait images span 2 rows; wide images with a main category span 2 cols.
   grid-auto-flow: dense fills holes automatically. */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 280px;
    grid-auto-flow: dense;
    gap: 4px;
    padding: 0 4px 4px;
}

/* Individual cell */
.grid-item {
    overflow: hidden;
    cursor: pointer;
    position: relative;
    background: #ebebeb;
    /* Fade-in — triggered by IntersectionObserver adding .in-view */
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.55s ease, transform 0.55s ease;
}
.grid-item.in-view {
    opacity: 1;
    transform: none;
}

.grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.65s ease;
}
.grid-item:hover img { transform: scale(1.05); }

/* Category tag overlay — visible on hover */
.item-overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 2.5rem 0.85rem 0.85rem;
    background: linear-gradient(transparent, rgba(0,0,0,0.58));
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}
.grid-item:hover .item-overlay { opacity: 1; }

.item-tag {
    font-size: 0.6rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.88);
    border: 1px solid rgba(255,255,255,0.42);
    padding: 2px 9px;
    border-radius: 100px;
}

/* =====================
   Lightbox
   ===================== */
#gallery-lightbox { display: none; }

#gallery-lightbox.open {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 9999;
}

/* Dark background */
.lb-bg {
    position: absolute;
    inset: 0;
    background: #0a0a0a;
    cursor: zoom-out;
}

/* Image stage — centred, padded to leave room for UI chrome */
.lb-stage {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3.5rem 6rem 5.5rem;
    pointer-events: none;
}

.lb-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    pointer-events: auto;
    transition: opacity 0.18s ease;
}
.lb-img.fading { opacity: 0; }

/* Close button */
.lb-close {
    position: fixed;
    top: 1rem; right: 1.5rem;
    z-index: 2;
    background: none; border: none; cursor: pointer;
    color: rgba(255,255,255,0.42);
    font-size: 1.25rem;
    padding: 10px; line-height: 1;
    transition: color 0.2s;
}
.lb-close:hover { color: #fff; }

/* Counter */
.lb-counter {
    position: fixed;
    top: 1.15rem; left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    color: rgba(255,255,255,0.3);
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    pointer-events: none;
}

/* Prev / Next arrows */
.lb-prev, .lb-next {
    position: fixed;
    top: 50%; transform: translateY(-50%);
    z-index: 2;
    background: none; border: none; cursor: pointer;
    color: rgba(255,255,255,0.32);
    font-size: 5rem; font-weight: 100;
    padding: 1rem 1.8rem; line-height: 1;
    transition: color 0.25s;
}
.lb-prev:hover, .lb-next:hover { color: rgba(255,255,255,0.88); }
.lb-prev { left: 0; }
.lb-next { right: 0; }

/* Bottom bar — category tags + CTA */
.lb-bar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 2.5rem 2.5rem 1.6rem;
    background: linear-gradient(transparent, rgba(0,0,0,0.68));
    pointer-events: none;
}

.lb-tags {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
}

.lb-tag {
    font-size: 0.62rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.55);
    border: 1px solid rgba(255,255,255,0.28);
    padding: 3px 10px;
    border-radius: 100px;
}

/* CTA button */
.lb-cta {
    display: inline-block;
    padding: 0.72rem 1.9rem;
    background: #fff;
    color: #111;
    font-size: 0.68rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    font-weight: 700;
    white-space: nowrap;
    transition: background 0.2s, transform 0.15s;
    cursor: pointer;
    pointer-events: auto;   /* click-through from lb-bar's none */
    flex-shrink: 0;
}
.lb-cta:hover {
    background: #f0f0f0;
    transform: translateY(-1px);
}

/* =====================
   About Section
   ===================== */
#about { padding: 0; }

.about-split {
    display: flex;
    min-height: 100vh;
}

/* Left: panel */
.about-panel {
    flex: 1 1 50%;
    display: flex;
    align-items: center;
    background: #fff;
    padding: 4rem 3rem;
}

.about-panel-inner {
    max-width: 440px;
    width: 100%;
}

/* Right: photo */
.about-photo {
    flex: 1 1 50%;
    position: relative;
    overflow: hidden;
    min-height: 480px;
}

.about-photo img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
    filter: grayscale(15%);
    transition: transform 8s ease;
}

.about-photo:hover img {
    transform: scale(1.04);
}

.about-photo-caption {
    position: absolute;
    bottom: 1.25rem;
    right: 1.5rem;
    font-size: 0.62rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.45);
}

/* Overline */
.about-overline {
    font-size: 0.65rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--color-muted-2);
    margin: 0 0 1rem;
}

/* Heading */
.about-heading {
    font-size: clamp(1.9rem, 3vw, 2.6rem);
    font-weight: 300;
    line-height: 1.18;
    letter-spacing: -0.01em;
    margin: 0 0 1.25rem;
    color: #111;
}

/* Subtext */
.about-sub {
    font-size: 0.92rem;
    line-height: 1.75;
    color: var(--color-muted);
    margin: 0 0 2rem;
}

/* Stats row */
.about-stats {
    display: flex;
    gap: 2rem;
    margin: 0 0 2rem;
    padding: 1.5rem 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.about-stat {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.stat-number {
    font-size: 1.75rem;
    font-weight: 300;
    color: #111;
    line-height: 1;
    letter-spacing: -0.02em;
}

.stat-label {
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-muted-2);
}

/* Services list */
.about-services {
    list-style: none;
    padding: 0;
    margin: 0 0 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.about-services li {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
}

.as-icon {
    font-size: 0.55rem;
    color: #bbb;
    margin-top: 0.35rem;
    flex-shrink: 0;
}

.about-services li div {
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
}

.about-services li strong {
    font-size: 0.88rem;
    font-weight: 600;
    color: #111;
    line-height: 1.3;
}

.about-services li span {
    font-size: 0.78rem;
    color: var(--color-muted-2);
}

/* CTA group */
.about-cta-group {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.about-cta-primary {
    display: inline-block;
    padding: 0.8rem 2rem;
    background: #111;
    color: #fff;
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-weight: 600;
    transition: background 0.25s, transform 0.15s;
    white-space: nowrap;
    cursor: pointer;
}
.about-cta-primary:hover {
    background: #333;
    transform: translateY(-1px);
}

.about-cta-secondary {
    font-size: 0.82rem;
    color: #555;
    border-bottom: 1px solid #ccc;
    padding-bottom: 1px;
    transition: color 0.2s, border-color 0.2s;
    white-space: nowrap;
    cursor: pointer;
}
.about-cta-secondary:hover {
    color: #111;
    border-color: #111;
}

@media (max-width: 860px) {
    .about-split      { flex-direction: column-reverse; min-height: auto; }
    .about-photo      { flex: none; height: 65vw; min-height: 280px; }
    .about-panel      { padding: 2.8rem 1.8rem; }
    .about-panel-inner { max-width: 100%; }
    .about-stats      { gap: 1.25rem; }
}

/* =====================
   Contact Section
   ===================== */
#contact {
    padding: 0;
}

/* Split layout */
.contact-split {
    display: flex;
    min-height: 100vh;
}

/* Left: photo */
.contact-photo {
    flex: 1 1 50%;
    position: relative;
    overflow: hidden;
    min-height: 480px;
}

.contact-photo img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 30%;
}

.contact-photo-caption {
    position: absolute;
    bottom: 1.25rem;
    left: 1.5rem;
    font-size: 0.62rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.45);
}

/* Right: panel */
.contact-panel {
    flex: 1 1 50%;
    display: flex;
    align-items: center;
    background: #fafafa;
    padding: 4rem 3rem;
}

.contact-panel-inner {
    max-width: 440px;
    width: 100%;
}

/* Overline */
.contact-overline {
    font-size: 0.65rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--color-muted-2);
    margin: 0 0 1rem;
}

/* Heading */
.contact-heading {
    font-size: clamp(1.9rem, 3vw, 2.6rem);
    font-weight: 300;
    line-height: 1.18;
    letter-spacing: -0.01em;
    margin: 0 0 1.25rem;
    color: #111;
}

/* Subtext */
.contact-sub {
    font-size: 0.92rem;
    line-height: 1.75;
    color: var(--color-muted);
    margin: 0 0 2rem;
}

/* Services list */
.contact-services {
    list-style: none;
    padding: 0;
    margin: 0 0 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-services li {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
}

.cs-icon {
    font-size: 0.55rem;
    color: #bbb;
    margin-top: 0.35rem;
    flex-shrink: 0;
    letter-spacing: 0;
}

.contact-services li div {
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
}

.contact-services li strong {
    font-size: 0.88rem;
    font-weight: 600;
    color: #111;
    line-height: 1.3;
}

.contact-services li span {
    font-size: 0.78rem;
    color: var(--color-muted-2);
}

/* CTA group */
.contact-cta-group {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.contact-cta-primary {
    display: inline-block;
    padding: 0.8rem 2rem;
    background: #111;
    color: #fff;
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-weight: 600;
    transition: background 0.25s, transform 0.15s;
    white-space: nowrap;
}
.contact-cta-primary:hover {
    background: #333;
    transform: translateY(-1px);
}

.contact-cta-secondary {
    font-size: 0.82rem;
    color: #555;
    border-bottom: 1px solid #ccc;
    padding-bottom: 1px;
    transition: color 0.2s, border-color 0.2s;
    white-space: nowrap;
}
.contact-cta-secondary:hover {
    color: #111;
    border-color: #111;
}

/* Responsive */
@media (max-width: 860px) {
    .contact-split { flex-direction: column; min-height: auto; }
    .contact-photo  { flex: none; height: 55vw; min-height: 280px; }
    .contact-panel  { padding: 2.8rem 1.8rem; }
    .contact-panel-inner { max-width: 100%; }
}

/* =====================
   Footer
   ===================== */
footer {
    text-align: center;
    padding: 2rem;
    color: #ccc;
    font-size: 0.73rem;
    letter-spacing: 0.06em;
    border-top: 1px solid #f0f0f0;
    margin-top: 4rem;
}

/* =====================
   Responsive
   ===================== */
@media (max-width: 900px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 250px;
    }
    .hero-nav { padding: 1.2rem 1.5rem; }
    .hero-nav ul { gap: 1.5rem; }
}

@media (max-width: 560px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: 300px;
    }
    /* Remove column spans on single-column layout */
    .grid-item[style*="grid-column"] { grid-column: span 1 !important; }

    .hero-logo { display: none; }
    .hero-nav  { justify-content: center; }
    .hero-nav ul { gap: 1.2rem; }
    .hero-center h1 { font-size: 2.2rem; }
    .filter-bar { padding: 1.8rem 1rem 1rem; }

    .lb-stage  { padding: 3rem 3.5rem 7rem; }
    .lb-prev, .lb-next { font-size: 3rem; padding: 0.75rem 1rem; }
    .lb-bar    { flex-direction: column; align-items: flex-start; gap: 0.75rem; padding: 2rem 1.5rem 1.25rem; }
    .lb-cta    { align-self: stretch; text-align: center; }
    #contact   { padding: 3rem 1.5rem; }
}
