/* hangul.name - Art Deco Hangul Specimen Cabinet */

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

:root {
    --brass: #c9a84c;
    --dark: #2c2825;
    --blush: #e8c4b8;
    --tan: #b8a98e;
    --frost: #d4dfe8;
    --cream: #f0ece4;
    --slate: #3d4a5c;
}

body {
    background-color: var(--cream);
    color: var(--dark);
    font-family: 'Roboto Slab', serif;
    font-weight: 300;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Grain overlay */
.grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    transition: opacity 600ms ease;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.4'/%3E%3C/svg%3E");
}

.grain-overlay.visible {
    opacity: 0.04;
}

/* Opening screen */
.opening-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--cream);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 800ms ease;
}

.opening-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

.opening-jamo {
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 800ms ease, transform 800ms ease;
}

.opening-jamo.visible {
    opacity: 1;
    transform: scale(1);
}

.jamo-reveal {
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    transition: stroke-dashoffset 1.5s ease;
}

.jamo-reveal.drawn {
    stroke-dashoffset: 0;
}

.opening-subtitle {
    font-family: 'Noto Serif KR', serif;
    font-size: 1.2rem;
    color: var(--tan);
    margin-top: 1.5rem;
    opacity: 0;
    transition: opacity 600ms ease 1s;
}

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

/* Side navigation */
.side-nav {
    position: fixed;
    left: 0;
    top: 0;
    width: 240px;
    height: 100vh;
    background: var(--dark);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    z-index: 100;
    border-right: 1px solid var(--brass);
    transform: translateX(-100%);
    transition: transform 600ms ease;
}

.side-nav.visible {
    transform: translateX(0);
}

.nav-header {
    margin-bottom: 3rem;
}

.nav-title {
    font-family: 'Zilla Slab', serif;
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--cream);
    letter-spacing: 0.04em;
}

.nav-title .dot {
    color: var(--brass);
}

.nav-links {
    list-style: none;
    flex: 1;
}

.nav-links li {
    margin-bottom: 1rem;
}

.nav-link {
    font-family: 'Roboto Slab', serif;
    font-weight: 300;
    font-size: 0.85rem;
    color: var(--tan);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.5rem 0;
    display: block;
    border-left: 2px solid transparent;
    padding-left: 1rem;
    transition: color 300ms ease, border-color 300ms ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--brass);
    border-left-color: var(--brass);
}

.nav-deco {
    margin-top: auto;
    opacity: 0.6;
}

/* Main content */
.main-content {
    margin-left: 240px;
    padding: 3rem 4rem;
    opacity: 0;
    transition: opacity 600ms ease;
}

.main-content.visible {
    opacity: 1;
}

.section {
    margin-bottom: 6rem;
}

.section-title {
    font-family: 'Zilla Slab', serif;
    font-weight: 700;
    font-size: clamp(2.8rem, 6vw, 5.5rem);
    letter-spacing: 0.04em;
    line-height: 1.1;
    color: var(--dark);
    margin-bottom: 2.5rem;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 2px;
    background: var(--brass);
    margin-top: 1rem;
}

/* Specimen grid */
.specimen-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.specimen-card {
    background: white;
    border: 1px solid var(--tan);
    padding: 2rem;
    position: relative;
    transition: transform 300ms ease, box-shadow 300ms ease;
}

.specimen-card::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    right: -8px;
    bottom: -8px;
    border: 1px solid var(--brass);
    opacity: 0.3;
    z-index: -1;
}

.specimen-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(44, 40, 37, 0.1);
}

.specimen-frame {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.specimen-svg {
    width: 100%;
    max-width: 200px;
    height: auto;
}

.specimen-label {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-top: 1px solid var(--tan);
    padding-top: 1rem;
    margin-top: 1rem;
}

.specimen-name {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 1rem;
    color: var(--slate);
}

.specimen-romanize {
    font-family: 'Roboto Slab', serif;
    font-size: 0.8rem;
    color: var(--tan);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Construction section */
.construction-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2.5rem;
}

.construction-panel {
    background: white;
    border: 1px solid var(--tan);
    padding: 2.5rem;
}

.panel-title {
    font-family: 'Zilla Slab', serif;
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--slate);
    margin-bottom: 1rem;
}

.panel-text {
    font-size: 0.95rem;
    color: var(--dark);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.construction-diagram {
    border: 1px solid rgba(184, 169, 142, 0.3);
    background: var(--cream);
    padding: 1rem;
}

.diagram-svg {
    width: 100%;
    height: auto;
}

/* Syllable section */
.syllable-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.syllable-card {
    background: var(--dark);
    padding: 2.5rem 1.5rem;
    text-align: center;
    border: 1px solid var(--brass);
    position: relative;
    overflow: hidden;
}

.syllable-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--brass), transparent);
}

.syllable-char {
    font-family: 'Noto Serif KR', serif;
    font-size: 4rem;
    color: var(--cream);
    margin-bottom: 1rem;
}

.syllable-breakdown {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
}

.jamo-part {
    font-family: 'Noto Serif KR', serif;
    font-size: 1.2rem;
    padding: 0.2rem 0.5rem;
    border-radius: 2px;
}

.jamo-part.initial {
    color: var(--brass);
    border-bottom: 1px solid var(--brass);
}

.jamo-part.medial {
    color: var(--blush);
    border-bottom: 1px solid var(--blush);
}

.jamo-part.final {
    color: var(--frost);
    border-bottom: 1px solid var(--frost);
}

.syllable-romanize {
    font-family: 'Roboto Slab', serif;
    font-size: 0.8rem;
    color: var(--tan);
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.section-note {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 1rem;
    color: var(--slate);
    max-width: 700px;
    line-height: 1.8;
}

/* History timeline */
.history-timeline {
    position: relative;
    padding-left: 3rem;
}

.history-timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--brass);
}

.timeline-item {
    position: relative;
    margin-bottom: 3rem;
    padding-left: 2rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -3.35rem;
    top: 0.5rem;
    width: 8px;
    height: 8px;
    background: var(--brass);
    transform: rotate(45deg);
}

.timeline-year {
    font-family: 'Zilla Slab', serif;
    font-weight: 700;
    font-size: 1.8rem;
    color: var(--brass);
    margin-bottom: 0.3rem;
}

.timeline-content h3 {
    font-family: 'Zilla Slab', serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.timeline-content p {
    font-size: 0.95rem;
    color: var(--slate);
    line-height: 1.7;
    max-width: 600px;
}

/* Deco corner elements */
.specimen-card::after {
    content: '';
    position: absolute;
    top: 6px;
    right: 6px;
    width: 20px;
    height: 20px;
    border-top: 1px solid var(--brass);
    border-right: 1px solid var(--brass);
}

/* Responsive */
@media (max-width: 768px) {
    .side-nav {
        width: 200px;
    }

    .main-content {
        margin-left: 200px;
        padding: 2rem;
    }

    .construction-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .side-nav {
        display: none;
    }

    .main-content {
        margin-left: 0;
        padding: 1.5rem;
    }
}
