/* ==========================================================================
   bada.style - Gilded Restraint
   Magazine-spread editorial with gold-black luxury palette
   1920s Parisian atelier meets Japanese minimalism
   ========================================================================== */

/* ---------- CSS Custom Properties ---------- */
:root {
    --onyx-black: #0a0a0a;
    --ivory-silk: #f5f0e8;
    --burnished-gold: #c9a84c;
    --muted-gold: #b8976a;
    --deep-charcoal: #1a1a18;
    --pure-black: #000000;

    --font-display: 'Poiret One', cursive;
    --font-body: 'Cormorant Garamond', serif;

    --nav-height: 48px;
}

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

html {
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background-color: var(--onyx-black);
    color: var(--ivory-silk);
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1rem, 1.3vw, 1.2rem);
    line-height: 1.85;
    letter-spacing: 0.015em;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---------- Entry Screen ---------- */
#entry-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--pure-black);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    pointer-events: none;
}

#entry-screen.fade-out {
    animation: entryFadeOut 800ms ease forwards;
}

.entry-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

#entry-bada {
    font-family: var(--font-display);
    font-size: clamp(4rem, 10vw, 9rem);
    color: var(--ivory-silk);
    letter-spacing: 0.06em;
    opacity: 0;
    animation: fadeIn 600ms ease forwards;
    animation-delay: 300ms;
}

#entry-line {
    width: 40vw;
    height: 1px;
    background: var(--burnished-gold);
    transform: scaleX(0);
    transform-origin: center;
    animation: lineDrawCenter 500ms ease forwards;
    animation-delay: 900ms;
    margin: 0.5rem 0;
}

#entry-style {
    font-family: var(--font-body);
    font-style: italic;
    font-weight: 300;
    font-size: clamp(1.2rem, 2vw, 1.8rem);
    color: var(--muted-gold);
    letter-spacing: 0.04em;
    opacity: 0;
    animation: fadeIn 600ms ease forwards;
    animation-delay: 1400ms;
}

#entry-screen.slide-up .entry-content {
    animation: slideUpToNav 800ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* ---------- Keyframes ---------- */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes lineDrawCenter {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

@keyframes entryFadeOut {
    from { opacity: 1; }
    to { opacity: 0; visibility: hidden; }
}

@keyframes slideUpToNav {
    from {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    to {
        transform: translateY(-45vh) scale(0.15);
        opacity: 0;
    }
}

@keyframes spreadFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes photoWipeReveal {
    from { transform: translateX(0); }
    to { transform: translateX(100%); }
}

@keyframes botanicalDraw {
    from { stroke-dashoffset: var(--dash-length); }
    to { stroke-dashoffset: 0; }
}

/* ---------- Navigation ---------- */
#main-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    z-index: 9000;
    background: transparent;
    transition: background 400ms ease, backdrop-filter 400ms ease;
    opacity: 0;
    pointer-events: none;
}

#main-nav.visible {
    opacity: 1;
    pointer-events: auto;
}

#main-nav.scrolled {
    background: rgba(10, 10, 10, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 clamp(1.5rem, 4vw, 4rem);
}

.nav-logo {
    font-family: var(--font-display);
    font-size: clamp(0.9rem, 1.5vw, 1.1rem);
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--ivory-silk);
    text-decoration: none;
    transition: color 300ms ease, transform 400ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

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

.nav-links {
    display: flex;
    gap: clamp(1.5rem, 3vw, 3rem);
}

.nav-link {
    font-family: var(--font-body);
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted-gold);
    text-decoration: none;
    transition: color 300ms ease, transform 400ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

.nav-link:hover {
    color: var(--burnished-gold);
}

/* ---------- Magazine Spreads ---------- */
.spread {
    width: 100vw;
    height: 100vh;
    position: relative;
    scroll-snap-align: start;
    overflow: hidden;
    opacity: 1;
    transition: opacity 200ms ease;
    will-change: opacity, transform;
}

.spread.fading {
    opacity: 0.8;
}

.spread-grid {
    display: grid;
    grid-template-columns: 1fr 2px 1fr;
    width: 100%;
    height: 100%;
}

/* ---------- Gold Spine Divider ---------- */
.spread-spine {
    width: 2px;
    height: 100%;
    background: var(--burnished-gold);
    box-shadow: 0 0 12px rgba(201, 168, 76, 0.15);
    position: relative;
    transition: width 300ms ease, box-shadow 300ms ease;
    will-change: transform, width;
}

.spread-spine.flare {
    width: 3px;
    box-shadow: 0 0 20px rgba(201, 168, 76, 0.3);
}

/* ---------- Spread Columns ---------- */
.spread-left,
.spread-right {
    position: relative;
    overflow: hidden;
    height: 100%;
}

.spread-text-content {
    padding: clamp(3rem, 6vw, 8rem);
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
    gap: 1.5em;
}

/* ---------- Photography ---------- */
.photo-container {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
    will-change: transform;
    transition: transform 200ms ease;
}

.photo-container[data-tilt]:hover {
    border: 0.5px solid rgba(201, 168, 76, 0.5);
}

.photo-placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(85%) sepia(12%) contrast(1.1) brightness(0.95);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Generated CSS gradient backgrounds mimicking editorial nature photographs
   Black-and-white with warm sepia shift, fashion-photography lighting */
.photo-hero {
    background: linear-gradient(
        145deg,
        #1a1a18 0%,
        #2a2520 15%,
        #3d3528 30%,
        #1a1815 48%,
        #2d2820 62%,
        #3a3225 75%,
        #0a0a0a 88%,
        #1a1a18 100%
    );
}

.photo-leaves {
    background:
        radial-gradient(ellipse at 30% 40%, #3a3225 0%, transparent 50%),
        radial-gradient(ellipse at 70% 60%, #2a2518 0%, transparent 40%),
        radial-gradient(ellipse at 50% 30%, #4a3f2d 0%, transparent 35%),
        radial-gradient(ellipse at 20% 70%, #2d2820 0%, transparent 30%),
        linear-gradient(160deg, #1a1a18 0%, #2a2520 40%, #1a1815 70%, #0a0a0a 100%);
}

.photo-water {
    background:
        repeating-linear-gradient(
            175deg,
            transparent 0px,
            rgba(201, 168, 76, 0.03) 1px,
            transparent 2px,
            transparent 8px
        ),
        radial-gradient(ellipse at 50% 50%, rgba(58, 50, 37, 0.4) 0%, transparent 60%),
        linear-gradient(180deg, #0a0a0a 0%, #1a1815 30%, #2a2520 50%, #1a1a18 70%, #0a0a0a 100%);
}

.photo-stone {
    background:
        radial-gradient(circle at 40% 50%, #3a3530 0%, transparent 60%),
        radial-gradient(circle at 65% 35%, #2a2520 0%, transparent 45%),
        radial-gradient(circle at 50% 70%, #2d2820 0%, transparent 35%),
        linear-gradient(135deg, #1a1a18 0%, #2d2820 30%, #1a1815 60%, #0a0a0a 100%);
}

.photo-petals {
    background:
        radial-gradient(ellipse at 45% 45%, #4a3f2d 0%, transparent 30%),
        radial-gradient(ellipse at 55% 55%, #3a3225 0%, transparent 25%),
        radial-gradient(ellipse at 50% 50%, rgba(201, 168, 76, 0.05) 0%, transparent 40%),
        radial-gradient(ellipse at 35% 65%, #2d2820 0%, transparent 28%),
        linear-gradient(150deg, #0a0a0a 0%, #1a1a18 40%, #2a2520 70%, #1a1815 100%);
}

.photo-fog {
    background:
        linear-gradient(180deg,
            #0a0a0a 0%,
            #1a1815 15%,
            #2d2820 28%,
            #3a3530 42%,
            #2a2520 58%,
            #1a1a18 75%,
            #0a0a0a 100%
        );
}

/* Photo reveal wipe effect - gold rectangle slides to reveal image */
.photo-reveal {
    position: relative;
}

.photo-reveal::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--burnished-gold);
    transform: translateX(0);
    z-index: 2;
}

.photo-reveal.revealed::after {
    animation: photoWipeReveal 700ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* ---------- Spread Type C - Full Bleed Overlay ---------- */
.spread-c .spread-full-image {
    position: relative;
    width: 100%;
    height: 100%;
}

.spread-c .photo-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.spread-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    z-index: 1;
}

/* ---------- Typography ---------- */
h1, h2 {
    font-family: var(--font-display);
    font-weight: 400;
    color: var(--ivory-silk);
    letter-spacing: 0.06em;
}

.hero-title {
    font-size: clamp(3rem, 8vw, 7rem);
    text-align: center;
}

.hero-subtitle {
    font-family: var(--font-body);
    font-style: italic;
    font-weight: 300;
    font-size: clamp(0.9rem, 1.5vw, 1.3rem);
    color: var(--muted-gold);
    letter-spacing: 0.04em;
    text-align: center;
}

.section-heading {
    font-size: clamp(1.8rem, 4vw, 3.5rem);
    position: relative;
    display: inline-block;
    padding-bottom: 12px;
}

/* Gold underline draw on scroll */
.section-heading::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--burnished-gold);
    transition: width 800ms ease-out;
}

.section-heading.underline-drawn::after {
    width: 100%;
}

/* Body paragraphs */
p {
    margin-bottom: 0;
    color: var(--ivory-silk);
}

/* Drop Cap for Spread Type B - art-deco geometric styling */
.has-drop-cap::first-letter {
    font-family: var(--font-display);
    font-size: clamp(4rem, 8vw, 7rem);
    color: var(--burnished-gold);
    float: left;
    line-height: 0.75;
    margin-right: 0.1em;
    margin-top: 0.05em;
}

/* ---------- Pull Quote ---------- */
.pull-quote-container {
    position: relative;
    align-items: center;
    text-align: center;
}

.pull-quote-mark {
    font-family: var(--font-display);
    font-size: 8rem;
    color: var(--burnished-gold);
    opacity: 0.15;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -70%);
    line-height: 1;
    pointer-events: none;
    z-index: 0;
}

.pull-quote {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 4.5rem);
    color: var(--ivory-silk);
    letter-spacing: 0.06em;
    line-height: 1.3;
    position: relative;
    z-index: 1;
}

/* ---------- Page Numbers (magazine-style) ---------- */
.page-number {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-body);
    font-size: 0.7rem;
    color: var(--muted-gold);
    font-variant-numeric: oldstyle-nums;
    letter-spacing: 0.1em;
    z-index: 5;
}

/* ---------- Botanical SVG Accent ---------- */
.botanical-accent {
    position: absolute;
    bottom: 4rem;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 60px;
    z-index: 5;
}

.botanical-svg {
    width: 100%;
    height: 100%;
}

.botanical-svg path {
    stroke-dasharray: var(--dash-length);
    stroke-dashoffset: var(--dash-length);
}

.botanical-accent.animate-draw path {
    animation: botanicalDraw 1.5s ease forwards;
}

.botanical-accent.animate-draw .botanical-leaf.leaf-1 { animation-delay: 0.3s; }
.botanical-accent.animate-draw .botanical-leaf.leaf-2 { animation-delay: 0.4s; }
.botanical-accent.animate-draw .botanical-leaf.leaf-3 { animation-delay: 0.6s; }
.botanical-accent.animate-draw .botanical-leaf.leaf-4 { animation-delay: 0.7s; }
.botanical-accent.animate-draw .botanical-leaf.leaf-5 { animation-delay: 0.9s; }
.botanical-accent.animate-draw .botanical-leaf.leaf-6 { animation-delay: 1.1s; }
.botanical-accent.animate-draw .botanical-leaf.leaf-7 { animation-delay: 1.2s; }

/* ---------- Scroll-in animation for spread content ---------- */
.spread .spread-text-content,
.spread .photo-container {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 800ms ease, transform 800ms ease;
}

.spread.in-view .spread-text-content,
.spread.in-view .photo-container {
    opacity: 1;
    transform: translateY(0);
}

/* Spread Type C - photo always visible, overlay animates in */
.spread-c .spread-overlay {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 800ms ease, transform 800ms ease;
}

.spread-c.in-view .spread-overlay {
    opacity: 1;
    transform: translateY(0);
}

.spread-c .photo-container {
    opacity: 1;
    transform: none;
}

/* ---------- Gold Horizontal Rule Between Sections ---------- */
.spread::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 60%;
    height: 1px;
    background: var(--burnished-gold);
    opacity: 0;
    transition: transform 600ms ease-out, opacity 400ms ease;
    z-index: 10;
}

.spread.in-view::before {
    transform: translateX(-50%) scaleX(1);
    opacity: 0.6;
}

/* First spread - no top rule */
.spread:first-child::before {
    display: none;
}

/* ---------- Mobile Responsive (below 768px) ---------- */
@media (max-width: 768px) {
    html {
        scroll-snap-type: y mandatory;
    }

    .spread {
        height: auto;
        min-height: 100vh;
    }

    .spread-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        height: auto;
        min-height: 100vh;
    }

    .spread-spine {
        width: 100%;
        height: 1px;
        box-shadow: 0 0 12px rgba(201, 168, 76, 0.15);
    }

    .spread-left,
    .spread-right {
        height: auto;
    }

    /* Image columns become 60vh containers on mobile */
    .spread-a .spread-left,
    .spread-b .spread-right {
        height: 60vh;
    }

    .spread-text-content {
        padding: clamp(2rem, 4vw, 4rem);
        min-height: 40vh;
    }

    /* Reorder for Type B on mobile: image should come first */
    .spread-b .spread-grid {
        display: flex;
        flex-direction: column;
    }

    .spread-b .spread-right {
        order: -1;
    }

    .spread-b .spread-spine {
        order: 0;
    }

    .spread-b .spread-left {
        order: 1;
    }

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

    .pull-quote {
        font-size: clamp(1.5rem, 5vw, 2.5rem);
    }

    .pull-quote-mark {
        font-size: 5rem;
    }

    .botanical-accent {
        bottom: 3rem;
    }

    .nav-links {
        gap: 1rem;
    }

    .nav-link {
        font-size: 9px;
        letter-spacing: 0.15em;
    }

    .page-number {
        bottom: 1rem;
    }

    /* Disable gold top rules on mobile - too cluttered */
    .spread::before {
        display: none;
    }
}

/* ---------- Selection styling ---------- */
::selection {
    background: rgba(201, 168, 76, 0.3);
    color: var(--ivory-silk);
}

/* ---------- Scrollbar styling ---------- */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: var(--onyx-black);
}

::-webkit-scrollbar-thumb {
    background: var(--muted-gold);
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--burnished-gold);
}
