/* =====================================================================
   hangul.dev — a scholar's glass pavilion
   Midnight Ink · Frosted Slate · Moon Silk · Pale Frost
   Candlewick Gold · Jamo Blue · Glass Edge · Candle Bloom
   ===================================================================== */

:root {
    /* exact hex from DESIGN.md */
    --midnight-ink: #0d0f14;
    --frosted-slate: rgba(28, 32, 44, 0.65);
    --moon-silk: #c8cad3;
    --pale-frost: #e8eaf0;
    --candlewick-gold: #c4935a;
    --jamo-blue: #5b7a9e;
    --glass-edge: rgba(255, 255, 255, 0.08);
    --glass-edge-bright: rgba(255, 255, 255, 0.15);
    --candle-bloom: rgba(196, 147, 90, 0.15);
    --candle-bloom-soft: rgba(196, 147, 90, 0.08);

    --deep-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --inset-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    --inset-highlight-bright: inset 0 1px 0 rgba(255, 255, 255, 0.12);

    --font-kor: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
    --font-body: "Josefin Sans", "Inter", sans-serif;
    --font-mono: "IBM Plex Mono", "SF Mono", monospace;

    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-quiet: cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.75;
    color: var(--moon-silk);
    background: var(--midnight-ink);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;

    /* deep atmospheric underlay — cool blue mist pooling at different heights */
    background-image:
        radial-gradient(ellipse 70vw 60vh at 50% 10%, rgba(91, 122, 158, 0.05) 0%, transparent 70%),
        radial-gradient(ellipse 60vw 50vh at 20% 55%, rgba(91, 122, 158, 0.04) 0%, transparent 65%),
        radial-gradient(ellipse 50vw 40vh at 80% 80%, rgba(196, 147, 90, 0.035) 0%, transparent 70%);
    background-attachment: fixed;
}

/* subtle film grain to simulate frosted glass texture */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    opacity: 0.35;
    mix-blend-mode: overlay;
    background-image:
        repeating-linear-gradient(
            0deg,
            rgba(255, 255, 255, 0.01) 0 1px,
            transparent 1px 2px
        ),
        repeating-linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.01) 0 1px,
            transparent 1px 2px
        );
}

/* =====================================================================
   candle cursor — warm glow that follows attention
   ===================================================================== */

.candle-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 420px;
    height: 420px;
    pointer-events: none;
    z-index: 2;
    transform: translate(-50%, -50%);
    background: radial-gradient(
        circle at 50% 50%,
        rgba(196, 147, 90, 0.10) 0%,
        rgba(196, 147, 90, 0.04) 30%,
        transparent 65%
    );
    mix-blend-mode: screen;
    opacity: 0;
    transition: opacity 800ms var(--ease-quiet);
    will-change: transform;
}

.candle-cursor.is-active {
    opacity: 1;
}

/* =====================================================================
   floating hangul particle field (ambient dust-motes)
   ===================================================================== */

.particle-field {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    font-family: var(--font-kor);
    font-weight: 300;
    color: var(--moon-silk);
    line-height: 1;
    user-select: none;
    will-change: transform, opacity;
    filter: blur(0.5px);
}

/* =====================================================================
   navigation strip — 48px frosted glass
   ===================================================================== */

.nav-strip {
    position: sticky;
    top: 0;
    z-index: 100;
    height: 56px;
    backdrop-filter: blur(12px) saturate(140%);
    -webkit-backdrop-filter: blur(12px) saturate(140%);
    background: rgba(13, 15, 20, 0.7);
    border-bottom: 1px solid var(--glass-edge);
    transition: background 400ms var(--ease-quiet);
}

.nav-inner {
    max-width: 1400px;
    margin: 0 auto;
    height: 100%;
    padding: 0 clamp(1rem, 3vw, 2.5rem);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.nav-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 0.95rem;
    letter-spacing: 0.14em;
    text-transform: lowercase;
    color: var(--pale-frost);
    text-decoration: none;
    transition: color 300ms var(--ease-quiet);
}

.nav-brand:hover {
    color: var(--candlewick-gold);
}

.nav-brand-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--candlewick-gold);
    box-shadow: 0 0 12px rgba(196, 147, 90, 0.6);
}

.nav-items {
    list-style: none;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.nav-item {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0;
    padding: 0.4rem 0.7rem;
    border-radius: 10px;
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 0.9rem;
    letter-spacing: 0.08em;
    color: var(--moon-silk);
    text-decoration: none;
    background: transparent;
    border: 1px solid transparent;
    transition: all 400ms var(--ease-quiet);
    overflow: hidden;
    max-width: 2.5rem;
}

.nav-item .jamo {
    font-family: var(--font-kor);
    font-weight: 400;
    font-size: 1.05rem;
    color: var(--pale-frost);
    line-height: 1;
}

.nav-item .nav-label {
    display: inline-block;
    max-width: 0;
    white-space: nowrap;
    overflow: hidden;
    opacity: 0;
    transition: max-width 420ms var(--ease-quiet), opacity 300ms var(--ease-quiet) 80ms, margin 420ms var(--ease-quiet);
    margin-left: 0;
}

.nav-item:hover,
.nav-item:focus-visible {
    max-width: 14rem;
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--glass-edge);
    color: var(--candlewick-gold);
}

.nav-item:hover .jamo,
.nav-item:focus-visible .jamo {
    color: var(--candlewick-gold);
}

.nav-item:hover .nav-label,
.nav-item:focus-visible .nav-label {
    max-width: 10rem;
    opacity: 1;
    margin-left: 0.6rem;
}

/* =====================================================================
   hero — the glass pane
   ===================================================================== */

.hero {
    position: relative;
    min-height: calc(100vh - 56px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem 6rem;
    z-index: 3;
}

.hero-glow {
    position: absolute;
    left: 50%;
    top: 48%;
    transform: translate(-50%, -50%);
    width: min(80vmin, 900px);
    height: min(80vmin, 900px);
    background: radial-gradient(
        circle at 50% 50%,
        rgba(196, 147, 90, 0.18) 0%,
        rgba(196, 147, 90, 0.08) 25%,
        rgba(91, 122, 158, 0.04) 55%,
        transparent 75%
    );
    pointer-events: none;
    filter: blur(4px);
    opacity: 0;
    animation: heroGlow 900ms var(--ease-quiet) 200ms forwards,
        heroGlowBreathe 7s ease-in-out 1100ms infinite;
}

@keyframes heroGlow {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.92);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes heroGlowBreathe {
    0%, 100% { opacity: 0.85; }
    50% { opacity: 1; }
}

.hero-inner {
    position: relative;
    z-index: 2;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.hero-char-wrap {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.hero-char {
    font-family: var(--font-kor);
    font-weight: 300;
    font-size: clamp(8rem, 22vw, 18rem);
    line-height: 0.92;
    color: var(--pale-frost);
    letter-spacing: -0.02em;
    text-shadow:
        0 0 60px rgba(196, 147, 90, 0.15),
        0 0 120px rgba(91, 122, 158, 0.08);
    opacity: 0;
    transform: scale(0.92);
    animation: heroCharEnter 700ms var(--ease-bounce) 700ms forwards;
    will-change: transform, opacity;
}

@keyframes heroCharEnter {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.hero-char-romanized {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 0.75rem;
    letter-spacing: 0.55em;
    text-transform: uppercase;
    color: var(--moon-silk);
    opacity: 0;
    animation: fadeUp 800ms var(--ease-quiet) 1400ms forwards;
    padding-left: 0.55em;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 0.8;
        transform: translateY(0);
    }
}

.hero-label {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.7rem;
    margin-top: 0.5rem;
    opacity: 0;
    animation: fadeUp 800ms var(--ease-quiet) 1200ms forwards;
}

.hero-brand {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 1.1rem;
    letter-spacing: 0.15em;
    color: var(--pale-frost);
    text-transform: lowercase;
}

.hero-divider {
    width: 1px;
    height: 24px;
    background: linear-gradient(180deg, transparent, var(--glass-edge-bright), transparent);
}

.hero-caption {
    font-family: var(--font-body);
    font-weight: 300;
    font-style: italic;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    color: var(--moon-silk);
    opacity: 0.7;
}

.hero-meta {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    margin-top: 1rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.22em;
    color: var(--jamo-blue);
    text-transform: uppercase;
    opacity: 0;
    animation: fadeUp 900ms var(--ease-quiet) 1600ms forwards;
}

.meta-dot {
    color: var(--glass-edge-bright);
}

.scroll-hint {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    opacity: 0;
    animation: fadeUp 1000ms var(--ease-quiet) 2000ms forwards;
}

.scroll-hint-line {
    width: 1px;
    height: 48px;
    background: linear-gradient(180deg, transparent, var(--candlewick-gold));
    animation: scrollPulse 2.5s ease-in-out infinite;
    transform-origin: top;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; transform: scaleY(0.8); }
    50% { opacity: 1; transform: scaleY(1); }
}

.scroll-hint-label {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 0.7rem;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: var(--moon-silk);
    opacity: 0.55;
}

/* =====================================================================
   parallax panes
   ===================================================================== */

main {
    position: relative;
    z-index: 3;
}

.pane {
    position: relative;
    padding: clamp(4rem, 10vw, 8rem) clamp(1.25rem, 4vw, 3rem);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    will-change: transform;
}

.pane-marker {
    display: inline-flex;
    align-items: baseline;
    gap: 1rem;
    width: min(85%, 1200px);
    padding: 0 clamp(1rem, 2vw, 2rem);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--jamo-blue);
    border-bottom: 1px solid var(--glass-edge);
    padding-bottom: 1rem;
}

.pane-index {
    color: var(--candlewick-gold);
    font-weight: 500;
}

.pane-korean {
    font-family: var(--font-kor);
    font-weight: 400;
    font-size: 0.95rem;
    letter-spacing: 0.12em;
    color: var(--pale-frost);
}

.pane-en {
    color: var(--moon-silk);
    font-family: var(--font-body);
    font-weight: 400;
    margin-left: auto;
    text-transform: none;
    letter-spacing: 0.1em;
    font-size: 0.78rem;
    opacity: 0.75;
}

/* =====================================================================
   glassmorphic cards
   ===================================================================== */

.glass-card {
    width: min(85%, 1200px);
    border-radius: 20px;
    background: var(--frosted-slate);
    backdrop-filter: blur(16px) saturate(120%);
    -webkit-backdrop-filter: blur(16px) saturate(120%);
    border: 1px solid var(--glass-edge);
    box-shadow: var(--deep-shadow), var(--inset-highlight);
    padding: clamp(2rem, 4vw, 3.5rem);
    position: relative;
    contain: layout style paint;
    transition:
        box-shadow 500ms var(--ease-quiet),
        border-color 500ms var(--ease-quiet),
        transform 700ms var(--ease-bounce);
    opacity: 0;
    transform: translateY(60px);
    will-change: transform, opacity, box-shadow;
}

.glass-card[data-reveal].is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* subtle top gloss — as if catching moonlight from above */
.glass-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 20px;
    pointer-events: none;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.05) 0%,
        rgba(255, 255, 255, 0) 40%,
        transparent 100%
    );
}

.glass-card::after {
    content: "";
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.15),
        transparent
    );
    pointer-events: none;
}

.glass-card:hover {
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        0 0 40px rgba(196, 147, 90, 0.12),
        var(--inset-highlight-bright);
    border-color: var(--glass-edge-bright);
}

/* card grid */
.card-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 2.5rem;
    align-items: start;
}

.card-copy {
    grid-column: span 7;
}

.card-visual {
    grid-column: span 5;
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-grid-wide .card-copy-wide {
    grid-column: span 12;
    margin-bottom: 0.5rem;
}

.card-title {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: clamp(1.6rem, 3vw, 2.25rem);
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: var(--pale-frost);
    margin-bottom: 1.25rem;
}

.card-lede {
    font-size: clamp(1.05rem, 1.4vw, 1.2rem);
    color: var(--pale-frost);
    margin-bottom: 1.25rem;
    line-height: 1.7;
    font-weight: 300;
}

.card-body {
    color: var(--moon-silk);
    margin-bottom: 1.75rem;
    line-height: 1.8;
}

.card-body em,
.card-lede em {
    color: var(--candlewick-gold);
    font-style: italic;
}

/* =====================================================================
   jamo list — speech organ consonants
   ===================================================================== */

.jamo-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    border-top: 1px solid var(--glass-edge);
    padding-top: 1.5rem;
    margin-top: 1rem;
}

.jamo-row {
    display: grid;
    grid-template-columns: 3.5rem 1fr;
    align-items: center;
    gap: 1.25rem;
    padding: 0.5rem 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
    transition: all 400ms var(--ease-quiet);
}

.jamo-row:last-child {
    border-bottom: none;
}

.jamo-row:hover {
    transform: translateX(4px);
}

.jamo-row:hover .jamo-glyph {
    color: var(--candlewick-gold);
    text-shadow: 0 0 20px rgba(196, 147, 90, 0.4);
}

.jamo-glyph {
    font-family: var(--font-kor);
    font-weight: 400;
    font-size: 2rem;
    color: var(--pale-frost);
    line-height: 1;
    text-align: center;
    transition: all 400ms var(--ease-quiet);
}

.jamo-meta {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.jamo-name {
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    color: var(--pale-frost);
    text-transform: uppercase;
}

.jamo-desc {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 0.88rem;
    color: var(--moon-silk);
    opacity: 0.8;
    font-style: italic;
}

/* =====================================================================
   stroke diagram panel
   ===================================================================== */

.stroke-panel {
    width: 100%;
    max-width: 340px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    padding: 1.5rem;
    border: 1px dashed var(--glass-edge);
    border-radius: 14px;
    background: rgba(13, 15, 20, 0.3);
}

.stroke-diagram {
    width: 100%;
    height: auto;
    max-width: 240px;
}

.stroke-diagram .jamo-path {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
}

.stroke-diagram.is-drawn .jamo-path {
    animation: strokeDraw 1200ms ease-in-out forwards;
}

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

.stroke-diagram.is-drawn .organ-path,
.stroke-diagram.is-drawn .organ-ghost {
    animation: organFade 600ms ease-in 1100ms forwards;
}

@keyframes organFade {
    to { opacity: 0.25; }
}

.stroke-label {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.3em;
    fill: var(--moon-silk);
    text-transform: uppercase;
    opacity: 0;
    animation: fadeIn 400ms ease 1700ms forwards;
}

.stroke-diagram.is-drawn .stroke-label {
    animation: fadeIn 400ms ease forwards;
}

@keyframes fadeIn {
    to { opacity: 0.7; }
}

.stroke-caption {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    color: var(--jamo-blue);
    text-transform: uppercase;
    width: 100%;
    justify-content: center;
}

.caption-line {
    flex: 1;
    max-width: 32px;
    height: 1px;
    background: var(--glass-edge-bright);
}

.caption-step {
    white-space: nowrap;
}

/* =====================================================================
   syllable block — chosong / jungseong / jongseong
   ===================================================================== */

.syllable-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.syllable-block {
    position: relative;
    width: 220px;
    height: 220px;
    border: 1px solid var(--glass-edge);
    border-radius: 12px;
    background: rgba(13, 15, 20, 0.4);
    display: grid;
    grid-template-areas:
        "init init"
        "med  med"
        "fin  fin";
    grid-template-rows: 1fr 1fr 1fr;
    overflow: hidden;
    cursor: pointer;
    transition: all 500ms var(--ease-quiet);
}

.syllable-block:hover {
    border-color: var(--candlewick-gold);
    box-shadow: 0 0 30px rgba(196, 147, 90, 0.15);
}

.syl {
    font-family: var(--font-kor);
    font-weight: 300;
    font-size: 3rem;
    color: var(--pale-frost);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 500ms var(--ease-quiet);
    position: relative;
}

.syl-chosong {
    grid-area: init;
    background: rgba(91, 122, 158, 0.08);
    border-bottom: 1px dashed var(--glass-edge);
}

.syl-jungseong {
    grid-area: med;
    background: rgba(196, 147, 90, 0.06);
    border-bottom: 1px dashed var(--glass-edge);
}

.syl-jongseong {
    grid-area: fin;
    background: rgba(91, 122, 158, 0.12);
}

.syl-assembled {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-kor);
    font-weight: 300;
    font-size: 8rem;
    color: var(--pale-frost);
    background: rgba(13, 15, 20, 0.92);
    opacity: 0;
    transition: opacity 600ms var(--ease-quiet);
    pointer-events: none;
    text-shadow: 0 0 40px rgba(196, 147, 90, 0.25);
}

.syllable-block.is-assembled .syl-assembled {
    opacity: 1;
}

.syllable-block.is-assembled .syl {
    opacity: 0;
}

.syllable-caption {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.2em;
    color: var(--moon-silk);
    text-transform: uppercase;
    opacity: 0.8;
}

.syllable-caption .sep {
    color: var(--glass-edge-bright);
}

/* block legend */
.block-legend {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--glass-edge);
}

.block-legend li {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    font-family: var(--font-body);
    font-size: 0.88rem;
    color: var(--moon-silk);
    font-weight: 300;
}

.legend-swatch {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 1px solid var(--glass-edge);
}

.legend-init { background: rgba(91, 122, 158, 0.25); }
.legend-med  { background: rgba(196, 147, 90, 0.22); }
.legend-fin  { background: rgba(91, 122, 158, 0.4); }

/* =====================================================================
   unicode table
   ===================================================================== */

.unicode-table {
    margin-top: 1.5rem;
    border-top: 1px solid var(--glass-edge);
    border-bottom: 1px solid var(--glass-edge);
    display: flex;
    flex-direction: column;
}

.unicode-row {
    display: grid;
    grid-template-columns: 1.4fr 1.6fr 0.6fr;
    gap: 1rem;
    align-items: center;
    padding: 0.85rem 0.25rem;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.04);
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 0.92rem;
    color: var(--moon-silk);
    transition: all 400ms var(--ease-quiet);
}

.unicode-row:last-child {
    border-bottom: none;
}

.unicode-row:not(.unicode-head):hover {
    background: rgba(255, 255, 255, 0.02);
    color: var(--pale-frost);
}

.unicode-head {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.22em;
    color: var(--jamo-blue);
    text-transform: uppercase;
    border-bottom: 1px solid var(--glass-edge);
}

.unicode-head:hover {
    background: transparent;
}

.unicode-row > span:last-child {
    text-align: right;
    font-family: var(--font-mono);
    color: var(--candlewick-gold);
    font-size: 0.82rem;
}

/* inline glassmorphic code badge */
.code-badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: 0.82rem;
    letter-spacing: 0.05em;
    color: var(--jamo-blue);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-edge);
    border-radius: 4px;
    padding: 0.12rem 0.5rem;
}

/* =====================================================================
   code window
   ===================================================================== */

.code-window {
    width: 100%;
    max-width: 420px;
    border-radius: 12px;
    border: 1px solid var(--glass-edge);
    background: rgba(13, 15, 20, 0.5);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.code-chrome {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--glass-edge);
}

.chrome-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
}

.chrome-dot:nth-child(1) { background: rgba(196, 147, 90, 0.5); }
.chrome-dot:nth-child(2) { background: rgba(91, 122, 158, 0.5); }
.chrome-dot:nth-child(3) { background: rgba(255, 255, 255, 0.1); }

.chrome-title {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    color: var(--moon-silk);
    opacity: 0.7;
}

.code-body {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    line-height: 1.6;
    color: var(--moon-silk);
    padding: 1.25rem 1.35rem;
    white-space: pre;
    overflow-x: auto;
}

.code-body .tok-c { color: var(--jamo-blue); opacity: 0.75; font-style: italic; }
.code-body .tok-k { color: var(--candlewick-gold); }
.code-body .tok-s { color: #9eb4cc; }
.code-body .tok-f { color: var(--pale-frost); }
.code-body .tok-n { color: var(--candlewick-gold); }

/* =====================================================================
   tool grid
   ===================================================================== */

.tool-grid {
    grid-column: span 12;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-top: 1rem;
}

.tool-card {
    position: relative;
    padding: 1.75rem 1.5rem 1.35rem;
    border-radius: 14px;
    border: 1px solid var(--glass-edge);
    background: rgba(28, 32, 44, 0.45);
    backdrop-filter: blur(8px) saturate(110%);
    -webkit-backdrop-filter: blur(8px) saturate(110%);
    transition:
        transform 500ms var(--ease-bounce),
        border-color 400ms var(--ease-quiet),
        box-shadow 400ms var(--ease-quiet),
        background 400ms var(--ease-quiet);
    opacity: 0;
    transform: translateY(30px);
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    overflow: hidden;
}

.tool-card[data-reveal].is-visible {
    opacity: 1;
    transform: translateY(0);
}

.tool-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
}

.tool-card:hover {
    transform: translateY(-4px);
    border-color: var(--glass-edge-bright);
    background: rgba(28, 32, 44, 0.65);
    box-shadow: 0 0 36px rgba(196, 147, 90, 0.08);
}

.tool-card:hover .tool-glyph {
    color: var(--candlewick-gold);
    text-shadow: 0 0 18px rgba(196, 147, 90, 0.5);
}

.tool-glyph {
    font-family: var(--font-kor);
    font-weight: 300;
    font-size: 2.4rem;
    color: var(--pale-frost);
    line-height: 1;
    opacity: 0.9;
    transition: all 400ms var(--ease-quiet);
}

.tool-title {
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 1rem;
    letter-spacing: 0.04em;
    color: var(--pale-frost);
}

.tool-desc {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--moon-silk);
    flex: 1;
}

.tool-tag {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--jamo-blue);
    border-top: 1px dashed var(--glass-edge);
    padding-top: 0.6rem;
    margin-top: 0.4rem;
}

/* =====================================================================
   reading list & quote pane
   ===================================================================== */

.reading-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
    border-top: 1px solid var(--glass-edge);
    padding-top: 1.5rem;
}

.reading-list li {
    display: grid;
    grid-template-columns: 3rem 1fr;
    align-items: center;
    gap: 1rem;
    padding: 0.6rem 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
    transition: all 400ms var(--ease-quiet);
}

.reading-list li:last-child {
    border-bottom: none;
}

.reading-list li:hover {
    transform: translateX(6px);
}

.reading-list li:hover .reading-mark {
    color: var(--candlewick-gold);
    border-color: var(--candlewick-gold);
    box-shadow: 0 0 18px rgba(196, 147, 90, 0.25);
}

.reading-mark {
    font-family: var(--font-kor);
    font-weight: 400;
    font-size: 1.2rem;
    color: var(--pale-frost);
    width: 2.4rem;
    height: 2.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--glass-edge);
    border-radius: 6px;
    transition: all 400ms var(--ease-quiet);
}

.reading-meta {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.reading-title {
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.98rem;
    color: var(--pale-frost);
}

.reading-sub {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 0.82rem;
    color: var(--moon-silk);
    opacity: 0.75;
    font-style: italic;
}

.quote-pane {
    width: 100%;
    padding: 2rem 1.75rem;
    border: 1px solid var(--glass-edge);
    border-radius: 14px;
    background: rgba(13, 15, 20, 0.35);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.quote-mark {
    font-family: var(--font-kor);
    font-weight: 300;
    font-size: 3rem;
    color: var(--candlewick-gold);
    line-height: 0.6;
    opacity: 0.5;
}

.quote-text {
    font-family: var(--font-body);
    font-weight: 300;
    font-style: italic;
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--pale-frost);
}

.quote-attrib {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    color: var(--jamo-blue);
    padding-top: 0.5rem;
    border-top: 1px dashed var(--glass-edge);
}

/* =====================================================================
   footer — the candlelit base
   ===================================================================== */

.candlelit-footer {
    position: relative;
    min-height: 70vh;
    padding: 8rem 1.5rem 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.5) 60%, rgba(0, 0, 0, 0.85));
    overflow: hidden;
    z-index: 3;
}

.candle-bloom {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 400px;
    background: radial-gradient(
        ellipse 300px 200px at 50% 50%,
        rgba(196, 147, 90, 0.18) 0%,
        rgba(196, 147, 90, 0.08) 40%,
        transparent 100%
    );
    pointer-events: none;
    animation: candleFlicker 4s ease-in-out infinite;
    filter: blur(2px);
}

@keyframes candleFlicker {
    0%, 100% { opacity: 0.55; transform: translate(-50%, -50%) scale(1); }
    25% { opacity: 0.78; transform: translate(-50%, -50%) scale(1.04); }
    50% { opacity: 0.62; transform: translate(-50%, -50%) scale(0.97); }
    75% { opacity: 0.88; transform: translate(-50%, -50%) scale(1.02); }
}

.footer-inner {
    position: relative;
    z-index: 2;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    max-width: 700px;
}

.footer-char {
    font-family: var(--font-kor);
    font-weight: 300;
    font-size: clamp(6rem, 14vw, 10rem);
    line-height: 1;
    color: var(--pale-frost);
    text-shadow: 0 0 60px rgba(196, 147, 90, 0.3);
    letter-spacing: -0.02em;
}

.footer-dedication {
    font-family: var(--font-body);
    font-weight: 300;
    font-style: italic;
    font-size: 1rem;
    line-height: 1.8;
    color: var(--moon-silk);
    max-width: 520px;
    opacity: 0.85;
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    padding: 1.5rem 0;
    border-top: 1px solid var(--glass-edge);
    border-bottom: 1px solid var(--glass-edge);
    width: 100%;
}

.footer-link {
    position: relative;
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 0.88rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--moon-silk);
    text-decoration: none;
    padding: 0.3rem 0.1rem;
    transition: color 300ms var(--ease-quiet);
}

.footer-link::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 1px;
    background: var(--candlewick-gold);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 400ms var(--ease-quiet);
}

.footer-link:hover {
    color: var(--candlewick-gold);
}

.footer-link:hover::after {
    transform: scaleX(1);
}

.footer-meta {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--jamo-blue);
    opacity: 0.75;
}

.footer-meta .sep {
    color: var(--glass-edge-bright);
}

/* =====================================================================
   responsive — mobile collapse to single column
   ===================================================================== */

@media (max-width: 900px) {
    .card-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .card-copy,
    .card-visual {
        grid-column: span 1;
    }

    .card-visual {
        order: -1;
        min-height: 220px;
    }

    .pane-marker {
        width: 92%;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .pane-en {
        margin-left: 0;
        width: 100%;
    }

    .glass-card {
        width: 92%;
        padding: 2rem 1.5rem;
    }

    .nav-brand-text {
        display: none;
    }

    .nav-items {
        gap: 0.25rem;
    }

    .hero-char {
        font-size: clamp(7rem, 28vw, 14rem);
    }
}

@media (max-width: 560px) {
    .footer-nav {
        gap: 1rem;
    }

    .candle-cursor {
        display: none;
    }

    .code-body {
        font-size: 0.72rem;
        padding: 1rem;
    }

    .unicode-row {
        grid-template-columns: 1fr;
        gap: 0.3rem;
        padding: 0.9rem 0.25rem;
    }

    .unicode-row > span:last-child {
        text-align: left;
    }

    .unicode-head {
        display: none;
    }
}

/* =====================================================================
   reduced motion
   ===================================================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-delay: 0.001ms !important;
        transition-duration: 0.001ms !important;
    }

    .glass-card {
        opacity: 1;
        transform: none;
    }

    .tool-card {
        opacity: 1;
        transform: none;
    }
}
