/* ============================================
   gabs.quest - Ethereal Quest Design
   ============================================ */

/* --- CSS Variables / Palette --- */
:root {
    --honeyed-amber: #E8C88A;
    --parchment-light: #FAF5E8;
    --sage-mist: #8CA88C;
    --warm-clay: #B87D5A;
    --ethereal-lilac: #B8A0D4;
    --quest-ink: #2A2218;
    --glow-gold: #F0D078;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Hind', sans-serif;
    font-weight: 400;
    font-size: clamp(15px, 1.5vw, 18px);
    line-height: 1.8;
    color: var(--quest-ink);
    background-color: var(--honeyed-amber);
    overflow-x: hidden;
}

/* --- Typography --- */
h1, h2, h3 {
    font-family: 'Cardo', serif;
    font-weight: 700;
    letter-spacing: -0.005em;
}

h2 {
    font-size: clamp(26px, 4.5vw, 58px);
    line-height: 1.2;
    margin-bottom: 0.6em;
}

.noto-initial {
    font-family: 'Noto Serif Display', serif;
    font-weight: 700;
    font-size: 1.15em;
}

em {
    font-style: italic;
    font-family: 'Cardo', serif;
}

/* --- Quest Path SVG --- */
.quest-path-svg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.quest-line {
    stroke-dasharray: 0;
    stroke-dashoffset: 0;
    transition: none;
}

/* --- Watercolor Wash Effects --- */
.watercolor-wash {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    transition: opacity 0.6s ease;
}

.wash-1 {
    width: 500px;
    height: 500px;
    top: 10%;
    left: -5%;
    background: radial-gradient(circle, rgba(184, 160, 212, 0.12) 0%, transparent 70%);
}

.wash-2 {
    width: 600px;
    height: 600px;
    top: 20%;
    right: -10%;
    background: radial-gradient(circle, rgba(232, 200, 138, 0.1) 0%, transparent 70%);
}

.wash-3 {
    width: 400px;
    height: 400px;
    bottom: 15%;
    left: 20%;
    background: radial-gradient(circle, rgba(140, 168, 140, 0.1) 0%, transparent 70%);
}

.wash-4 {
    width: 350px;
    height: 350px;
    top: 50%;
    right: 15%;
    background: radial-gradient(circle, rgba(184, 160, 212, 0.08) 0%, transparent 70%);
}

/* --- Hero Section --- */
.hero {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: var(--honeyed-amber);
    overflow: hidden;
}

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

.hero-title {
    font-family: 'Cardo', serif;
    font-size: clamp(56px, 12vw, 140px);
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--quest-ink);
    opacity: 0;
    animation: heroTitleIn 600ms 600ms ease-out forwards;
    text-shadow: 0 0 40px rgba(240, 208, 120, 0.15);
}

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

@keyframes heroFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-3px);
    }
}

.hero-title.animate-float {
    animation: heroFloat 4s ease-in-out infinite;
}

.hero-subtitle {
    position: relative;
    display: inline-block;
    margin-top: 8px;
    opacity: 0;
    animation: subtitleIn 500ms 1200ms ease-out forwards;
}

@keyframes subtitleIn {
    from {
        opacity: 0;
        clip-path: inset(0 100% 0 0);
    }
    to {
        opacity: 1;
        clip-path: inset(0 0 0 0);
    }
}

.quest-text {
    font-family: 'Cardo', serif;
    font-style: italic;
    font-size: clamp(24px, 4vw, 48px);
    color: var(--quest-ink);
    letter-spacing: 0.1em;
}

.subtitle-underline {
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 100%;
    height: 12px;
    overflow: visible;
}

.subtitle-underline path {
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
    animation: drawUnderline 400ms 1500ms ease-out forwards;
}

@keyframes drawUnderline {
    to {
        stroke-dashoffset: 0;
    }
}

/* --- Ethereal Glow Pulse --- */
@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 0 40px rgba(240, 208, 120, 0.1);
    }
    50% {
        box-shadow: 0 0 40px rgba(240, 208, 120, 0.2);
    }
}

.hero-title.glow-active {
    animation: glowPulse 4s ease-in-out infinite;
}

/* --- Quest Markers --- */
.quest-marker {
    position: relative;
    z-index: 3;
    width: 12px;
    height: 12px;
    border: 2px solid var(--quest-ink);
    border-radius: 50%;
    background: var(--glow-gold);
    margin: 0 auto;
    opacity: 0;
    transform: scale(0);
    transition: opacity 400ms ease, transform 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.quest-marker.visible {
    opacity: 1;
    transform: scale(1);
}

.marker-dot {
    display: block;
    width: 4px;
    height: 4px;
    background: var(--quest-ink);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.first-marker {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%) scale(0);
    opacity: 0;
    animation: markerAppear 400ms 1700ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes markerAppear {
    to {
        opacity: 1;
        transform: translateX(-50%) scale(1);
    }
}

/* --- Quest Sections --- */
.quest-section {
    position: relative;
    padding: 100px 20px;
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.quest-content {
    position: relative;
    z-index: 2;
    max-width: 600px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 600ms ease, transform 600ms ease;
}

.quest-section.in-view .quest-content {
    opacity: 1;
    transform: translateY(0);
}

/* Asymmetric positioning */
.section-left {
    align-items: flex-start;
    padding-left: 30%;
}

.section-left .quest-content {
    transform: translateX(-40px) translateY(30px);
}

.section-left.in-view .quest-content {
    transform: translateX(0) translateY(0);
}

.section-right {
    align-items: flex-end;
    padding-right: 15%;
}

.section-right .quest-content {
    transform: translateX(40px) translateY(30px);
}

.section-right.in-view .quest-content {
    transform: translateX(0) translateY(0);
}

.section-center {
    align-items: center;
}

/* Section body text */
.section-body {
    font-family: 'Hind', sans-serif;
    font-weight: 400;
    font-size: clamp(15px, 1.5vw, 18px);
    line-height: 1.8;
    color: var(--quest-ink);
    margin-bottom: 1em;
}

.section-body:last-child {
    margin-bottom: 0;
}

/* --- Section Title --- */
.section-title {
    color: var(--quest-ink);
}

/* --- Draw Underline --- */
.draw-underline {
    position: relative;
    display: inline-block;
}

.draw-underline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--warm-clay);
    border-radius: 2px;
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 400ms ease-out;
}

.in-view .draw-underline::after {
    transform: scaleX(1);
}

/* --- Marble Frame --- */
.marble-frame {
    position: relative;
    z-index: 2;
    max-width: 560px;
    padding: 32px 36px;
    background:
        linear-gradient(135deg, rgba(250, 245, 232, 0.9) 0%, rgba(240, 235, 220, 0.7) 30%, rgba(250, 245, 232, 0.85) 50%, rgba(230, 225, 210, 0.6) 70%, rgba(250, 245, 232, 0.9) 100%),
        linear-gradient(45deg, rgba(200, 195, 180, 0.15) 0%, transparent 40%, rgba(200, 195, 180, 0.1) 60%, transparent 100%),
        linear-gradient(200deg, transparent 0%, rgba(190, 185, 170, 0.08) 30%, transparent 50%, rgba(200, 195, 180, 0.12) 80%, transparent 100%);
    border: 1px solid rgba(42, 34, 24, 0.2);
    opacity: 0;
    transform: scale(0.97);
    transition: opacity 400ms ease, transform 400ms ease, border-color 400ms ease;
}

.quest-section.in-view .marble-frame {
    opacity: 1;
    transform: scale(1);
    border-color: rgba(42, 34, 24, 0.25);
}

.marble-quote {
    font-family: 'Cardo', serif;
    font-size: clamp(20px, 3vw, 32px);
    font-weight: 400;
    font-style: italic;
    line-height: 1.5;
    color: var(--quest-ink);
    text-align: center;
}

.marble-quote .noto-initial {
    font-family: 'Noto Serif Display', serif;
    font-size: 1.4em;
    line-height: 1;
    vertical-align: -0.1em;
}

/* --- Watercolor Transition Washes --- */
.wash-transition {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.wash-t1 {
    width: 450px;
    height: 450px;
    top: -100px;
    right: 10%;
    background: radial-gradient(circle, rgba(184, 160, 212, 0.1) 0%, transparent 70%);
}

.wash-t2 {
    width: 500px;
    height: 500px;
    top: -50px;
    left: -5%;
    background: radial-gradient(circle, rgba(140, 168, 140, 0.12) 0%, transparent 70%);
}

.wash-t3 {
    width: 400px;
    height: 400px;
    bottom: -80px;
    right: -5%;
    background: radial-gradient(circle, rgba(232, 200, 138, 0.1) 0%, transparent 70%);
}

.wash-t4 {
    width: 550px;
    height: 550px;
    top: -60px;
    left: 15%;
    background: radial-gradient(circle, rgba(184, 160, 212, 0.08) 0%, transparent 70%);
}

.wash-t5 {
    width: 480px;
    height: 480px;
    bottom: -100px;
    right: 20%;
    background: radial-gradient(circle, rgba(140, 168, 140, 0.1) 0%, transparent 70%);
}

.wash-t6 {
    width: 420px;
    height: 420px;
    top: -70px;
    left: -8%;
    background: radial-gradient(circle, rgba(232, 200, 138, 0.12) 0%, transparent 70%);
}

.wash-t7 {
    width: 500px;
    height: 500px;
    top: -40px;
    right: -10%;
    background: radial-gradient(circle, rgba(184, 160, 212, 0.12) 0%, transparent 70%);
}

.wash-footer {
    width: 600px;
    height: 600px;
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    background: radial-gradient(circle, rgba(240, 208, 120, 0.12) 0%, transparent 70%);
}

/* --- Quest Footer --- */
.quest-footer {
    position: relative;
    padding: 120px 20px 80px;
    text-align: center;
    overflow: hidden;
}

.footer-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(240, 208, 120, 0.2) 0%, transparent 70%);
    animation: glowPulseFooter 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes glowPulseFooter {
    0%, 100% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

.footer-text {
    position: relative;
    z-index: 2;
    font-family: 'Cardo', serif;
    font-size: clamp(20px, 3vw, 32px);
    font-weight: 700;
    color: var(--quest-ink);
    letter-spacing: 0.05em;
}

.footer-korean {
    position: relative;
    z-index: 2;
    font-family: 'Noto Serif Display', serif;
    font-size: clamp(36px, 6vw, 72px);
    color: var(--quest-ink);
    opacity: 0.3;
    margin-top: 16px;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .section-left {
        padding-left: 20px;
        align-items: center;
    }

    .section-right {
        padding-right: 20px;
        align-items: center;
    }

    .section-left .quest-content,
    .section-right .quest-content {
        transform: translateY(30px);
    }

    .section-left.in-view .quest-content,
    .section-right.in-view .quest-content {
        transform: translateY(0);
    }

    .quest-content {
        max-width: 90%;
    }

    .marble-frame {
        max-width: 90%;
        padding: 24px 20px;
    }

    .quest-path-svg {
        display: none;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: clamp(48px, 16vw, 80px);
    }

    .quest-text {
        font-size: clamp(18px, 6vw, 32px);
    }
}
