:root {
    --washi: #f7f2ea;
    --pearl: #ede6da;
    --silk: #d4c8b8;
    --ink: #3a322a;
    --stone: #7d7167;
    --kintsugi: #c9a96e;
    --sakura: #e8c4c4;
    --plum: #6b5b7b;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--washi);
    color: var(--ink);
    font-family: 'Nunito', sans-serif;
    font-weight: 300;
    overflow-x: hidden;
}

/* Sparkle Overlay */
#sparkle-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.sparkle {
    position: fixed;
    width: 6px;
    height: 6px;
    background: var(--kintsugi);
    clip-path: polygon(50% 0%, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0% 50%, 40% 40%);
    animation: twinkle var(--duration) ease-in-out infinite;
    animation-delay: var(--delay);
}

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

/* Scroll Ring */
#scroll-ring {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 40px;
    height: 40px;
    z-index: 20;
    pointer-events: none;
}

/* Zone 1: The Gate */
#zone-gate {
    min-height: 100vh;
    display: grid;
    place-items: center;
    position: relative;
    background: var(--washi);
    overflow: hidden;
}

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

.gate-title {
    font-family: 'Caveat Brush', cursive;
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 400;
    color: var(--ink);
    letter-spacing: 0.02em;
}

.gate-line {
    width: 1px;
    height: 15vh;
    background: var(--kintsugi);
    margin: 2rem auto;
    animation: pulse-line 4s ease-in-out infinite;
}

@keyframes pulse-line {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

.gate-subtitle {
    font-family: 'Zen Kaku Gothic New', sans-serif;
    font-weight: 300;
    font-size: clamp(0.9rem, 1.5vw, 1.2rem);
    color: var(--stone);
}

#gate-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.gate-particle {
    position: absolute;
    opacity: 0.3;
    animation: drift var(--drift-duration) ease-in-out infinite alternate;
}

@keyframes drift {
    0% { transform: translate(0, 0); }
    100% { transform: translate(var(--dx), var(--dy)); }
}

/* Zone 2: The Garden */
#zone-garden {
    padding: clamp(1rem, 3vw, 4rem);
    background: var(--washi);
}

.garden-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: clamp(1rem, 2vw, 2rem);
    max-width: 1400px;
    margin: 0 auto;
}

.tile {
    background: var(--pearl);
    border: 1px solid var(--silk);
    border-radius: 4px;
    aspect-ratio: 4/5;
    padding: clamp(1.5rem, 3vw, 3rem);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    transition: transform 0.6s ease, box-shadow 0.6s ease;
    opacity: 0;
    transform: translateY(24px);
}

.tile.visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s ease, transform 0.8s ease, box-shadow 0.6s ease;
}

.tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(201, 169, 110, 0.12);
}

.tile.visible:hover {
    transform: translateY(-4px);
}

.tile-span-row {
    grid-row: span 2;
}

.tile-span-col {
    grid-column: span 2;
    aspect-ratio: auto;
}

.tile-art {
    width: 60%;
    max-height: 60%;
    flex-shrink: 0;
}

.tile-jp {
    font-family: 'Zen Kaku Gothic New', sans-serif;
    font-weight: 300;
    font-size: clamp(1rem, 1.5vw, 1.3rem);
    color: var(--ink);
}

.tile-en {
    font-family: 'Nunito', sans-serif;
    font-weight: 300;
    font-size: clamp(0.75rem, 1vw, 0.9rem);
    color: var(--stone);
}

/* Zone 3: The Reflection */
#zone-reflection {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: var(--washi);
    position: relative;
}

.mandala-container {
    position: relative;
    width: min(80vw, 80vh);
    height: min(80vw, 80vh);
}

#mandala {
    width: 100%;
    height: 100%;
    animation: spin 120s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.mandala-sparkle {
    position: absolute;
    width: 5px;
    height: 5px;
    background: var(--kintsugi);
    clip-path: polygon(50% 0%, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0% 50%, 40% 40%);
    animation: twinkle var(--duration) ease-in-out infinite;
    animation-delay: var(--delay);
}

.reflection-date {
    font-family: 'Zen Kaku Gothic New', sans-serif;
    font-weight: 300;
    font-size: clamp(0.8rem, 1.2vw, 1rem);
    color: var(--stone);
    margin-top: 2rem;
}

/* Zone 4: The Horizon */
#zone-horizon {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    background: var(--washi);
    overflow: hidden;
}

.horizon-title {
    font-family: 'Caveat Brush', cursive;
    font-size: clamp(6rem, 15vw, 12rem);
    font-weight: 400;
    color: rgba(58, 50, 42, 0.08);
    white-space: nowrap;
    overflow: visible;
}

.horizon-mark {
    opacity: 0.6;
}

.horizon-footer {
    font-family: 'Nunito', sans-serif;
    font-weight: 300;
    font-size: clamp(0.8rem, 1vw, 1rem);
    color: var(--stone);
    text-align: center;
}

/* Breathing animation for key elements */
@keyframes breathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.gate-content {
    animation: breathe 4s ease-in-out infinite;
}

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