/* ============================================
   yongzoon.com - Cinematic Calligraphy
   Color Palette:
   Void:         #0A0B14
   Deep Aurora:  #1B0A3A
   Ink Violet:   #3A1F5E
   Warm Bronze:  #C7956D
   Rose Dawn:    #D4728C
   Lavender Mist:#A89EC2
   Aurora Green: #2D6B5A
   Parchment:    #F0E6D3
   ============================================ */

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

:root {
    --void: #0A0B14;
    --deep-aurora: #1B0A3A;
    --ink-violet: #3A1F5E;
    --warm-bronze: #C7956D;
    --rose-dawn: #D4728C;
    --lavender-mist: #A89EC2;
    --aurora-green: #2D6B5A;
    --parchment: #F0E6D3;
    --scroll-progress: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--void);
    color: var(--parchment);
    font-family: 'Commissioner', sans-serif;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   ACT I: The Void
   ============================================ */
#act-void {
    height: 100vh;
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--void);
}

.void-pulse {
    position: absolute;
    width: 60vw;
    height: 60vw;
    border-radius: 50%;
    background: radial-gradient(circle, var(--deep-aurora) 0%, transparent 70%);
    opacity: 0.03;
    animation: voidPulse 4s ease-in-out infinite;
}

@keyframes voidPulse {
    0%, 100% { opacity: 0.03; transform: scale(1); }
    50% { opacity: 0.07; transform: scale(1.05); }
}

/* ============================================
   ACT II: The Name
   ============================================ */
#act-name {
    min-height: 150vh;
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--void);
}

.name-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    perspective: 800px;
}

.brushstroke-svg {
    width: clamp(280px, 50vw, 500px);
    height: auto;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.brushstroke-svg.visible {
    opacity: 1;
}

.brush-stroke {
    stroke-linecap: round;
    stroke-linejoin: round;
}

.latin-name {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(6rem, 18vw, 14rem);
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--parchment);
    text-rendering: geometricPrecision;
    line-height: 1;
    position: relative;
}

.letter {
    display: inline-block;
    clip-path: polygon(50% 0%, 50% 0%, 50% 100%, 50% 100%);
    transition: clip-path 0.6s cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

.letter.revealed {
    clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%);
}

/* Alternating reveal directions */
.letter[data-index="0"].revealed { clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%); }
.letter[data-index="1"].revealed { clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%); }
.letter[data-index="2"].revealed { clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%); }
.letter[data-index="3"].revealed { clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%); }
.letter[data-index="4"].revealed { clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%); }
.letter[data-index="5"].revealed { clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%); }
.letter[data-index="6"].revealed { clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%); }
.letter[data-index="7"].revealed { clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%); }

.korean-name {
    font-family: 'Noto Serif KR', serif;
    font-weight: 700;
    font-size: clamp(3.5rem, 10vw, 8rem);
    color: var(--parchment);
    transform: translateZ(-40px);
    opacity: 0;
    transition: opacity 0.8s ease 0.5s, transform 0.8s ease 0.5s;
}

.korean-name.visible {
    opacity: 0.85;
    transform: translateZ(-40px) translateY(0);
}

/* ============================================
   ACT III: The Coordinates
   ============================================ */
#act-coordinates {
    height: 100vh;
    width: 100%;
    position: relative;
    background-color: var(--void);
    overflow: hidden;
}

.constellation-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.constellation-svg line {
    stroke: var(--ink-violet);
    stroke-width: 0.15;
    opacity: 0.4;
}

.coordinates-grid {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 2;
}

.coord-item {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    filter: blur(8px);
    opacity: 0;
    transition: filter 0.6s ease, opacity 0.6s ease;
}

.coord-item.revealed {
    filter: blur(0);
    opacity: 1;
}

.coord-dot {
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--warm-bronze);
    flex-shrink: 0;
}

.coord-text {
    font-family: 'Commissioner', sans-serif;
    font-weight: 300;
    font-size: clamp(0.75rem, 1.2vw, 1rem);
    letter-spacing: 0.12em;
    color: var(--lavender-mist);
    white-space: nowrap;
}

.coord-link {
    color: var(--lavender-mist);
    text-decoration: none;
    transition: color 0.3s ease;
}

.coord-link:hover {
    color: var(--rose-dawn);
}

/* ============================================
   ACT IV: The Mark
   ============================================ */
#act-mark {
    height: 80vh;
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--void);
}

.seal-container {
    transform: scale(0.3);
    transition: transform 1.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.seal-container.scaled {
    transform: scale(1);
}

.seal-svg {
    width: clamp(200px, 40vw, 350px);
    height: auto;
    filter: drop-shadow(0 0 20px rgba(199, 149, 109, 0.4));
    animation: sealRotate 90s linear infinite;
}

@keyframes sealRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.monogram-text {
    font-family: 'Bebas Neue', sans-serif;
}

.dancheong-diamonds polygon {
    fill: var(--warm-bronze);
    opacity: 0.7;
}

/* ============================================
   ACT V: The Departure
   ============================================ */
#act-departure {
    height: 60vh;
    width: 100%;
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 4rem;
    background: linear-gradient(to bottom, var(--void) 0%, var(--deep-aurora) 100%);
}

.departure-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.departure-rule {
    border: none;
    width: 40vw;
    height: 0.5px;
    background-color: var(--warm-bronze);
    opacity: 0.6;
}

.departure-signature {
    font-family: 'Commissioner', sans-serif;
    font-weight: 200;
    font-size: 0.75rem;
    letter-spacing: 0.5em;
    color: var(--warm-bronze);
    text-transform: lowercase;
}

/* ============================================
   Flowing Curves (decorative overlay)
   ============================================ */
.flowing-curves {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
    opacity: 0.4;
}

/* ============================================
   General Act Styling
   ============================================ */
.act {
    position: relative;
    z-index: 1;
}

/* ============================================
   Reduced Motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .void-pulse {
        animation: none;
        opacity: 0.05;
    }

    .seal-svg {
        animation: none;
    }

    .brush-stroke {
        stroke-dashoffset: 0 !important;
    }

    .letter {
        clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%) !important;
        transition: none;
    }

    .korean-name {
        opacity: 0.85;
        transition: none;
    }

    .coord-item {
        filter: blur(0);
        opacity: 1;
        transition: none;
    }

    .seal-container {
        transform: scale(1);
        transition: none;
    }
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 768px) {
    .coord-item {
        gap: 0.5rem;
    }

    .coord-text {
        font-size: 0.7rem;
    }

    .departure-rule {
        width: 60vw;
    }
}
