/* heisei.boo - Ghostly Nostalgia Trip */

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

:root {
    --heisei-lavender: #C9B1FF;
    --sakura-pink: #FFB1D0;
    --ghost-blue: #B1E5FF;
    --chrome-silver: #D4D4D8;
    --glass-white: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(255, 255, 255, 0.3);
    --konbini-green: #7CFC00;
    --fog-white: #F8F6FF;
    --spirit-gray: #AAAAAA;
    --white: #FFFFFF;
    --ghost-text: #DDDDDD;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'M PLUS Rounded 1c', sans-serif;
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.75;
    color: #333;
    background: var(--fog-white);
    overflow-x: hidden;
    position: relative;
}

/* Iridescent Cycling Background */
#iridescent-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0;
    transition: opacity 1.5s ease;
    background:
        radial-gradient(ellipse at 30% 20%, var(--heisei-lavender) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, var(--sakura-pink) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, var(--ghost-blue) 0%, transparent 60%);
    background-size: 200% 200%;
    animation: iridescent-shift 8s ease-in-out infinite;
}

#iridescent-bg.visible {
    opacity: 1;
}

@keyframes iridescent-shift {
    0% {
        background-position: 0% 0%, 100% 100%, 50% 50%;
    }
    33% {
        background-position: 100% 50%, 0% 50%, 50% 0%;
    }
    66% {
        background-position: 50% 100%, 50% 0%, 0% 100%;
    }
    100% {
        background-position: 0% 0%, 100% 100%, 50% 50%;
    }
}

/* Floating Stickers Container */
#floating-stickers {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.floating-sticker {
    position: absolute;
    opacity: 0;
    animation: float-drift linear infinite;
}

@keyframes float-drift {
    0% {
        transform: translateY(0) rotate(0deg);
    }
    100% {
        transform: translateY(-110vh) rotate(360deg);
    }
}

.floating-sticker svg {
    width: 100%;
    height: 100%;
}

/* Spirit Gate (Hero Section) */
#spirit-gate {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.chrome-title {
    font-family: 'Righteous', cursive;
    font-weight: 400;
    font-size: clamp(2.5rem, 6vw, 5rem);
    background: linear-gradient(135deg, #D4D4D8 0%, #FFFFFF 25%, #D4D4D8 50%, #FFFFFF 75%, #D4D4D8 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    position: relative;
    opacity: 0;
    animation: chrome-shimmer 3s linear infinite, title-materialize 0.8s ease forwards 1s;
    letter-spacing: 0.05em;
}

.chrome-title::after {
    content: attr(data-text);
    position: absolute;
    top: 4px;
    left: 4px;
    width: 100%;
    font-family: 'Righteous', cursive;
    font-weight: 400;
    font-size: clamp(2.5rem, 6vw, 5rem);
    background: none;
    -webkit-text-fill-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.2);
    filter: blur(2px);
    z-index: -1;
    opacity: 0;
    animation: ghost-trail-appear 0.5s ease forwards 2s;
}

@keyframes chrome-shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

@keyframes title-materialize {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes ghost-trail-appear {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

.hero-subtitle {
    font-family: 'M PLUS Rounded 1c', sans-serif;
    font-weight: 400;
    font-size: 1rem;
    color: var(--spirit-gray);
    margin-top: 1rem;
    opacity: 0;
    animation: title-materialize 0.8s ease forwards 1.5s;
    letter-spacing: 0.15em;
}

/* Glassmorphism Panels */
.glass-panel {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: var(--glass-white);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* Memory Panels */
.memory-panel {
    position: relative;
    z-index: 2;
    max-width: 680px;
    padding: 3rem 2.5rem;
    margin: 80px auto;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.memory-panel.visible {
    opacity: 1;
    transform: translateY(0);
}

#memory-panel-1 {
    margin-left: auto;
    margin-right: calc(50% - 300px);
}

#memory-panel-2 {
    margin-left: calc(50% - 300px);
    margin-right: auto;
}

#memory-panel-3 {
    margin-left: auto;
    margin-right: calc(50% - 280px);
}

@media (max-width: 768px) {
    #memory-panel-1,
    #memory-panel-2,
    #memory-panel-3 {
        margin-left: 1rem;
        margin-right: 1rem;
        max-width: calc(100% - 2rem);
    }
}

.panel-inner {
    max-width: 600px;
}

.ghost-heading {
    font-family: 'M PLUS Rounded 1c', sans-serif;
    font-weight: 700;
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    color: #444;
    position: relative;
    display: inline-block;
    margin-bottom: 0.5rem;
}

.ghost-heading::after {
    content: attr(data-text);
    position: absolute;
    top: 3px;
    left: 3px;
    color: rgba(255, 255, 255, 0.15);
    filter: blur(1.5px);
    z-index: -1;
    pointer-events: none;
}

.era-label {
    font-family: 'Zen Maru Gothic', serif;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--heisei-lavender);
    margin-bottom: 1rem;
    letter-spacing: 0.08em;
}

.memory-panel p {
    color: #555;
    margin-bottom: 0.8rem;
}

.memory-panel p:last-child {
    margin-bottom: 0;
}

/* Purikura Strip */
#purikura-strip {
    position: relative;
    z-index: 2;
    padding: 4rem 2rem;
    text-align: center;
    margin: 40px auto;
}

#purikura-strip .ghost-heading {
    display: block;
    text-align: center;
    margin-bottom: 2rem;
    color: var(--spirit-gray);
    font-size: 1.2rem;
    letter-spacing: 0.2em;
}

.purikura-frames {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.purikura-frame {
    width: 120px;
    height: 120px;
    border-radius: 12px;
    border: 4px solid var(--white);
    background: var(--glass-white);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    position: relative;
    overflow: visible;
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
    transition: transform 0.3s ease, opacity 0.5s ease;
}

.purikura-frame.visible {
    opacity: 1;
    transform: translateY(0);
}

.purikura-frame:hover {
    transform: rotate(var(--hover-rotation, 3deg)) scale(1.05);
}

.purikura-frame::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    opacity: 0;
    transition: none;
    pointer-events: none;
}

.purikura-frame:hover::before {
    animation: purikura-flash 0.3s ease forwards;
}

@keyframes purikura-flash {
    0% {
        left: -100%;
        opacity: 1;
    }
    100% {
        left: 100%;
        opacity: 0;
    }
}

.frame-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.frame-icon {
    font-family: 'Righteous', cursive;
    font-size: 1.2rem;
    color: var(--chrome-silver);
    letter-spacing: 0.05em;
}

.sticker {
    position: absolute;
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.purikura-frame:hover .sticker {
    transform: scale(1.2);
}

.star-sticker {
    top: -8px;
    right: -8px;
    fill: var(--sakura-pink);
}

.heart-sticker {
    bottom: -6px;
    left: -6px;
    fill: var(--heisei-lavender);
}

.sparkle-sticker {
    top: -8px;
    left: -8px;
    fill: var(--konbini-green);
}

/* Ghost Farewell */
#ghost-farewell {
    position: relative;
    z-index: 2;
    height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
}

.farewell-content {
    text-align: center;
}

.farewell-era {
    font-family: 'Zen Maru Gothic', serif;
    font-weight: 500;
    font-size: clamp(3rem, 8vw, 6rem);
    color: var(--ghost-text);
    opacity: 0;
    transition: opacity 1s ease;
    letter-spacing: 0.2em;
}

.farewell-dates {
    font-family: 'M PLUS Rounded 1c', sans-serif;
    font-weight: 400;
    font-size: 1.2rem;
    color: var(--ghost-text);
    margin-top: 1rem;
    opacity: 0;
    transition: opacity 1s ease;
    letter-spacing: 0.3em;
}
