/* ============================================
   yesang.org - Burgundy Meditation Chamber
   ============================================ */

/* CSS Custom Properties */
:root {
    --color-cream: #f5ede0;
    --color-burgundy-deep: #5a1a2a;
    --color-burgundy-text: #2d1018;
    --color-burgundy-medium: #7a2838;
    --color-burgundy-accent: #8c2f42;
    --color-mauve: #8a6a72;
    --color-rose-gold: #c47a70;
    --color-bokeh-pink: #e8b4a8;
    --color-bokeh-amber: #d4a870;
    --color-wine: #4a0e1e;
    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'Source Serif 4', 'Times New Roman', serif;
    --font-caption: 'Recursive', 'Courier New', monospace;
    --base-spacing: 2.4rem;
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background-color: var(--color-cream);
    color: var(--color-burgundy-text);
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1rem, 1.7vw, 1.15rem);
    line-height: 1.85;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ============================================
   Opening Screen
   ============================================ */
.opening-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-cream);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.8s ease-out 3.2s;
}

.opening-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

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

.bokeh-intro {
    position: absolute;
    border-radius: 50%;
    opacity: 0;
}

.bokeh-intro-1 {
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, var(--color-bokeh-pink) 0%, transparent 70%);
    top: 20%;
    left: 10%;
    animation: bokeh-fade-in 2s ease-out forwards;
}

.bokeh-intro-2 {
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, var(--color-bokeh-amber) 0%, transparent 70%);
    top: 60%;
    right: 15%;
    animation: bokeh-fade-in 2s ease-out 0.3s forwards;
}

.bokeh-intro-3 {
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, var(--color-burgundy-medium) 0%, transparent 70%);
    bottom: 20%;
    left: 20%;
    animation: bokeh-fade-in 2s ease-out 0.6s forwards;
}

@keyframes bokeh-fade-in {
    from { opacity: 0; }
    to { opacity: 0.2; }
}

.opening-body {
    position: relative;
    z-index: 1;
    opacity: 0;
    animation: fade-in-opening 0.6s ease-out 2.4s forwards;
}

@keyframes fade-in-opening {
    from { opacity: 0; }
    to { opacity: 1; }
}

.opening-title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(2rem, 5vw, 3.5rem);
    letter-spacing: -0.01em;
    color: var(--color-burgundy-text);
    margin-bottom: 0.5rem;
}

.opening-subtitle {
    font-family: var(--font-caption);
    font-weight: 400;
    font-size: clamp(0.75rem, 1.1vw, 0.9rem);
    letter-spacing: 0.02em;
    color: var(--color-mauve);
    animation: subtitle-spring 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 2.8s both;
}

@keyframes subtitle-spring {
    0% {
        opacity: 0;
        transform: translateY(8px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   Bokeh Background Container
   ============================================ */
.bokeh-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.bokeh-circle {
    position: absolute;
    border-radius: 50%;
    opacity: 0;
}

.bokeh-1 {
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, var(--color-bokeh-pink) 0%, transparent 70%);
    top: 5%;
    left: 5%;
    animation: bokeh-appear 3s ease-out 3.2s forwards, bokeh-drift 8s ease-in-out 4s infinite, bokeh-pulse 6s ease-in-out 4s infinite;
    opacity: 0.2;
}

.bokeh-2 {
    width: 140px;
    height: 140px;
    background: radial-gradient(circle, var(--color-bokeh-amber) 0%, transparent 70%);
    top: 25%;
    right: 8%;
    animation: bokeh-appear 3s ease-out 3.3s forwards, bokeh-drift-alt 8.5s ease-in-out 4.2s infinite, bokeh-pulse 7s ease-in-out 4.2s infinite;
    opacity: 0.25;
}

.bokeh-3 {
    width: 160px;
    height: 160px;
    background: radial-gradient(circle, var(--color-burgundy-medium) 0%, transparent 70%);
    bottom: 10%;
    left: 12%;
    animation: bokeh-appear 3s ease-out 3.4s forwards, bokeh-drift 9s ease-in-out 4.4s infinite, bokeh-pulse 8s ease-in-out 4.4s infinite;
    opacity: 0.15;
}

.bokeh-4 {
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, var(--color-bokeh-pink) 0%, transparent 70%);
    top: 45%;
    right: 3%;
    animation: bokeh-appear 3s ease-out 3.5s forwards, bokeh-drift-alt 8s ease-in-out 4.6s infinite, bokeh-pulse 5.5s ease-in-out 4.6s infinite;
    opacity: 0.18;
}

.bokeh-5 {
    width: 95px;
    height: 95px;
    background: radial-gradient(circle, var(--color-bokeh-amber) 0%, transparent 70%);
    bottom: 25%;
    right: 15%;
    animation: bokeh-appear 3s ease-out 3.6s forwards, bokeh-drift 7.5s ease-in-out 4.8s infinite, bokeh-pulse 6.5s ease-in-out 4.8s infinite;
    opacity: 0.2;
}

.bokeh-6 {
    width: 110px;
    height: 110px;
    background: radial-gradient(circle, var(--color-burgundy-medium) 0%, transparent 70%);
    top: 60%;
    left: 8%;
    animation: bokeh-appear 3s ease-out 3.7s forwards, bokeh-drift-alt 9.5s ease-in-out 5s infinite, bokeh-pulse 7.5s ease-in-out 5s infinite;
    opacity: 0.12;
}

.bokeh-7 {
    width: 140px;
    height: 140px;
    background: radial-gradient(circle, var(--color-bokeh-pink) 0%, transparent 70%);
    bottom: 15%;
    right: 8%;
    animation: bokeh-appear 3s ease-out 3.8s forwards, bokeh-drift 8.8s ease-in-out 5.2s infinite, bokeh-pulse 5.8s ease-in-out 5.2s infinite;
    opacity: 0.22;
}

.bokeh-8 {
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, var(--color-bokeh-amber) 0%, transparent 70%);
    top: 15%;
    right: 25%;
    animation: bokeh-appear 3s ease-out 3.9s forwards, bokeh-drift-alt 7s ease-in-out 5.4s infinite, bokeh-pulse 6s ease-in-out 5.4s infinite;
    opacity: 0.17;
}

@keyframes bokeh-appear {
    from { opacity: 0; }
    to { opacity: var(--bokeh-opacity, 0.2); }
}

@keyframes bokeh-drift {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(2px, 3px); }
}

@keyframes bokeh-drift-alt {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-3px, -2px); }
}

@keyframes bokeh-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

/* ============================================
   Sections & Layout
   ============================================ */
.scroll-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(var(--base-spacing) * 2) 24px;
    background-color: var(--color-cream);
}

.section-column {
    width: 100%;
    max-width: min(680px, 85vw);
    margin: 0 auto;
}

/* ============================================
   Typography
   ============================================ */
.domain-title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(2rem, 5vw, 3.5rem);
    letter-spacing: -0.01em;
    line-height: 1.2;
    color: var(--color-burgundy-text);
    margin-bottom: var(--base-spacing);
    text-align: center;
}

.korean-subtitle {
    font-family: var(--font-caption);
    font-weight: 400;
    font-size: clamp(0.75rem, 1.1vw, 0.9rem);
    letter-spacing: 0.02em;
    color: var(--color-mauve);
    text-align: center;
    margin-bottom: calc(var(--base-spacing) * 1.5);
}

.intro-text {
    font-size: clamp(1rem, 1.7vw, 1.15rem);
    line-height: 1.85;
    margin-bottom: var(--base-spacing);
    text-align: center;
}

.body-text {
    margin-bottom: 1.5em;
    color: #3d2818;
}

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

.pull-quote {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(1.3rem, 3vw, 1.8rem);
    font-style: italic;
    letter-spacing: -0.01em;
    color: var(--color-burgundy-accent);
    margin: calc(var(--base-spacing) * 1.5) 0;
    line-height: 1.4;
    text-align: center;
}

.body-text-white {
    color: #f5f0e8;
    margin-bottom: 1.5em;
}

.closing-meditation {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(1.4rem, 3.5vw, 2rem);
    letter-spacing: -0.01em;
    color: var(--color-burgundy-text);
    margin-top: calc(var(--base-spacing) * 1.5);
    text-align: center;
    line-height: 1.3;
}

/* ============================================
   Pattern Dividers
   ============================================ */
.pattern-divider {
    width: 100%;
    height: 40px;
    margin: calc(var(--base-spacing) * 3) 0;
    background-repeat: repeat-x;
    background-position: left center;
    background-size: auto 40px;
}

/* Seigaiha: Overlapping concentric arcs (wave pattern) */
.seigaiha {
    background-image:
        repeating-linear-gradient(
            90deg,
            var(--color-burgundy-medium) 0,
            var(--color-burgundy-medium) 1px,
            var(--color-cream) 1px,
            var(--color-cream) 8px
        );
    background-size: 8px 40px;
    position: relative;
}

.seigaiha::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 4px 20px, var(--color-cream) 4px, transparent 4px),
        radial-gradient(circle at 4px 20px, var(--color-burgundy-medium) 6px, transparent 6px);
    background-size: 8px 40px;
    background-position: 0 0;
    background-repeat: repeat-x;
    opacity: 0.6;
}

/* Yagasuri: Arrow-feather chevrons */
.yagasuri {
    background-image:
        repeating-linear-gradient(45deg, var(--color-burgundy-medium) 0, var(--color-burgundy-medium) 2px, var(--color-cream) 2px, var(--color-cream) 4px),
        repeating-linear-gradient(-45deg, var(--color-burgundy-medium) 0, var(--color-burgundy-medium) 2px, var(--color-cream) 2px, var(--color-cream) 4px);
    background-size: 6px 40px, 6px 40px;
    background-position: 0 0, 3px 0;
}

/* Asanoha: Hemp-leaf geometric star pattern */
.asanoha {
    background-image:
        repeating-linear-gradient(0deg, var(--color-burgundy-medium) 0, var(--color-burgundy-medium) 1px, transparent 1px, transparent 8px),
        repeating-linear-gradient(90deg, var(--color-burgundy-medium) 0, var(--color-burgundy-medium) 1px, transparent 1px, transparent 8px),
        repeating-linear-gradient(45deg, var(--color-burgundy-medium) 0, var(--color-burgundy-medium) 1px, transparent 1px, transparent 11px),
        repeating-linear-gradient(-45deg, var(--color-burgundy-medium) 0, var(--color-burgundy-medium) 1px, transparent 1px, transparent 11px);
    background-size: 8px 8px, 8px 8px, 11px 11px, 11px 11px;
    opacity: 0.8;
}

/* ============================================
   Inversion Block
   ============================================ */
.section-inversion {
    background-color: var(--color-burgundy-deep);
    position: relative;
    margin-left: -24px;
    margin-right: -24px;
    padding-left: 24px;
    padding-right: 24px;
}

.inversion-block {
    width: 100%;
    padding: calc(var(--base-spacing) * 2.5) 0;
}

.inversion-text {
    max-width: min(680px, 85vw);
}

/* ============================================
   Scroll Reveal
   ============================================ */
.scroll-reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

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

/* Spring Physics Fallback */
.scroll-reveal.spring-animate {
    animation: spring-enter 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes spring-enter {
    0% {
        opacity: 0;
        transform: translateY(12px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    :root {
        --base-spacing: 2rem;
    }

    .scroll-section {
        padding: calc(var(--base-spacing) * 1.5) 20px;
    }

    .bokeh-circle {
        display: none;
    }

    .section-inversion {
        margin-left: -20px;
        margin-right: -20px;
        padding-left: 20px;
        padding-right: 20px;
    }

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

/* ============================================
   Prefers Reduced Motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .bokeh-intro,
    .bokeh-circle,
    .opening-subtitle,
    .scroll-reveal {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }

    .opening-screen {
        transition: none;
    }

    .opening-screen.fade-out {
        opacity: 0;
    }
}
