/* ============================================
   hangul.day - McBling Glamour x Korean Pottery
   ============================================ */

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

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

body {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    background: #F5EDE0;
    color: #3E2F24;
    overflow-x: hidden;
}

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

/* --- Navigation Dots --- */
#nav-dots {
    position: fixed;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 100;
}

.nav-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1.5px solid #9E8A6F;
    background: transparent;
    transition: background 0.4s ease, border-color 0.4s ease;
    display: block;
}

.nav-dot.active {
    background: #B8965A;
    border-color: #B8965A;
}

/* --- Section Base --- */
.section {
    width: 100%;
    height: 100vh;
    position: relative;
    overflow: hidden;
}

.section-inner {
    width: 100%;
    height: 100%;
    display: flex;
    position: relative;
}

/* --- Light / Dark Section Variants --- */
.section--light {
    background: #F5EDE0;
    color: #3E2F24;
}

.section--dark {
    background: #2B2420;
    color: #F5EDE0;
}

.section--closing {
    background: #F5EDE0;
    color: #3E2F24;
    transition: background 3s ease, color 3s ease;
}

.section--closing.faded {
    background: #2B2420;
    color: #F5EDE0;
}

/* --- Character Zone (left 40%) --- */
.character-zone {
    width: 40%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 10;
    padding: 2rem;
}

/* --- Hangul Character - McBling Treatment --- */
.hangul-character {
    font-family: 'Noto Serif KR', serif;
    font-size: clamp(120px, 18vw, 280px);
    font-weight: 700;
    line-height: 1;
    position: relative;
    /* Initial hidden state for scroll reveal */
    opacity: 0;
    transform: translateY(40px) scale(0.92);
    transition: opacity 0.8s cubic-bezier(0.34, 1.56, 0.64, 1),
                transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hangul-character.revealed {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Opening section: larger */
#section-0 .hangul-character {
    font-size: clamp(160px, 25vw, 400px);
}

/* McBling metallic gradient text */
.mcbling-text {
    background: linear-gradient(135deg, #C9A96E 0%, #E8D5A3 45%, #8B7240 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
}

/* Rhinestone dot grid overlay via pseudo-element */
.mcbling-text::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle 1px at center, #E8D5A3 0.5px, transparent 1px);
    background-size: 8px 8px;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0.6;
    pointer-events: none;
    mix-blend-mode: overlay;
}

/* Intense McBling for closing section */
.mcbling-intense {
    text-shadow: 0 0 40px #B8965A33, 0 0 80px #B8965A22;
    filter: brightness(1.1);
}

.mcbling-intense::before {
    background-size: 6px 6px;
    opacity: 0.8;
}

/* --- Character Label (opening section) --- */
.character-label {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 200;
    font-size: 10px;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: #8C7B6B;
    margin-top: 2rem;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.6s ease 0.6s, transform 0.6s ease 0.6s;
}

.section.in-view .character-label {
    opacity: 1;
    transform: translateY(0);
}

/* --- Romanization --- */
.romanization {
    font-family: 'Poiret One', cursive;
    font-size: clamp(36px, 5vw, 72px);
    font-weight: 400;
    letter-spacing: 0.12em;
    color: #B8965A;
    margin-top: 1.5rem;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.6s ease 0.5s, transform 0.6s ease 0.5s;
}

.section.in-view .romanization {
    opacity: 1;
    transform: translateY(0);
}

.section--dark .romanization {
    color: #E8D5A3;
}

/* Deep clay variant for Poiret One on dark backgrounds */
.romanization-clay {
    color: #5C3D2E;
}

.section--closing.faded .romanization {
    color: #E8D5A3;
}

/* --- Atmosphere Zone (right 60%) --- */
.atmosphere-zone {
    width: 60%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.atmosphere-zone--full {
    width: 60%;
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    overflow: hidden;
}

/* --- Watercolor Washes --- */
.watercolor-wash {
    position: absolute;
    border-radius: 40% 50% 35% 55%;
    filter: blur(60px);
    opacity: 0;
    transform: scale(0.7);
    transition: opacity 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s,
                transform 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s;
}

.section.in-view .watercolor-wash {
    opacity: 0.25;
    transform: scale(1);
}

/* Wash positions and colors - Light sections */
.section--light .wash-1 {
    width: 300%;
    height: 300%;
    top: -80%;
    left: -60%;
    background: radial-gradient(ellipse at 40% 40%, #A8C4B0 0%, transparent 70%);
    mix-blend-mode: multiply;
    animation: breathe-1 25s ease-in-out infinite;
}

.section--light .wash-2 {
    width: 250%;
    height: 250%;
    top: -40%;
    left: -30%;
    background: radial-gradient(ellipse at 60% 60%, #C4836A 0%, transparent 65%);
    mix-blend-mode: multiply;
    border-radius: 50% 35% 55% 40%;
    animation: breathe-2 32s ease-in-out infinite;
}

.section--light .wash-3 {
    width: 200%;
    height: 200%;
    top: -20%;
    left: -10%;
    background: radial-gradient(ellipse at 50% 50%, #7A9E8E40 0%, transparent 60%);
    mix-blend-mode: multiply;
    border-radius: 35% 55% 40% 50%;
    animation: breathe-3 28s ease-in-out infinite;
}

/* Wash positions and colors - Dark sections */
.section--dark .wash-1 {
    width: 300%;
    height: 300%;
    top: -80%;
    left: -60%;
    background: radial-gradient(ellipse at 40% 40%, #B8965A20 0%, transparent 70%);
    mix-blend-mode: screen;
    animation: breathe-1 25s ease-in-out infinite;
}

.section--dark .wash-2 {
    width: 250%;
    height: 250%;
    top: -40%;
    left: -30%;
    background: radial-gradient(ellipse at 60% 60%, #E8D5A320 0%, transparent 65%);
    mix-blend-mode: screen;
    border-radius: 50% 35% 55% 40%;
    animation: breathe-2 32s ease-in-out infinite;
}

.section--dark .wash-3 {
    width: 200%;
    height: 200%;
    top: -20%;
    left: -10%;
    background: radial-gradient(ellipse at 50% 50%, #7A9E8E30 0%, transparent 60%);
    mix-blend-mode: screen;
    border-radius: 35% 55% 40% 50%;
    animation: breathe-3 28s ease-in-out infinite;
}

/* Cool washes for vowel sections */
.wash-cool.wash-1 {
    background: radial-gradient(ellipse at 40% 40%, #7A9E8E 0%, transparent 70%) !important;
}

.wash-cool.wash-2 {
    background: radial-gradient(ellipse at 60% 60%, #A8C4B0 0%, transparent 65%) !important;
}

.wash-cool.wash-3 {
    background: radial-gradient(ellipse at 50% 50%, #7A9E8E60 0%, transparent 60%) !important;
}

.section--dark .wash-cool.wash-1 {
    background: radial-gradient(ellipse at 40% 40%, #7A9E8E30 0%, transparent 70%) !important;
    mix-blend-mode: screen;
}

.section--dark .wash-cool.wash-2 {
    background: radial-gradient(ellipse at 60% 60%, #A8C4B040 0%, transparent 65%) !important;
    mix-blend-mode: screen;
}

.section--dark .wash-cool.wash-3 {
    background: radial-gradient(ellipse at 50% 50%, #7A9E8E30 0%, transparent 60%) !important;
    mix-blend-mode: screen;
}

/* Closing section washes - more intense, filling viewport */
.wash-closing.wash-1 {
    width: 400%;
    height: 400%;
    top: -120%;
    left: -100%;
    background: radial-gradient(ellipse at 40% 40%, #A8C4B0 0%, transparent 60%) !important;
    animation: breathe-1 20s ease-in-out infinite;
}

.wash-closing.wash-2 {
    width: 350%;
    height: 350%;
    top: -80%;
    left: -70%;
    background: radial-gradient(ellipse at 60% 60%, #C4836A 0%, transparent 55%) !important;
    animation: breathe-2 26s ease-in-out infinite;
}

.wash-closing.wash-3 {
    width: 300%;
    height: 300%;
    top: -60%;
    left: -50%;
    background: radial-gradient(ellipse at 50% 50%, #7A9E8E 0%, transparent 60%) !important;
    animation: breathe-3 22s ease-in-out infinite;
}

.wash-closing.wash-4 {
    width: 280%;
    height: 280%;
    top: -40%;
    left: -80%;
    background: radial-gradient(ellipse at 30% 70%, #B8965A40 0%, transparent 60%);
    border-radius: 45% 55% 50% 40%;
    animation: breathe-1 30s ease-in-out infinite reverse;
}

.wash-closing.wash-5 {
    width: 320%;
    height: 320%;
    top: -100%;
    left: -40%;
    background: radial-gradient(ellipse at 70% 30%, #E8D5A340 0%, transparent 55%);
    border-radius: 55% 40% 45% 50%;
    animation: breathe-2 35s ease-in-out infinite reverse;
}

.section--closing.faded .wash-closing {
    mix-blend-mode: screen !important;
}

/* --- Watercolor Breathing Animations --- */
@keyframes breathe-1 {
    0%, 100% { transform: scale(1) translate(0, 0); }
    33% { transform: scale(1.05) translate(10px, -8px); }
    66% { transform: scale(0.97) translate(-6px, 5px); }
}

@keyframes breathe-2 {
    0%, 100% { transform: scale(1) translate(0, 0); }
    40% { transform: scale(1.03) translate(-8px, 12px); }
    75% { transform: scale(0.96) translate(5px, -4px); }
}

@keyframes breathe-3 {
    0%, 100% { transform: scale(1) translate(0, 0); }
    50% { transform: scale(1.06) translate(6px, 6px); }
}

/* Override breathe transform when not yet in view */
.section:not(.in-view) .watercolor-wash {
    animation: none;
}

.section.in-view .watercolor-wash {
    opacity: 0.25;
    transform: scale(1);
}

/* --- Changsal (Window Lattice) Overlay --- */
.changsal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 19px,
            #B8965A15 19px,
            #B8965A15 20px
        ),
        repeating-linear-gradient(
            135deg,
            transparent,
            transparent 19px,
            #B8965A15 19px,
            #B8965A15 20px
        );
    pointer-events: none;
    opacity: 0.5;
}

/* --- Taegeuk SVG Decoration --- */
.taegeuk-decoration {
    position: absolute;
    width: 200px;
    height: 200px;
    top: 15%;
    right: 10%;
    opacity: 0.15;
    pointer-events: none;
}

/* --- Consonant Diagrams (watermark) --- */
.consonant-diagram {
    position: absolute;
    top: 20%;
    left: 20%;
    width: 200px;
    height: 200px;
    opacity: 0.08;
    pointer-events: none;
}

.diagram-giyeok {
    border-right: 2px solid #3E2F24;
    border-bottom: 2px solid #3E2F24;
    width: 80px;
    height: 80px;
    top: 25%;
    left: 30%;
}

.diagram-nieun {
    border-left: 2px solid #3E2F24;
    border-bottom: 2px solid #3E2F24;
    width: 80px;
    height: 80px;
    top: 25%;
    left: 30%;
}

.diagram-mieum {
    border: 2px solid #3E2F24;
    width: 80px;
    height: 80px;
    top: 25%;
    left: 30%;
    border-radius: 0;
}

.section--dark .diagram-mieum {
    border-color: #F5EDE0;
}

.diagram-siot {
    width: 0;
    height: 0;
    border-left: 40px solid transparent;
    border-right: 40px solid transparent;
    border-bottom: 70px solid #3E2F2420;
    top: 25%;
    left: 30%;
    background: none;
}

/* --- Verse Text --- */
.verse-text {
    position: absolute;
    bottom: 15%;
    right: 10%;
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: 15px;
    line-height: 1.85;
    color: #3E2F24;
    text-align: right;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 1s cubic-bezier(0.34, 1.56, 0.64, 1) 0.4s,
                transform 1s cubic-bezier(0.34, 1.56, 0.64, 1) 0.4s;
}

.section.in-view .verse-text {
    opacity: 1;
    transform: translateX(0);
}

.section--dark .verse-text {
    color: #F5EDE0;
}

.section--closing.faded .verse-text {
    color: #F5EDE0;
}

.verse-text--final {
    font-size: 18px;
    font-weight: 400;
}

/* --- Section Border (Lattice) --- */
.section-border {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg,
        #B8965A 0%,
        #C9A96E 25%,
        #E8D5A3 50%,
        #C9A96E 75%,
        #B8965A 100%
    );
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.section.in-view .section-border {
    transform: scaleX(1);
}

/* --- Sparkle Effects --- */
.sparkle-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.sparkle {
    position: absolute;
    width: 12px;
    height: 12px;
    opacity: 0;
}

.sparkle::before,
.sparkle::after {
    content: '';
    position: absolute;
    background: #E8D5A3;
}

.sparkle::before {
    width: 2px;
    height: 100%;
    left: 50%;
    transform: translateX(-50%);
}

.sparkle::after {
    width: 100%;
    height: 2px;
    top: 50%;
    transform: translateY(-50%);
}

/* Sparkle positions */
.sparkle:nth-child(1) { top: 20%; left: 15%; animation: sparkle-cycle 2.5s ease-in-out 0s infinite; }
.sparkle:nth-child(2) { top: 60%; left: 70%; animation: sparkle-cycle 2.5s ease-in-out 0.8s infinite; }
.sparkle:nth-child(3) { top: 40%; left: 45%; animation: sparkle-cycle 2.5s ease-in-out 1.6s infinite; }
.sparkle:nth-child(4) { top: 75%; left: 25%; animation: sparkle-cycle 2.5s ease-in-out 0.4s infinite; }
.sparkle:nth-child(5) { top: 30%; left: 60%; animation: sparkle-cycle 2.5s ease-in-out 1.2s infinite; }
.sparkle:nth-child(6) { top: 55%; left: 35%; animation: sparkle-cycle 2.5s ease-in-out 2.0s infinite; }

/* Sparkle animation only when section is in view */
.section:not(.in-view) .sparkle {
    animation: none !important;
    opacity: 0 !important;
}

/* Intense sparkle for closing */
.sparkle-intense .sparkle {
    width: 16px;
    height: 16px;
}

@keyframes sparkle-cycle {
    0% { opacity: 0; transform: scale(0) rotate(0deg); }
    50% { opacity: 1; transform: scale(1) rotate(90deg); }
    100% { opacity: 0; transform: scale(0) rotate(180deg); }
}

/* --- Dancheong Bands (for section borders, optional decoration) --- */
.dancheong-band {
    position: absolute;
    bottom: 6px;
    left: 0;
    width: 100%;
    height: 8px;
    opacity: 0.4;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .section-inner {
        flex-direction: column;
    }

    .character-zone {
        width: 100%;
        height: 50%;
        padding: 1rem;
    }

    .atmosphere-zone,
    .atmosphere-zone--full {
        width: 100%;
        height: 50%;
    }

    .hangul-character {
        font-size: clamp(80px, 20vw, 180px);
    }

    #section-0 .hangul-character {
        font-size: clamp(100px, 25vw, 220px);
    }

    .verse-text {
        bottom: 10%;
        right: 5%;
        font-size: 13px;
    }

    .romanization {
        font-size: clamp(24px, 6vw, 48px);
    }

    #nav-dots {
        right: 12px;
    }

    .taegeuk-decoration {
        width: 120px;
        height: 120px;
        top: 5%;
        right: 5%;
    }
}

@media (max-width: 480px) {
    .character-label {
        font-size: 8px;
    }

    .verse-text {
        font-size: 12px;
    }
}
