/* hangeul.day — Bauhaus Typographic Aesthetic */
/* Colors: #f5f0e8, #1a1a2e, #3a3a4e, #d4a574, #7ab8a0, #e07850, #f0e6d6 */
/* Fonts: Noto Serif KR (900), Noto Sans KR (400, 700), Space Grotesk (500) */

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: #f5f0e8;
    color: #3a3a4e;
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 400;
    line-height: 1.8;
    overflow-x: hidden;
}

/* Vertical center line */
.center-line {
    position: fixed;
    top: 0;
    left: 50%;
    width: 1px;
    height: 100vh;
    background-color: rgba(212, 165, 116, 0.3);
    z-index: 1;
    pointer-events: none;
}

/* Vowel navigation */
.vowel-nav {
    position: fixed;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 24px;
    z-index: 100;
}

.vowel-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    text-decoration: none;
    font-family: 'Noto Serif KR', serif;
    font-weight: 900;
    font-size: 20px;
    color: #d4a574;
    transition: transform 0.3s ease, color 0.3s ease;
    position: relative;
}

.vowel-link:hover {
    transform: scale(1.3);
    color: #e07850;
}

.vowel-link:hover::after {
    content: attr(data-name);
    position: absolute;
    right: 48px;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 12px;
    color: #d4a574;
    white-space: nowrap;
    letter-spacing: 0.03em;
}

/* Syllable sections */
.syllable-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 48px 24px;
}

.section-inner {
    width: 100%;
    max-width: min(100vw, 100vh);
    margin: 0 auto;
}

.dark-section {
    background-color: #1a1a2e;
    color: #f0e6d6;
}

/* Section grid */
.section-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
}

.grid-header {
    text-align: center;
}

.section-label {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 14px;
    letter-spacing: 0.03em;
    color: #d4a574;
    text-transform: uppercase;
    display: block;
    margin-bottom: 12px;
}

.section-title {
    font-family: 'Noto Serif KR', serif;
    font-weight: 900;
    font-size: 64px;
    color: #1a1a2e;
    line-height: 1.2;
}

.dark-section .section-title {
    color: #f0e6d6;
}

/* ======================== */
/* SECTION 1: Opening       */
/* ======================== */
.opening-section {
    min-height: 100vh;
}

.opening-animation {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
}

#elemental-strokes {
    opacity: 0;
}

#elemental-strokes line {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
}

#elemental-strokes.animate line {
    animation: drawStroke 600ms ease-out forwards;
}

#elemental-strokes.animate #stroke-heaven {
    animation-delay: 0ms;
}

#elemental-strokes.animate #stroke-earth {
    animation-delay: 900ms;
}

#elemental-strokes.animate #stroke-human {
    animation-delay: 1800ms;
}

@keyframes drawStroke {
    to {
        stroke-dashoffset: 0;
    }
}

.opening-character {
    font-family: 'Noto Serif KR', serif;
    font-weight: 900;
    font-size: 80px;
    color: #1a1a2e;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 800ms ease, transform 800ms ease;
}

.opening-character.visible {
    opacity: 1;
    transform: translateY(0);
}

.opening-subtitle {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 16px;
    letter-spacing: 0.03em;
    color: #d4a574;
    opacity: 0;
    transition: opacity 800ms ease 400ms;
}

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

/* ======================== */
/* SECTION 2: Consonants    */
/* ======================== */
.character-anatomy-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.anatomy-card {
    background: rgba(245, 240, 232, 0.06);
    border: 1px solid rgba(212, 165, 116, 0.2);
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 12px;
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 600ms ease, transform 600ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.anatomy-card.revealed {
    opacity: 1;
    transform: scale(1);
}

.anatomy-display {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto;
}

.anatomy-char {
    font-family: 'Noto Serif KR', serif;
    font-weight: 900;
    font-size: 80px;
    color: #f0e6d6;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    line-height: 1;
}

.construction-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0;
    transition: opacity 600ms ease;
}

.anatomy-card.revealed .construction-lines {
    opacity: 0.4;
}

.construction-lines line,
.construction-lines rect,
.construction-lines circle {
    stroke: #d4a574;
    stroke-width: 1;
    fill: none;
}

.anatomy-label {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 13px;
    color: #d4a574;
    letter-spacing: 0.03em;
}

.anatomy-desc {
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 400;
    font-size: 13px;
    color: rgba(240, 230, 214, 0.7);
    line-height: 1.5;
}

/* ======================== */
/* SECTION 3: Syllable Blocks */
/* ======================== */
.block-demo-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

.block-examples {
    display: flex;
    gap: 48px;
    justify-content: center;
    flex-wrap: wrap;
}

.block-example {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.block-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    width: 140px;
    height: 140px;
    border: 2px solid rgba(212, 165, 116, 0.3);
    border-radius: 8px;
    padding: 4px;
}

.block-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(212, 165, 116, 0.08);
    border-radius: 4px;
    position: relative;
    opacity: 0;
    transition: opacity 300ms ease-out, transform 300ms ease-out;
}

.block-cell.animate-in {
    opacity: 1;
}

.block-cell.initial {
    transform: translateX(-20px);
}

.block-cell.initial.animate-in {
    transform: translateX(0);
}

.block-cell.medial {
    transform: translateX(20px);
}

.block-cell.medial.animate-in {
    transform: translateX(0);
}

.block-cell.final {
    transform: translateY(20px);
}

.block-cell.final.animate-in {
    transform: translateY(0);
}

.block-cell.full-width {
    grid-column: span 2;
}

.block-cell span:first-child {
    font-family: 'Noto Serif KR', serif;
    font-weight: 900;
    font-size: 28px;
    color: #1a1a2e;
}

.cell-label {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 9px;
    color: #d4a574;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.block-result {
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 400ms ease 600ms, transform 400ms cubic-bezier(0.34, 1.56, 0.64, 1) 600ms;
}

.block-result.animate-in {
    opacity: 1;
    transform: scale(1);
}

.result-char {
    font-family: 'Noto Serif KR', serif;
    font-weight: 900;
    font-size: 64px;
    color: #1a1a2e;
}

.block-explanation {
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 400;
    font-size: 16px;
    color: #3a3a4e;
    max-width: 600px;
    text-align: center;
    line-height: 1.8;
}

/* ======================== */
/* SECTION 4: Composer      */
/* ======================== */
.composer-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
}

.composer-result {
    width: 160px;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(212, 165, 116, 0.4);
    border-radius: 8px;
    background: rgba(245, 240, 232, 0.05);
}

.composed-character {
    font-family: 'Noto Serif KR', serif;
    font-weight: 900;
    font-size: 120px;
    color: #f0e6d6;
    line-height: 1;
    transition: transform 400ms cubic-bezier(0.34, 1.56, 0.64, 1), opacity 200ms ease;
}

.composed-character.updating {
    transform: scale(0.8);
    opacity: 0.5;
}

.jamo-rows {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 700px;
}

.jamo-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.row-label {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 13px;
    color: #d4a574;
    letter-spacing: 0.03em;
}

.jamo-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.jamo-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(212, 165, 116, 0.3);
    border-radius: 4px;
    background: rgba(245, 240, 232, 0.05);
    color: #f0e6d6;
    font-family: 'Noto Serif KR', serif;
    font-weight: 900;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.jamo-btn:hover {
    background: rgba(212, 165, 116, 0.15);
    border-color: #d4a574;
    transform: scale(1.1);
}

.jamo-btn.selected {
    background: #d4a574;
    color: #1a1a2e;
    border-color: #d4a574;
    transform: scale(1.1);
}

.composer-hint {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
    font-size: 13px;
    color: rgba(240, 230, 214, 0.5);
    letter-spacing: 0.03em;
}

/* ======================== */
/* SECTION 5: Story         */
/* ======================== */
.story-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 48px;
    max-width: 640px;
    margin: 0 auto;
}

.story-block {
    position: relative;
    padding-left: 80px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 600ms ease, transform 600ms ease;
}

.story-block.revealed {
    opacity: 1;
    transform: translateY(0);
}

.story-year {
    position: absolute;
    left: 0;
    top: 0;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 14px;
    color: #e07850;
    letter-spacing: 0.03em;
}

.story-heading {
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 700;
    font-size: 20px;
    color: #1a1a2e;
    margin-bottom: 8px;
}

.story-text {
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 400;
    font-size: 16px;
    color: #3a3a4e;
    line-height: 1.8;
}

.story-featured-char {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 48px;
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 600ms ease, transform 600ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.story-featured-char.revealed {
    opacity: 1;
    transform: scale(1);
}

.featured-display {
    font-family: 'Noto Serif KR', serif;
    font-weight: 900;
    font-size: 120px;
    color: #1a1a2e;
    line-height: 1;
}

.featured-label {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 14px;
    color: #d4a574;
    letter-spacing: 0.03em;
}

/* ======================== */
/* Ink wash background      */
/* ======================== */
.dark-section::before {
    content: '';
    position: absolute;
    top: 20%;
    left: 30%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(26, 26, 46, 0.6) 0%, transparent 70%);
    pointer-events: none;
    opacity: 0.4;
}

/* ======================== */
/* Footer                   */
/* ======================== */
.site-footer {
    background: #1a1a2e;
    padding: 32px;
    text-align: center;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.footer-char {
    font-family: 'Noto Serif KR', serif;
    font-weight: 900;
    font-size: 24px;
    color: #7ab8a0;
}

.footer-text {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 13px;
    color: rgba(240, 230, 214, 0.5);
    letter-spacing: 0.03em;
}

/* ======================== */
/* Responsive (mobile)      */
/* ======================== */
@media (max-width: 768px) {
    .center-line {
        display: none;
    }

    .vowel-nav {
        position: fixed;
        right: auto;
        left: 0;
        top: auto;
        bottom: 0;
        transform: none;
        flex-direction: row;
        width: 100%;
        justify-content: space-around;
        background: rgba(26, 26, 46, 0.95);
        padding: 8px 0;
        gap: 0;
    }

    .vowel-link {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .vowel-link:hover::after {
        display: none;
    }

    .section-title {
        font-size: 40px;
    }

    .opening-character {
        font-size: 56px;
    }

    .character-anatomy-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .anatomy-char {
        font-size: 56px;
    }

    .block-examples {
        flex-direction: column;
        align-items: center;
        gap: 32px;
    }

    .composed-character {
        font-size: 80px;
    }

    .jamo-btn {
        width: 38px;
        height: 38px;
        font-size: 15px;
    }

    .featured-display {
        font-size: 80px;
    }

    .story-block {
        padding-left: 60px;
    }
}
