/* ============================================
   hangul.name - Y2K Futurism Korean Name Explorer
   Palette: Burgundy-Cream with Chrome Accents
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 400;
    line-height: 1.85;
    font-size: clamp(15px, 1.05vw, 17px);
    color: #2A1018;
    background: #FFF5F0;
    overflow-x: hidden;
}

/* --- Typography --- */
.logotype {
    font-family: 'DM Serif Display', serif;
    font-weight: 400;
    font-size: clamp(24px, 3.5vw, 48px);
    letter-spacing: 0.03em;
    color: #FFF5F0;
}

.section-title {
    font-family: 'Noto Serif KR', serif;
    font-weight: 500;
    font-size: clamp(28px, 4vw, 52px);
    color: #2A1018;
    margin-bottom: 0.3em;
}

.section-subtitle {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: 12px;
    color: #8A3A4A;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 2.5em;
}

/* --- Hero Section (Split-Screen) --- */
.hero {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.hero-left {
    width: 45%;
    background: #5A1A2A;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    opacity: 0;
    animation: fadeFromBlack 800ms ease-out forwards;
}

@keyframes fadeFromBlack {
    from {
        background-color: #000;
        opacity: 0;
    }
    to {
        background-color: #5A1A2A;
        opacity: 1;
    }
}

.hero-left-content {
    text-align: center;
    padding: 2em;
}

.chrome-character {
    margin: 1em 0;
    position: relative;
}

.chrome-text {
    font-family: 'Noto Serif KR', serif;
    font-weight: 700;
    font-size: clamp(60px, 12vw, 160px);
    background: linear-gradient(180deg, #E8EEF4 0%, #C0C8D0 45%, #8090A0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
    display: inline-block;
    position: relative;
    animation: chromeShimmer 1500ms ease-in-out forwards;
}

@keyframes chromeShimmer {
    0% {
        background: linear-gradient(0deg, #E8EEF4 0%, #C0C8D0 45%, #8090A0 100%);
        -webkit-background-clip: text;
        background-clip: text;
    }
    25% {
        background: linear-gradient(90deg, #E8EEF4 0%, #C0C8D0 45%, #8090A0 100%);
        -webkit-background-clip: text;
        background-clip: text;
    }
    50% {
        background: linear-gradient(180deg, #E8EEF4 0%, #C0C8D0 45%, #8090A0 100%);
        -webkit-background-clip: text;
        background-clip: text;
    }
    75% {
        background: linear-gradient(270deg, #E8EEF4 0%, #C0C8D0 45%, #8090A0 100%);
        -webkit-background-clip: text;
        background-clip: text;
    }
    100% {
        background: linear-gradient(360deg, #E8EEF4 0%, #C0C8D0 45%, #8090A0 100%);
        -webkit-background-clip: text;
        background-clip: text;
    }
}

.hero-subtitle {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: 12px;
    color: #C0C8D0;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-top: 1em;
}

/* --- Hero Right Panel --- */
.hero-right {
    width: 55%;
    background: #FFF5F0;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateX(100%);
    animation: slideInRight 800ms ease-out 200ms forwards;
}

@keyframes slideInRight {
    to {
        transform: translateX(0);
    }
}

.hero-right-content {
    padding: 3em;
    max-width: 560px;
    width: 100%;
}

.hero-heading {
    font-family: 'Noto Serif KR', serif;
    font-weight: 700;
    font-size: clamp(28px, 4.5vw, 64px);
    color: #2A1018;
    margin-bottom: 0.4em;
    line-height: 1.2;
}

.kr-accent {
    color: #8A3A4A;
}

.hero-description {
    font-size: clamp(15px, 1.05vw, 17px);
    color: #2A1018;
    margin-bottom: 2em;
    max-width: 440px;
}

/* --- Y2K Chrome Input Field --- */
.input-chrome {
    position: relative;
    padding: 3px;
    background: #C0C8D0;
    border-radius: 6px;
    margin-bottom: 1.5em;
    opacity: 0;
    animation: borderDraw 400ms ease-out 1000ms forwards;
}

.input-chrome::before {
    content: '';
    position: absolute;
    inset: 2px;
    border: 1px solid #E8EEF4;
    border-radius: 4px;
    pointer-events: none;
}

@keyframes borderDraw {
    0% {
        opacity: 0;
        clip-path: polygon(0 0, 0 0, 0 0, 0 0);
    }
    25% {
        clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
    }
    50% {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }
    100% {
        opacity: 1;
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }
}

.name-input {
    width: 100%;
    padding: 14px 18px;
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 16px;
    color: #2A1018;
    background: #FFF5F0;
    border: none;
    border-radius: 3px;
    outline: none;
    transition: box-shadow 300ms ease;
}

.name-input::placeholder {
    color: #8A3A4A;
    opacity: 0.5;
}

.name-input:focus {
    box-shadow: 0 0 8px rgba(192, 200, 208, 0.5);
}

/* --- Name Result --- */
.name-result {
    min-height: 60px;
    margin-bottom: 2em;
    opacity: 0;
    transition: opacity 300ms ease;
}

.name-result.visible {
    opacity: 1;
}

.name-result-inner {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.result-hangul {
    font-family: 'Noto Serif KR', serif;
    font-weight: 700;
    font-size: clamp(28px, 4.5vw, 48px);
    background: linear-gradient(180deg, #E8EEF4 0%, #C0C8D0 45%, #8090A0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
}

.result-meaning {
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    color: #8A3A4A;
}

/* --- Scroll Hint --- */
.scroll-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    color: #8090A0;
    margin-top: 2em;
}

.scroll-arrow {
    animation: bounceDown 1.5s ease-in-out infinite;
    font-size: 16px;
}

@keyframes bounceDown {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(5px); }
}

/* --- Slash Dividers --- */
.slash-divider {
    width: 100%;
    height: 60px;
    position: relative;
    overflow: hidden;
}

.slash-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: -5%;
    width: 110%;
    height: 3px;
    background: #5A1A2A;
    transform: rotate(-2deg);
}

.slash-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    left: -5%;
    width: 40%;
    height: 2px;
    background: #C0C8D0;
    transform: rotate(-2deg) translateY(8px);
}

.slash-mid {
    height: 40px;
}

.slash-mid::before {
    height: 1px;
    opacity: 0.4;
}

.slash-mid::after {
    display: none;
}

/* --- Trends Section --- */
.trends-section {
    background: #FFF5F0;
    padding: 4em 0;
}

.trends-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 2em;
    text-align: center;
}

.chart-group {
    text-align: left;
    margin-bottom: 2em;
}

.chart-label {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: 12px;
    color: #8A3A4A;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1em;
}

.bar-chart {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bar-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bar-label {
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    color: #2A1018;
    width: 100px;
    text-align: right;
    flex-shrink: 0;
}

.bar-track {
    flex: 1;
    height: 28px;
    background: #F0E0D8;
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.bar-fill {
    height: 100%;
    background: #5A1A2A;
    border-radius: 2px;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 400ms ease-out;
    position: relative;
}

.bar-fill.animated {
    transform: scaleX(1);
}

.bar-value {
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    color: #8090A0;
    width: 40px;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 300ms ease 400ms;
}

.bar-value.visible {
    opacity: 1;
}

/* Tooltip on bar hover */
.bar-row:hover .bar-fill {
    background: #8A3A4A;
}

/* --- Gallery Section --- */
.gallery-section {
    background: #FFF5F0;
    padding: 4em 0;
}

.gallery-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 2em;
    text-align: center;
}

.name-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 24px;
    text-align: left;
}

.name-card {
    position: relative;
    background: #F0E0D8;
    border: 2px solid #C0C8D0;
    border-radius: 4px;
    overflow: hidden;
    min-height: 220px;
}

.name-card::before {
    content: '';
    position: absolute;
    inset: 2px;
    border: 1px solid #E8EEF4;
    border-radius: 2px;
    pointer-events: none;
    z-index: 2;
}

.card-cover {
    position: absolute;
    inset: 0;
    background: #5A1A2A;
    z-index: 3;
    transform: translateX(0);
    transition: transform 500ms ease-in-out;
}

.name-card.revealed .card-cover {
    transform: translateX(-100%);
}

.card-content {
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    opacity: 0;
    transition: opacity 300ms ease 200ms;
}

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

.card-hangul {
    font-family: 'Noto Serif KR', serif;
    font-weight: 700;
    font-size: clamp(28px, 4.5vw, 48px);
    color: #2A1018;
    line-height: 1.2;
}

.card-romanized {
    font-family: 'DM Serif Display', serif;
    font-size: 18px;
    color: #5A1A2A;
    letter-spacing: 0.02em;
}

.card-meaning {
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 14px;
    color: #8A3A4A;
    margin-top: 4px;
}

.card-hanja {
    font-family: 'Noto Serif KR', serif;
    font-weight: 500;
    font-size: 20px;
    color: #8090A0;
    margin-top: 4px;
}

.element-dots {
    display: flex;
    gap: 6px;
    margin-top: 10px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.dot-wood {
    background: #4A8A4A;
}

.dot-fire {
    background: #C04040;
}

.dot-earth {
    background: #D4A060;
}

.dot-metal {
    background: #C0C8D0;
}

.dot-water {
    background: #4060A0;
}

/* --- Education Section (Split Screen) --- */
.education-section {
    background: #FFF5F0;
    padding: 4em 0;
}

.edu-block {
    display: flex;
    max-width: 1100px;
    margin: 0 auto 2em;
    padding: 0 2em;
    gap: 3em;
    align-items: center;
}

.edu-block-reverse {
    flex-direction: row-reverse;
}

.edu-visual {
    flex: 1;
    min-width: 0;
}

.edu-text {
    flex: 1;
    min-width: 0;
}

.edu-title {
    font-family: 'Noto Serif KR', serif;
    font-weight: 700;
    font-size: clamp(24px, 3vw, 40px);
    color: #2A1018;
    margin-bottom: 0.15em;
}

.edu-kr-title {
    font-family: 'Noto Serif KR', serif;
    font-weight: 500;
    font-size: 18px;
    color: #8A3A4A;
    margin-bottom: 1em;
}

.edu-body {
    font-size: clamp(15px, 1.05vw, 17px);
    color: #2A1018;
    margin-bottom: 1.2em;
    line-height: 1.85;
}

/* Stroke Diagram */
.stroke-diagram {
    position: relative;
    background: #F0E0D8;
    border: 2px solid #C0C8D0;
    border-radius: 4px;
    overflow: hidden;
    min-height: 280px;
}

.stroke-diagram .card-cover {
    position: absolute;
    inset: 0;
    background: #5A1A2A;
    z-index: 3;
    transform: translateX(0);
    transition: transform 500ms ease-in-out;
}

.stroke-diagram.revealed .card-cover {
    transform: translateX(-100%);
}

.stroke-content {
    padding: 30px;
    display: flex;
    gap: 24px;
    align-items: center;
    opacity: 0;
    transition: opacity 300ms ease 200ms;
}

.stroke-diagram.revealed .stroke-content {
    opacity: 1;
}

.big-hangul {
    font-family: 'Noto Serif KR', serif;
    font-weight: 700;
    font-size: 100px;
    color: #5A1A2A;
    line-height: 1;
}

.stroke-lines {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.stroke-line {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stroke-num {
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    color: #8090A0;
    width: 80px;
    flex-shrink: 0;
}

.stroke-bar {
    flex: 1;
    height: 16px;
    background: #E8EEF4;
    border-radius: 2px;
    overflow: hidden;
}

.stroke-fill {
    height: 100%;
    background: linear-gradient(90deg, #D4A060, #C04040);
    border-radius: 2px;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 500ms ease-out;
}

.stroke-diagram.revealed .stroke-fill {
    transform: scaleX(1);
}

/* Elements Diagram */
.elements-diagram {
    position: relative;
    background: #F0E0D8;
    border: 2px solid #C0C8D0;
    border-radius: 4px;
    overflow: hidden;
    min-height: 320px;
}

.elements-diagram .card-cover {
    position: absolute;
    inset: 0;
    background: #5A1A2A;
    z-index: 3;
    transform: translateX(0);
    transition: transform 500ms ease-in-out;
}

.elements-diagram.revealed .card-cover {
    transform: translateX(-100%);
}

.elements-content {
    padding: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 320px;
    opacity: 0;
    transition: opacity 300ms ease 200ms;
}

.elements-diagram.revealed .elements-content {
    opacity: 1;
}

.element-ring {
    position: relative;
    width: 240px;
    height: 240px;
}

.element-node {
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px solid #C0C8D0;
    transition: transform 300ms ease;
}

.element-node:hover {
    transform: scale(1.15);
}

.element-char {
    font-family: 'Noto Serif KR', serif;
    font-weight: 700;
    font-size: 18px;
    color: #FFF5F0;
    line-height: 1;
}

.element-name-kr {
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 11px;
    color: #FFF5F0;
    opacity: 0.85;
}

/* Position elements in a pentagon */
.element-wood {
    background: #4A8A4A;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

.element-fire {
    background: #C04040;
    top: 35%;
    right: 0;
}

.element-earth {
    background: #D4A060;
    bottom: 0;
    right: 15%;
}

.element-metal {
    background: #C0C8D0;
    bottom: 0;
    left: 15%;
}

.element-metal .element-char,
.element-metal .element-name-kr {
    color: #2A1018;
}

.element-water {
    background: #4060A0;
    top: 35%;
    left: 0;
}

/* Generational Diagram */
.gen-diagram {
    position: relative;
    background: #F0E0D8;
    border: 2px solid #C0C8D0;
    border-radius: 4px;
    overflow: hidden;
    min-height: 280px;
}

.gen-diagram .card-cover {
    position: absolute;
    inset: 0;
    background: #5A1A2A;
    z-index: 3;
    transform: translateX(0);
    transition: transform 500ms ease-in-out;
}

.gen-diagram.revealed .card-cover {
    transform: translateX(-100%);
}

.gen-content {
    padding: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    opacity: 0;
    transition: opacity 300ms ease 200ms;
}

.gen-diagram.revealed .gen-content {
    opacity: 1;
}

.gen-tree {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.gen-row {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.gen-name {
    font-family: 'Noto Serif KR', serif;
    font-weight: 500;
    font-size: 22px;
    color: #2A1018;
    padding: 8px 14px;
    background: #FFF5F0;
    border: 1px solid #C0C8D0;
    border-radius: 3px;
}

.gen-shared {
    color: #C04040;
    font-weight: 700;
}

.gen-connector {
    width: 2px;
    height: 20px;
    background: #C0C8D0;
}

/* --- Footer --- */
.footer {
    background: #5A1A2A;
    padding: 3em 2em;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.footer-brand {
    margin-bottom: 2em;
}

.footer-logo {
    font-family: 'DM Serif Display', serif;
    font-size: 28px;
    color: #FFF5F0;
    letter-spacing: 0.03em;
}

.footer-tagline {
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    color: #C0C8D0;
    margin-top: 0.5em;
}

.footer-surnames {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 2em;
}

.surname-btn {
    font-family: 'Noto Serif KR', serif;
    font-weight: 700;
    font-size: 20px;
    color: #FFF5F0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #C0C8D0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 200ms ease;
    background: transparent;
    position: relative;
}

.surname-btn::before {
    content: '';
    position: absolute;
    inset: 2px;
    border: 1px solid #E8EEF4;
    border-radius: 2px;
    pointer-events: none;
}

.surname-btn:hover {
    background: #8A3A4A;
    border-color: #E8EEF4;
    transform: translateY(-2px);
}

.footer-copy {
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    color: #8090A0;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .hero {
        flex-direction: column;
    }

    .hero-left {
        width: 100%;
        min-height: 50vh;
    }

    .hero-right {
        width: 100%;
        min-height: 50vh;
    }

    .edu-block,
    .edu-block-reverse {
        flex-direction: column;
    }

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

    .gen-name {
        font-size: 16px;
        padding: 6px 10px;
    }

    .big-hangul {
        font-size: 60px;
    }

    .stroke-content {
        flex-direction: column;
    }

    .element-ring {
        width: 200px;
        height: 200px;
    }

    .element-node {
        width: 48px;
        height: 48px;
    }

    .element-char {
        font-size: 14px;
    }

    .element-name-kr {
        font-size: 9px;
    }
}
