/* ============================================
   ppzz.lu - Enchanted Forest Dashboard
   Fairycore aesthetic with dashboard layout
   ============================================ */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Quicksand', sans-serif;
    font-weight: 400;
    font-size: clamp(15px, 1.5vw, 18px);
    line-height: 1.75;
    color: #F5F0F8;
    background: #1A2F23;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    letter-spacing: 0.08em;
}

/* --- Enchanted Gateway (Hero) --- */
#enchanted-gateway {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    background: linear-gradient(180deg, #1A2F23 0%, #2D4A3E 60%, #1A2F23 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Forest layers */
.forest-layer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.forest-layer svg {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.forest-back {
    z-index: 1;
    animation: fadeInLayer 0.8s 0.3s ease forwards;
}

.forest-mid {
    z-index: 2;
    animation: fadeInLayer 0.8s 0.5s ease forwards;
}

.forest-front {
    z-index: 3;
    animation: fadeInLayer 0.8s 0.7s ease forwards;
}

@keyframes fadeInLayer {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Atmosphere overlay */
.atmosphere-overlay {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 30% 40%, rgba(61, 107, 79, 0.15) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 60%, rgba(196, 177, 212, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(126, 184, 218, 0.06) 0%, transparent 40%);
    z-index: 4;
    pointer-events: none;
}

/* Fireflies */
#fireflies {
    position: absolute;
    inset: 0;
    z-index: 5;
    pointer-events: none;
    opacity: 0;
    animation: fadeInFireflies 1s 0.8s ease forwards;
}

@keyframes fadeInFireflies {
    from { opacity: 0; }
    to { opacity: 1; }
}

.firefly {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #E8D5A3;
    box-shadow: 0 0 6px 2px rgba(232, 213, 163, 0.6);
    animation-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1);
    animation-iteration-count: infinite;
}

.firefly-1 { animation: fly1 10s infinite cubic-bezier(0.34,1.56,0.64,1); }
.firefly-2 { animation: fly2 12s infinite cubic-bezier(0.34,1.56,0.64,1); }
.firefly-3 { animation: fly3 9s infinite cubic-bezier(0.34,1.56,0.64,1); }
.firefly-4 { animation: fly4 14s infinite cubic-bezier(0.34,1.56,0.64,1); }
.firefly-5 { animation: fly5 11s infinite cubic-bezier(0.34,1.56,0.64,1); }
.firefly-6 { animation: fly6 13s infinite cubic-bezier(0.34,1.56,0.64,1); }
.firefly-7 { animation: fly7 10s infinite cubic-bezier(0.34,1.56,0.64,1); }
.firefly-8 { animation: fly8 15s infinite cubic-bezier(0.34,1.56,0.64,1); }
.firefly-9 { animation: fly9 8s infinite cubic-bezier(0.34,1.56,0.64,1); }
.firefly-10 { animation: fly10 12s infinite cubic-bezier(0.34,1.56,0.64,1); }
.firefly-11 { animation: fly11 11s infinite cubic-bezier(0.34,1.56,0.64,1); }
.firefly-12 { animation: fly12 14s infinite cubic-bezier(0.34,1.56,0.64,1); }
.firefly-13 { animation: fly13 9s infinite cubic-bezier(0.34,1.56,0.64,1); }
.firefly-14 { animation: fly14 13s infinite cubic-bezier(0.34,1.56,0.64,1); }
.firefly-15 { animation: fly15 10s infinite cubic-bezier(0.34,1.56,0.64,1); }
.firefly-16 { animation: fly16 12s infinite cubic-bezier(0.34,1.56,0.64,1); }
.firefly-17 { animation: fly17 11s infinite cubic-bezier(0.34,1.56,0.64,1); }
.firefly-18 { animation: fly18 15s infinite cubic-bezier(0.34,1.56,0.64,1); }

@keyframes fly1 {
    0% { transform: translate(0, 0); opacity: 0.8; }
    25% { transform: translate(40px, -60px); opacity: 1; }
    50% { transform: translate(-20px, -30px); opacity: 0.6; }
    75% { transform: translate(30px, -80px); opacity: 0.9; }
    100% { transform: translate(0, 0); opacity: 0.8; }
}
@keyframes fly2 {
    0% { transform: translate(0, 0); opacity: 0.6; }
    20% { transform: translate(-50px, -40px); opacity: 1; }
    40% { transform: translate(-30px, -90px); opacity: 0.7; }
    60% { transform: translate(20px, -50px); opacity: 0.9; }
    80% { transform: translate(-10px, -20px); opacity: 0.5; }
    100% { transform: translate(0, 0); opacity: 0.6; }
}
@keyframes fly3 {
    0% { transform: translate(0, 0); opacity: 0.9; }
    33% { transform: translate(60px, -45px); opacity: 0.6; }
    66% { transform: translate(-15px, -70px); opacity: 1; }
    100% { transform: translate(0, 0); opacity: 0.9; }
}
@keyframes fly4 {
    0% { transform: translate(0, 0); opacity: 0.7; }
    25% { transform: translate(-35px, -55px); opacity: 0.9; }
    50% { transform: translate(25px, -85px); opacity: 0.5; }
    75% { transform: translate(-45px, -30px); opacity: 1; }
    100% { transform: translate(0, 0); opacity: 0.7; }
}
@keyframes fly5 {
    0% { transform: translate(0, 0); opacity: 0.8; }
    20% { transform: translate(55px, -35px); opacity: 0.6; }
    40% { transform: translate(20px, -75px); opacity: 1; }
    60% { transform: translate(-30px, -50px); opacity: 0.7; }
    80% { transform: translate(10px, -20px); opacity: 0.9; }
    100% { transform: translate(0, 0); opacity: 0.8; }
}
@keyframes fly6 {
    0% { transform: translate(0, 0); opacity: 0.5; }
    33% { transform: translate(-40px, -65px); opacity: 0.9; }
    66% { transform: translate(35px, -25px); opacity: 0.7; }
    100% { transform: translate(0, 0); opacity: 0.5; }
}
@keyframes fly7 {
    0% { transform: translate(0, 0); opacity: 0.9; }
    25% { transform: translate(30px, -50px); opacity: 0.6; }
    50% { transform: translate(-25px, -80px); opacity: 1; }
    75% { transform: translate(45px, -35px); opacity: 0.7; }
    100% { transform: translate(0, 0); opacity: 0.9; }
}
@keyframes fly8 {
    0% { transform: translate(0, 0); opacity: 0.6; }
    20% { transform: translate(-60px, -30px); opacity: 0.8; }
    40% { transform: translate(-20px, -70px); opacity: 1; }
    60% { transform: translate(40px, -45px); opacity: 0.5; }
    80% { transform: translate(15px, -15px); opacity: 0.9; }
    100% { transform: translate(0, 0); opacity: 0.6; }
}
@keyframes fly9 {
    0% { transform: translate(0, 0); opacity: 1; }
    50% { transform: translate(45px, -55px); opacity: 0.6; }
    100% { transform: translate(0, 0); opacity: 1; }
}
@keyframes fly10 {
    0% { transform: translate(0, 0); opacity: 0.7; }
    33% { transform: translate(-25px, -40px); opacity: 1; }
    66% { transform: translate(50px, -70px); opacity: 0.5; }
    100% { transform: translate(0, 0); opacity: 0.7; }
}
@keyframes fly11 {
    0% { transform: translate(0, 0); opacity: 0.8; }
    25% { transform: translate(35px, -30px); opacity: 0.5; }
    50% { transform: translate(-40px, -65px); opacity: 1; }
    75% { transform: translate(20px, -45px); opacity: 0.7; }
    100% { transform: translate(0, 0); opacity: 0.8; }
}
@keyframes fly12 {
    0% { transform: translate(0, 0); opacity: 0.6; }
    50% { transform: translate(-30px, -50px); opacity: 1; }
    100% { transform: translate(0, 0); opacity: 0.6; }
}
@keyframes fly13 {
    0% { transform: translate(0, 0); opacity: 0.9; }
    20% { transform: translate(25px, -45px); opacity: 0.6; }
    40% { transform: translate(-35px, -30px); opacity: 0.8; }
    60% { transform: translate(15px, -75px); opacity: 1; }
    80% { transform: translate(-20px, -55px); opacity: 0.7; }
    100% { transform: translate(0, 0); opacity: 0.9; }
}
@keyframes fly14 {
    0% { transform: translate(0, 0); opacity: 0.5; }
    33% { transform: translate(50px, -40px); opacity: 0.9; }
    66% { transform: translate(-15px, -60px); opacity: 0.7; }
    100% { transform: translate(0, 0); opacity: 0.5; }
}
@keyframes fly15 {
    0% { transform: translate(0, 0); opacity: 0.7; }
    25% { transform: translate(-45px, -35px); opacity: 1; }
    50% { transform: translate(30px, -60px); opacity: 0.6; }
    75% { transform: translate(-10px, -20px); opacity: 0.8; }
    100% { transform: translate(0, 0); opacity: 0.7; }
}
@keyframes fly16 {
    0% { transform: translate(0, 0); opacity: 0.8; }
    50% { transform: translate(-50px, -45px); opacity: 0.5; }
    100% { transform: translate(0, 0); opacity: 0.8; }
}
@keyframes fly17 {
    0% { transform: translate(0, 0); opacity: 0.6; }
    33% { transform: translate(40px, -55px); opacity: 1; }
    66% { transform: translate(-20px, -80px); opacity: 0.7; }
    100% { transform: translate(0, 0); opacity: 0.6; }
}
@keyframes fly18 {
    0% { transform: translate(0, 0); opacity: 0.9; }
    25% { transform: translate(-30px, -25px); opacity: 0.5; }
    50% { transform: translate(45px, -50px); opacity: 0.8; }
    75% { transform: translate(-15px, -70px); opacity: 1; }
    100% { transform: translate(0, 0); opacity: 0.9; }
}

/* Wordmark */
#wordmark {
    position: relative;
    z-index: 10;
    text-align: center;
    opacity: 0;
    animation: wordmarkGlow 1s 1.2s ease forwards;
}

@keyframes wordmarkGlow {
    0% {
        opacity: 0;
        text-shadow: 0 0 0 rgba(232, 213, 163, 0);
    }
    100% {
        opacity: 1;
        text-shadow: 0 0 20px rgba(232, 213, 163, 0.6);
    }
}

.carved-text {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: clamp(48px, 8vw, 120px);
    letter-spacing: 0.12em;
    color: #E8D5A3;
    text-shadow:
        0 0 20px rgba(232, 213, 163, 0.6),
        0 0 40px rgba(232, 213, 163, 0.3),
        0 0 60px rgba(232, 213, 163, 0.15);
}

.subtitle {
    font-family: 'Dancing Script', cursive;
    font-weight: 400;
    font-size: clamp(16px, 2vw, 22px);
    color: #C4B1D4;
    margin-top: 12px;
    letter-spacing: 0.04em;
}

/* --- Forest Dashboard --- */
#forest-dashboard {
    position: relative;
    padding: 80px 40px;
    background: linear-gradient(180deg, #1A2F23 0%, #2D4A3E 30%, #1A2F23 100%);
}

#forest-dashboard::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 30%, rgba(196, 177, 212, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(126, 184, 218, 0.04) 0%, transparent 40%);
    pointer-events: none;
}

.section-title {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: clamp(24px, 3.5vw, 48px);
    letter-spacing: 0.08em;
    color: #E8D5A3;
    text-align: center;
    margin-bottom: 50px;
    position: relative;
    z-index: 1;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Enchanted Panel */
.enchanted-panel {
    position: relative;
    border-radius: 16px;
    background: linear-gradient(135deg,
        rgba(45, 74, 62, 0.6) 0%,
        rgba(26, 47, 35, 0.8) 100%);
    backdrop-filter: blur(10px);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.enchanted-panel:hover {
    transform: translateY(-4px);
    box-shadow:
        0 8px 32px rgba(196, 177, 212, 0.15),
        0 0 0 1px rgba(61, 107, 79, 0.3);
    border-color: #E8A0B5;
}

.enchanted-panel:hover .panel-content h3 {
    color: #7EB8DA;
}

.enchanted-panel .vine-border {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.vine-path {
    stroke-dasharray: 1600;
    stroke-dashoffset: 1600;
    transition: stroke-dashoffset 1.5s ease;
}

.enchanted-panel.in-view .vine-path {
    stroke-dashoffset: 0;
}

.vine-leaf {
    transform: scale(0);
    transition: transform 0.3s ease;
}

.enchanted-panel.in-view .vine-leaf {
    transform: scale(1);
    transition-delay: 1.5s;
}

.panel-content {
    position: relative;
    z-index: 1;
    padding: 30px 24px;
}

/* Crystal icons */
.crystal-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 16px;
}

.crystal-icon svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 8px rgba(126, 184, 218, 0.3));
    /* Crystal Blue #7EB8DA glow base */
}

.crystal-emerald .crystal-highlight,
.crystal-sapphire .crystal-highlight {
    fill: #7EB8DA;
}

.crystal-rose .crystal-highlight,
.crystal-amethyst .crystal-highlight {
    fill: #E8A0B5;
}

.panel-content h3 {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: clamp(18px, 2vw, 24px);
    letter-spacing: 0.08em;
    color: #E8D5A3;
    margin-bottom: 12px;
}

.panel-content p {
    font-family: 'Quicksand', sans-serif;
    font-weight: 400;
    font-size: clamp(14px, 1.3vw, 16px);
    line-height: 1.75;
    color: #F5F0F8;
    margin-bottom: 16px;
    opacity: 0.85;
}

/* Panel data rows */
.panel-data {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-top: 1px solid rgba(61, 107, 79, 0.3);
}

.data-label {
    font-family: 'Quicksand', sans-serif;
    font-weight: 400;
    font-size: 13px;
    color: #C4B1D4;
    letter-spacing: 0.02em;
}

.data-value {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 16px;
    color: #E8D5A3;
}

/* --- Book of Spells Section --- */
#book-of-spells {
    position: relative;
    padding: 80px 40px 100px;
    background: linear-gradient(180deg, #1A2F23 0%, #2D4A3E 50%, #1A2F23 100%);
}

#book-of-spells .section-title {
    margin-bottom: 40px;
}

.book-container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 0;
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
}

.book-page {
    padding: 40px 60px;
    position: relative;
    min-height: 400px;
}

.page-left {
    background: linear-gradient(90deg, #F5F0F8 0%, #FFFEF8 100%);
    border-radius: 4px 0 0 4px;
    clip-path: polygon(0% 2%, 100% 0%, 100% 100%, 0% 98%);
}

.page-right {
    background: linear-gradient(90deg, #FFFEF8 0%, #F5F0F8 100%);
    border-radius: 0 4px 4px 0;
    clip-path: polygon(0% 0%, 100% 2%, 100% 98%, 0% 100%);
}

.book-spine {
    width: 3px;
    background: linear-gradient(180deg,
        #3D6B4F 0%,
        #2D4A3E 30%,
        #3D6B4F 50%,
        #2D4A3E 70%,
        #3D6B4F 100%);
    position: relative;
    z-index: 2;
}

.book-spine::before {
    content: '';
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: calc(100% + 8px);
    background: linear-gradient(90deg,
        rgba(26, 47, 35, 0.15) 0%,
        rgba(26, 47, 35, 0.4) 50%,
        rgba(26, 47, 35, 0.15) 100%);
    border-radius: 2px;
}

.page-content {
    position: relative;
    z-index: 1;
}

.spell-title {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: clamp(20px, 2.5vw, 28px);
    letter-spacing: 0.08em;
    color: #1A2F23;
    margin-bottom: 8px;
}

.spell-annotation {
    font-family: 'Dancing Script', cursive;
    font-weight: 400;
    font-size: 16px;
    color: #3D6B4F;
    margin-bottom: 20px;
    font-style: italic;
}

.book-page p {
    font-family: 'Quicksand', sans-serif;
    font-weight: 400;
    font-size: clamp(14px, 1.3vw, 16px);
    line-height: 1.75;
    color: #2D4A3E;
    margin-bottom: 16px;
}

.spell-note {
    font-family: 'Dancing Script', cursive;
    font-weight: 400;
    font-size: 15px;
    color: #C4B1D4;
    border-left: 2px solid #C4B1D4;
    padding-left: 16px;
    margin-top: 20px;
    font-style: italic;
}

/* --- Starlit Footer --- */
#starlit-footer {
    position: relative;
    padding: 80px 40px 40px;
    background: linear-gradient(180deg, #1A2F23 0%, #0d1a12 100%);
    overflow: hidden;
    min-height: 250px;
}

#stars-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.star {
    position: absolute;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: #F5F0F8;
}

.star-twinkle {
    animation: twinkle var(--duration) var(--delay) ease-in-out infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 1; }
}

.mushroom-row {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    padding: 0 10%;
    pointer-events: none;
}

.mushroom {
    width: 40px;
    height: 50px;
    opacity: 0.8;
    filter: drop-shadow(0 0 4px rgba(196, 177, 212, 0.3));
}

.mushroom:nth-child(1) { transform: translateY(5px) scale(0.8); }
.mushroom:nth-child(2) { transform: translateY(2px) scale(0.7); }
.mushroom:nth-child(3) { transform: translateY(0px) scale(1); }
.mushroom:nth-child(4) { transform: translateY(4px) scale(0.65); }
.mushroom:nth-child(5) { transform: translateY(1px) scale(0.9); }

.footer-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.footer-text {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 24px;
    letter-spacing: 0.12em;
    color: #E8D5A3;
    text-shadow: 0 0 10px rgba(232, 213, 163, 0.4);
}

.footer-subtitle {
    font-family: 'Dancing Script', cursive;
    font-weight: 400;
    font-size: 16px;
    color: #C4B1D4;
    margin-top: 8px;
    letter-spacing: 0.04em;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
}

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    #forest-dashboard {
        padding: 60px 20px;
    }

    .book-container {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .book-spine {
        width: 100%;
        height: 3px;
    }

    .book-spine::before {
        top: 50%;
        left: -4px;
        transform: translateY(-50%);
        width: calc(100% + 8px);
        height: 20px;
    }

    .page-left {
        clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%);
        border-radius: 4px 4px 0 0;
    }

    .page-right {
        clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%);
        border-radius: 0 0 4px 4px;
    }

    .book-page {
        padding: 30px 24px;
        min-height: auto;
    }

    #book-of-spells {
        padding: 60px 20px 80px;
    }

    #starlit-footer {
        padding: 60px 20px 40px;
    }
}

@media (max-width: 480px) {
    .carved-text {
        letter-spacing: 0.06em;
    }

    .panel-content {
        padding: 24px 18px;
    }

    .section-title {
        margin-bottom: 30px;
    }
}
