/* ==========================================================================
   yongzoon.com — Najeonchilgi Lacquerware Aesthetic
   Mother-of-pearl inlay, dragon scales, cloisonne wire dividers.
   ========================================================================== */

/* ---------- Palette tokens (Najeonchilgi Lacquer) ---------- */
:root {
    --lacquer-black: #050508;
    --deep-carmine: #1A0508;
    --pearl-white: #E8E4DC;
    --silk-gray: #B0A8A0;
    --mother-of-pearl: #7EB8C4;
    --iridescent-gold: #C4A86C;
    --iridescent-blue: #2A4A6A;
    --dragon-red: #8B2020;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Noto Sans KR", sans-serif;
    font-weight: 300;
    color: #B0A8A0;
    background: #050508;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
}

img,
svg {
    display: block;
    max-width: 100%;
}

/* ==========================================================================
   HERO — 200vh Lacquer Surface with Sticky Title
   ========================================================================== */

.hero {
    position: relative;
    height: 200vh;
    background: #050508;
    overflow: hidden;
    isolation: isolate;
}

/* Subtle dragon-scale tessellation as full-bleed texture (seigaiha adapted) */
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 0% 50%, rgba(126, 184, 196, 0.05) 0 6px, transparent 7px),
        radial-gradient(circle at 100% 50%, rgba(126, 184, 196, 0.05) 0 6px, transparent 7px),
        radial-gradient(circle at 50% 0%, rgba(126, 184, 196, 0.05) 0 6px, transparent 7px),
        radial-gradient(circle at 50% 100%, rgba(126, 184, 196, 0.05) 0 6px, transparent 7px);
    background-size: 24px 24px;
    opacity: 0.45;
    pointer-events: none;
    z-index: 0;
}

/* Faint inner vignette for "lacquer surface" depth */
.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 30%, rgba(0, 0, 0, 0.55) 100%);
    pointer-events: none;
    z-index: 1;
}

/* ---------- Sticky title ---------- */

.hero-title-wrap {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.hero-title-inner {
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1.2s ease-out, transform 1.2s ease-out;
    padding: 0 24px;
}

.hero-title-inner.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.hero-mark {
    font-family: "Cinzel Decorative", serif;
    font-weight: 400;
    font-size: 18px;
    letter-spacing: 0.45em;
    color: #7EB8C4;
    text-transform: uppercase;
    margin-bottom: 36px;
    opacity: 0.75;
}

.hero-title {
    font-family: "Noto Serif KR", serif;
    font-weight: 900;
    color: #E8E4DC;
    text-shadow: 0 0 30px rgba(232, 228, 220, 0.3);
    line-height: 1;
    margin-bottom: 28px;
}

.hero-title__korean {
    display: block;
    font-size: clamp(72px, 13vw, 168px);
    letter-spacing: 0.04em;
}

.hero-title__roman {
    display: block;
    font-family: "Cormorant", serif;
    font-weight: 400;
    font-style: italic;
    color: #C4A86C;
    font-size: clamp(20px, 2.2vw, 32px);
    letter-spacing: 0.42em;
    text-transform: lowercase;
    margin-top: 24px;
    text-shadow: 0 0 24px rgba(196, 168, 108, 0.25);
}

.hero-sub {
    font-family: "Cormorant", serif;
    font-style: italic;
    font-weight: 400;
    font-size: 15px;
    letter-spacing: 0.18em;
    color: rgba(176, 168, 160, 0.6);
}

/* ---------- Scroll indicator ---------- */

.scroll-cue {
    position: absolute;
    bottom: 48px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    z-index: 10;
    opacity: 0;
    transition: opacity 1.5s ease-out;
}

.scroll-cue.is-visible {
    opacity: 1;
}

.scroll-cue__line {
    width: 1px;
    height: 56px;
    background: linear-gradient(to bottom, transparent, #C4A86C);
    animation: cue-pulse 3s ease-in-out infinite;
}

.scroll-cue__label {
    font-family: "Cinzel Decorative", serif;
    font-size: 11px;
    letter-spacing: 0.4em;
    color: #7EB8C4;
    text-transform: uppercase;
    opacity: 0.7;
}

@keyframes cue-pulse {
    0%, 100% { opacity: 0.3; transform: scaleY(1); transform-origin: top; }
    50% { opacity: 0.85; transform: scaleY(1.1); transform-origin: top; }
}

/* ==========================================================================
   PEARL FRAGMENT PARTICLES — irregular polygons that shimmer
   ========================================================================== */

.pearl-field {
    position: absolute;
    inset: 0;
    z-index: 5;
    pointer-events: none;
}

.pearl {
    position: absolute;
    display: block;
    opacity: 0;
    transition: opacity 1.4s ease-out;
    transform-origin: center;
    will-change: opacity, filter;
}

.pearl.is-revealed {
    animation: shimmer 5s ease-in-out infinite;
}

/* irregular polygon shapes via clip-path; size + color via individual classes */
.pearl--1  { top: 12%; left:  8%; width: 16px; height: 16px; background: #7EB8C4; clip-path: polygon(50% 0%, 100% 35%, 80% 100%, 20% 95%, 0% 40%); animation-delay: 0s; }
.pearl--2  { top: 22%; left: 78%; width: 18px; height: 14px; background: #C4A86C; clip-path: polygon(20% 0%, 100% 20%, 90% 80%, 30% 100%, 0% 50%); animation-delay: 0.6s; }
.pearl--3  { top: 35%; left: 18%; width: 12px; height: 14px; background: #E8E4DC; clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%); animation-delay: 1.1s; }
.pearl--4  { top: 18%; left: 52%; width: 20px; height: 18px; background: #7EB8C4; clip-path: polygon(40% 0%, 100% 30%, 90% 90%, 20% 100%, 0% 60%, 10% 20%); animation-delay: 1.7s; }
.pearl--5  { top: 48%; left: 88%; width: 14px; height: 12px; background: #C4A86C; clip-path: polygon(50% 0%, 100% 50%, 70% 100%, 0% 80%, 10% 30%); animation-delay: 2.2s; }
.pearl--6  { top: 58%; left: 12%; width: 16px; height: 18px; background: #E8E4DC; clip-path: polygon(30% 0%, 90% 20%, 100% 70%, 50% 100%, 0% 60%); animation-delay: 0.4s; }
.pearl--7  { top: 65%; left: 65%; width: 11px; height: 11px; background: #7EB8C4; clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%); animation-delay: 2.9s; }
.pearl--8  { top: 28%; left: 38%; width: 19px; height: 16px; background: #C4A86C; clip-path: polygon(20% 10%, 100% 0%, 100% 70%, 60% 100%, 0% 80%); animation-delay: 1.4s; }
.pearl--9  { top: 75%; left: 32%; width: 13px; height: 15px; background: #7EB8C4; clip-path: polygon(50% 0%, 100% 35%, 80% 100%, 20% 95%, 0% 40%); animation-delay: 3.5s; }
.pearl--10 { top: 82%; left: 72%; width: 15px; height: 13px; background: #E8E4DC; clip-path: polygon(40% 0%, 100% 30%, 90% 90%, 10% 100%, 0% 50%); animation-delay: 4.1s; }
.pearl--11 { top: 42%; left: 5%;  width: 10px; height: 10px; background: #C4A86C; clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%); animation-delay: 0.9s; }
.pearl--12 { top: 88%; left: 48%; width: 17px; height: 15px; background: #7EB8C4; clip-path: polygon(30% 0%, 90% 20%, 100% 70%, 50% 100%, 0% 60%); animation-delay: 2.6s; }
.pearl--13 { top: 8%;  left: 62%; width: 12px; height: 14px; background: #C4A86C; clip-path: polygon(50% 0%, 100% 50%, 70% 100%, 0% 80%, 10% 30%); animation-delay: 3.8s; }
.pearl--14 { top: 52%; left: 42%; width: 14px; height: 12px; background: #E8E4DC; clip-path: polygon(20% 10%, 100% 0%, 100% 70%, 60% 100%, 0% 80%); animation-delay: 1.9s; }
.pearl--15 { top: 70%; left: 18%; width: 11px; height: 13px; background: #7EB8C4; clip-path: polygon(50% 0%, 100% 35%, 80% 100%, 20% 95%, 0% 40%); animation-delay: 4.5s; }
.pearl--16 { top: 32%; left: 92%; width: 13px; height: 11px; background: #C4A86C; clip-path: polygon(40% 0%, 100% 30%, 90% 90%, 10% 100%, 0% 50%); animation-delay: 0.2s; }
.pearl--17 { top: 60%; left: 50%; width: 9px;  height: 10px; background: #E8E4DC; clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%); animation-delay: 3.1s; }
.pearl--18 { top: 78%; left: 82%; width: 16px; height: 14px; background: #7EB8C4; clip-path: polygon(30% 0%, 90% 20%, 100% 70%, 50% 100%, 0% 60%); animation-delay: 2.4s; }

@keyframes shimmer {
    0%, 100% {
        filter: hue-rotate(0deg) brightness(1);
        opacity: 0.4;
    }
    50% {
        filter: hue-rotate(15deg) brightness(1.25);
        opacity: 0.65;
    }
}

/* ==========================================================================
   CLOUD SCROLL PATTERNS — drift across hero after 100vh threshold
   ========================================================================== */

.cloud-layer {
    position: absolute;
    left: -50%;
    width: 200%;
    pointer-events: none;
    z-index: 3;
    opacity: 0;
    transition: opacity 1.6s ease-out;
}

.cloud-layer.is-active {
    opacity: 1;
}

.cloud-layer--far {
    top: 18%;
    height: 220px;
    animation: cloud-drift-slow 60s linear infinite;
    animation-play-state: paused;
}

.cloud-layer--mid {
    top: 42%;
    height: 200px;
    animation: cloud-drift-mid 48s linear infinite;
    animation-play-state: paused;
}

.cloud-layer--near {
    top: 68%;
    height: 240px;
    animation: cloud-drift-fast 40s linear infinite;
    animation-play-state: paused;
}

.cloud-layer.is-active.cloud-layer--far,
.cloud-layer.is-active.cloud-layer--mid,
.cloud-layer.is-active.cloud-layer--near {
    animation-play-state: running;
}

.cloud-svg {
    width: 100%;
    height: 100%;
}

@keyframes cloud-drift-slow {
    from { transform: translateX(0); }
    to   { transform: translateX(-25%); }
}

@keyframes cloud-drift-mid {
    from { transform: translateX(0); }
    to   { transform: translateX(-30%); }
}

@keyframes cloud-drift-fast {
    from { transform: translateX(0); }
    to   { transform: translateX(-20%); }
}

/* ==========================================================================
   THRESHOLD — narrow cloisonne wire band between sections
   ========================================================================== */

.threshold {
    position: relative;
    height: 40px;
    background: rgba(42, 74, 106, 0.15); /* #2A4A6A iridescent blue at 15% */
    border-top: 1px solid rgba(196, 168, 108, 0.06);
    border-bottom: 1px solid rgba(139, 32, 32, 0.06); /* #8B2020 dragon red trace */
    overflow: hidden;
}

.threshold::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right,
        transparent,
        rgba(196, 168, 108, 0.5) 20%,
        rgba(196, 168, 108, 0.7) 50%,
        rgba(196, 168, 108, 0.5) 80%,
        transparent
    );
    transform: translateY(-50%);
}

.threshold::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    background: #C4A86C;
    transform: translate(-50%, -50%) rotate(45deg);
    opacity: 0.6;
}

/* ==========================================================================
   TRANSITION GRADIENT BANDS (50vh)
   ========================================================================== */

.transition {
    position: relative;
    height: 50vh;
    pointer-events: none;
}

.transition--carmine {
    background: linear-gradient(to bottom, #050508 0%, #1A0508 100%);
}

.transition--black {
    background: linear-gradient(to bottom, #1A0508 0%, #050508 100%);
}

/* ==========================================================================
   CHAMBER SECTIONS (100vh, centered single column)
   ========================================================================== */

.chamber {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 100px 24px;
    overflow: hidden;
    isolation: isolate;
}

.chamber--black {
    background: #050508;
}

.chamber--carmine {
    background: #1A0508;
}

/* Dragon-scale full-bleed background (seigaiha radial gradient at low opacity) */
.chamber__scales {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        radial-gradient(circle at 0% 100%, rgba(126, 184, 196, 0.05) 0 18px, transparent 19px),
        radial-gradient(circle at 50% 100%, rgba(126, 184, 196, 0.05) 0 18px, transparent 19px),
        radial-gradient(circle at 100% 100%, rgba(126, 184, 196, 0.05) 0 18px, transparent 19px),
        radial-gradient(circle at 25% 50%, rgba(126, 184, 196, 0.04) 0 18px, transparent 19px),
        radial-gradient(circle at 75% 50%, rgba(126, 184, 196, 0.04) 0 18px, transparent 19px);
    background-size: 60px 36px;
    opacity: 0.5;
}

.chamber__scales--dense {
    background-size: 48px 28px;
    opacity: 0.65;
}

/* Drifting cloud as background of chamber */
.chamber__cloud-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.7;
}

.chamber__cloud-bg .cloud-svg {
    width: 120%;
    height: 100%;
    margin-left: -10%;
    animation: cloud-drift-slow 90s linear infinite;
}

/* Inner content */

.chamber__inner {
    position: relative;
    z-index: 2;
    max-width: 640px;
    text-align: center;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1.4s ease-out, transform 1.4s ease-out;
}

.chamber__inner.is-revealed {
    opacity: 1;
    transform: translateY(0);
}

.chamber__roman {
    font-family: "Cinzel Decorative", serif;
    font-weight: 400;
    font-size: 20px;
    letter-spacing: 0.4em;
    color: #7EB8C4;
    text-transform: uppercase;
    margin-bottom: 28px;
    opacity: 0.85;
}

.chamber__title {
    font-family: "Noto Serif KR", serif;
    font-weight: 900;
    font-size: clamp(36px, 5vw, 52px);
    color: #E8E4DC;
    text-shadow: 0 0 30px rgba(232, 228, 220, 0.3);
    line-height: 1.2;
    margin-bottom: 56px;
    letter-spacing: 0.02em;
}

.chamber__lead {
    font-family: "Noto Sans KR", sans-serif;
    font-weight: 300;
    font-size: 19px;
    line-height: 1.85;
    color: #B0A8A0;
    margin-bottom: 32px;
}

.chamber__body {
    font-family: "Noto Sans KR", sans-serif;
    font-weight: 300;
    font-size: 17px;
    line-height: 1.85;
    color: rgba(176, 168, 160, 0.85);
    margin-bottom: 24px;
}

.chamber__body:last-of-type {
    margin-bottom: 48px;
}

.chamber__inscription {
    font-family: "Cormorant", serif;
    font-weight: 400;
    font-style: italic;
    font-size: 16px;
    letter-spacing: 0.18em;
    color: #C4A86C;
    margin-top: 56px;
    opacity: 0.85;
}

/* ==========================================================================
   FINAL SEAL (footer)
   ========================================================================== */

.seal {
    position: relative;
    background: #050508;
    padding: 120px 24px 80px;
    text-align: center;
    border-top: 1px solid rgba(196, 168, 108, 0.15);
    box-shadow: inset 0 80px 120px -80px #2A4A6A; /* iridescent blue inner glow */
}

.seal__mark {
    width: 80px;
    height: 80px;
    margin: 0 auto 32px;
    opacity: 0.85;
}

.seal__svg {
    width: 100%;
    height: 100%;
}

.seal__line {
    font-family: "Noto Serif KR", serif;
    font-weight: 700;
    font-size: 18px;
    color: #E8E4DC;
    letter-spacing: 0.25em;
    margin-bottom: 14px;
    text-shadow: 0 0 28px rgba(139, 32, 32, 0.35); /* #8B2020 dragon red glow */
}

.seal__meta {
    font-family: "Cormorant", serif;
    font-style: italic;
    font-weight: 400;
    font-size: 13px;
    letter-spacing: 0.22em;
    color: rgba(176, 168, 160, 0.5);
    text-transform: lowercase;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 768px) {
    .chamber {
        padding: 80px 22px;
    }

    .chamber__title {
        font-size: 34px;
        margin-bottom: 40px;
    }

    .chamber__lead {
        font-size: 17px;
    }

    .chamber__body {
        font-size: 16px;
    }

    .hero-mark {
        font-size: 14px;
        letter-spacing: 0.35em;
    }

    .hero-sub {
        font-size: 13px;
    }

    .scroll-cue {
        bottom: 32px;
    }
}

@media (max-width: 480px) {
    .chamber__title {
        font-size: 28px;
    }

    .seal {
        padding: 80px 22px 56px;
    }
}

/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .pearl {
        opacity: 0.5;
    }
}
