/* hangul.name - Design Language Styles */
/* Palette: Ocean Deep */
:root {
    --abyss: #061520;
    --midnight: #0a2e4a;
    --teal: #0d7377;
    --phosphor: #4fc3f7;
    --seafoam: #b8d4e8;
    --moonlit: #e0f0ff;
    --sediment: #3d2b1f;
    --coral: #c45e3a;
    --secondary-text: #7a9ab5;
    --pixel-size: 6px;
}

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

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

body {
    background-color: var(--abyss);
    color: var(--seafoam);
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: clamp(16px, 1.2vw, 20px);
    line-height: 1.75;
    letter-spacing: 0.01em;
    overflow-x: hidden;
    position: relative;
}

/* Grid Substrate */
.grid-substrate {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background-image:
        linear-gradient(to right, rgba(10, 46, 74, 0.15) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(10, 46, 74, 0.15) 1px, transparent 1px);
    background-size: calc(100% / 14) calc(100% / 14);
}

/* Sediment Particles */
.sediment-field {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.sediment-particle {
    position: absolute;
    background: var(--sediment);
    opacity: 0.25;
    animation: sedimentDrift linear infinite;
}

@keyframes sedimentDrift {
    0% { transform: translateY(-20px) translateX(0); }
    50% { transform: translateY(50vh) translateX(15px); }
    100% { transform: translateY(110vh) translateX(-10px); }
}

/* Compass Rose Navigation */
.compass-rose {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.compass-icon {
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.compass-pixel {
    width: 0;
    height: 0;
    box-shadow:
        0px -12px 0 3px var(--phosphor),
        0px 12px 0 3px var(--phosphor),
        -12px 0px 0 3px var(--phosphor),
        12px 0px 0 3px var(--phosphor),
        -8px -8px 0 2px var(--teal),
        8px -8px 0 2px var(--teal),
        -8px 8px 0 2px var(--teal),
        8px 8px 0 2px var(--teal),
        0px 0px 0 2px var(--moonlit);
}

.compass-menu {
    display: none;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.75rem;
    background: rgba(6, 21, 32, 0.95);
    border: 1px solid var(--teal);
    padding: 0.75rem 1rem;
}

.compass-rose.active .compass-menu {
    display: flex;
}

.compass-link {
    font-family: 'Press Start 2P', cursive;
    font-size: 10px;
    color: var(--phosphor);
    text-decoration: none;
    padding: 0.3rem 0;
    transition: color 0.3s;
    white-space: nowrap;
}

.compass-link:hover {
    color: var(--moonlit);
}

/* Sections */
.section {
    position: relative;
    z-index: 2;
}

/* Hero Section */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.hero-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.domain-name {
    font-family: 'Silkscreen', cursive;
    font-size: clamp(28px, 5vw, 64px);
    color: var(--moonlit);
    letter-spacing: 0.06em;
    line-height: 1.2;
}

.hero-tagline {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: clamp(16px, 2vw, 24px);
    color: var(--seafoam);
    opacity: 0;
    transition: opacity 1.5s ease;
    font-weight: 300;
    letter-spacing: 0.04em;
}

.hero-tagline.visible {
    opacity: 1;
}

.pixel-han-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: clamp(200px, 50vw, 400px);
    height: clamp(200px, 50vw, 400px);
    position: relative;
}

.pixel-han {
    width: 0;
    height: 0;
    position: relative;
}

/* Depth Bands */
.depth-band {
    height: 4px;
    background: linear-gradient(to right, var(--abyss), var(--midnight), var(--teal), var(--midnight), var(--abyss));
    position: relative;
    z-index: 2;
}

/* Narrative Sections */
.narrative-section {
    min-height: 80vh;
    display: flex;
    align-items: center;
    padding: 4rem 2rem;
}

.section-inner {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.f-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.text-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.section-title {
    font-family: 'Silkscreen', cursive;
    font-size: clamp(24px, 4vw, 48px);
    color: var(--moonlit);
    letter-spacing: 0.06em;
    line-height: 1.2;
    text-transform: uppercase;
}

.body-text {
    color: var(--seafoam);
    line-height: 1.75;
    font-weight: 400;
}

.body-text.secondary {
    color: var(--secondary-text);
    opacity: 1;
    font-style: italic;
}

/* Reveal animations */
.text-column,
.illustration-column {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.text-column.revealed,
.illustration-column.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Constellation SVG */
.constellation-svg {
    width: 100%;
    max-width: 300px;
    height: auto;
    margin: 0 auto;
    display: block;
}

.cosmo-line {
    stroke: var(--teal);
    stroke-width: 2;
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
    transition: stroke-dashoffset 2s ease;
    opacity: 0.8;
}

.cosmo-line.drawn {
    stroke-dashoffset: 0;
}

.cosmo-line.pulsing {
    animation: linePulse 12s ease-in-out infinite;
}

@keyframes linePulse {
    0%, 100% { stroke: var(--teal); opacity: 0.6; }
    50% { stroke: var(--phosphor); opacity: 1; }
}

.cosmo-point {
    fill: var(--phosphor);
    opacity: 0;
    transition: opacity 0.5s ease 2s;
}

.cosmo-point.visible {
    opacity: 1;
}

.heaven-point { fill: var(--phosphor); }
.earth-point { fill: var(--teal); }
.human-point { fill: var(--coral); }

.cosmo-label-text {
    font-family: 'Silkscreen', cursive;
    font-size: 18px;
    fill: var(--moonlit);
    text-anchor: middle;
    opacity: 0;
    transition: opacity 0.5s ease 2.5s;
}

.cosmo-label-text.visible {
    opacity: 1;
}

.orbital-jamo {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 14px;
    fill: var(--teal);
    text-anchor: middle;
    opacity: 0;
    transition: opacity 0.5s ease 3s;
}

.orbital-jamo.visible {
    opacity: 0.7;
}

/* Morph Container */
.morph-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.morph-shape {
    width: 180px;
    height: 180px;
    background: var(--phosphor);
    opacity: 0.9;
    clip-path: circle(50% at 50% 50%);
    transition: clip-path 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.morph-shape.circle {
    clip-path: circle(50% at 50% 50%);
}

.morph-shape.square {
    clip-path: polygon(10% 10%, 90% 10%, 90% 90%, 10% 90%);
}

.morph-shape.triangle {
    clip-path: polygon(50% 10%, 90% 90%, 10% 90%);
}

.morph-label {
    font-family: 'Press Start 2P', cursive;
    font-size: 11px;
    color: var(--phosphor);
    text-align: center;
    transition: opacity 0.3s;
    min-height: 2em;
}

/* Syllable Builder */
.syllable-builder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.builder-display {
    width: 180px;
    height: 180px;
    border: 2px solid var(--teal);
    background: rgba(10, 46, 74, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 100px;
    color: var(--moonlit);
    font-family: 'IBM Plex Sans', sans-serif;
}

.builder-controls {
    display: flex;
    gap: 1rem;
}

.jamo-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    cursor: pointer;
    padding: 0.75rem 1rem;
    border: 1px solid var(--midnight);
    background: rgba(10, 46, 74, 0.3);
    transition: border-color 0.3s, background 0.3s;
    user-select: none;
}

.jamo-slot:hover {
    border-color: var(--phosphor);
    background: rgba(13, 115, 119, 0.2);
}

.slot-label {
    font-family: 'Press Start 2P', cursive;
    font-size: 8px;
    color: var(--phosphor);
    text-transform: uppercase;
}

.slot-value {
    font-size: 28px;
    color: var(--moonlit);
    font-family: 'IBM Plex Sans', sans-serif;
}

.builder-result {
    font-size: 48px;
    color: var(--phosphor);
    font-family: 'IBM Plex Sans', sans-serif;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Constellation Footer */
.constellation-section {
    min-height: 80vh;
    padding: 4rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.constellation-header {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    z-index: 3;
}

.constellation-subtitle {
    max-width: 500px;
    margin: 1rem auto 0;
    text-align: center;
    opacity: 0.8;
}

.jamo-field {
    position: relative;
    width: 100%;
    max-width: 1000px;
    height: 400px;
    margin: 0 auto;
}

.jamo-star {
    position: absolute;
    font-family: 'IBM Plex Sans', sans-serif;
    color: var(--teal);
    cursor: default;
    transition: color 0.3s, text-shadow 0.3s, transform 0.3s;
    text-align: center;
}

.jamo-star .jamo-char {
    font-size: 24px;
    display: block;
}

.jamo-star .jamo-info {
    font-family: 'Press Start 2P', cursive;
    font-size: 8px;
    color: var(--phosphor);
    opacity: 0;
    transition: opacity 0.3s;
    white-space: nowrap;
    display: block;
    margin-top: 4px;
}

.jamo-star:hover {
    color: var(--phosphor);
    text-shadow: 0 0 12px rgba(79, 195, 247, 0.6);
    transform: scale(1.3);
}

.jamo-star:hover .jamo-info {
    opacity: 1;
}

.jamo-star.consonant {
    color: var(--phosphor);
    opacity: 0.5;
}

.jamo-star.vowel {
    color: var(--teal);
    opacity: 0.5;
}

.jamo-star:hover.consonant,
.jamo-star:hover.vowel {
    opacity: 1;
}

/* Illustration Column */
.illustration-column {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    :root {
        --pixel-size: 3px;
    }

    .f-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .narrative-section {
        padding: 3rem 1.5rem;
    }

    .compass-rose {
        top: auto;
        bottom: 0;
        right: 0;
        left: 0;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        background: rgba(6, 21, 32, 0.97);
        padding: 0.5rem;
        border-top: 1px solid var(--teal);
    }

    .compass-icon {
        width: 30px;
        height: 30px;
    }

    .compass-menu {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        margin-top: 0;
        margin-left: 0.5rem;
        border: none;
        background: none;
        padding: 0;
        gap: 0.5rem;
    }

    .compass-link {
        font-size: 8px;
    }

    .jamo-field {
        height: 300px;
    }

    .morph-shape {
        width: 140px;
        height: 140px;
    }

    .builder-display {
        width: 140px;
        height: 140px;
        font-size: 72px;
    }
}
