/* ===================================================================
   saram.quest -- Fairycore / Layered-Depth / Honeyed-Neutral
   Palette: #F5E6C8 #D4A050 #FF9BE3 #7DFFBD #C8A060 #4A3828 #FFF8F0
   Fonts:   Commissioner (headlines) / Nunito (body) / Fira Code (label)
   =================================================================== */

/* ---------- Tokens ---------- */
:root {
    --color-golden-hour: #F5E6C8;
    --color-warm-honey: #D4A050;
    --color-fairy-pink: #FF9BE3;
    --color-enchanted-mint: #7DFFBD;
    --color-deep-amber: #C8A060;
    --color-forest-shadow: #4A3828;
    --color-petal-white: #FFF8F0;

    --font-headline: 'Commissioner', Georgia, serif;
    --font-body: 'Nunito', system-ui, sans-serif;
    --font-mono: 'Fira Code', 'Courier New', monospace;

    --ease-soft: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-glide: cubic-bezier(0.16, 1, 0.3, 1);

    --layer-bg: 1;
    --layer-mid: 2;
    --layer-fore: 3;
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(16px, 1.5vw, 18px);
    line-height: 1.85;
    color: var(--color-forest-shadow);
    background: var(--color-golden-hour);
    overflow-x: hidden;
    min-height: 100vh;
}
img, svg { max-width: 100%; display: block; }
em { font-style: italic; color: var(--color-warm-honey); }

/* ---------- Korean glyph ---------- */
.korean {
    font-family: var(--font-headline);
    font-weight: 700;
    color: var(--color-warm-honey);
    letter-spacing: 0.05em;
}
.korean--lg {
    font-size: clamp(96px, 14vw, 200px);
    line-height: 1;
    color: var(--color-warm-honey);
    text-shadow:
        0 0 40px rgba(255, 155, 227, 0.25),
        0 0 90px rgba(125, 255, 189, 0.18);
    display: inline-block;
}

/* ---------- Meta label (futuristic monospace) ---------- */
.meta-label {
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: 12px;
    letter-spacing: 0.18em;
    color: var(--color-warm-honey);
    text-transform: uppercase;
    margin: 0 0 16px;
    opacity: 0.85;
}

/* ===================================================================
   THE CLEARING (100vh hero)
   =================================================================== */
.clearing {
    position: relative;
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background:
        radial-gradient(ellipse at 30% 20%, rgba(255, 248, 240, 0.45) 0%, transparent 55%),
        radial-gradient(ellipse at 75% 75%, rgba(212, 160, 80, 0.18) 0%, transparent 55%),
        var(--color-golden-hour);
}

.clearing__content {
    position: relative;
    z-index: var(--layer-mid);
    text-align: center;
    padding: 0 32px;
    max-width: 900px;
}

.wordmark {
    font-family: var(--font-headline);
    font-weight: 700;
    font-size: clamp(56px, 9vw, 128px);
    line-height: 1;
    letter-spacing: -0.02em;
    margin: 0 0 24px;
    color: var(--color-forest-shadow);
    opacity: 0;
    transform: scale(0.97);
    transition: opacity 1s var(--ease-glide), transform 1.2s var(--ease-glide);
}
.wordmark.is-visible {
    opacity: 1;
    transform: scale(1);
}
.wordmark__dot { color: var(--color-forest-shadow); }
.wordmark__sep {
    color: var(--color-fairy-pink);
    text-shadow:
        0 0 18px rgba(255, 155, 227, 0.55),
        0 0 36px rgba(255, 155, 227, 0.3);
    margin: 0 0.02em;
}
.wordmark__tld {
    color: var(--color-warm-honey);
    font-style: italic;
    font-weight: 600;
}

.wordmark__subtitle {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(14px, 1.4vw, 17px);
    line-height: 1.6;
    color: var(--color-forest-shadow);
    margin: 0;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.9s var(--ease-glide) 0.35s, transform 0.9s var(--ease-glide) 0.35s;
}
.wordmark__subtitle.is-visible {
    opacity: 0.78;
    transform: translateY(0);
}

/* Glow layer (bioluminescent points) */
.glow-layer {
    position: absolute;
    inset: 0;
    z-index: var(--layer-bg);
    pointer-events: none;
}
.glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(20px);
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 0.9s var(--ease-soft), transform 1.2s var(--ease-soft);
}
.glow.is-visible {
    opacity: 1;
    transform: scale(1);
}
.glow--pink {
    background: radial-gradient(circle, rgba(255, 155, 227, 0.7) 0%, rgba(255, 155, 227, 0) 70%);
}
.glow--mint {
    background: radial-gradient(circle, rgba(125, 255, 189, 0.7) 0%, rgba(125, 255, 189, 0) 70%);
}
.glow--1 { width: 60px; height: 60px; top: 15%; left: 10%; }
.glow--2 { width: 80px; height: 80px; top: 20%; right: 12%; }
.glow--3 { width: 50px; height: 50px; top: 65%; left: 18%; }
.glow--4 { width: 70px; height: 70px; bottom: 18%; right: 22%; }
.glow--5 { width: 40px; height: 40px; top: 40%; left: 8%; }
.glow--6 { width: 55px; height: 55px; top: 78%; right: 8%; }
.glow--7 { width: 45px; height: 45px; top: 30%; left: 75%; }
.glow--8 { width: 65px; height: 65px; bottom: 12%; left: 35%; }

.glow--xl { filter: blur(45px); opacity: 0; }
.glow--xl.is-visible { opacity: 0.8; }

.glow--bg-1 { width: 280px; height: 280px; top: 8%; left: -60px; }
.glow--bg-2 { width: 340px; height: 340px; bottom: 5%; right: -80px; }
.glow--th-1 { width: 240px; height: 240px; top: 20%; right: 10%; }
.glow--th-2 { width: 300px; height: 300px; bottom: 10%; left: 5%; }

/* Fairy-path SVG (futuristic circuit lines) */
.fairy-paths {
    position: absolute;
    inset: 0;
    z-index: var(--layer-fore);
    width: 100%;
    height: 100%;
    pointer-events: none;
}
.fairy-path {
    stroke-dasharray: 1500;
    stroke-dashoffset: 1500;
    transition: stroke-dashoffset 1.6s var(--ease-glide);
}
.fairy-path.is-visible {
    stroke-dashoffset: 0;
}
.fairy-node {
    opacity: 0;
    transition: opacity 0.6s var(--ease-soft);
}
.fairy-node.is-visible {
    opacity: 1;
}

/* Scroll cue */
.scroll-cue {
    position: absolute;
    bottom: 36px;
    left: 50%;
    transform: translateX(-50%);
    z-index: var(--layer-fore);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    opacity: 0;
    transition: opacity 1s var(--ease-soft) 1.6s;
}
.scroll-cue.is-visible { opacity: 0.65; }
.scroll-cue__label {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--color-warm-honey);
}
.scroll-cue__line {
    width: 1px;
    height: 36px;
    background: linear-gradient(to bottom, var(--color-warm-honey), transparent);
    animation: cueDrift 2.4s var(--ease-soft) infinite;
}
@keyframes cueDrift {
    0%, 100% { transform: translateY(0); opacity: 0.7; }
    50%      { transform: translateY(8px); opacity: 1; }
}

/* ===================================================================
   FOREST LAYERS (progressive disclosure narrative)
   =================================================================== */
.forest-layers {
    position: relative;
    padding: clamp(80px, 12vw, 160px) clamp(24px, 6vw, 96px);
    overflow: hidden;
    background:
        linear-gradient(180deg,
            var(--color-golden-hour) 0%,
            #F1DDB9 50%,
            var(--color-golden-hour) 100%);
}

.forest__bg-layer {
    position: absolute;
    inset: 0;
    z-index: var(--layer-bg);
    pointer-events: none;
    opacity: 0;
    transform: translateY(20px) scale(1.05);
    transition: opacity 1s var(--ease-soft), transform 1.2s var(--ease-soft);
}
.forest__bg-layer.is-revealed {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.circuit-arc {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(80vw, 900px);
    height: auto;
    opacity: 0.5;
}

.forest__content {
    position: relative;
    z-index: var(--layer-mid);
    max-width: 880px;
    margin: 0 auto 80px;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.9s var(--ease-soft) 0.3s, transform 0.9s var(--ease-soft) 0.3s;
}
.forest__content.is-revealed {
    opacity: 1;
    transform: translateY(0);
}

.forest__heading {
    font-family: var(--font-headline);
    font-weight: 600;
    font-size: clamp(28px, 4.5vw, 56px);
    line-height: 1.18;
    letter-spacing: -0.01em;
    color: var(--color-forest-shadow);
    margin: 0 0 28px;
}

.forest__lede {
    font-family: var(--font-body);
    font-size: clamp(16px, 1.5vw, 19px);
    line-height: 1.85;
    color: var(--color-forest-shadow);
    margin: 0 auto;
    max-width: 680px;
    opacity: 0.92;
}

.forest__fore {
    position: relative;
    z-index: var(--layer-fore);
    max-width: 1240px;
    margin: 0 auto;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.9s var(--ease-soft) 0.6s, transform 0.9s var(--ease-soft) 0.6s;
}
.forest__fore.is-revealed {
    opacity: 1;
    transform: translateY(0);
}

.forest__motif-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: clamp(28px, 3.5vw, 56px);
    align-items: start;
}

.motif {
    position: relative;
    padding: 32px 28px 32px 0;
    border-left: 1px solid rgba(212, 160, 80, 0.45);
    padding-left: 28px;
}

.motif__index {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.18em;
    color: var(--color-fairy-pink);
    text-shadow: 0 0 12px rgba(255, 155, 227, 0.4);
    margin: 0 0 12px;
    opacity: 0.95;
}

.motif__title {
    font-family: var(--font-headline);
    font-weight: 600;
    font-size: clamp(22px, 2.2vw, 28px);
    line-height: 1.25;
    color: var(--color-forest-shadow);
    margin: 0 0 16px;
}

.motif__body {
    font-size: 16px;
    line-height: 1.85;
    color: var(--color-forest-shadow);
    margin: 0;
    opacity: 0.85;
}

/* ===================================================================
   THE TREASURE HALL (artifact cards)
   =================================================================== */
.treasure-hall {
    position: relative;
    padding: clamp(80px, 12vw, 160px) clamp(24px, 6vw, 96px);
    overflow: hidden;
    background:
        radial-gradient(ellipse at 70% 30%, rgba(255, 248, 240, 0.6) 0%, transparent 60%),
        var(--color-golden-hour);
}

.treasure-hall__bg {
    position: absolute;
    inset: 0;
    z-index: var(--layer-bg);
    pointer-events: none;
    opacity: 0;
    transform: scale(1.08);
    transition: opacity 1s var(--ease-soft), transform 1.2s var(--ease-soft);
}
.treasure-hall__bg.is-revealed {
    opacity: 1;
    transform: scale(1);
}

.treasure-hall__header {
    position: relative;
    z-index: var(--layer-mid);
    max-width: 760px;
    margin: 0 auto 80px;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.9s var(--ease-soft) 0.3s, transform 0.9s var(--ease-soft) 0.3s;
}
.treasure-hall__header.is-revealed {
    opacity: 1;
    transform: translateY(0);
}

.treasure-hall__heading {
    font-family: var(--font-headline);
    font-weight: 600;
    font-size: clamp(28px, 4.5vw, 52px);
    line-height: 1.2;
    color: var(--color-forest-shadow);
    margin: 0 0 24px;
}
.treasure-hall__lede {
    font-size: clamp(16px, 1.5vw, 18px);
    line-height: 1.85;
    color: var(--color-forest-shadow);
    margin: 0;
    opacity: 0.85;
}

.artifact-grid {
    position: relative;
    z-index: var(--layer-fore);
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: clamp(24px, 3vw, 40px);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.9s var(--ease-soft) 0.6s, transform 0.9s var(--ease-soft) 0.6s;
}
.artifact-grid.is-revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Artifact card (enchanted card glow) */
.artifact {
    position: relative;
    transition: transform 0.6s var(--ease-glide);
}
.artifact:hover {
    transform: translateY(-6px);
}

.artifact__frame {
    position: relative;
    background: var(--color-petal-white);
    padding: 40px 28px 32px;
    border-radius: 2px;
    box-shadow:
        0 0 30px rgba(255, 155, 227, 0.15),
        0 0 60px rgba(125, 255, 189, 0.1),
        0 1px 0 rgba(212, 160, 80, 0.25);
    transition:
        box-shadow 0.6s var(--ease-glide),
        transform 0.6s var(--ease-glide);
    overflow: hidden;
}

.artifact:hover .artifact__frame {
    box-shadow:
        0 0 50px rgba(255, 155, 227, 0.3),
        0 0 100px rgba(125, 255, 189, 0.2),
        0 4px 0 rgba(212, 160, 80, 0.35);
}

/* Futuristic frame corners */
.artifact__corner {
    position: absolute;
    width: 14px;
    height: 14px;
    border-color: var(--color-warm-honey);
    border-style: solid;
    border-width: 0;
}
.artifact__corner--tl { top: 8px; left: 8px;     border-top-width: 1px; border-left-width: 1px; }
.artifact__corner--tr { top: 8px; right: 8px;    border-top-width: 1px; border-right-width: 1px; }
.artifact__corner--bl { bottom: 8px; left: 8px;  border-bottom-width: 1px; border-left-width: 1px; }
.artifact__corner--br { bottom: 8px; right: 8px; border-bottom-width: 1px; border-right-width: 1px; }

.artifact__sigil {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.24em;
    color: var(--color-warm-honey);
    text-transform: uppercase;
    margin: 0 0 6px;
}
.artifact__rune {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.14em;
    color: var(--color-fairy-pink);
    text-shadow: 0 0 10px rgba(255, 155, 227, 0.4);
    margin: 0 0 22px;
    opacity: 0.95;
}

.artifact__name {
    font-family: var(--font-headline);
    font-weight: 700;
    font-size: clamp(24px, 2.2vw, 30px);
    line-height: 1.2;
    color: var(--color-forest-shadow);
    margin: 0 0 16px;
    position: relative;
}
.artifact__name::after {
    content: "";
    display: block;
    width: 32px;
    height: 1px;
    background: linear-gradient(to right, var(--color-fairy-pink), var(--color-enchanted-mint));
    margin-top: 12px;
    box-shadow: 0 0 8px rgba(255, 155, 227, 0.4);
}

.artifact__description {
    font-size: 15px;
    line-height: 1.8;
    color: var(--color-forest-shadow);
    margin: 0;
    opacity: 0.82;
}

/* ===================================================================
   THE INSCRIPTION
   =================================================================== */
.inscription {
    position: relative;
    padding: clamp(100px, 14vw, 200px) clamp(24px, 6vw, 96px);
    background:
        radial-gradient(ellipse at center, rgba(255, 248, 240, 0.7) 0%, transparent 65%),
        linear-gradient(180deg, var(--color-golden-hour) 0%, #EFD9B5 100%);
    text-align: center;
    overflow: hidden;
}

.inscription__inner {
    position: relative;
    max-width: 760px;
    margin: 0 auto;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1.2s var(--ease-soft), transform 1.2s var(--ease-soft);
}
.inscription__inner.is-revealed {
    opacity: 1;
    transform: translateY(0);
}

.inscription__text {
    margin: 0 0 24px;
}

.inscription__translation {
    font-family: var(--font-body);
    font-size: clamp(15px, 1.4vw, 18px);
    line-height: 1.7;
    color: var(--color-forest-shadow);
    margin: 0 0 48px;
    opacity: 0.85;
}

.inscription__signoff {
    font-family: var(--font-headline);
    font-weight: 600;
    font-style: italic;
    font-size: clamp(18px, 2vw, 24px);
    line-height: 1.6;
    color: var(--color-warm-honey);
    margin: 0;
}

/* ===================================================================
   STARLIGHT FOOTER
   =================================================================== */
.starlight-footer {
    position: relative;
    padding: clamp(80px, 10vw, 140px) clamp(24px, 6vw, 96px) 64px;
    background:
        linear-gradient(180deg,
            var(--color-warm-honey) 0%,
            var(--color-deep-amber) 80%,
            #B58A45 100%);
    color: var(--color-petal-white);
    overflow: hidden;
}

.starlight-footer__stars {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}
.star {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--color-petal-white);
    box-shadow:
        0 0 8px rgba(255, 248, 240, 0.9),
        0 0 18px rgba(255, 155, 227, 0.5);
    animation: twinkle 3.6s ease-in-out infinite;
}
.star--1  { top: 14%; left: 8%;  animation-delay: 0s;    }
.star--2  { top: 28%; left: 22%; animation-delay: 0.4s;  }
.star--3  { top: 18%; left: 38%; animation-delay: 0.9s;  background: var(--color-enchanted-mint); }
.star--4  { top: 42%; left: 48%; animation-delay: 1.2s;  }
.star--5  { top: 24%; left: 62%; animation-delay: 0.6s;  background: var(--color-fairy-pink); }
.star--6  { top: 36%; left: 78%; animation-delay: 1.8s;  }
.star--7  { top: 12%; left: 92%; animation-delay: 2.2s;  background: var(--color-enchanted-mint); }
.star--8  { top: 56%; left: 14%; animation-delay: 1.5s;  }
.star--9  { top: 64%; left: 70%; animation-delay: 0.3s;  background: var(--color-fairy-pink); }
.star--10 { top: 50%; left: 86%; animation-delay: 2s;    }

@keyframes twinkle {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50%      { opacity: 1;   transform: scale(1.2); }
}

.footer-circuit {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 200px;
    z-index: 1;
    pointer-events: none;
    opacity: 0.7;
}

.starlight-footer__content {
    position: relative;
    z-index: 2;
    max-width: 880px;
    margin: 0 auto;
    text-align: center;
}

.footer-mark {
    font-family: var(--font-headline);
    font-weight: 700;
    font-size: clamp(28px, 3.4vw, 44px);
    letter-spacing: -0.01em;
    color: var(--color-petal-white);
    margin: 0 0 10px;
    text-shadow: 0 0 24px rgba(255, 155, 227, 0.35);
}
.footer-tagline {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.7;
    color: var(--color-petal-white);
    margin: 0 0 36px;
    opacity: 0.88;
}
.footer-meta {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 22px;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.18em;
    color: var(--color-petal-white);
    text-transform: uppercase;
    margin: 0;
    opacity: 0.75;
}
.footer-meta span {
    white-space: nowrap;
}

/* ===================================================================
   Reveal hooks (set initial state for IntersectionObserver targets)
   =================================================================== */
[data-reveal] {
    will-change: opacity, transform;
}

/* ===================================================================
   Responsive
   =================================================================== */
@media (max-width: 768px) {
    .clearing { padding: 0 24px; }
    .wordmark { font-size: clamp(48px, 12vw, 84px); }
    .forest__motif-grid { grid-template-columns: 1fr; }
    .artifact-grid { grid-template-columns: 1fr; }
    .footer-meta { flex-direction: column; gap: 8px; }
    .scroll-cue { bottom: 20px; }
    .glow--xl { filter: blur(35px); }
}

@media (max-width: 480px) {
    .motif { padding-left: 20px; }
    .artifact__frame { padding: 32px 22px 26px; }
    .korean--lg { font-size: clamp(80px, 22vw, 130px); }
}

/* Reduced motion override */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
    .glow, .wordmark, .wordmark__subtitle, .scroll-cue,
    .forest__bg-layer, .forest__content, .forest__fore,
    .treasure-hall__bg, .treasure-hall__header, .artifact-grid,
    .inscription__inner, .fairy-path, .fairy-node {
        opacity: 1 !important;
        transform: none !important;
        stroke-dashoffset: 0 !important;
    }
}
