/* ============================================
   hangul.name - Y2K Futurism Korean Name Portal
   ============================================ */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.75;
    color: #2A2A30;
    background: linear-gradient(180deg, #C8D0D8 0%, #E8E4E0 100%);
    background-attachment: fixed;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* --- Cultural Pattern Overlay (Hangul Wallpaper) --- */
#hangul-wallpaper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.02;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Ctext x='10' y='30' font-family='sans-serif' font-size='24' fill='%23C8D0D8' transform='rotate(15 60 60)'%3E%E3%84%B1%3C/text%3E%3Ctext x='60' y='30' font-family='sans-serif' font-size='24' fill='%23C8D0D8' transform='rotate(15 60 60)'%3E%E3%85%8E%3C/text%3E%3Ctext x='10' y='75' font-family='sans-serif' font-size='24' fill='%23C8D0D8' transform='rotate(15 60 60)'%3E%E3%85%82%3C/text%3E%3Ctext x='60' y='75' font-family='sans-serif' font-size='24' fill='%23C8D0D8' transform='rotate(15 60 60)'%3E%E3%85%88%3C/text%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 120px 120px;
}

/* --- Scroll-Triggered Background Layers --- */
.bg-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

#bg-layer-tertiary {
    z-index: 1;
    background: radial-gradient(ellipse at 20% 50%, rgba(120, 88, 168, 0.06) 0%, transparent 60%),
                radial-gradient(ellipse at 80% 30%, rgba(72, 120, 184, 0.06) 0%, transparent 60%);
}

#bg-layer-secondary {
    z-index: 2;
    background: radial-gradient(ellipse at 60% 70%, rgba(72, 120, 184, 0.04) 0%, transparent 50%),
                radial-gradient(ellipse at 30% 20%, rgba(232, 184, 96, 0.03) 0%, transparent 50%);
}

/* --- Depth Panel System --- */
.depth-panel {
    position: absolute;
    border-radius: 16px;
}

.depth-panel--back {
    top: 25px;
    left: 25px;
    right: -15px;
    bottom: -15px;
    background: rgba(168, 176, 184, 0.25);
    filter: blur(1px);
    z-index: 1;
}

.depth-panel--mid {
    top: 12px;
    left: 12px;
    right: -6px;
    bottom: -6px;
    background: rgba(200, 208, 216, 0.35);
    z-index: 2;
}

.depth-panel--front {
    position: relative;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 16px;
    border: 1px solid rgba(168, 176, 184, 0.3);
    padding: 48px;
    z-index: 3;
}

/* --- Section Depth Wrapper --- */
.section-depth-wrapper {
    position: relative;
    max-width: 900px;
    margin: 0 auto 60px;
}

/* --- Section Headings --- */
.section-heading {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: clamp(2rem, 4vw, 3.5rem);
    letter-spacing: 0.01em;
    color: #2A2A30;
    margin-bottom: 16px;
}

.section-intro {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.75;
    color: #7A7A88;
    max-width: 680px;
}

/* ============================================
   HERO SECTION
   ============================================ */
#hero {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    overflow: hidden;
}

/* Hero depth panels */
.hero-panel {
    position: absolute;
    border-radius: 16px;
}

.hero-panel--deep {
    width: min(600px, 80vw);
    height: 340px;
    background: rgba(168, 176, 184, 0.2);
    filter: blur(1px);
    transform: translate(40px, 40px);
    z-index: 1;
    opacity: 0;
}

.hero-panel--mid {
    width: min(560px, 76vw);
    height: 310px;
    background: rgba(200, 208, 216, 0.35);
    transform: translate(20px, 20px);
    z-index: 2;
    opacity: 0;
}

.hero-panel--primary {
    position: relative;
    width: min(520px, 72vw);
    height: 280px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(168, 176, 184, 0.3);
    z-index: 3;
    opacity: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-panel__shimmer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
    transform: translateX(-100%);
    z-index: 10;
    pointer-events: none;
}

.hero-title {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: clamp(2.5rem, 5vw, 4rem);
    letter-spacing: 0.01em;
    color: #2A2A30;
    opacity: 0;
    transform: translateY(10px);
}

.hero-subtitle {
    font-family: 'Ubuntu Mono', monospace;
    font-weight: 400;
    font-size: 0.85rem;
    color: #7A7A88;
    margin-top: 8px;
    opacity: 0;
    transform: translateY(10px);
}

.hero-tagline {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: 1rem;
    color: #4878B8;
    margin-top: 16px;
    opacity: 0;
    transform: translateY(10px);
}

/* ============================================
   NAME EXPLORER SECTION
   ============================================ */
#name-explorer {
    position: relative;
    z-index: 10;
    padding: 100px 24px;
}

.character-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 32px;
    max-width: 900px;
    margin: 0 auto;
}

/* --- Character Card --- */
.character-card {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1.15;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(168, 176, 184, 0.3);
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.character-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(72, 120, 184, 0.15);
}

/* Pixel layer: behind, pixelated */
.card-pixel-layer {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -55%);
    font-family: 'Nanum Myeongjo', serif;
    font-size: clamp(4rem, 10vw, 7rem);
    color: rgba(168, 176, 184, 0.2);
    image-rendering: pixelated;
    filter: blur(0.5px);
    z-index: 1;
    user-select: none;
    pointer-events: none;
}

/* Gradient layer: main character display */
.card-gradient-layer {
    position: relative;
    font-family: 'Nanum Myeongjo', serif;
    font-size: clamp(3rem, 8vw, 6rem);
    background: linear-gradient(135deg, #4878B8, #7858A8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    z-index: 2;
    user-select: none;
    transition: transform 0.3s ease;
}

/* Chrome badge */
.card-chrome-badge {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #E8E4E0 0%, #C8D0D8 40%, #A8B0B8 60%, #C8D0D8 100%);
    border: 1px solid rgba(168, 176, 184, 0.5);
    border-radius: 20px;
    padding: 4px 20px;
    z-index: 3;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.character-card:hover .card-chrome-badge {
    background: linear-gradient(150deg, #E8E4E0 0%, #C8D0D8 40%, #A8B0B8 60%, #C8D0D8 100%);
    box-shadow: 0 2px 12px rgba(72, 120, 184, 0.15);
}

.badge-text {
    font-family: 'Ubuntu Mono', monospace;
    font-weight: 400;
    font-size: 0.85rem;
    color: #2A2A30;
}

/* Card info */
.card-info {
    position: absolute;
    bottom: 16px;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    z-index: 3;
}

.card-meaning {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: 0.8rem;
    color: #7A7A88;
}

.card-code {
    font-family: 'Ubuntu Mono', monospace;
    font-weight: 400;
    font-size: 0.75rem;
    color: #A8B0B8;
}

/* ============================================
   EXPANDED CARD OVERLAY
   ============================================ */
.card-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(42, 42, 48, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.card-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.expanded-card {
    position: relative;
    width: min(440px, 85vw);
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(168, 176, 184, 0.4);
    border-radius: 16px;
    padding: 48px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: scale(0.9);
    transition: transform 0.4s ease;
}

.card-overlay.active .expanded-card {
    transform: scale(1);
}

.expanded-pixel-layer {
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-55%);
    font-family: 'Nanum Myeongjo', serif;
    font-size: 7rem;
    color: rgba(168, 176, 184, 0.15);
    image-rendering: pixelated;
    filter: blur(0.5px);
    z-index: 1;
    pointer-events: none;
    user-select: none;
    transition: transform 0.4s ease;
}

.card-overlay.active .expanded-pixel-layer {
    transform: translateX(-55%) translateX(-5px);
}

.expanded-gradient-layer {
    position: relative;
    font-family: 'Nanum Myeongjo', serif;
    font-size: clamp(4rem, 10vw, 7rem);
    background: linear-gradient(135deg, #4878B8, #7858A8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    z-index: 2;
    user-select: none;
    margin-bottom: 8px;
}

.expanded-chrome-badge {
    background: linear-gradient(135deg, #E8E4E0 0%, #C8D0D8 40%, #A8B0B8 60%, #C8D0D8 100%);
    border: 1px solid rgba(168, 176, 184, 0.5);
    border-radius: 20px;
    padding: 6px 28px;
    z-index: 3;
    margin-bottom: 24px;
    transition: transform 0.4s ease;
}

.card-overlay.active .expanded-chrome-badge {
    transform: translateX(10px);
}

.expanded-badge-text {
    font-family: 'Ubuntu Mono', monospace;
    font-weight: 400;
    font-size: 1rem;
    color: #2A2A30;
}

.expanded-details {
    text-align: center;
    z-index: 3;
}

.expanded-char-name {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    color: #2A2A30;
    margin-bottom: 8px;
}

.expanded-meaning {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: 1rem;
    color: #4878B8;
    margin-bottom: 16px;
}

.expanded-detail {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: 0.95rem;
    line-height: 1.75;
    color: #7A7A88;
    margin-bottom: 16px;
    max-width: 360px;
}

.expanded-code {
    font-family: 'Ubuntu Mono', monospace;
    font-weight: 400;
    font-size: 0.85rem;
    color: #A8B0B8;
}

/* ============================================
   CULTURAL DEPTH ZONES
   ============================================ */
#naming-culture {
    position: relative;
    z-index: 10;
    padding: 80px 24px 100px;
}

.culture-depth-zone {
    position: relative;
    max-width: 900px;
    margin: 0 auto 60px;
}

.culture-depth-zone:last-child {
    margin-bottom: 0;
}

.culture-depth-zone--shallow .depth-panel--back {
    background: rgba(168, 176, 184, 0.2);
}

.culture-depth-zone--shallow .depth-panel--front {
    background: rgba(255, 255, 255, 0.6);
}

.culture-depth-zone--medium .depth-panel--back {
    background: rgba(120, 88, 168, 0.12);
}

.culture-depth-zone--medium .depth-panel--front {
    background: rgba(255, 255, 255, 0.5);
}

.culture-depth-zone--deep .depth-panel--back {
    background: rgba(72, 120, 184, 0.15);
}

.culture-depth-zone--deep .depth-panel--front {
    background: rgba(255, 255, 255, 0.4);
}

.culture-text {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.75;
    color: #2A2A30;
    max-width: 720px;
}

/* ============================================
   NAME SPECIMENS
   ============================================ */
#name-specimens {
    position: relative;
    z-index: 10;
    padding: 80px 24px 120px;
}

.specimens-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 40px;
    max-width: 900px;
    margin: 0 auto;
}

.specimen-card {
    position: relative;
}

.specimen-shadow {
    position: absolute;
    top: 20px;
    left: 20px;
    right: -10px;
    bottom: -10px;
    background: rgba(168, 176, 184, 0.2);
    border-radius: 14px;
    filter: blur(1px);
    z-index: 1;
}

.specimen-content {
    position: relative;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(168, 176, 184, 0.3);
    border-radius: 14px;
    padding: 36px 32px;
    z-index: 2;
}

.specimen-hangul {
    font-family: 'Nanum Myeongjo', serif;
    font-weight: 400;
    font-size: clamp(3rem, 8vw, 5rem);
    color: #2A2A30;
    margin-bottom: 4px;
    line-height: 1.2;
    text-shadow: 2px 2px 0 rgba(232, 184, 96, 0.15);
}

.specimen-hangul::first-letter {
    color: #E8B860;
}

.specimen-roman {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
    color: #4878B8;
    margin-bottom: 20px;
}

.specimen-breakdown {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
}

.specimen-char {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #E8E4E0 0%, #C8D0D8 40%, #A8B0B8 60%, #C8D0D8 100%);
    border: 1px solid rgba(168, 176, 184, 0.4);
    border-radius: 12px;
    flex: 1;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.specimen-char:hover {
    background: linear-gradient(150deg, #E8E4E0 0%, #C8D0D8 40%, #A8B0B8 60%, #C8D0D8 100%);
    box-shadow: 0 2px 12px rgba(72, 120, 184, 0.15);
}

.specimen-char-hangul {
    font-family: 'Nanum Myeongjo', serif;
    font-weight: 400;
    font-size: 1.6rem;
    color: #2A2A30;
}

.specimen-char-meaning {
    font-family: 'Ubuntu Mono', monospace;
    font-weight: 400;
    font-size: 0.7rem;
    color: #7A7A88;
    text-align: center;
}

.specimen-meta {
    font-family: 'Ubuntu Mono', monospace;
    font-weight: 400;
    font-size: 0.85rem;
    color: #A8B0B8;
    padding-top: 12px;
    border-top: 1px solid rgba(168, 176, 184, 0.2);
}

/* ============================================
   FOOTER
   ============================================ */
#portal-footer {
    position: relative;
    z-index: 10;
    padding: 0 24px 60px;
}

.footer-depth-wrapper {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
}

.footer-logo {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    color: #2A2A30;
}

.footer-status {
    font-family: 'Ubuntu Mono', monospace;
    font-weight: 400;
    font-size: 0.85rem;
    color: #7A7A88;
}

.status-indicator {
    color: #4878B8;
}

.footer-text {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: 0.85rem;
    color: #A8B0B8;
    max-width: 480px;
    line-height: 1.6;
}

/* ============================================
   ANIMATIONS (Opening Sequence Classes)
   ============================================ */
.fade-in {
    animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.slide-fade-in {
    animation: slideFadeIn 0.5s ease forwards;
}

@keyframes slideFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.shimmer-sweep {
    animation: shimmerSweep 0.6s ease-out forwards;
}

@keyframes shimmerSweep {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(100%);
    }
}

/* Scroll reveal for sections */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .character-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 20px;
    }

    .specimens-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .depth-panel--front {
        padding: 32px 24px;
    }

    .hero-panel--primary {
        width: 85vw;
        height: 260px;
    }

    .hero-panel--mid {
        width: 81vw;
        height: 240px;
    }

    .hero-panel--deep {
        width: 77vw;
        height: 220px;
    }

    .specimen-breakdown {
        flex-wrap: wrap;
    }

    .expanded-card {
        padding: 36px 24px;
    }
}

@media (max-width: 480px) {
    .character-grid {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }

    .card-chrome-badge {
        bottom: 50px;
        padding: 3px 14px;
    }

    .card-info {
        bottom: 12px;
    }

    .card-meaning {
        font-size: 0.7rem;
    }

    .card-code {
        font-size: 0.65rem;
    }

    .hero-panel--primary {
        height: 240px;
    }
}
