/* Color Palette */
:root {
    --color-void-dark: #0D0F1F;
    --color-void-darker: #0A0E1A;
    --color-text-dark: #111827;
    --color-text-light: #E2E8F0;
    --color-accent-blue: #4FC3F7;
    --color-accent-teal: #00BFA5;
    --color-accent-orange: #FFB74D;
    --color-secondary: #334155;
    --color-accent-slate: #94A3B8;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    font-family: 'Share Tech Mono', 'Courier New', monospace;
}

body {
    background-color: var(--color-void-darker);
    color: var(--color-text-light);
    overflow-x: hidden;
    position: relative;
}

/* Noise Overlay */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    background-image:
        url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="256" height="256"><filter id="noise"><feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="4" result="noise"/></filter><rect width="256" height="256" fill="%23000" filter="url(%23noise)"/></svg>');
    background-size: 256px 256px;
    opacity: 0.05;
    animation: grain-shift 120ms infinite;
}

@keyframes grain-shift {
    0% { background-position: 0 0; }
    12.5% { background-position: -20px -20px; }
    25% { background-position: -40px 0; }
    37.5% { background-position: -60px -20px; }
    50% { background-position: -80px 0; }
    62.5% { background-position: -40px -40px; }
    75% { background-position: -20px 0; }
    87.5% { background-position: -60px -60px; }
    100% { background-position: 0 0; }
}

/* Viewport Container */
.viewport-container {
    width: 100%;
    min-height: 100vh;
    background-color: var(--color-void-darker);
}

/* Section Layout */
section {
    display: flex;
    min-height: 100vh;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.void-field {
    flex: 0 0 62%;
    background: linear-gradient(135deg, var(--color-void-dark) 0%, var(--color-void-darker) 100%);
    position: relative;
    opacity: 0.8;
}

.void-field::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-image:
        repeating-linear-gradient(
            0deg,
            rgba(79, 195, 247, 0.03) 0px,
            rgba(79, 195, 247, 0.03) 2px,
            transparent 2px,
            transparent 4px
        );
    pointer-events: none;
    animation: flicker 0.15s infinite;
}

@keyframes flicker {
    0%, 100% { opacity: 0.95; }
    50% { opacity: 1; }
}

.void-right {
    order: 2;
    flex: 0 0 38%;
}

.void-left {
    order: 0;
    flex: 0 0 62%;
}

.glyph-field {
    flex: 0 0 38%;
    background: linear-gradient(135deg, rgba(13, 15, 31, 0.95) 0%, rgba(10, 14, 26, 0.98) 100%);
    padding: 4rem 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 10;
    border-left: 1px solid rgba(79, 195, 247, 0.2);
}

/* Reverse order for right void sections */
section:nth-child(even) {
    flex-direction: row-reverse;
}

section:nth-child(even) .glyph-field {
    border-left: none;
    border-right: 1px solid rgba(79, 195, 247, 0.2);
}

/* Hero Section */
.hero-content {
    width: 100%;
    max-width: 90%;
}

.domain-title {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 700;
    font-family: 'Orbitron', 'Share Tech Mono', monospace;
    letter-spacing: 0.15em;
    color: var(--color-accent-blue);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    animation: title-glow 3s ease-in-out infinite;
}

@keyframes title-glow {
    0%, 100% { text-shadow: 0 0 10px rgba(79, 195, 247, 0.3); }
    50% { text-shadow: 0 0 20px rgba(79, 195, 247, 0.6); }
}

.subtitle {
    font-size: clamp(0.9rem, 1.3vw, 1.1rem);
    color: var(--color-accent-teal);
    margin-bottom: 1.5rem;
    letter-spacing: 0.04em;
    font-weight: 400;
}

.hero-text p {
    font-size: clamp(0.85rem, 1.2vw, 1.05rem);
    line-height: 1.75;
    letter-spacing: 0.06em;
    color: var(--color-text-light);
    max-width: 35rem;
    margin-bottom: 1rem;
}

/* Evolution Section */
.evolution-content {
    width: 100%;
    max-width: 90%;
}

.section-title {
    font-size: clamp(1.3rem, 3vw, 2rem);
    font-weight: 700;
    font-family: 'Orbitron', 'Share Tech Mono', monospace;
    letter-spacing: 0.15em;
    color: var(--color-accent-blue);
    margin-bottom: 2rem;
    text-transform: uppercase;
    text-shadow: 0 0 15px rgba(79, 195, 247, 0.2);
}

.glyph-matrix {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.glyph-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.glyph-hologram {
    width: 120px;
    height: 120px;
    filter: drop-shadow(0 0 15px rgba(79, 195, 247, 0.5));
    animation: float 3s ease-in-out infinite;
}

.glyph-hologram:nth-child(1) {
    animation-delay: 0s;
}

.glyph-hologram:nth-child(2) {
    animation-delay: 0.5s;
}

.glyph-hologram:nth-child(3) {
    animation-delay: 1s;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.hologram-char {
    font-family: 'Noto Sans KR', 'Share Tech Mono', monospace;
    font-size: 60px;
    font-weight: 100;
    fill: var(--color-accent-blue);
    filter: drop-shadow(0 0 8px rgba(0, 191, 165, 0.6));
}

.glyph-label {
    font-size: 0.85rem;
    color: var(--color-accent-slate);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Consonants Section */
.consonants-content {
    width: 100%;
    max-width: 90%;
}

.consonant-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1.5rem;
}

.consonant-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    border: 1px solid rgba(79, 195, 247, 0.3);
    background: linear-gradient(135deg, rgba(79, 195, 247, 0.05), rgba(0, 191, 165, 0.05));
    border-radius: 2px;
    transition: all 0.3s ease;
    gap: 0.5rem;
}

.consonant-item:hover {
    border-color: rgba(79, 195, 247, 0.6);
    background: linear-gradient(135deg, rgba(79, 195, 247, 0.15), rgba(0, 191, 165, 0.1));
    box-shadow: 0 0 15px rgba(79, 195, 247, 0.3);
}

.consonant-glyph {
    font-size: clamp(2rem, 5vw, 2.5rem);
    font-family: 'Noto Sans KR', 'Share Tech Mono', monospace;
    font-weight: 100;
    color: var(--color-accent-blue);
    line-height: 1;
}

.consonant-name {
    font-size: 0.75rem;
    color: var(--color-accent-teal);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Vowels Section */
.vowels-content {
    width: 100%;
    max-width: 90%;
}

.vowel-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1.5rem;
}

.vowel-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    border: 1px solid rgba(0, 191, 165, 0.3);
    background: linear-gradient(135deg, rgba(0, 191, 165, 0.05), rgba(79, 195, 247, 0.05));
    border-radius: 2px;
    transition: all 0.3s ease;
    gap: 0.5rem;
}

.vowel-item:hover {
    border-color: rgba(0, 191, 165, 0.6);
    background: linear-gradient(135deg, rgba(0, 191, 165, 0.15), rgba(79, 195, 247, 0.1));
    box-shadow: 0 0 15px rgba(0, 191, 165, 0.3);
}

.vowel-glyph {
    font-size: clamp(2rem, 5vw, 2.5rem);
    font-family: 'Noto Sans KR', 'Share Tech Mono', monospace;
    font-weight: 100;
    color: var(--color-accent-teal);
    line-height: 1;
}

.vowel-name {
    font-size: 0.75rem;
    color: var(--color-accent-blue);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Synthesis Section */
.synthesis-content {
    width: 100%;
    max-width: 90%;
}

.syllable-showcase {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    align-items: center;
}

.syllable {
    font-size: clamp(2rem, 6vw, 3rem);
    font-family: 'Noto Sans KR', 'Share Tech Mono', monospace;
    font-weight: 300;
    color: var(--color-accent-orange);
    padding: 0.75rem 1.5rem;
    border: 1px solid rgba(255, 183, 77, 0.4);
    background: linear-gradient(135deg, rgba(255, 183, 77, 0.1), rgba(79, 195, 247, 0.05));
    letter-spacing: 0.04em;
    transition: all 0.3s ease;
}

.syllable:hover {
    border-color: rgba(255, 183, 77, 0.7);
    box-shadow: 0 0 15px rgba(255, 183, 77, 0.4);
}

.synthesis-text p {
    font-size: clamp(0.85rem, 1.2vw, 1.05rem);
    line-height: 1.75;
    letter-spacing: 0.06em;
    color: var(--color-text-light);
    max-width: 35rem;
}

/* Coda Section */
.coda-content {
    width: 100%;
    max-width: 90%;
}

.coda-text {
    margin-bottom: 2rem;
}

.coda-text p {
    font-size: clamp(0.85rem, 1.2vw, 1.05rem);
    line-height: 1.75;
    letter-spacing: 0.06em;
    color: var(--color-text-light);
    max-width: 40rem;
    margin-bottom: 1.5rem;
}

.coda-signature {
    text-align: left;
    margin-top: 2rem;
}

.signature {
    font-size: 0.9rem;
    color: var(--color-accent-teal);
    letter-spacing: 0.08em;
    display: inline-block;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.signature:hover {
    opacity: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
    section {
        flex-direction: column-reverse !important;
    }

    section:nth-child(even) {
        flex-direction: column-reverse;
    }

    .void-field {
        flex: 0 0 40%;
        min-height: 25vh;
    }

    .void-right {
        flex: 0 0 40%;
    }

    .void-left {
        flex: 0 0 40%;
    }

    .glyph-field {
        flex: 0 0 60%;
        min-height: 75vh;
        padding: 2rem 1.5rem;
        border: none;
        border-top: 1px solid rgba(79, 195, 247, 0.2);
    }

    section:nth-child(even) .glyph-field {
        border: none;
        border-top: 1px solid rgba(79, 195, 247, 0.2);
    }

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

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

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

    .domain-title {
        font-size: 1.8rem;
    }

    .section-title {
        font-size: 1.4rem;
    }
}

@media (max-width: 480px) {
    .glyph-field {
        padding: 1.5rem 1rem;
    }

    .glyph-matrix {
        grid-template-columns: 1fr;
    }

    .consonant-list {
        grid-template-columns: 1fr;
    }

    .vowel-list {
        grid-template-columns: 1fr;
    }

    .syllable-showcase {
        flex-direction: column;
        gap: 1rem;
    }

    .syllable {
        width: 100%;
        text-align: center;
    }

    .domain-title {
        font-size: 1.5rem;
    }

    .section-title {
        font-size: 1.2rem;
    }
}
