/* gabs.boo -- Haunted Night Market */

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

:root {
    --bg-dark: #0D0221;
    --bg-light: #FAFBFF;
    --pink: #FF2E93;
    --mint: #00F5D4;
    --yellow: #FEE440;
    --lavender: #E0D7FF;
    --violet: #3A0078;
    --receipt: #FFF8E7;
    --phantom: #7B68EE;
    --crimson: #FF3366;
    --bg: var(--bg-dark);
    --text: var(--lavender);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Sora', sans-serif;
    font-weight: 400;
    font-size: 17px;
    line-height: 1.65;
    color: var(--text);
    background-color: var(--bg);
    overflow-x: hidden;
    transition: background-color 0.6s ease, color 0.6s ease;
}

body.light-mode {
    --bg: var(--bg-light);
    --text: var(--violet);
    background-color: var(--bg-light);
    color: var(--violet);
}

.section {
    min-height: 100vh;
    position: relative;
}

/* ===================== FLOATING PRICE TAGS ===================== */

.floating-tags {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.price-tag {
    position: absolute;
    width: 50px;
    height: 30px;
    border: 2px solid var(--pink);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Share Tech Mono', monospace;
    font-size: 10px;
    color: var(--lavender);
    opacity: 0.4;
    animation: floatUp var(--dur) linear infinite;
    animation-delay: var(--delay);
    left: var(--x);
}

.price-tag::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-right: 8px solid currentColor;
}

.price-tag::after {
    content: '';
    position: absolute;
    left: -3px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--bg-dark);
    border: 1px solid currentColor;
}

@keyframes floatUp {
    0% { transform: translateY(110vh) rotate(var(--rot)); opacity: 0; }
    10% { opacity: 0.4; }
    90% { opacity: 0.4; }
    100% { transform: translateY(-10vh) rotate(calc(var(--rot) + 20deg)); opacity: 0; }
}

/* ===================== CURSOR TRAIL ===================== */

#cursor-trail {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 99;
}

.trail-char {
    position: absolute;
    font-family: 'Jua', sans-serif;
    font-size: 14px;
    color: var(--phantom);
    opacity: 0.7;
    pointer-events: none;
    animation: trailFade 0.8s ease-out forwards;
}

@keyframes trailFade {
    0% { opacity: 0.7; transform: scale(1); }
    100% { opacity: 0; transform: scale(0.3) translateY(-20px); }
}

/* ===================== SECTION 1: SUMMONING ===================== */

#summoning {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2;
    position: relative;
}

.ghost-emoji {
    position: absolute;
    font-size: 60px;
    opacity: 0.15;
    animation: ghostDrift 20s linear infinite, ghostPulse 3s ease-in-out infinite;
    top: 20%;
    left: 10%;
}

@keyframes ghostDrift {
    0% { transform: translate(0, 0); }
    25% { transform: translate(60vw, -10vh); }
    50% { transform: translate(70vw, 30vh); }
    75% { transform: translate(10vw, 40vh); }
    100% { transform: translate(0, 0); }
}

@keyframes ghostPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.domain-title {
    font-family: 'Black Ops One', cursive;
    font-size: clamp(4rem, 12vw, 9rem);
    letter-spacing: 0.05em;
    -webkit-text-stroke: 2px var(--pink);
    color: transparent;
    text-align: center;
    position: relative;
}

.value-reveal {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(1.2rem, 2.5vw, 2rem);
    opacity: 0;
    animation: fadeInUp 1s ease 2s forwards;
}

.val-korean {
    font-family: 'Jua', sans-serif;
    color: var(--yellow);
    font-size: 1.5em;
}

.val-equals {
    color: var(--mint);
}

.val-english {
    color: var(--pink);
}

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

.scroll-hint {
    position: absolute;
    bottom: 40px;
    opacity: 0;
    animation: fadeInUp 0.5s ease 3s forwards, bounce 1.5s ease-in-out 3.5s infinite;
}

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

/* ===================== SECTION 2: VALUE MAZE ===================== */

#value-maze {
    padding: 100px 24px;
    z-index: 2;
    position: relative;
}

.bento-broken {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 1000px;
    margin: 0 auto;
}

.maze-card {
    background: rgba(13, 2, 33, 0.8);
    border: 2px solid var(--border-color);
    padding: 32px 24px;
    transform: rotate(var(--rotation));
    will-change: transform;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    opacity: 0;
}

.maze-card.visible {
    opacity: 1;
    animation: slideIn 0.5s ease forwards;
}

.maze-card:hover {
    box-shadow: 0 0 30px color-mix(in srgb, var(--border-color) 40%, transparent);
}

.maze-card h3 {
    font-family: 'Black Ops One', cursive;
    font-size: 1.2rem;
    color: var(--yellow);
    margin-bottom: 12px;
    letter-spacing: 0.03em;
}

.maze-card h3.kr {
    font-family: 'Jua', sans-serif;
    color: var(--mint);
    font-size: 1.4rem;
}

.maze-card p {
    font-family: 'Sora', sans-serif;
    font-weight: 300;
    font-size: 0.95rem;
    color: var(--lavender);
    line-height: 1.6;
}

.maze-card:nth-child(2) { grid-column: span 2; }
.maze-card:nth-child(5) { grid-column: span 2; }

@keyframes slideIn {
    from { opacity: 0; transform: rotate(var(--rotation)) translateY(30px); }
    to { opacity: 1; transform: rotate(var(--rotation)) translateY(0); }
}

/* ===================== SECTION 3: TICKER TAPE ===================== */

#ticker-tape {
    min-height: 30vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    z-index: 2;
    position: relative;
}

.receipt-border-top,
.receipt-border-bottom {
    height: 12px;
    background: var(--receipt);
    clip-path: polygon(0% 0%, 2% 100%, 4% 0%, 6% 100%, 8% 0%, 10% 100%, 12% 0%, 14% 100%, 16% 0%, 18% 100%, 20% 0%, 22% 100%, 24% 0%, 26% 100%, 28% 0%, 30% 100%, 32% 0%, 34% 100%, 36% 0%, 38% 100%, 40% 0%, 42% 100%, 44% 0%, 46% 100%, 48% 0%, 50% 100%, 52% 0%, 54% 100%, 56% 0%, 58% 100%, 60% 0%, 62% 100%, 64% 0%, 66% 100%, 68% 0%, 70% 100%, 72% 0%, 74% 100%, 76% 0%, 78% 100%, 80% 0%, 82% 100%, 84% 0%, 86% 100%, 88% 0%, 90% 100%, 92% 0%, 94% 100%, 96% 0%, 98% 100%, 100% 0%);
}

.ticker-track {
    background: var(--receipt);
    padding: 24px 0;
    overflow: hidden;
    display: flex;
}

.ticker-scroll {
    display: flex;
    gap: 24px;
    animation: tickerMove 40s linear infinite;
    flex-shrink: 0;
    padding-right: 24px;
}

@keyframes tickerMove {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

.ticker-item {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.9rem;
    color: var(--violet);
    white-space: nowrap;
}

.ticker-sep {
    color: var(--phantom);
    opacity: 0.4;
}

/* ===================== SECTION 4: THE REVEAL ===================== */

#reveal {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 24px;
    z-index: 2;
    position: relative;
    transition: background-color 0.6s ease;
}

.boo-text {
    font-family: 'Black Ops One', cursive;
    font-size: clamp(5rem, 15vw, 12rem);
    color: var(--pink);
    opacity: 0;
    transform: scale(0);
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    margin-bottom: 40px;
}

.boo-text.active {
    opacity: 0.4;
    transform: scale(1);
}

.reveal-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    max-width: 700px;
    width: 100%;
    margin-bottom: 60px;
}

.reveal-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--phantom);
    padding: 28px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.reveal-card:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(123, 104, 238, 0.3);
}

.price-side {
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.8rem;
    color: var(--crimson);
    margin-bottom: 12px;
    transition: opacity 0.4s ease;
}

.value-side {
    font-family: 'Sora', sans-serif;
    font-weight: 300;
    font-size: 0.95rem;
    color: var(--lavender);
    line-height: 1.5;
}

body.light-mode .reveal-card {
    background: rgba(58, 0, 120, 0.05);
}

body.light-mode .value-side {
    color: var(--violet);
}

body.light-mode .boo-text {
    color: var(--violet);
}

.reveal-closing {
    font-family: 'Jua', sans-serif;
    font-size: clamp(1.3rem, 3vw, 2rem);
    color: var(--yellow);
    text-align: center;
    margin-bottom: 8px;
}

.reveal-closing-en {
    font-family: 'Sora', sans-serif;
    font-weight: 300;
    font-size: 1rem;
    color: var(--phantom);
    text-align: center;
}

body.light-mode .reveal-closing {
    color: var(--violet);
}

/* ===================== GHOST NAV ===================== */

.ghost-nav-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--phantom);
    background: rgba(13, 2, 33, 0.8);
    font-size: 24px;
    cursor: pointer;
    z-index: 50;
    transition: transform 0.3s ease;
}

.ghost-nav-btn:hover {
    transform: scale(1.1);
}

.ghost-menu {
    position: fixed;
    bottom: 80px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 49;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.ghost-menu.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.ghost-menu a {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.85rem;
    color: var(--lavender);
    text-decoration: none;
    background: rgba(13, 2, 33, 0.9);
    border: 1px solid var(--phantom);
    padding: 8px 16px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.ghost-menu a:hover {
    background: var(--phantom);
    color: var(--bg-dark);
}

/* ===================== NEON GLOW ===================== */

@keyframes neonPulse {
    0%, 100% { box-shadow: 0 0 5px var(--border-color), 0 0 10px color-mix(in srgb, var(--border-color) 40%, transparent); }
    50% { box-shadow: 0 0 10px var(--border-color), 0 0 20px color-mix(in srgb, var(--border-color) 60%, transparent); }
}

/* ===================== RESPONSIVE ===================== */

@media (max-width: 768px) {
    .bento-broken {
        grid-template-columns: 1fr;
    }

    .maze-card:nth-child(2),
    .maze-card:nth-child(5) {
        grid-column: span 1;
    }

    .reveal-grid {
        grid-template-columns: 1fr;
    }

    .maze-card {
        transform: rotate(0deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .ticker-scroll {
        animation-play-state: paused;
    }

    .ghost-emoji {
        animation: none;
    }

    .price-tag {
        animation: none;
        opacity: 0.2;
    }
}
