/* ============================================================
   hangeul.day — Styles
   Sci-fi futurism meets Hangeul geometric elegance
   ============================================================ */

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

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

body {
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 400;
    line-height: 1.9;
    font-size: clamp(15px, 1.1vw, 17px);
    color: #2A2030;
    background: #FFF5EB;
    overflow-x: hidden;
}

/* --- Typography --- */
.section-title,
.timeline-heading,
.constellation-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(24px, 3.5vw, 48px);
    letter-spacing: 0.02em;
    color: #2A2030;
}

.section-body {
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 400;
    line-height: 1.9;
    font-size: clamp(15px, 1.1vw, 17px);
    color: #2A2030;
    margin-bottom: 1.5em;
}

/* --- Neon glow classes --- */
.jamo-consonant-glow {
    color: #6B5FD0;
    text-shadow: 0 0 20px rgba(107, 95, 208, 0.3);
}

.jamo-vowel-glow {
    color: #E06B8F;
    text-shadow: 0 0 20px rgba(224, 107, 143, 0.3);
}

.jamo-cyan-glow {
    color: #5FC0D0;
    text-shadow: 0 0 20px rgba(95, 192, 208, 0.3);
}

/* --- Glow pulse animation --- */
@keyframes glowPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1.0; }
}

/* ============================================================
   SECTION 1: Hero
   ============================================================ */
.section-hero {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-bg-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #FFF5EB 0%, #F0E0D0 60%, #E8E0F0 100%);
    z-index: 0;
}

/* Floating bubbles */
.bubbles-container {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.bubble {
    position: absolute;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Noto Serif KR', serif;
    font-weight: 700;
    pointer-events: none;
    animation: bubbleDrift linear infinite;
}

@keyframes bubbleDrift {
    0% { transform: translate(0, 0); }
    25% { transform: translate(30px, -20px); }
    50% { transform: translate(-15px, -40px); }
    75% { transform: translate(-30px, -10px); }
    100% { transform: translate(0, 0); }
}

/* Logotype */
.hero-logotype {
    position: absolute;
    top: 8vh;
    right: 8vw;
    z-index: 10;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.hero-logotype.visible {
    opacity: 1;
    transform: translateX(0);
}

.logotype-text {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(20px, 2.5vw, 36px);
    letter-spacing: 0.02em;
    color: #2A2030;
    text-shadow: 0 0 30px rgba(107, 95, 208, 0.15);
}

/* Central character area */
.hero-character-area {
    position: relative;
    width: 40vw;
    height: 40vw;
    max-width: 500px;
    max-height: 500px;
    min-width: 280px;
    min-height: 280px;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-lines-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.connection-line {
    stroke: #6B5FD0;
    stroke-width: 1;
    opacity: 0;
    stroke-dasharray: 400;
    stroke-dashoffset: 400;
    transition: stroke-dashoffset 0.6s ease, opacity 0.4s ease;
}

.connection-line.drawn {
    stroke-dashoffset: 0;
    opacity: 0.4;
}

/* Jamo pieces */
.jamo-piece {
    position: absolute;
    font-family: 'Noto Serif KR', serif;
    font-weight: 700;
    font-size: clamp(40px, 8vw, 90px);
    z-index: 3;
    opacity: 0;
    transition: transform 2s cubic-bezier(0.175, 0.885, 0.32, 1.275),
                opacity 0.4s ease;
    will-change: transform, opacity;
}

.jamo-piece.assembled {
    opacity: 1;
}

.jamo-piece.glow-active {
    text-shadow: 0 0 30px currentColor;
}

.jamo-consonant {
    color: #6B5FD0;
}

.jamo-vowel {
    color: #E06B8F;
}

/* Assembled character */
.assembled-character {
    position: absolute;
    font-family: 'Noto Serif KR', serif;
    font-weight: 700;
    font-size: clamp(120px, 25vw, 300px);
    background: linear-gradient(135deg, #6B5FD0, #9B8FE0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0;
    z-index: 2;
    transition: opacity 0.6s ease;
    filter: drop-shadow(0 0 40px rgba(107, 95, 208, 0.3));
}

.assembled-character.visible {
    opacity: 0.3;
}

/* Glitch effect */
@keyframes glitchShift {
    0% { clip-path: inset(0 0 0 0); transform: translateX(0); }
    20% { clip-path: inset(10% 0 60% 0); transform: translateX(-3px); }
    40% { clip-path: inset(40% 0 20% 0); transform: translateX(3px); }
    60% { clip-path: inset(70% 0 5% 0); transform: translateX(-2px); }
    80% { clip-path: inset(20% 0 40% 0); transform: translateX(2px); }
    100% { clip-path: inset(0 0 0 0); transform: translateX(0); }
}

.glitch-active {
    animation: glitchShift 0.15s steps(2) 1;
}

/* Scroll hint */
.scroll-hint {
    position: absolute;
    bottom: 4vh;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    text-align: center;
    opacity: 0;
    transition: opacity 1s ease 3s;
}

.scroll-hint.visible {
    opacity: 0.6;
}

.scroll-hint-text {
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 12px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #2A2030;
    display: block;
    margin-bottom: 6px;
}

.scroll-hint-arrow {
    font-size: 18px;
    color: #6B5FD0;
    animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
}

/* ============================================================
   SECTION 2: Jamo Explanation
   ============================================================ */
.section-jamo {
    position: relative;
    background: linear-gradient(180deg, #F0E0D0 0%, #FFF5EB 100%);
    padding: 10vh 5vw;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.jamo-section-inner {
    display: flex;
    gap: 5%;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.jamo-left-column {
    flex: 0 0 35%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3vh;
}

.jamo-stack-item {
    font-family: 'Noto Serif KR', serif;
    font-weight: 700;
    font-size: clamp(36px, 5vw, 72px);
    animation: glowPulse 3s ease-in-out infinite;
    cursor: default;
    transition: transform 0.3s ease;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.jamo-stack-item.in-view {
    opacity: 1;
    transform: translateY(0);
}

.jamo-right-column {
    flex: 0 0 60%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.jamo-right-column .section-title {
    margin-bottom: 1.5em;
}

.inline-jamo {
    font-family: 'Noto Serif KR', serif;
    font-weight: 700;
    font-size: 1.1em;
    display: inline;
}

/* ============================================================
   SECTION 3: Constellation
   ============================================================ */
.section-constellation {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    background: #2A2540;
    overflow: hidden;
}

.constellation-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.constellation-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 6vh;
    pointer-events: none;
}

.constellation-title {
    color: #E8E0F0;
    text-shadow: 0 0 30px rgba(107, 95, 208, 0.4);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.constellation-title.in-view {
    opacity: 1;
    transform: translateY(0);
}

.constellation-subtitle {
    font-family: 'Noto Sans KR', sans-serif;
    font-size: clamp(13px, 1vw, 16px);
    color: #E8E0F0;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.8s ease 0.3s, transform 0.8s ease 0.3s;
    margin-top: 1em;
}

.constellation-subtitle.in-view {
    opacity: 0.6;
    transform: translateY(0);
}

/* ============================================================
   SECTION 4: Timeline
   ============================================================ */
.section-timeline {
    position: relative;
    background: linear-gradient(180deg, #FFF5EB 0%, #F0E0D0 50%, #FFF5EB 100%);
    padding: 12vh 5vw;
    min-height: 100vh;
}

.timeline-heading {
    text-align: center;
    margin-bottom: 8vh;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.timeline-heading.in-view {
    opacity: 1;
    transform: translateY(0);
}

.timeline-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 3vw;
    max-width: 1200px;
    margin: 0 auto;
    justify-content: center;
}

.timeline-card {
    position: relative;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(107, 95, 208, 0.15);
    border-radius: 16px;
    padding: 3em 2.5em;
    width: clamp(280px, 30%, 360px);
    box-shadow: 0 8px 40px rgba(42, 37, 64, 0.06);
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s ease, transform 0.7s ease, box-shadow 0.3s ease;
}

.timeline-card.in-view {
    opacity: 1;
    transform: translateY(0);
}

.timeline-card:hover {
    box-shadow: 0 12px 50px rgba(107, 95, 208, 0.15);
}

/* Asymmetric card offsets */
.card-offset-1 { margin-top: 0; }
.card-offset-2 { margin-top: 5vh; }
.card-offset-3 { margin-top: -2vh; }
.card-offset-4 { margin-top: 7vh; }
.card-offset-5 { margin-top: 1vh; }
.card-offset-6 { margin-top: 4vh; }

.card-date {
    display: block;
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(14px, 1.2vw, 18px);
    color: #6B5FD0;
    letter-spacing: 0.1em;
    margin-bottom: 0.5em;
}

.card-char {
    display: block;
    font-family: 'Noto Serif KR', serif;
    font-weight: 700;
    font-size: clamp(48px, 5vw, 72px);
    margin-bottom: 0.3em;
    animation: glowPulse 3s ease-in-out infinite;
}

.card-desc {
    font-family: 'Noto Sans KR', sans-serif;
    font-size: clamp(13px, 0.95vw, 15px);
    line-height: 1.8;
    color: #2A2030;
}

/* ============================================================
   FOOTER: Vowel Bar
   ============================================================ */
.section-footer {
    position: relative;
    background: #2A2540;
    padding: 6vh 5vw;
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-vowels {
    display: flex;
    gap: clamp(24px, 5vw, 80px);
    align-items: center;
}

.footer-vowel {
    font-family: 'Noto Serif KR', serif;
    font-weight: 700;
    font-size: clamp(24px, 3vw, 48px);
    color: #E8E0F0;
    text-shadow: 0 4px 20px rgba(107, 95, 208, 0.4);
    cursor: pointer;
    transition: color 0.3s ease, text-shadow 0.3s ease, transform 0.3s ease;
    position: relative;
}

.footer-vowel::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 3px;
    background: #6B5FD0;
    border-radius: 2px;
    box-shadow: 0 0 12px rgba(107, 95, 208, 0.6);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.footer-vowel:hover {
    color: #9B8FE0;
    text-shadow: 0 4px 30px rgba(155, 143, 224, 0.6);
    transform: translateY(-4px);
}

.footer-vowel:hover::after {
    opacity: 1;
}

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

    .jamo-left-column {
        flex: none;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 2vh 4vw;
    }

    .jamo-right-column {
        flex: none;
    }

    .timeline-cards {
        flex-direction: column;
        align-items: center;
    }

    .timeline-card {
        width: 90%;
        max-width: 400px;
    }

    .card-offset-1,
    .card-offset-2,
    .card-offset-3,
    .card-offset-4,
    .card-offset-5,
    .card-offset-6 {
        margin-top: 0;
    }

    .hero-character-area {
        width: 70vw;
        height: 70vw;
    }
}
