:root {
    --bg-color: #030303;
    --text-main: #f5f5f7;
    --text-muted: #888890;
    --accent: #ff3366;
    
    --font-sans: 'Space Grotesk', sans-serif;
    --font-serif: 'Playfair Display', serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: none;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-sans);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
    background: #333;
}

/* Custom Cursor */
.cursor-dot {
    width: 6px;
    height: 6px;
    background-color: #fff;
    border-radius: 50%;
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    z-index: 10000;
    pointer-events: none;
    opacity: 0;
}

.cursor-outline {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: 50%;
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    z-index: 9999;
    pointer-events: none;
    transition: transform 0.2s ease, background-color 0.2s ease;
    opacity: 0;
}

/* Film Grain Overlay */
.noise-overlay {
    position: fixed;
    inset: 0;
    z-index: 9000;
    opacity: 0.05;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Ambient Deep Space Glows */
.ambient-glow {
    position: fixed;
    width: 50vw;
    height: 50vw;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.15;
    z-index: -1;
    pointer-events: none;
}
.glow-1 {
    top: -10%;
    left: -10%;
    background: radial-gradient(circle, #ff2a5f 0%, transparent 70%);
}
.glow-2 {
    bottom: 20%;
    right: -10%;
    background: radial-gradient(circle, #00e5ff 0%, transparent 70%);
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    padding: 0 5vw;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: -10%;
    background-image: url('assets/hero_bg.png');
    background-size: cover;
    background-position: center;
    filter: brightness(0.6) contrast(1.2) grayscale(0.2) sepia(0.1);
    z-index: -2;
    will-change: transform;
}

.hero-vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, transparent 0%, var(--bg-color) 100%);
    z-index: -1;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30vh;
    background: linear-gradient(to top, var(--bg-color) 0%, transparent 100%);
    z-index: -1;
}

.hero-content {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    position: relative;
    z-index: 10;
}

/* Typography Animations */
.reveal-text {
    display: inline-block;
    transform: translateY(100%);
    opacity: 0;
    transition: transform 1s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 1s ease;
}

body.loaded .reveal-text {
    transform: translateY(0);
    opacity: 1;
}

.title-line {
    display: block;
    overflow: hidden;
    line-height: 1.1;
}

body.loaded .title-line:nth-child(1) .reveal-text { transition-delay: 0.1s; }
body.loaded .title-line:nth-child(2) .reveal-text { transition-delay: 0.2s; }
body.loaded .title-line:nth-child(3) .reveal-text { transition-delay: 0.3s; }
body.loaded .subtitle .reveal-text { transition-delay: 0.5s; }
body.loaded .pre-title .reveal-text { transition-delay: 0.0s; }

.pre-title {
    font-size: 0.85rem;
    letter-spacing: 0.4em;
    
    color: var(--text-muted);
    margin-bottom: 2rem;
    overflow: hidden;
}

.main-title {
    font-size: clamp(4rem, 10vw, 8rem);
    font-family: var(--font-serif);
    font-weight: 400;
    letter-spacing: -0.02em;
    margin-bottom: 2rem;
    text-shadow: 0 20px 40px rgba(0,0,0,0.8);
}

.highlight-italic {
    font-style: italic;
    font-weight: 700;
    color: transparent;
    -webkit-text-stroke: 1px var(--text-main);
    position: relative;
}

.highlight-italic::before {
    content: attr(data-text);
    position: absolute;
    left: 0;
    top: 0;
    color: var(--text-main);
    filter: blur(15px);
    opacity: 0.5;
    z-index: -1;
}

.subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    max-width: 500px;
    color: var(--text-muted);
    font-weight: 300;
    line-height: 1.8;
    overflow: hidden;
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 5vh;
    right: 5vw;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    opacity: 0;
    animation: fadeIn 1s 1.5s forwards;
}

.scroll-text {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--text-muted);
    transform: rotate(90deg);
    transform-origin: right center;
    margin-right: 30px;
}

.scroll-line-container {
    width: 1px;
    height: 80px;
    background: rgba(255,255,255,0.1);
    overflow: hidden;
}

.scroll-line {
    width: 100%;
    height: 100%;
    background: var(--text-main);
    transform: translateY(-100%);
    animation: scrollDown 2s infinite cubic-bezier(0.7, 0, 0.3, 1);
}

@keyframes scrollDown {
    0% { transform: translateY(-100%); }
    50% { transform: translateY(0); }
    100% { transform: translateY(100%); }
}

@keyframes fadeIn {
    to { opacity: 1; }
}

/* Anime Editorial Layout */
.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 15vh 5vw;
    position: relative;
    z-index: 10;
}

.anime-list {
    display: flex;
    flex-direction: column;
    gap: 25vh;
}

/* Card Structure */
.anime-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8vw;
    align-items: center;
    position: relative;
}
.anime-card:nth-child(even) {
    direction: rtl;
}
.anime-card:nth-child(even) > * {
    direction: ltr;
}

/* Massive Numeric Ranking Background */
.card-rank {
    position: absolute;
    top: -50%;
    left: 0;
    font-size: clamp(10rem, 30vw, 25rem);
    font-family: var(--font-serif);
    font-weight: 700;
    color: transparent;
    -webkit-text-stroke: 1px rgba(255,255,255,0.05);
    line-height: 1;
    z-index: -1;
    user-select: none;
    transform: translateY(100px);
    opacity: 0;
    transition: all 1.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.anime-card:nth-child(even) .card-rank {
    left: auto;
    right: 0;
}
.anime-card.visible .card-rank {
    transform: translateY(0);
    opacity: 1;
}

/* Images & Color Grading overrides per card */
.card-image-container {
    position: relative;
    aspect-ratio: 4/5;
    overflow: hidden;
    clip-path: polygon(0 100%, 100% 100%, 100% 100%, 0 100%);
    transition: clip-path 1.5s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: 0 40px 80px rgba(0,0,0,0.8);
    will-change: transform;
}

.anime-card.visible .card-image-container {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}

.card-image {
    position: absolute;
    inset: -10%;
    background-size: cover;
    background-position: center;
    transition: filter 0.8s ease, transform 0.8s ease;
}

/* Image Backgrounds setup - Drop your images in the /assets/ folder with these names */
.bg-onepiece { background-image: url('assets/onepiece.jpg'); }
.bg-naruto { background-image: url('assets/naruto.jpg'); }
.bg-aot { background-image: url('assets/aot.jpg'); }
.bg-dragonball { background-image: url('assets/dragonball.jpg'); }
.bg-bleach { background-image: url('assets/bleach.jpg'); }
.bg-vinland { background-image: url('assets/vinland.jpg'); }
.bg-jjk { background-image: url('assets/jjk.jpg'); }
.bg-demonslayer { background-image: url('assets/demonslayer.jpg'); }
.bg-deathnote { background-image: url('assets/deathnote.jpg'); }
.bg-sololeveling { background-image: url('assets/sololeveling.jpg'); }

/* Cinematic Filters & Color Grading Overrides */
.card-image-container:hover .card-image {
    transform: scale(1.05);
}

.color-red { filter: brightness(0.6) contrast(1.4) saturate(1.5) sepia(0.5) hue-rotate(-20deg); }
.card-image-container:hover .color-red { filter: brightness(0.8) contrast(1.2) saturate(2) hue-rotate(0deg); }

.color-orange { filter: brightness(0.9) contrast(1.1) saturate(1.2); }
.card-image-container:hover .color-orange { filter: brightness(1) contrast(1.1) saturate(1.5); }

.color-cyan { filter: brightness(0.8) contrast(1.3) saturate(0.8) hue-rotate(180deg);  }
.card-image-container:hover .color-cyan { filter: brightness(0.9) contrast(1.1) saturate(1.2) hue-rotate(180deg); }

.color-purple { filter: brightness(0.8) contrast(1.2) saturate(1.3) hue-rotate(280deg); }
.card-image-container:hover .color-purple { filter: brightness(1) contrast(1.1) saturate(1.5) hue-rotate(280deg); }

.color-green { filter: brightness(0.9) contrast(1.2) saturate(1.4) hue-rotate(100deg); }
.card-image-container:hover .color-green { filter: brightness(1) contrast(1.1) saturate(1.8) hue-rotate(100deg); }

.color-gold { filter: brightness(0.7) contrast(1.3) saturate(2) sepia(1) hue-rotate(20deg); }
.card-image-container:hover .color-gold { filter: brightness(0.9) contrast(1.1) saturate(2) sepia(0.5) hue-rotate(10deg); }

.color-orange-dark { filter: brightness(0.6) contrast(1.5) saturate(2) sepia(0.8) hue-rotate(10deg); }
.card-image-container:hover .color-orange-dark { filter: brightness(0.8) contrast(1.2) saturate(2.5) hue-rotate(5deg); }

.color-blue { filter: brightness(0.6) contrast(1.4) saturate(2) hue-rotate(200deg); }
.card-image-container:hover .color-blue { filter: brightness(0.8) contrast(1.2) saturate(2.5) hue-rotate(200deg); }

.color-pink { filter: brightness(0.7) contrast(1.3) saturate(1.5) hue-rotate(300deg); }
.card-image-container:hover .color-pink { filter: brightness(0.9) contrast(1.2) saturate(2) hue-rotate(300deg); }

.color-darkred { filter: brightness(0.5) contrast(1.8) saturate(2) sepia(0.5) hue-rotate(-20deg); }
.card-image-container:hover .color-darkred { filter: brightness(0.7) contrast(1.5) saturate(2.5) hue-rotate(-10deg); }


.card-image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 40%);
    pointer-events: none;
}


/* Text Content */
.card-content {
    opacity: 0;
    transform: translateY(40px);
    transition: all 1s cubic-bezier(0.2, 0.8, 0.2, 1) 0.3s;
    will-change: transform;
}

.anime-card.visible .card-content {
    opacity: 1;
    transform: translateY(0);
}

.anime-title {
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    line-height: 1.1;
    margin-bottom: 2rem;
    font-weight: 400;
}

.anime-title span {
    display: block;
    font-style: italic;
    color: var(--text-muted);
    font-size: 0.7em;
    margin-top: 0.5rem;
}

.anime-meta {
    margin-bottom: 1.5rem;
    font-family: var(--font-sans);
}

.anime-author {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--bg-color);
    background: var(--accent);
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
    box-shadow: 0 4px 15px rgba(255, 51, 102, 0.3);
}

.anime-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-main);
}

.star-rating {
    letter-spacing: 0.1em;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.episode-count {
    color: #ffd700;
    font-weight: bold;
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.anime-desc {
    font-size: clamp(1rem, 1.5vw, 1.1rem);
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 3rem;
    max-width: 500px;
}

/* Animated Tags */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.tags span {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.8em 1.5em;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    transition: color 0.3s ease;
}

/* Custom accent colors per alternate card index */
.anime-card:nth-child(1) .tags span::before { background: #ff4d4d; }
.anime-card:nth-child(2) .tags span::before { background: #ff9933; }
.anime-card:nth-child(3) .tags span::before { background: #00e5ff; }
.anime-card:nth-child(4) .tags span::before { background: #9933ff; }
.anime-card:nth-child(5) .tags span::before { background: #33cc33; }
.anime-card:nth-child(6) .tags span::before { background: #ffcc00; }
.anime-card:nth-child(7) .tags span::before { background: #ff6600; }
.anime-card:nth-child(8) .tags span::before { background: #6699ff; }
.anime-card:nth-child(9) .tags span::before { background: #ff66b2; }
.anime-card:nth-child(10) .tags span::before { background: #cc3333; }

.tags span::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 100%;
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    z-index: -1;
}

.tags span:hover {
    color: #000;
    border-color: transparent;
}

.tags span:hover::before {
    transform: translateY(-100%);
}

/* Mobile Responsiveness */
@media (max-width: 900px) {
    .anime-card, .anime-card:nth-child(even) {
        grid-template-columns: 1fr;
        gap: 2rem;
        direction: ltr;
    }
    
    .card-rank {
        top: -5%;
        left: -5%;
        font-size: 15rem;
    }
    
    .anime-card:nth-child(even) .card-rank {
        right: -5%;
        left: auto;
    }

    .card-image-container {
        aspect-ratio: 4/5;
        max-height: 70vh;
    }

    .main-title {
        text-align: center;
    }
    
    .pre-title, .subtitle {
        text-align: center;
        margin-left: auto;
        margin-right: auto;
    }
    
    .cursor-dot, .cursor-outline {
        display: none;
    }
    
    * { cursor: auto; }
}

/* Vote Poll Styles */
.vote-container {
    margin-top: 2rem;
    display: inline-flex;
}

.vote-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    color: var(--text-main);
    font-family: var(--font-sans);
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.vote-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: var(--accent);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
    z-index: -1;
}

.vote-btn:hover {
    border-color: var(--accent);
}

.vote-btn:hover::before {
    width: 200%;
    height: 200%;
}

.heart-icon {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.vote-btn.voted .heart-icon {
    fill: currentColor;
    stroke: none;
}

.vote-btn.voted {
    border-color: var(--accent);
    color: var(--accent);
}

.vote-btn.voted:hover {
    color: #fff;
}

@keyframes pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}
