/* =============================================
   Krystyna — Ikony Pisane Ręcznie
   Dark sacred theme · "Cicha Kaplica"
   ============================================= */

/* --- 1. Custom Properties --- */
:root {
    --bg-deep:    #0f0c08;
    --bg:         #1a1410;
    --bg-surface: #231c14;
    --bg-card:    #2a2118;

    --gold:       #c9a84c;
    --gold-bright:#e2c56d;
    --gold-dim:   #7a6530;
    --gold-mist:  rgba(201, 168, 76, 0.06);

    --cream:      #e8dcc8;
    --cream-dim:  #9a8b78;

    --font-display: 'Cinzel', 'Times New Roman', serif;
    --font-logo:    'Cinzel Decorative', 'Cinzel', serif;
    --font-body:    'Cormorant', 'Garamond', serif;
}

/* Boosted contrast for mobile / outdoor readability */
@media (max-width: 640px) {
    :root {
        --gold-dim:   #918055;
        --cream-dim:  #b0a495;
    }
}

/* --- 2. Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 19px;
    color: var(--cream);
    background: var(--bg-deep);
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

.container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 28px;
}

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

a {
    color: var(--gold);
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: var(--gold-bright);
}

::selection {
    background: rgba(201, 168, 76, 0.25);
    color: var(--cream);
}

/* --- 3. Grain Overlay --- */
.grain {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 200px 200px;
}

/* --- 4. Typography --- */
h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.2;
    color: var(--cream);
}

.section-title {
    font-size: 2rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.section-title.center { text-align: center; }

.section-desc {
    color: var(--cream-dim);
    font-size: 1.1rem;
    max-width: 520px;
    margin-bottom: 56px;
}

.section-desc.center {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

/* --- 5. Button --- */
.btn {
    display: inline-block;
    padding: 15px 44px;
    border: 1px solid var(--gold);
    color: var(--gold);
    font-family: var(--font-display);
    font-size: 0.68rem;
    font-weight: 400;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    transition: background 0.4s, color 0.4s;
}

.btn:hover {
    background: var(--gold);
    color: var(--bg-deep);
}

/* --- 6. Ornament Divider --- */
.ornament {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 0;
}

.ornament::before,
.ornament::after {
    content: '';
    width: 80px;
    height: 1px;
}

.ornament::before {
    background: linear-gradient(to right, transparent, var(--gold-dim));
}

.ornament::after {
    background: linear-gradient(to left, transparent, var(--gold-dim));
}

.ornament span {
    width: 6px;
    height: 6px;
    background: var(--gold);
    transform: rotate(45deg);
    margin: 0 16px;
    flex-shrink: 0;
}

.ornament--hero::before,
.ornament--hero::after {
    width: 120px;
}

.ornament--footer {
    padding-bottom: 24px;
}

/* --- 7. Header & Nav --- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    padding: 22px 0;
    transition: background 0.4s, padding 0.4s;
}

.header.scrolled {
    background: rgba(15, 12, 8, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 14px 0;
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-family: var(--font-logo);
    font-size: 1.5rem;
    color: var(--gold);
    letter-spacing: 0.04em;
    transition: color 0.3s;
}

.logo:hover {
    color: var(--gold-bright);
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 36px;
}

.nav-list a {
    color: var(--cream-dim);
    font-family: var(--font-display);
    font-size: 0.65rem;
    font-weight: 400;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    transition: color 0.3s;
}

.nav-list a:hover {
    color: var(--gold);
}

/* Mobile nav toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle-bar {
    display: block;
    width: 24px;
    height: 1.5px;
    background: var(--gold);
}

.nav-close {
    display: none;
}

.nav-close-item {
    display: none;
}

/* --- 8. Hero --- */
.hero {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-deep);
    overflow: hidden;
}

.hero-pattern {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(201, 168, 76, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(201, 168, 76, 0.035) 1px, transparent 1px);
    background-size: 48px 48px;
    -webkit-mask-image: radial-gradient(ellipse 55% 65% at center, black, transparent);
    mask-image: radial-gradient(ellipse 55% 65% at center, black, transparent);
}

.hero-glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 40% 50% at 50% 45%, rgba(201, 168, 76, 0.07), transparent);
}

.hero-content {
    position: relative;
    text-align: center;
}

.hero-kicker {
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 400;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--gold-dim);
    margin-bottom: 24px;
    animation: fadeUp 1s ease 0.3s both;
}

.hero-title {
    font-size: clamp(2.4rem, 6vw, 4.2rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 20px;
    letter-spacing: 0.03em;
}

.hero-tradition {
    font-family: var(--font-body);
    font-style: italic;
    font-size: 1.05rem;
    color: var(--cream-dim);
    margin-bottom: 44px;
    animation: fadeUp 1s ease 0.95s both;
}

.hero-title span {
    display: inline;
}

.hero-title span:first-child {
    animation: fadeUp 1s ease 0.6s both;
}

.hero-title span:last-child {
    animation: fadeUp 1s ease 0.8s both;
}

.hero .btn {
    animation: fadeUp 1s ease 1.3s both;
}

.hero .ornament--hero {
    animation: fadeUp 1s ease 0.1s both;
}

/* Gold shimmer on hero text */
.gold-shimmer {
    background: linear-gradient(
        120deg,
        #7a6530 0%,
        #c9a84c 20%,
        #f0dda0 45%,
        #c9a84c 65%,
        #7a6530 85%,
        #c9a84c 100%
    );
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 6s ease-in-out infinite, fadeUp 1s ease 0.6s both;
}

.hero-title span:last-child .gold-shimmer,
.hero-title span:last-child {
    animation-delay: 0.8s;
}

@keyframes shimmer {
    0%, 100% { background-position: 0% center; }
    50%      { background-position: 100% center; }
}

/* --- 9. Sections --- */
.section {
    padding: 110px 0;
}

.section--about {
    background: var(--bg);
}

.section--gallery {
    background: var(--bg-deep);
}

.section--symbolism {
    background: var(--bg-deep);
}

.section--process {
    background: var(--bg);
}

.section--contact {
    background: var(--bg-deep);
}

/* --- 10. About --- */
.about-grid {
    display: grid;
    grid-template-columns: 0.85fr 1fr;
    gap: 64px;
    align-items: center;
}

.about-text .section-title {
    margin-bottom: 24px;
}

.about-text p {
    color: var(--cream-dim);
    margin-bottom: 18px;
    font-size: 1.05rem;
}

.about-text p:last-child {
    margin-bottom: 0;
}

/* Gold corner frame */
.frame {
    position: relative;
    padding: 14px;
}

.frame::before,
.frame::after {
    content: '';
    position: absolute;
    width: 44px;
    height: 44px;
}

.frame::before {
    top: 0;
    left: 0;
    border-top: 1.5px solid var(--gold-dim);
    border-left: 1.5px solid var(--gold-dim);
}

.frame::after {
    bottom: 0;
    right: 0;
    border-bottom: 1.5px solid var(--gold-dim);
    border-right: 1.5px solid var(--gold-dim);
}

/* --- 11. Placeholder Images --- */
.placeholder-img {
    aspect-ratio: 3 / 4;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(ellipse 60% 40% at 50% 35%, rgba(201, 168, 76, 0.06), transparent),
        linear-gradient(180deg, #1e1812, #13100b);
    border: 1px solid rgba(201, 168, 76, 0.1);
    color: var(--cream-dim);
    font-family: var(--font-body);
    font-style: italic;
    font-size: 0.9rem;
}

.placeholder--portrait {
    aspect-ratio: 4 / 5;
}

/* --- 12. Gallery --- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.gallery-item {
    position: relative;
    background: var(--bg-surface);
    overflow: hidden;
    transition: transform 0.5s ease, box-shadow 0.5s ease;
}

.gallery-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 40%, rgba(201, 168, 76, 0.1), transparent 70%);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    z-index: 1;
}

.gallery-item:hover {
    transform: translateY(-6px);
    box-shadow:
        0 16px 48px rgba(0, 0, 0, 0.3),
        0 0 40px rgba(201, 168, 76, 0.06);
}

.gallery-item:hover::after {
    opacity: 1;
}

.gallery-caption {
    padding: 16px 20px 20px;
}

.gallery-caption h3 {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    margin-bottom: 4px;
}

.gallery-caption p {
    font-size: 0.85rem;
    color: var(--cream-dim);
}

/* --- 12b. Symbolism --- */
.symbol-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.symbol-item {
    text-align: center;
    padding: 8px 0;
}

.symbol-swatch {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    margin: 0 auto 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
}

.symbol-item h3 {
    font-size: 0.85rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--cream);
    margin-bottom: 10px;
}

.symbol-item p {
    font-size: 0.9rem;
    color: var(--cream-dim);
    line-height: 1.65;
    max-width: 280px;
    margin: 0 auto;
}

/* Stagger symbol items */
.symbol-item.reveal:nth-child(1) { transition-delay: 0.0s; }
.symbol-item.reveal:nth-child(2) { transition-delay: 0.1s; }
.symbol-item.reveal:nth-child(3) { transition-delay: 0.2s; }
.symbol-item.reveal:nth-child(4) { transition-delay: 0.25s; }
.symbol-item.reveal:nth-child(5) { transition-delay: 0.35s; }
.symbol-item.reveal:nth-child(6) { transition-delay: 0.45s; }

/* --- 13. Timeline / Process --- */
.timeline {
    position: relative;
    padding-left: 48px;
    max-width: 600px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 4px;
    bottom: 4px;
    width: 1px;
    background: linear-gradient(to bottom, var(--gold-dim), rgba(122, 101, 48, 0.2));
}

.timeline-item {
    position: relative;
    padding-bottom: 52px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: -48px;
    top: 2px;
}

.timeline-marker span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--gold-dim);
    border-radius: 50%;
    font-family: var(--font-display);
    font-size: 0.7rem;
    letter-spacing: 0;
    color: var(--gold);
    background: var(--bg);
    transition: border-color 0.3s, background 0.3s;
}

.timeline-item:hover .timeline-marker span {
    border-color: var(--gold);
    background: rgba(201, 168, 76, 0.08);
}

.timeline-body h3 {
    font-size: 1.05rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 10px;
    color: var(--cream);
}

.timeline-body p {
    color: var(--cream-dim);
    font-size: 0.95rem;
    line-height: 1.7;
}

/* --- 14. Contact --- */
.contact-cards {
    display: flex;
    justify-content: center;
    gap: 32px;
}

.contact-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 36px 48px;
    border: 1px solid rgba(122, 101, 48, 0.3);
    transition: border-color 0.4s, background 0.4s;
    text-decoration: none;
    min-width: 220px;
}

.contact-card:hover {
    border-color: var(--gold);
    background: var(--gold-mist);
}

.contact-icon {
    width: 28px;
    height: 28px;
    color: var(--gold);
    margin-bottom: 16px;
}

.contact-label {
    font-family: var(--font-display);
    font-size: 0.68rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--cream-dim);
    margin-bottom: 6px;
}

.contact-value {
    color: var(--cream);
    font-size: 0.95rem;
    transition: color 0.3s;
}

.contact-card:hover .contact-value {
    color: var(--gold);
}

/* --- 15. Footer --- */
.footer {
    background: var(--bg-deep);
    text-align: center;
    padding: 32px 0 40px;
    font-size: 0.8rem;
    color: rgba(154, 139, 120, 0.5);
    font-family: var(--font-display);
    letter-spacing: 0.08em;
}

/* --- 16. Animations --- */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scroll reveal */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger gallery items */
.gallery-item.reveal:nth-child(1) { transition-delay: 0.0s; }
.gallery-item.reveal:nth-child(2) { transition-delay: 0.1s; }
.gallery-item.reveal:nth-child(3) { transition-delay: 0.2s; }
.gallery-item.reveal:nth-child(4) { transition-delay: 0.25s; }
.gallery-item.reveal:nth-child(5) { transition-delay: 0.35s; }
.gallery-item.reveal:nth-child(6) { transition-delay: 0.45s; }

/* Stagger timeline items */
.timeline-item.reveal:nth-child(1) { transition-delay: 0.0s; }
.timeline-item.reveal:nth-child(2) { transition-delay: 0.12s; }
.timeline-item.reveal:nth-child(3) { transition-delay: 0.24s; }
.timeline-item.reveal:nth-child(4) { transition-delay: 0.36s; }

/* =============================================
   17. Responsive
   ============================================= */
@media (max-width: 900px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .about-image {
        max-width: 380px;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .symbol-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 28px;
    }

    .contact-cards {
        gap: 20px;
    }

    .contact-card {
        padding: 28px 32px;
        min-width: 0;
        flex: 1;
    }
}

@media (max-width: 640px) {
    body {
        font-size: 17px;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-close-item {
        display: block;
        text-align: right;
        margin-bottom: 8px;
    }

    .nav-close {
        display: inline-block;
        background: none;
        border: none;
        cursor: pointer;
        color: var(--gold-bright);
        font-size: 2.2rem;
        line-height: 1;
        padding: 0 4px;
        transition: color 0.3s;
    }

    .nav-close:hover {
        color: var(--cream);
    }

    .nav-list {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        height: 100dvh;
        background: var(--bg);
        flex-direction: column;
        padding: 24px 36px 36px;
        gap: 28px;
        transition: right 0.35s ease;
        z-index: 205;
        border-left: 1px solid rgba(201, 168, 76, 0.08);
    }

    .nav-list.open {
        right: 0;
    }

    .nav-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 200;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.35s ease, visibility 0.35s ease;
    }

    .nav-overlay.open {
        opacity: 1;
        visibility: visible;
    }

    .nav-list a {
        color: var(--cream-dim);
        font-size: 0.75rem;
    }

    .section {
        padding: 72px 0;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .hero-title {
        font-size: clamp(2rem, 8vw, 3rem);
    }

    .hero-kicker {
        font-size: 0.8rem;
    }

    .btn {
        font-size: 0.78rem;
    }

    .contact-label {
        font-size: 0.72rem;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        max-width: 360px;
        margin: 0 auto;
    }

    .symbol-grid {
        grid-template-columns: 1fr;
        max-width: 300px;
        margin: 0 auto;
        gap: 32px;
    }

    .timeline {
        padding-left: 44px;
    }

    .contact-cards {
        flex-direction: column;
        align-items: center;
        gap: 16px;
    }

    .contact-card {
        width: 100%;
        max-width: 300px;
    }

    .ornament::before,
    .ornament::after {
        width: 50px;
    }
}
