/* ggoomimi.com -- watercolor dreamscape handscroll */

/* ============================================
   CSS Custom Properties (Global)
   ============================================ */
:root {
    --rice-paper: #F5F0E8;
    --morning-ink: #2A2438;
    --faded-plum: #8B7B8B;
    --dream-rose: #D4A0A0;
    --twilight-lavender: #9B8EC4;
    --celadon-mist: #A8C4B8;
    --persimmon-glow: #D4956A;
    --indigo-wash: #4A5A7B;
    --moonlight: #E8E0D4;
}

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

html {
    overflow: hidden;
    height: 100%;
}

body {
    background: var(--rice-paper);
    color: var(--morning-ink);
    font-family: 'Karla', sans-serif;
    font-weight: 300;
    font-size: clamp(0.95rem, 1.2vw, 1.15rem);
    line-height: 1.95;
    height: 100%;
    overflow: hidden;
    cursor: default;
}

/* ============================================
   SVG Filters (hidden)
   ============================================ */
.svg-filters {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* ============================================
   Paper Texture Overlay
   ============================================ */
.paper-texture {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    pointer-events: none;
    mix-blend-mode: multiply;
    opacity: 0.04;
    background: var(--rice-paper);
    filter: url(#paper-texture);
}

/* ============================================
   Horizontal Handscroll Container
   ============================================ */
.handscroll {
    display: flex;
    flex-wrap: nowrap;
    height: 100vh;
    overflow-x: scroll;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.handscroll::-webkit-scrollbar {
    display: none;
}

/* ============================================
   Panel Base
   ============================================ */
.panel {
    flex-shrink: 0;
    height: 100vh;
    position: relative;
    overflow: hidden;
    scroll-snap-align: start;
}

.panel-1 { width: 100vw; }
.panel-2 { width: 140vw; }
.panel-3 { width: 80vw; }
.panel-4 { width: 120vw; }
.panel-5 { width: 100vw; }

/* ============================================
   Watercolor Washes
   ============================================ */
.wash {
    position: absolute;
    top: -10%;
    left: -10%;
    width: 120%;
    height: 120%;
    z-index: 0;
    pointer-events: none;
    filter: url(#watercolor-warp);
    will-change: transform;
}

.wash-1 {
    background:
        radial-gradient(ellipse 60% 50% at 75% 20%, rgba(212,160,160,0.35) 0%, transparent 70%),
        radial-gradient(ellipse 40% 60% at 20% 80%, rgba(212,160,160,0.15) 0%, transparent 60%),
        radial-gradient(ellipse 80% 40% at 50% 60%, rgba(232,224,212,0.20) 0%, transparent 65%);
    filter: url(#watercolor-warp) blur(60px);
}

.wash-2 {
    background:
        radial-gradient(ellipse 50% 70% at 30% 30%, rgba(155,142,196,0.30) 0%, transparent 65%),
        radial-gradient(ellipse 60% 40% at 70% 70%, rgba(155,142,196,0.20) 0%, transparent 60%),
        radial-gradient(ellipse 45% 55% at 55% 20%, rgba(212,160,160,0.10) 0%, transparent 55%);
    filter: url(#watercolor-warp) blur(80px);
}

.wash-3 {
    background:
        radial-gradient(ellipse 55% 65% at 40% 50%, rgba(168,196,184,0.30) 0%, transparent 65%),
        radial-gradient(ellipse 35% 45% at 70% 25%, rgba(168,196,184,0.15) 0%, transparent 55%);
    filter: url(#watercolor-warp) blur(70px);
}

.wash-4 {
    background:
        radial-gradient(ellipse 50% 55% at 35% 40%, rgba(212,149,106,0.30) 0%, transparent 65%),
        radial-gradient(ellipse 60% 50% at 75% 65%, rgba(212,149,106,0.18) 0%, transparent 60%),
        radial-gradient(ellipse 40% 40% at 20% 75%, rgba(232,224,212,0.15) 0%, transparent 50%);
    filter: url(#watercolor-warp) blur(90px);
}

.wash-5 {
    background:
        radial-gradient(ellipse 65% 60% at 50% 45%, rgba(74,90,123,0.35) 0%, transparent 65%),
        radial-gradient(ellipse 40% 50% at 25% 70%, rgba(74,90,123,0.25) 0%, transparent 55%),
        radial-gradient(ellipse 50% 40% at 80% 20%, rgba(42,36,56,0.15) 0%, transparent 60%);
    filter: url(#watercolor-warp) blur(100px);
}

/* ============================================
   Bleed Transitions Between Panels
   ============================================ */
.bleed {
    position: absolute;
    top: 0;
    width: 200px;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.bleed-left {
    left: 0;
}

/* ============================================
   Floating Hangul Jamo
   ============================================ */
.jamo {
    position: absolute;
    font-family: 'Noto Serif KR', serif;
    font-weight: 300;
    color: var(--morning-ink);
    opacity: 0;
    z-index: 2;
    pointer-events: none;
    user-select: none;
    transition: opacity 1.5s ease;
}

.jamo.visible {
    opacity: 0.05;
}

.jamo.final-breath {
    opacity: 0.10;
}

@keyframes jamo-drift {
    0%   { transform: translate(0, 0); }
    25%  { transform: translate(15px, -20px); }
    50%  { transform: translate(-10px, -10px); }
    75%  { transform: translate(-20px, 15px); }
    100% { transform: translate(0, 0); }
}

.jamo-float {
    animation: jamo-drift var(--jamo-duration, 35s) linear infinite;
}

/* ============================================
   Dream Circles
   ============================================ */
.dream-circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(2px);
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    transition: opacity 1.5s ease;
}

.dream-circle.animating {
    animation: circle-drift var(--circle-duration, 40s) ease-in-out infinite;
}

@keyframes circle-drift {
    0%   { transform: translate(0, 0); }
    20%  { transform: translate(25px, -15px); }
    40%  { transform: translate(-10px, -30px); }
    60%  { transform: translate(-30px, 10px); }
    80%  { transform: translate(15px, 25px); }
    100% { transform: translate(0, 0); }
}

/* ============================================
   Ink Filament Paths
   ============================================ */
.ink-filament-path {
    stroke-dasharray: var(--path-length, 1000);
    stroke-dashoffset: var(--path-length, 1000);
    transition: stroke-dashoffset 2.5s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.ink-filament-path.drawn {
    stroke-dashoffset: 0;
}

/* ============================================
   Panel 1: 꿈의 문 (The Door of Dreams)
   ============================================ */
.panel-1-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 5;
}

.spiral-svg {
    display: block;
    margin: 0 auto 2rem;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.spiral-svg.visible {
    opacity: 1;
}

.site-title {
    font-family: 'Noto Serif KR', serif;
    font-weight: 300;
    font-size: clamp(3rem, 6vw, 5rem);
    color: rgba(42, 36, 56, 0.80);
    letter-spacing: 0.3em;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 1.2s ease, transform 1.2s ease;
}

.site-title.visible {
    opacity: 1;
    transform: translateY(0);
}

.site-subtitle {
    font-family: 'Caveat', cursive;
    font-weight: 400;
    font-size: clamp(1rem, 1.5vw, 1.3rem);
    color: rgba(139, 123, 139, 0.50);
    margin-top: 0.8rem;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 1.5s ease 0.5s, transform 1.5s ease 0.5s;
}

.site-subtitle.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Bloom animation for wash */
.wash-1-bloom {
    position: absolute;
    top: 5%;
    right: 5%;
    width: 50vmin;
    height: 50vmin;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(212,160,160,0.35) 0%, transparent 70%);
    filter: blur(60px);
    transform: scale(0.3);
    opacity: 0;
    z-index: 0;
    pointer-events: none;
}

.wash-1-bloom.blooming {
    animation: bloom 4s ease-out forwards;
}

@keyframes bloom {
    0%   { transform: scale(0.3); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Scroll hint arrow */
.scroll-hint {
    position: absolute;
    right: 3vw;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    opacity: 0.5;
    animation: nudge 3s ease-in-out infinite;
}

@keyframes nudge {
    0%, 100% { transform: translateY(-50%) translateX(0); }
    50%      { transform: translateY(-50%) translateX(8px); }
}

/* ============================================
   Panel 2: 새벽빛 (Dawn Light)
   ============================================ */
.ghost-character {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Noto Serif KR', serif;
    font-weight: 900;
    font-size: 20vw;
    color: var(--twilight-lavender);
    opacity: 0.04;
    z-index: 1;
    pointer-events: none;
    user-select: none;
}

.filaments {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    pointer-events: none;
}

.panel-2-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: clamp(2rem, 4vw, 6rem);
    max-width: 80%;
    align-items: center;
}

.text-block {
    border-left: 2px solid var(--panel-accent-20, rgba(155,142,196,0.20));
    padding-left: clamp(1rem, 2vw, 2rem);
    color: var(--morning-ink);
    opacity: 0.85;
}

.text-block p {
    font-family: 'Karla', sans-serif;
    font-weight: 300;
    font-size: clamp(0.95rem, 1.2vw, 1.15rem);
    line-height: 1.95;
}

/* ============================================
   Panel 3: 고요 (Stillness)
   ============================================ */
.filament-vertical {
    position: absolute;
    left: 50%;
    top: 25%;
    width: 20px;
    height: 40%;
    z-index: 3;
    pointer-events: none;
    transform: translateX(-50%);
}

.panel-3-content {
    position: absolute;
    top: 40%;
    left: 30%;
    transform: translateY(-50%);
    z-index: 5;
    display: flex;
    gap: clamp(2rem, 4vw, 5rem);
}

.haiku p {
    margin-bottom: 0.5em;
}

.haiku-korean {
    font-family: 'Noto Serif KR', serif;
    font-weight: 300;
    font-size: clamp(1.1rem, 1.5vw, 1.4rem);
    color: var(--morning-ink);
    opacity: 0.80;
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

.haiku-english {
    font-family: 'Karla', sans-serif;
    font-weight: 200;
    font-style: italic;
    font-size: clamp(0.9rem, 1.1vw, 1.1rem);
    color: var(--faded-plum);
    opacity: 0.70;
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

/* ============================================
   Panel 4: 기억 (Memory)
   ============================================ */
.panel-4-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    width: 80%;
    max-height: 70vh;
}

.memory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.memory-card {
    aspect-ratio: 3 / 4;
    border: 1px solid rgba(212, 149, 106, 0.15);
    backdrop-filter: blur(1px);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.5rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease, border-color 0.6s ease, background-color 0.6s ease;
}

.memory-card.revealed {
    opacity: 1;
    transform: translateY(0);
}

.memory-card:hover {
    border-color: rgba(212, 149, 106, 0.40);
    background-color: rgba(212, 149, 106, 0.06);
}

.memory-card span {
    font-family: 'Caveat', cursive;
    font-weight: 400;
    font-size: clamp(1rem, 1.3vw, 1.2rem);
    color: var(--morning-ink);
    opacity: 0.75;
}

/* ============================================
   Panel 5: 여명 (Dawn's Promise)
   ============================================ */
.panel-5-content {
    position: absolute;
    top: 60%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 5;
}

.final-title {
    font-family: 'Caveat', cursive;
    font-weight: 400;
    font-size: 2rem;
    color: rgba(232, 224, 212, 0.60);
    margin-bottom: 1.2rem;
}

.final-text {
    font-family: 'Noto Serif KR', serif;
    font-weight: 300;
    font-size: clamp(1rem, 1.5vw, 1.3rem);
    color: rgba(232, 224, 212, 0.40);
}

/* ============================================
   Ink Drop Progress Indicator
   ============================================ */
.ink-drop-indicator {
    position: fixed;
    bottom: 2.5vh;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ink-drop-svg {
    width: 36px;
    height: 36px;
    animation: breathe 4s ease-in-out infinite;
}

@keyframes breathe {
    0%, 100% { opacity: 0.5; }
    50%      { opacity: 0.85; }
}

.ink-drop-track {
    fill: none;
    stroke: var(--faded-plum);
    stroke-width: 1;
    opacity: 0.25;
}

.ink-drop-fill {
    fill: none;
    stroke: var(--morning-ink);
    stroke-width: 2;
    opacity: 0.5;
    stroke-dasharray: 94.25;
    stroke-dashoffset: 94.25;
    transform: rotate(-90deg);
    transform-origin: center;
    transition: stroke-dashoffset 0.3s ease;
}

.ink-drop-center {
    fill: var(--morning-ink);
    opacity: 0.3;
}

/* Panel navigation swatches */
.panel-nav {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    opacity: 0;
    transform: translateY(5px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    pointer-events: none;
}

.ink-drop-indicator.nav-open .panel-nav {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.swatch {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid rgba(139, 123, 139, 0.25);
    cursor: pointer;
    transition: transform 0.3s ease, border-color 0.3s ease;
    padding: 0;
}

.swatch:hover {
    transform: scale(1.3);
    border-color: rgba(139, 123, 139, 0.6);
}

.swatch-1 { background: rgba(212, 160, 160, 0.50); }
.swatch-2 { background: rgba(155, 142, 196, 0.50); }
.swatch-3 { background: rgba(168, 196, 184, 0.50); }
.swatch-4 { background: rgba(212, 149, 106, 0.50); }
.swatch-5 { background: rgba(74, 90, 123, 0.50); }

/* ============================================
   Custom Scrollbar (for vertical micro-scroll)
   ============================================ */
.panel::-webkit-scrollbar {
    width: 3px;
}

.panel::-webkit-scrollbar-track {
    background: transparent;
}

.panel::-webkit-scrollbar-thumb {
    background: rgba(139, 123, 139, 0.25);
    border-radius: 3px;
}

/* ============================================
   Animations: Breathing, Drifting
   ============================================ */
@keyframes float-gentle {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-8px); }
}
