/* === RESET & BASE === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --gilded-deco: #c9a84c;
    --midnight-indigo: #1a1a3e;
    --watercolor-blush: #e8a4b8;
    --parchment-cream: #f5f0e3;
    --smoky-slate: #3d3d5c;
    --jade-tile: #3b8c7e;
    --cerulean-mist: #a8c8e8;
    --obsidian: #12121f;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.1vw, 1.15rem);
    line-height: 1.72;
    color: var(--midnight-indigo);
    background-color: var(--parchment-cream);
    overflow-x: hidden;
}

/* === NAVIGATION === */
#main-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 48px;
    z-index: 1000;
    transition: background 0.3s ease, border-color 0.3s ease;
    border-top: 2px solid transparent;
}

#main-nav.scrolled {
    background: rgba(245, 240, 227, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 2px solid var(--gilded-deco);
}

.nav-inner {
    max-width: 1400px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
}

.nav-logo {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: 0.12em;
    color: var(--midnight-indigo);
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-link {
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--smoky-slate);
    text-decoration: none;
    letter-spacing: 0.04em;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: var(--gilded-deco);
}

/* === HERO (Row 1) === */
#hero {
    min-height: 100vh;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    align-items: center;
    position: relative;
    background: var(--parchment-cream);
    overflow: hidden;
}

.hero-content {
    grid-column: 1 / 8;
    padding: 0 4rem;
    z-index: 2;
}

.hero-title {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 700;
    font-size: clamp(3rem, 10vw, 10rem);
    letter-spacing: 0.12em;
    color: var(--midnight-indigo);
    line-height: 1;
}

.hero-subtitle {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-weight: 400;
    font-size: clamp(1rem, 2vw, 1.8rem);
    color: var(--smoky-slate);
    margin-top: 0.5em;
}

.hero-sunburst {
    grid-column: 7 / 13;
    grid-row: 1;
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.hero-sunburst svg {
    width: 100%;
    max-width: 600px;
    height: auto;
}

/* Sunburst ray animation */
.sunburst-ray {
    transform-origin: 0 0;
    opacity: 0;
    animation: ray-appear 0.8s ease-out forwards;
}

@keyframes ray-appear {
    0% { opacity: 0; transform: scale(0.2); }
    80% { transform: scale(1.02); }
    100% { opacity: 1; transform: scale(1); }
}

/* === DIAGONAL BANDS (Rows 2 & 4) === */
.diagonal-band {
    position: relative;
    min-height: 60vh;
    background: var(--midnight-indigo);
    clip-path: polygon(0 0, 100% 15%, 100% 85%, 0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.diagonal-band-mirror {
    clip-path: polygon(0 15%, 100% 0, 100% 100%, 0 85%);
}

.diagonal-wash {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.diagonal-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: 4rem 2rem;
}

.diagonal-text {
    color: var(--parchment-cream);
}

.diagonal-text h2 {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 700;
    font-size: clamp(1.8rem, 4vw, 3.5rem);
    letter-spacing: 0.06em;
    margin-bottom: 1rem;
    color: var(--gilded-deco);
}

.diagonal-text p {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    line-height: 1.72;
    color: var(--parchment-cream);
    opacity: 0.9;
}

.diagonal-text-right {
    text-align: right;
}

.diagonal-text-left {
    text-align: left;
}

/* Drip marks */
.drip-marks {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
    pointer-events: none;
    z-index: 1;
}

.drip {
    position: absolute;
    bottom: 0;
    width: 3px;
    border-radius: 0 0 3px 3px;
    opacity: 0.3;
    filter: blur(1px);
}

/* Fade-in animations */
.fade-in-left {
    opacity: 0;
    transform: translateX(60px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.fade-in-right {
    opacity: 0;
    transform: translateX(-60px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* === ROW 3: CONTENT === */
.z-row-3 {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    min-height: 80vh;
    align-items: center;
    position: relative;
    padding: 6rem 0;
}

.row3-content {
    grid-column: 1 / 7;
    padding: 2rem 4rem;
    position: relative;
}

.row3-text {
    position: relative;
}

.row3-text .section-heading {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 700;
    font-size: clamp(1.8rem, 4vw, 3.5rem);
    letter-spacing: 0.06em;
    color: var(--midnight-indigo);
    margin-bottom: 1rem;
}

.row3-text p {
    margin-bottom: 2rem;
    color: var(--smoky-slate);
}

.row3-motif {
    grid-column: 7 / 13;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.watercolor-motif-svg {
    width: 100%;
    max-width: 400px;
}

/* Watercolor pools behind headings */
.watercolor-pool {
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    filter: blur(40px);
    pointer-events: none;
    z-index: -1;
}

.pool-jade {
    background: var(--jade-tile);
    opacity: 0.15;
    top: -40px;
    left: -20px;
}

.pool-blush {
    background: var(--watercolor-blush);
    opacity: 0.2;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
}

/* === PUZZLE CARDS === */
.puzzle-cards, .finale-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 1rem;
}

.puzzle-card {
    background: var(--parchment-cream);
    border: 1px solid rgba(201, 168, 76, 0.3);
    padding: 1.5rem;
    position: relative;
    cursor: pointer;
    transform: rotate(0deg);
    opacity: 0;
    transition: transform 0.6s ease-out, opacity 0.6s ease-out, box-shadow 0.3s ease;
    overflow: hidden;
    /* Stepped deco border effect via box-shadow */
    box-shadow: 
        0 0 0 1px rgba(201, 168, 76, 0.15),
        3px 3px 0 0 rgba(201, 168, 76, 0.08),
        6px 6px 0 0 rgba(201, 168, 76, 0.04);
}

.puzzle-card.card-initial-1 { transform: rotate(-2deg); }
.puzzle-card.card-initial-2 { transform: rotate(1.5deg); }
.puzzle-card.card-initial-3 { transform: rotate(-1deg); }

.puzzle-card.revealed {
    opacity: 1;
    transform: rotate(0deg) !important;
}

.puzzle-card:hover {
    box-shadow: 
        0 0 0 1px rgba(201, 168, 76, 0.3),
        3px 3px 0 0 rgba(201, 168, 76, 0.15),
        6px 6px 0 0 rgba(201, 168, 76, 0.08);
}

.card-inner h3 {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.08em;
    color: var(--midnight-indigo);
    margin-top: 0.5rem;
}

.card-caption {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-weight: 400;
    font-size: clamp(0.85rem, 1vw, 1rem);
    color: var(--smoky-slate);
    margin-top: 0.25rem;
}

.card-motif {
    width: 40px;
    height: 40px;
}

/* Watercolor ripple on click */
.ripple-blob {
    position: absolute;
    border-radius: 50%;
    background: var(--watercolor-blush);
    opacity: 0.4;
    pointer-events: none;
    transform: scale(0);
    filter: url(#watercolor-blur);
    animation: watercolor-ripple 0.6s ease-out forwards;
}

@keyframes watercolor-ripple {
    0% { transform: scale(0); opacity: 0.4; }
    100% { transform: scale(1.5); opacity: 0; }
}

/* === ROW 5: FINALE === */
.z-row-5 {
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    padding: 6rem 2rem;
    overflow: hidden;
}

.finale-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
}

.finale-heading {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 700;
    font-size: clamp(2.5rem, 7vw, 6rem);
    letter-spacing: 0.12em;
    color: var(--midnight-indigo);
    margin-bottom: 1rem;
}

.finale-text {
    font-family: 'Nunito', sans-serif;
    color: var(--smoky-slate);
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    margin-bottom: 2.5rem;
}

.cta-button {
    display: inline-block;
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--parchment-cream);
    background: var(--jade-tile);
    padding: 1rem 2.5rem;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    transition: background 0.3s ease;
    border: none;
    cursor: pointer;
}

.cta-button:hover {
    background: var(--gilded-deco);
}

.finale-cards {
    margin-top: 3rem;
}

.finale-fan {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 800px;
    pointer-events: none;
    z-index: 0;
}

/* === ISLAMIC TILING BORDER === */
.section-heading {
    position: relative;
}

/* === FOOTER === */
#footer {
    background: var(--obsidian);
    padding: 3rem 2rem 2rem;
    text-align: center;
    position: relative;
}

.celtic-knot {
    width: 100%;
    height: 30px;
    margin-bottom: 2rem;
}

.footer-content {
    max-width: 600px;
    margin: 0 auto;
}

.footer-logo {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: 0.12em;
    color: var(--gilded-deco);
}

.footer-tagline {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    color: var(--smoky-slate);
    margin-top: 0.25rem;
    font-size: 0.95rem;
}

.footer-links {
    margin-top: 1.5rem;
    display: flex;
    gap: 2rem;
    justify-content: center;
}

.footer-links a {
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--cerulean-mist);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--gilded-deco);
}

.footer-copy {
    margin-top: 1.5rem;
    font-size: 0.75rem;
    color: var(--smoky-slate);
    opacity: 0.6;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    #hero {
        grid-template-columns: 1fr;
        padding-top: 48px;
    }

    .hero-content {
        grid-column: 1;
        padding: 2rem;
        text-align: center;
    }

    .hero-sunburst {
        grid-column: 1;
        grid-row: 1;
        position: absolute;
        opacity: 0.3;
        width: 100%;
        height: 100%;
    }

    .diagonal-band {
        min-height: 40vh;
        clip-path: polygon(0 0, 100% 5%, 100% 95%, 0 100%);
    }

    .diagonal-band-mirror {
        clip-path: polygon(0 5%, 100% 0, 100% 100%, 0 95%);
    }

    .z-row-3 {
        grid-template-columns: 1fr;
        padding: 3rem 0;
    }

    .row3-content {
        grid-column: 1;
        padding: 2rem;
    }

    .row3-motif {
        grid-column: 1;
        max-height: 250px;
        overflow: hidden;
    }

    .puzzle-cards, .finale-cards {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .nav-links {
        gap: 1rem;
    }

    .nav-link {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .nav-link span {
        display: none;
    }
}
