/* hangul.day - Typographic Reliquary */

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

:root {
    --warm-parchment: #F4F1EB;
    --limestone: #EBE6DE;
    --lacquered-dark: #3A3530;
    --weathered-bronze: #8B7D6B;
    --celadon-gold: #B8860B;
    --kiln-ash: #A69B8C;
    --aged-linen: #D4CDC3;
    --patina: #C8BFB2;
    --muted-body: #5C554D;
}

body {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 300;
    background-color: var(--warm-parchment);
    color: var(--muted-body);
    overflow-x: hidden;
    line-height: 1.85;
    font-size: clamp(0.875rem, 1.1vw, 1.05rem);
}

/* Noise Layer */
.noise-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

/* ==================== OPENING FRAME ==================== */
.opening-frame {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-right: 15%;
    background: var(--warm-parchment);
}

.monumental-char {
    width: clamp(250px, 40vw, 500px);
    height: clamp(250px, 40vw, 500px);
}

.jamo-assembly {
    width: 100%;
    height: 100%;
}

.jamo-stroke {
    font-family: 'Noto Serif KR', serif;
    font-weight: 900;
    font-size: 120px;
    fill: var(--lacquered-dark);
}

.jamo-shadow {
    font-family: 'Noto Serif KR', serif;
    font-weight: 900;
    font-size: 120px;
    fill: var(--aged-linen);
}

.jamo-part {
    transition: opacity 1.2s cubic-bezier(0.25, 0.1, 0.25, 1), transform 1.2s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.jamo-part.assembled {
    opacity: 1 !important;
    transform: translate(0, 0) !important;
}

/* ==================== SPECIMEN ZONE ==================== */
.specimen-zone {
    background: var(--limestone);
    padding: 80px clamp(20px, 5vw, 80px);
    display: grid;
    grid-template-columns: 1fr 1.618fr 1fr;
    row-gap: clamp(2rem, 4vw, 5rem);
    column-gap: clamp(1rem, 2vw, 3rem);
    max-width: 1200px;
    margin: 0 auto;
}

.breath-rule {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    padding: 4vh 0;
}

.breath-rule hr {
    width: 40%;
    border: none;
    border-top: 1px solid var(--aged-linen);
}

.span-1 {
    grid-column: span 1;
}

.span-golden {
    grid-column: 2 / 3;
}

.span-2 {
    grid-column: span 2;
}

.tall {
    grid-row: span 2;
}

/* Specimen Card */
.specimen-card {
    background: var(--warm-parchment);
    border: 1px solid var(--patina);
    box-shadow: 0 2px 12px rgba(107, 96, 81, 0.08);
    padding: clamp(2rem, 3vw, 4rem);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 200px;
    transition: border-color 0.3s ease;
    cursor: default;
}

.specimen-card:hover {
    border-color: var(--celadon-gold);
}

/* Hover construction grid */
.specimen-card::after {
    content: '';
    position: absolute;
    inset: 8px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    border: 1px solid rgba(212, 205, 195, 0.2);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(212,205,195,0.2) 1px, transparent 1px),
        linear-gradient(90deg, rgba(212,205,195,0.2) 1px, transparent 1px);
    background-size: 50% 50%;
}

.specimen-card:hover::after {
    opacity: 1;
}

/* Skeleton Bars */
.skeleton-bars {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    position: absolute;
    inset: 0;
    justify-content: center;
    padding: 2rem;
    transition: opacity 0.4s ease;
}

.skel-bar {
    height: 8px;
    background: var(--aged-linen);
    border-radius: 2px;
    width: 50%;
}

.circle-skel {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.specimen-card.revealed .skeleton-bars {
    opacity: 0;
}

/* Specimen Content */
.specimen-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    transition: opacity 0.6s ease 0.3s;
    position: relative;
    z-index: 2;
}

.specimen-card.revealed .specimen-content {
    opacity: 1;
}

.specimen-jamo {
    font-family: 'Noto Serif KR', serif;
    font-weight: 900;
    font-size: clamp(4rem, 8vw, 10rem);
    color: var(--lacquered-dark);
    line-height: 1;
    position: relative;
}

/* Duotone emboss */
.specimen-jamo::before {
    content: attr(data-jamo);
    position: absolute;
    left: 3px;
    top: 3px;
    color: var(--aged-linen);
    z-index: -1;
}

.specimen-label {
    font-family: 'EB Garamond', serif;
    font-style: italic;
    font-size: 0.8rem;
    color: var(--kiln-ash);
    margin-top: 12px;
    letter-spacing: 0.08em;
}

/* ==================== TERMINAL FRAME ==================== */
.terminal-frame {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--warm-parchment);
    padding: 60px 20px;
}

.domain-mark {
    font-family: 'EB Garamond', serif;
    font-weight: 400;
    font-size: 1rem;
    color: var(--weathered-bronze);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    margin-top: 40px;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .specimen-zone {
        grid-template-columns: 1fr;
    }

    .span-golden,
    .span-2 {
        grid-column: 1;
    }

    .tall {
        grid-row: span 1;
    }

    .opening-frame {
        padding-right: 0;
        padding: 0 20px;
    }

    .specimen-jamo {
        font-size: clamp(3rem, 15vw, 6rem);
    }
}
