@tailwind base;
@tailwind components;
@tailwind utilities;

header {
    @apply fixed top-0 left-0 right-0 z-[100] transition-all duration-500 py-8 px-6 md:px-12 text-white;
    mix-blend-mode: difference;
}

header.scrolled {
    @apply py-4 bg-void/90 border-b border-white/5;
    mix-blend-mode: normal;
    backdrop-filter: blur(10px);
}

.bento-grid {
    @apply grid grid-cols-1 md:grid-cols-4 gap-6 auto-rows-[300px];
}

:root {
    --flickn-red: #ff3366;
    --flickn-crimson: #8b0000;
    --void: #0a0a0e;

    /* Legacy Variables for Hero */
    --bg: #0a0a0e;
    --bg-soft: #111116;
    --text: #ffffff;
    --muted: #8b8fa3;
    --accent: #ff3366;
    --accent-glow: rgba(255, 51, 102, 0.45);
    --accent-2: #ffd166;
    --card: #14141c;
    --border: #1e2030;
    --radius: 16px;
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    --header-h: 72px;
    --container: min(1200px, 92vw);
    --font-display-legacy: 'Bebas Neue', Impact, sans-serif;
}

/* Custom Utilities */
.text-stroke-white {
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.2);
}

.text-stroke-red {
    -webkit-text-stroke: 1px var(--flickn-red);
}

/* Marquee Animation */
@keyframes marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

.animate-marquee {
    animation: marquee 20s linear infinite;
}

/* Glitch Effect */
.glitch-hover:hover {
    animation: glitch 0.3s cubic-bezier(.25, .46, .45, .94) both infinite;
}

@keyframes glitch {
    0% {
        transform: translate(0);
    }

    20% {
        transform: translate(-2px, 2px);
        text-shadow: 2px 0 var(--flickn-red);
    }

    40% {
        transform: translate(-2px, -2px);
        text-shadow: -2px 0 #fff;
    }

    60% {
        transform: translate(2px, 2px);
        text-shadow: 2px 0 var(--flickn-red);
    }

    80% {
        transform: translate(2px, -2px);
        text-shadow: -2px 0 #fff;
    }

    100% {
        transform: translate(0);
    }
}

/* Custom Scrollbar for non-Lenis browsers */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--void);
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--flickn-red);
}

/* Bento Grid Overhaul (Perfected) */
.bento-grid {
    display: grid;
    grid-template-columns: 1fr;
    grid-auto-rows: min-content;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .bento-grid {
        grid-template-columns: repeat(12, 1fr);
        grid-auto-rows: minmax(280px, auto);
        gap: 2rem;
    }
}

.bento-item {
    @apply relative overflow-hidden bg-void border border-white/5 transition-all duration-500 rounded-xl flex flex-col;
}

/* Glassmorphism 2.0 */
.bento-card {
    @apply flex-1 relative w-full flex flex-col p-6 md:p-8 transition-transform duration-500 ease-out;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
    backdrop-filter: blur(10px);
}

/* Lift & Glow (Pure CSS) */
.bento-item:hover .bento-card {
    background: linear-gradient(135deg, rgba(255, 51, 102, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%);
    @apply border-white/20;
}

.bento-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.8), 0 0 40px -10px rgba(139, 0, 0, 0.4);
    z-index: 10;
}

/* Inner Shine Effect */
.bento-card::after {
    content: '';
    @apply absolute inset-0 opacity-0 transition-opacity duration-500 pointer-events-none;
    background: linear-gradient(45deg, transparent 0%, rgba(255, 255, 255, 0.05) 50%, transparent 100%);
}

.bento-item:hover .bento-card::after {
    @apply opacity-100;
}

/* Image Handling */
.bento-item .img-wrapper {
    @apply absolute inset-0 overflow-hidden pointer-events-none;
}

.bento-item .css-zoom-bg {
    @apply absolute inset-0 w-full h-full object-cover opacity-30 transition-transform duration-[1.5s] ease-out transform scale-105;
}

.bento-item:hover .css-zoom-bg {
    @apply scale-110 opacity-50;
}

@media (max-width: 767px) {
    .bento-item {
        min-height: 300px;
    }
}

/* Noise Overlay */
.noise {
    @apply fixed inset-0 z-[9999] pointer-events-none opacity-[0.03];
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* ============ OLD HERO RESTORATION ============ */
.hero {
    position: relative;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    overflow: hidden;
    background: #f5f5f3;
    user-select: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    color: #111;
}

.hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
    padding: 80px 0;
}

.hero-inner {
    width: var(--container);
    margin-inline: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

.hero-text {
    flex: 1;
    min-width: 0;
}

.hero-date {
    display: inline-block;
    font-family: var(--font-display-legacy);
    font-size: 1rem;
    letter-spacing: 5px;
    text-transform: uppercase;
    color: var(--accent);
    margin-top: 80px;
    margin-bottom: 0;
    position: relative;
    z-index: 10;
    padding: 8px 20px;
    border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
    background: color-mix(in srgb, var(--accent) 6%, transparent);
    border-radius: 4px;
}

.hero-title {
    font-family: var(--font-display-legacy);
    font-size: clamp(4rem, 4rem + 12vw, 12rem);
    line-height: .8;
    margin: 0;
    letter-spacing: 2px;
    color: #111;
}

.hero-accent-line {
    width: 80px;
    height: 3px;
    background: var(--accent);
    margin: 24px 0;
    border-radius: 2px;
    box-shadow: 0 0 12px var(--accent-glow);
}

.hero-tagline {
    font-size: 1.15rem;
    color: #555;
    max-width: 450px;
    line-height: 1.5;
    margin: 0;
    font-weight: 400;
}

.hero-swapper {
    display: grid;
    grid-template-columns: 1fr;
    align-items: center;
    position: relative;
    margin-top: -15px;
}

.hero-original {
    grid-area: 1 / 1;
    transition: opacity 0.8s ease, transform 0.8s ease;
    z-index: 2;
    margin-top: -80px;
}

.hero-blood-image {
    grid-area: 1 / 1;
    width: 100%;
    max-width: 600px;
    height: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.8s ease, transform 0.8s ease;
    z-index: 1;
    pointer-events: none;
}

body.milestone-reached .hero-original {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
}

body.milestone-reached .hero-blood-image {
    opacity: 1;
    visibility: visible;
    transform: translate(-10px, 0);
    z-index: 3;
}

.hero-heart {
    flex-shrink: 0;
    width: 280px;
    height: 280px;
    position: relative;
    display: grid;
    place-items: center;
    overflow: visible;
    margin-top: -180px;
}

.heart-counter-old {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'VT323', monospace;
    font-size: 2.2rem;
    color: var(--accent);
    text-shadow: 0 0 15px var(--accent-glow);
    letter-spacing: 4px;
    pointer-events: none;
    z-index: 10;
    min-width: 120px;
    text-align: center;
}

.blood-drip-old {
    grid-area: 1 / 1;
    width: 75%;
    height: auto;
    z-index: 1;
    pointer-events: none;
    align-self: start;
    justify-self: center;
    margin-top: 90%;
}

.pixel-heart-old {
    grid-area: 1 / 1;
    z-index: 2;
    width: 100%;
    height: 100%;
    object-fit: contain;
    animation: heartFlash 1.5s ease-in-out infinite;
    filter: drop-shadow(0 0 20px var(--accent-glow));
}

.scroll-indicator-old {
    position: absolute;
    bottom: 24px;
    right: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 2;
}

.scroll-indicator-old span {
    font-size: .6rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: rgba(0, 0, 0, .25);
    writing-mode: vertical-rl;
}

.scroll-line-old {
    width: 1px;
    height: 48px;
    background: linear-gradient(to bottom, var(--accent), transparent);
    animation: scrollPulse 2s ease-in-out infinite;
}

@media (max-width: 768px) {
    .hero-inner {
        flex-direction: column;
        text-align: center;
        gap: 8px;
        padding: 0 20px;
    }

    .hero-text {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .hero-title {
        font-size: clamp(3rem, 2rem + 12vw, 6rem);
    }

    .hero-content {
        padding: 30px 0 30px;
    }

    .hero-heart {
        width: 200px;
        height: 200px;
        margin-top: -40px;
    }
}