/* ============================================
   bada.cafe — Monochrome Dreamscape Café
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --bg-light: #f7f5f2;
    --bg-dark: #2a2a2e;
    --text-primary: #3d3d42;
    --text-body: #5a5a5e;
    --text-ghost: #8a8a8e;
    --accent-line: #c8c4be;
    --hover-active: #a09a92;
    --highlight: #e8e4de;

    --font-display: 'Quicksand', sans-serif;
    --font-body: 'Nunito', sans-serif;
    --font-accent: 'Cormorant Garamond', serif;

    --ease-natural: cubic-bezier(0.25, 0.1, 0.25, 1);
    --perspective: 1200px;
}

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

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

body {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.75;
    color: var(--text-body);
    background-color: var(--bg-light);
    overflow-x: hidden;
}

/* --- SVG Filters (hidden) --- */
.svg-filters {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* --- Grain Overlay --- */
.grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.025;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* --- Floating Monogram --- */
.monogram {
    position: fixed;
    top: 2rem;
    left: 2rem;
    z-index: 100;
    font-family: var(--font-accent);
    font-style: italic;
    font-weight: 300;
    font-size: 1.1rem;
    letter-spacing: 0.06em;
    color: var(--text-ghost);
    text-decoration: none;
    mix-blend-mode: difference;
    transition: opacity 0.4s var(--ease-natural);
}

.monogram:hover {
    opacity: 0.6;
}

/* --- Parallax Container --- */
.parallax-container {
    perspective: var(--perspective);
}

/* --- Section Base --- */
.section {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    scroll-snap-align: start;
    padding: clamp(8rem, 15vh, 14rem) clamp(2rem, 5vw, 6rem);
    display: flex;
    align-items: center;
    justify-content: center;
}

.section[data-bg="light"] {
    background-color: var(--bg-light);
    color: var(--text-primary);
}

.section[data-bg="dark"] {
    background-color: var(--bg-dark);
    color: var(--bg-light);
}

.section[data-bg="highlight"] {
    background-color: var(--highlight);
    color: var(--text-primary);
}

/* --- Section Content Grid --- */
.section-content {
    position: relative;
    width: 100%;
    max-width: 1200px;
    z-index: 2;
}

.grid-60-40 {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 4rem;
    align-items: center;
}

.grid-40-60 {
    display: grid;
    grid-template-columns: 2fr 3fr;
    gap: 4rem;
    align-items: center;
}

.section-content-centered {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* --- Parallax Depth Layers --- */
.parallax-depth-1 {
    transform: translateZ(-80px) scale(1.067);
}

.parallax-depth-2 {
    transform: translateZ(-140px) scale(1.117);
}

.parallax-depth-3 {
    transform: translateZ(-200px) scale(1.167);
}

/* --- Lens Flare Effects --- */
.lens-flare {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
    will-change: transform;
}

/* Section 1: Top-right light source */
.flare-1 {
    top: -40%;
    right: -30%;
    width: 200vw;
    height: 200vh;
    background: radial-gradient(circle at 30% 30%, rgba(247,245,242,0.9) 0%, rgba(247,245,242,0) 50%);
}

.flare-1b {
    top: 10%;
    right: 5%;
    width: 60vw;
    height: 60vh;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, rgba(247,245,242,0) 60%);
}

/* Section 2: Left side light */
.flare-2 {
    top: -20%;
    left: -40%;
    width: 150vw;
    height: 150vh;
    background: radial-gradient(circle at 40% 50%, rgba(232,228,222,0.7) 0%, rgba(232,228,222,0) 55%);
}

/* Section 3: Candlelight (dark section) */
.flare-3 {
    bottom: -20%;
    left: -10%;
    width: 120vw;
    height: 120vh;
    background: radial-gradient(circle at 40% 70%, rgba(200,196,190,0.15) 0%, rgba(42,42,46,0) 50%);
}

.flare-3b {
    top: 10%;
    right: 15%;
    width: 50vw;
    height: 50vh;
    background: radial-gradient(circle, rgba(200,196,190,0.08) 0%, rgba(42,42,46,0) 60%);
}

/* Section 4: Window right */
.flare-4 {
    top: -30%;
    right: -20%;
    width: 140vw;
    height: 140vh;
    background: radial-gradient(circle at 35% 40%, rgba(247,245,242,0.8) 0%, rgba(247,245,242,0) 50%);
}

/* Section 5: Pendant lamp center (dark) */
.flare-5 {
    top: -30%;
    left: 20%;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at 50% 30%, rgba(200,196,190,0.12) 0%, rgba(42,42,46,0) 45%);
}

.flare-5b {
    top: 30%;
    left: 40%;
    width: 40vw;
    height: 40vh;
    background: radial-gradient(circle, rgba(232,228,222,0.1) 0%, rgba(42,42,46,0) 55%);
}

/* Section 6: Return to original top-right */
.flare-6 {
    top: -40%;
    right: -30%;
    width: 200vw;
    height: 200vh;
    background: radial-gradient(circle at 30% 30%, rgba(247,245,242,0.9) 0%, rgba(247,245,242,0) 50%);
}

/* --- Bokeh Circles --- */
.bokeh {
    position: absolute;
    border-radius: 50%;
    background: rgba(247, 245, 242, 0.5);
    filter: url(#bokeh-blur);
    pointer-events: none;
    z-index: 1;
}

.section[data-bg="dark"] .bokeh {
    background: rgba(200, 196, 190, 0.4);
}

/* Bokeh floating animations (prime number durations) */
.bokeh-1 { animation: float-gentle 11s var(--ease-natural) infinite alternate; }
.bokeh-2 { animation: float-gentle 13s var(--ease-natural) infinite alternate-reverse; }
.bokeh-3 { animation: float-gentle 7s var(--ease-natural) infinite alternate; }
.bokeh-4 { animation: float-gentle 17s var(--ease-natural) infinite alternate; }
.bokeh-5 { animation: float-gentle 11s var(--ease-natural) infinite alternate-reverse; }
.bokeh-6 { animation: float-gentle 13s var(--ease-natural) infinite alternate; }
.bokeh-7 { animation: float-gentle 7s var(--ease-natural) infinite alternate-reverse; }
.bokeh-8 { animation: float-gentle 17s var(--ease-natural) infinite alternate; }
.bokeh-9 { animation: float-gentle 11s var(--ease-natural) infinite alternate-reverse; }
.bokeh-10 { animation: float-gentle 13s var(--ease-natural) infinite alternate; }
.bokeh-11 { animation: float-gentle 7s var(--ease-natural) infinite alternate; }
.bokeh-12 { animation: float-gentle 17s var(--ease-natural) infinite alternate-reverse; }
.bokeh-13 { animation: float-gentle 11s var(--ease-natural) infinite alternate; }
.bokeh-14 { animation: float-gentle 13s var(--ease-natural) infinite alternate-reverse; }

/* --- Hero Section (Section 1) --- */
.hero-text {
    padding-left: 5vw;
}

.hero-title {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: clamp(3rem, 8vw, 7rem);
    letter-spacing: 0.04em;
    color: var(--text-primary);
    line-height: 1.1;
}

.letter {
    display: inline-block;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s var(--ease-natural), transform 0.4s var(--ease-natural);
}

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

.hero-subtitle-wrap {
    position: relative;
    display: inline-block;
    margin-top: 0.5rem;
    margin-left: 2rem;
}

.hero-subtitle {
    font-family: var(--font-accent);
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    letter-spacing: 0.06em;
    color: var(--text-ghost);
    opacity: 0;
    transition: opacity 0.6s var(--ease-natural);
}

.hero-subtitle.visible {
    opacity: 1;
}

.hero-underline {
    width: 100%;
    height: 6px;
    margin-top: 0.3rem;
    display: block;
}

/* --- Section Headings --- */
.section-heading {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    letter-spacing: 0.04em;
    color: var(--text-body);
    line-height: 1.5;
}

.section[data-bg="dark"] .section-heading {
    color: var(--bg-light);
}

/* --- Section Captions --- */
.section-caption {
    font-family: var(--font-accent);
    font-weight: 300;
    font-style: italic;
    font-size: clamp(0.85rem, 1vw, 1rem);
    letter-spacing: 0.06em;
    color: var(--text-ghost);
    margin-bottom: 1.5rem;
}

.section-caption-ghost {
    color: var(--text-ghost);
}

.section[data-bg="dark"] .section-caption-ghost {
    color: var(--accent-line);
}

/* --- Content Cards --- */
.content-card {
    padding: 3rem;
    max-width: 540px;
}

.card-text {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.75;
    color: var(--text-body);
}

.section[data-bg="dark"] .card-text {
    color: var(--accent-line);
}

/* --- Underline Draw Pattern --- */
.underline-draw path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 1s var(--ease-natural);
}

.underline-draw.animate path {
    stroke-dashoffset: 0;
}

.underline-word {
    position: relative;
    display: inline-block;
}

.underline-word::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--hover-active);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.8s var(--ease-natural);
}

.underline-word.animate::after {
    transform: scaleX(1);
}

/* --- Final Section --- */
.final-title {
    font-family: var(--font-accent);
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1rem, 1.5vw, 1.3rem);
    letter-spacing: 0.06em;
    color: var(--text-ghost);
    opacity: 0;
    transition: opacity 0.8s var(--ease-natural);
}

.final-title.visible {
    opacity: 1;
}

.final-underline {
    width: clamp(200px, 40vw, 400px);
    height: 6px;
    margin-top: 1.5rem;
}

.fade-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(247, 245, 242, 0);
    pointer-events: none;
    z-index: 3;
    transition: background 3s var(--ease-natural);
}

.fade-overlay.active {
    background: rgba(247, 245, 242, 0.4);
}

/* --- Section Dividers --- */
.section-divider {
    position: relative;
    height: 2px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
    z-index: 2;
}

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

.divider-line {
    width: 80%;
    max-width: 900px;
    height: 6px;
}

.divider-line path {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 1.2s var(--ease-natural);
}

.divider-line.animate path {
    stroke-dashoffset: 0;
}

/* --- Steam Wisps --- */
.steam-wisp {
    width: 30px;
    height: 80px;
    opacity: 0;
    transition: opacity 0.6s var(--ease-natural);
}

.steam-wisp.visible {
    opacity: 1;
}

.steam-1 {
    position: absolute;
    bottom: 20%;
    right: 30%;
    animation: steam-rise 11s var(--ease-natural) infinite;
}

.steam-2 {
    position: absolute;
    bottom: 15%;
    right: 40%;
    animation: steam-rise 13s var(--ease-natural) infinite;
}

.steam-3 {
    position: absolute;
    bottom: 25%;
    right: 20%;
    animation: steam-rise 17s var(--ease-natural) infinite;
}

.steam-4 {
    position: absolute;
    bottom: 20%;
    right: 35%;
    animation: steam-rise 11s var(--ease-natural) infinite;
}

.steam-5 {
    position: absolute;
    bottom: 30%;
    left: 30%;
    animation: steam-rise 13s var(--ease-natural) infinite;
}

.steam-6 {
    position: absolute;
    bottom: 18%;
    right: 25%;
    animation: steam-rise 7s var(--ease-natural) infinite;
}

/* --- Crumb Particles --- */
.crumb {
    position: absolute;
    border-radius: 50%;
    background: var(--hover-active);
    pointer-events: none;
    z-index: 1;
}

.crumb-1 {
    width: 4px; height: 4px;
    top: 30%; left: 20%;
    opacity: 0.12;
    animation: drift-lateral 23s linear infinite;
}

.crumb-2 {
    width: 6px; height: 6px;
    top: 50%; left: 60%;
    opacity: 0.08;
    animation: drift-lateral 29s linear infinite reverse;
}

.crumb-3 {
    width: 3px; height: 3px;
    top: 70%; left: 40%;
    opacity: 0.15;
    animation: drift-lateral 19s linear infinite;
}

.crumb-4 {
    width: 5px; height: 5px;
    top: 25%; left: 75%;
    opacity: 0.1;
    animation: drift-lateral 31s linear infinite reverse;
}

.crumb-5 {
    width: 4px; height: 4px;
    top: 60%; left: 85%;
    opacity: 0.12;
    animation: drift-lateral 23s linear infinite;
}

.crumb-6 {
    width: 5px; height: 5px;
    top: 35%; left: 15%;
    opacity: 0.13;
    animation: drift-lateral 29s linear infinite reverse;
}

.crumb-7 {
    width: 3px; height: 3px;
    top: 55%; left: 55%;
    opacity: 0.1;
    animation: drift-lateral 19s linear infinite;
}

.crumb-8 {
    width: 6px; height: 6px;
    top: 75%; left: 80%;
    opacity: 0.08;
    animation: drift-lateral 31s linear infinite reverse;
}

/* --- Floating Particles (Global) --- */
.floating-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
}

.particle {
    position: absolute;
    border-radius: 50%;
    background: var(--hover-active);
}

.particle-1 {
    width: 3px; height: 3px;
    top: 10%; left: 15%;
    opacity: 0.1;
    animation: float-particle 11s cubic-bezier(0.37, 0, 0.63, 1) infinite alternate;
}

.particle-2 {
    width: 4px; height: 4px;
    top: 30%; left: 80%;
    opacity: 0.08;
    animation: float-particle 13s cubic-bezier(0.37, 0, 0.63, 1) infinite alternate-reverse;
}

.particle-3 {
    width: 2px; height: 2px;
    top: 50%; left: 45%;
    opacity: 0.12;
    animation: float-particle 7s cubic-bezier(0.37, 0, 0.63, 1) infinite alternate;
}

.particle-4 {
    width: 5px; height: 5px;
    top: 70%; left: 25%;
    opacity: 0.06;
    animation: float-particle 17s cubic-bezier(0.37, 0, 0.63, 1) infinite alternate-reverse;
}

.particle-5 {
    width: 3px; height: 3px;
    top: 85%; left: 65%;
    opacity: 0.09;
    animation: float-particle 11s cubic-bezier(0.37, 0, 0.63, 1) infinite alternate;
}

.particle-6 {
    width: 4px; height: 4px;
    top: 20%; left: 55%;
    opacity: 0.07;
    animation: float-particle 13s cubic-bezier(0.37, 0, 0.63, 1) infinite alternate-reverse;
}

.particle-7 {
    width: 2px; height: 2px;
    top: 60%; left: 90%;
    opacity: 0.11;
    animation: float-particle 7s cubic-bezier(0.37, 0, 0.63, 1) infinite alternate;
}

.particle-8 {
    width: 3px; height: 3px;
    top: 45%; left: 10%;
    opacity: 0.08;
    animation: float-particle 17s cubic-bezier(0.37, 0, 0.63, 1) infinite alternate-reverse;
}

/* --- Keyframe Animations --- */

@keyframes float-gentle {
    0% { transform: translateY(0px); }
    100% { transform: translateY(-15px); }
}

@keyframes steam-rise {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.15;
    }
    50% {
        transform: translateY(-30px) rotate(3deg);
        opacity: 0.12;
    }
    90% {
        opacity: 0.05;
    }
    100% {
        transform: translateY(-60px) rotate(-2deg);
        opacity: 0;
    }
}

@keyframes drift-lateral {
    0% { transform: translateX(0); }
    25% { transform: translateX(15px); }
    50% { transform: translateX(-10px); }
    75% { transform: translateX(8px); }
    100% { transform: translateX(0); }
}

@keyframes float-particle {
    0% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(5px, -8px) rotate(1deg); }
    66% { transform: translate(-3px, -12px) rotate(-1deg); }
    100% { transform: translate(2px, -15px) rotate(0.5deg); }
}

/* --- Section entry animations --- */
.section .primary-content,
.section .secondary-content {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s var(--ease-natural), transform 0.8s var(--ease-natural);
}

.section.in-view .primary-content,
.section.in-view .secondary-content {
    opacity: 1;
    transform: translateY(0);
}

.section.in-view .secondary-content {
    transition-delay: 0.2s;
}

/* Override for parallax depth elements when in view */
.section.in-view .parallax-depth-1 {
    opacity: 1;
    transform: translateZ(-80px) scale(1.067) translateY(0);
}

.section.in-view .parallax-depth-2 {
    opacity: 1;
    transform: translateZ(-140px) scale(1.117) translateY(0);
}

.section.in-view .parallax-depth-3 {
    opacity: 1;
    transform: translateZ(-200px) scale(1.167) translateY(0);
}

/* --- Page Load Blank State --- */
body.loading {
    opacity: 0;
}

body.loaded {
    opacity: 1;
    transition: opacity 0.3s var(--ease-natural);
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
    .bokeh,
    .particle,
    .crumb,
    .steam-wisp,
    .floating-particles {
        animation: none !important;
        display: none;
    }

    .parallax-depth-1,
    .parallax-depth-2,
    .parallax-depth-3 {
        transform: none !important;
    }

    .letter {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }

    .hero-subtitle {
        opacity: 1 !important;
        transition: none !important;
    }

    .final-title {
        opacity: 1 !important;
        transition: none !important;
    }

    .section .primary-content,
    .section .secondary-content {
        opacity: 1;
        transform: none;
        transition: opacity 0.3s ease;
    }

    .underline-draw path {
        stroke-dashoffset: 0 !important;
        transition: none !important;
    }

    .divider-line path {
        stroke-dashoffset: 0 !important;
        transition: none !important;
    }

    html {
        scroll-snap-type: none;
    }
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .grid-60-40,
    .grid-40-60 {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .hero-text {
        padding-left: 0;
    }

    .hero-subtitle-wrap {
        margin-left: 0.5rem;
    }

    .content-card {
        padding: 2rem 1rem;
    }

    .section {
        padding: clamp(4rem, 10vh, 8rem) clamp(1.5rem, 4vw, 3rem);
    }

    .monogram {
        top: 1.2rem;
        left: 1.2rem;
    }

    .secondary-content {
        display: none;
    }
}
