/* hangeul.day - Graffiti Mural Dashboard */

:root {
    --warm-concrete: #f2ece4;
    --charcoal-soot: #2a2520;
    --spray-ochre: #d4883a;
    --mural-teal: #2a8f7a;
    --tag-violet: #8a4fbf;
    --terracotta: #c75c4a;
    --cream-wash: #faf6f0;
    --slate-wall: #4a433d;
}

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

body {
    font-family: 'Commissioner', sans-serif;
    font-weight: 400;
    background-color: var(--warm-concrete);
    color: var(--charcoal-soot);
    line-height: 1.65;
    letter-spacing: 0.01em;
    overflow-x: hidden;
    /* Consonant grid watermark */
    background-image: repeating-conic-gradient(var(--charcoal-soot) 0% 25%, transparent 0% 100%);
    background-size: 4px 4px;
    background-blend-mode: overlay;
}

body::before {
    content: 'ㄱㄴㄷㄹㅁㅂㅅㅇㅈㅊㅋㅌㅍㅎ';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 5vw;
    font-weight: 900;
    color: var(--charcoal-soot);
    opacity: 0.03;
    display: flex;
    flex-wrap: wrap;
    align-content: center;
    justify-content: center;
    letter-spacing: 2vw;
    line-height: 1.5;
    pointer-events: none;
    z-index: 0;
    word-break: break-all;
}

/* Hero Wall */
.hero-wall {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: var(--warm-concrete);
    position: relative;
    z-index: 1;
    background-image: repeating-conic-gradient(
        rgba(42, 37, 32, 0.02) 0% 25%,
        transparent 0% 100%
    );
    background-size: 3px 3px;
}

.hero-content {
    text-align: center;
    position: relative;
}

#hero-svg {
    width: min(80vw, 600px);
    height: auto;
    margin-bottom: 1rem;
}

.jamo-path {
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    filter: blur(0.5px);
    transition: stroke-dashoffset 1.5s cubic-bezier(0.65, 0, 0.35, 1);
}

.jamo-path.animated {
    stroke-dashoffset: 0;
}

.drip {
    transition: opacity 0.8s ease 2s;
}

.drip.visible {
    opacity: 0.7;
}

.hero-subtitle {
    font-family: 'Commissioner', sans-serif;
    font-weight: 900;
    font-size: clamp(3rem, 7vw, 6.5rem);
    letter-spacing: 0.02em;
    color: var(--charcoal-soot);
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.4s ease-out 2.5s, transform 0.4s ease-out 2.5s;
}

.hero-subtitle.visible {
    opacity: 1;
    transform: translateX(0);
}

.hero-tagline {
    font-family: 'Commissioner', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 2vw, 1.4rem);
    color: var(--slate-wall);
    margin-top: 0.5rem;
    opacity: 0;
    transition: opacity 0.6s ease 3s;
}

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

.zigzag-divider {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px;
}

.zigzag-path {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 1.5s cubic-bezier(0.65, 0, 0.35, 1);
}

.zigzag-path.animated {
    stroke-dashoffset: 0;
}

/* Dashboard Zones */
.dashboard-zone {
    position: relative;
    z-index: 1;
    padding: 4rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.zone-title {
    font-family: 'Commissioner', sans-serif;
    font-weight: 900;
    font-size: clamp(2rem, 4vw, 3.5rem);
    letter-spacing: 0.02em;
    color: var(--charcoal-soot);
    margin-bottom: 2rem;
    position: relative;
    display: inline-block;
}

.zone-title::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--spray-ochre), var(--mural-teal), var(--tag-violet));
}

/* Jamo Explorer Grid */
.jamo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    background: var(--charcoal-soot);
    padding: 4px;
}

.jamo-tile {
    background: var(--cream-wash);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    clip-path: polygon(16px 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%, 0 16px);
}

.tile-ochre {
    border-left: 3px solid var(--spray-ochre);
    background: linear-gradient(135deg, rgba(212, 136, 58, 0.08), var(--cream-wash));
}

.tile-teal {
    border-left: 3px solid var(--mural-teal);
    background: linear-gradient(135deg, rgba(42, 143, 122, 0.08), var(--cream-wash));
}

.tile-violet {
    border-left: 3px solid var(--tag-violet);
    background: linear-gradient(135deg, rgba(138, 79, 191, 0.08), var(--cream-wash));
}

.jamo-svg {
    width: 100px;
    height: 100px;
    margin-bottom: 0.5rem;
}

.jamo-draw {
    stroke-dasharray: 400;
    stroke-dashoffset: 400;
    transition: stroke-dashoffset 1.5s cubic-bezier(0.65, 0, 0.35, 1);
}

.jamo-draw.animated {
    stroke-dashoffset: 0;
}

.jamo-label {
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 900;
    font-size: 2.5rem;
    margin: 0.5rem 0 0.25rem;
}

.jamo-romanization {
    font-family: 'Fira Code', monospace;
    font-size: 0.85em;
    letter-spacing: 0.05em;
    color: var(--slate-wall);
}

.jamo-description {
    font-size: 0.85rem;
    color: var(--slate-wall);
    margin-top: 0.25rem;
}

/* Timeline */
.timeline-strip {
    overflow-x: auto;
    padding: 2rem 0;
    scrollbar-width: thin;
    scrollbar-color: var(--spray-ochre) var(--warm-concrete);
}

.timeline-track {
    display: flex;
    gap: 4px;
    min-width: max-content;
    padding: 1rem;
    background: var(--charcoal-soot);
}

.timeline-event {
    background: var(--cream-wash);
    padding: 1.5rem 2rem;
    min-width: 220px;
    clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.timeline-event:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(42, 37, 32, 0.15);
}

.timeline-event:nth-child(3n+1) {
    border-top: 3px solid var(--spray-ochre);
}

.timeline-event:nth-child(3n+2) {
    border-top: 3px solid var(--mural-teal);
}

.timeline-event:nth-child(3n) {
    border-top: 3px solid var(--tag-violet);
}

.event-year {
    font-family: 'Fira Code', monospace;
    font-size: 0.85em;
    letter-spacing: 0.05em;
    color: var(--spray-ochre);
    display: block;
    margin-bottom: 0.25rem;
}

.event-title {
    font-family: 'Commissioner', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    display: block;
    margin-bottom: 0.5rem;
}

.event-detail {
    font-size: 0.9rem;
    color: var(--slate-wall);
    line-height: 1.5;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.timeline-event.expanded .event-detail {
    max-height: 100px;
}

/* Syllable Builder */
.builder-layout {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 2fr;
    gap: 4px;
    background: var(--charcoal-soot);
    padding: 4px;
}

.builder-column {
    background: var(--cream-wash);
    padding: 1.5rem;
    clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
}

.builder-column h3 {
    font-family: 'Commissioner', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--slate-wall);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.jamo-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.jamo-btn {
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 900;
    font-size: 1.2rem;
    width: 40px;
    height: 40px;
    border: 2px solid var(--charcoal-soot);
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--charcoal-soot);
}

.jamo-btn:hover {
    background: var(--warm-concrete);
}

#initial-consonants .jamo-btn.active {
    background: var(--spray-ochre);
    border-color: var(--spray-ochre);
    color: white;
}

#vowels .jamo-btn.active {
    background: var(--mural-teal);
    border-color: var(--mural-teal);
    color: white;
}

#final-consonants .jamo-btn.active {
    background: var(--tag-violet);
    border-color: var(--tag-violet);
    color: white;
}

.builder-result {
    background: var(--cream-wash);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 16px 100%, 0 calc(100% - 16px));
}

.result-block {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    width: 120px;
    height: 120px;
    border: 2px dashed var(--slate-wall);
    margin-bottom: 1rem;
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 900;
    font-size: 1.8rem;
    text-align: center;
}

.result-initial {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--spray-ochre);
}

.result-vowel {
    grid-column: 2;
    grid-row: 1 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--mural-teal);
}

.result-final {
    grid-column: 1;
    grid-row: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--tag-violet);
}

.result-combined {
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 900;
    font-size: clamp(4rem, 8vw, 6rem);
    color: var(--charcoal-soot);
    transition: transform 0.3s ease;
}

.result-combined.pop {
    transform: scale(1.1);
}

/* Quote Wall */
.quote-wall {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    background: var(--charcoal-soot);
    position: relative;
    z-index: 1;
}

.stencil-quote {
    max-width: 800px;
    text-align: center;
}

.stencil-quote p {
    font-family: 'Commissioner', sans-serif;
    font-weight: 900;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    color: var(--cream-wash);
    line-height: 1.4;
    mix-blend-mode: lighten;
}

.stencil-quote cite {
    display: block;
    margin-top: 1.5rem;
    font-family: 'Fira Code', monospace;
    font-size: 0.85em;
    letter-spacing: 0.05em;
    color: var(--spray-ochre);
    font-style: normal;
}

/* Responsive */
@media (max-width: 768px) {
    .jamo-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .builder-layout {
        grid-template-columns: 1fr;
    }

    .timeline-track {
        flex-direction: column;
        min-width: auto;
    }

    .timeline-event {
        min-width: auto;
    }

    .dashboard-zone {
        padding: 3rem 1rem;
    }
}

/* Scroll snap */
html {
    scroll-snap-type: y proximity;
}

.hero-wall,
#jamo-explorer,
#timeline,
#syllable-builder,
.quote-wall {
    scroll-snap-align: start;
}
