:root {
    --bg-color: #ffffff;
    --text-color: #0d0d0d;
    --card-bg: #f5f5f5;
    --border-color: #eaeaea;
    --primary-color: #5D3FD3;
    --primary-hover: #4E34B1;
    --shadow-color: rgba(0, 0, 0, 0.05);
    --gradient-start: #EDE7F6;
    --gradient-end: #D1C4E9;
}

body.dark-theme {
    --bg-color: #0a0a0a;
    --text-color: #f5f5f5;
    --card-bg: #1a1a1a;
    --border-color: #262626;
    --primary-color: #9575CD;
    --primary-hover: #B39DDB;
    --shadow-color: rgba(0, 0, 0, 0.2);
    --gradient-start: #673AB7;
    --gradient-end: #8E24AA;
}

html {
    /* scroll-behavior: smooth; */ /* Removed for Lenis */
    scrollbar-width: none; /* For Firefox */
}

/* For Chrome, Safari, and Opera */
html::-webkit-scrollbar {
    display: none;
}

.copy-alert {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translate(-50%, -150%);
    padding: 10px 22px 10px 38px; /* reduced padding for smaller popup */
    background-color: rgba(255, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 0, 0, 0.2);
    border-radius: 999px;
    color: var(--text-color);
    z-index: 2000;
    font-weight: 700;
    font-size: 0.95em; /* slightly smaller font */
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: fixed;
}

.copy-alert::before {
    content: "❗";
    position: absolute;
    left: 15px; /* move icon closer */
    top: 50%;
    transform: translateY(-50%);
    font-size: 1em; /* smaller icon */
    color: #d32f2f;
}

.copy-alert.show {
    transform: translate(-50%, 0);
    opacity: 1;
}

#scroll-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
    opacity: 0.5;
    width: 0%;
    z-index: 1002;
    transition: width 0.1s ease-out;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Manrope', sans-serif;
    margin: 0;
    transition: background-color 0.3s, color 0.3s;
    cursor: none;
    user-select: none; /* Disable text selection */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Custom Cursor */
.cursor-follower {
    position: fixed;
    width: 30px;
    height: 30px;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    pointer-events: none;
    z-index: 1001;
    transform: translate(-50%, -50%);
    transition: width 0.2s, height 0.2s, background-color 0.2s;
}

.cursor-follower.active {
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    opacity: 0.3;
}

/* Preloader */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#preloader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-logo {
    font-size: 2em;
    font-weight: 800;
    color: var(--primary-color);
    animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.95); }
}


.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.5;
    transition: transform 0.2s ease-out;
}

.shape-1 {
    width: 400px;
    height: 400px;
    background: var(--gradient-start);
    top: -10%;
    left: -10%;
    animation: move-shape 20s infinite alternate;
}

.shape-2 {
    width: 500px;
    height: 500px;
    background: var(--gradient-end);
    bottom: -15%;
    right: -15%;
    animation: move-shape 25s infinite alternate-reverse;
}

.shape-3 {
    width: 300px;
    height: 300px;
    background: var(--primary-color);
    top: 50%;
    left: 50%;
    animation: move-shape 18s infinite alternate;
}

@keyframes move-shape {
    from {
        transform: translate(0, 0) scale(1);
    }
    to {
        transform: translate(100px, 50px) scale(1.2);
    }
}

@keyframes gradient-flow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 40px;
}

.full-width {
    width: 100%;
}

/* Header */
header {
    background-color: transparent;
    padding: 20px 0;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    width: 100%;
    transition: background-color 0.3s ease, backdrop-filter 0.3s ease;
}

header.scrolled {
    background-color: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}

body.dark-theme header.scrolled {
    background-color: rgba(10, 10, 10, 0.5);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8em;
    font-weight: 800;
    text-decoration: none;
    background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end), var(--gradient-start));
    background-size: 200% auto;
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    animation: text-gradient-flow 5s linear infinite;
}

.nav-right {
    display: flex;
    align-items: center;
}

.theme-toggle-btn {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    font-size: 1.2em;
    cursor: pointer;
    transition: all 0.3s;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle-btn i {
    transition: transform 0.5s ease, opacity 0.3s ease;
}

.theme-toggle-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: scale(1.1);
}

/* Main Content */
main {
    width: 100%;
}

.hero {
    display: flex;
    align-items: center;
    min-height: 80vh;
    padding: 120px 0 60px;
    text-align: center;
}

.hero h1 {
    font-size: clamp(3rem, 10vw, 6rem);
    font-weight: 800;
    margin-bottom: 20px;
    line-height: 1.1;
    letter-spacing: -0.03em;
    min-height: 1.1em; /* Prevent layout shift */
    background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end), var(--gradient-start));
    background-size: 200% auto;
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    animation: text-gradient-flow 5s linear infinite;
}

@keyframes text-gradient-flow {
    0% { background-position: 200% center; }
    100% { background-position: 0% center; }
}

.hero h1::after {
    content: '|';
    animation: blink 1s step-end infinite;
    margin-left: 0.1em;
}

@keyframes blink {
    from, to { color: transparent; }
    50% { color: var(--text-color); }
}

.hero p {
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    color: var(--text-color);
    opacity: 0.7;
    max-width: 700px;
    margin: 0 auto 40px;
}

.cta-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 18px 40px;
    font-size: 1.2em;
    font-family: 'Manrope', sans-serif;
    font-weight: 700;
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s, box-shadow 0.3s;
    text-decoration: none;
}

.cta-button:hover {
    background-color: var(--primary-hover);
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.rules-section {
    padding: 80px 0;
    text-align: center;
}

.rules-section h2 {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 800;
    margin-bottom: 15px;
    color: var(--text-color);
}

body.dark-theme .rules-section h2,
body.dark-theme .rules-section p {
    color: #fff;
}

.rules-section p {
    font-size: 1.2rem;
    opacity: 0.8;
    max-width: 500px;
    margin: 0 auto 30px;
    color: var(--text-color);
}

.rules-section .cta-button {
    color: #fff;
}

.rules-section .cta-button:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    transform: translateY(-5px);
}

.administration-section {
    padding: 100px 0;
    background-color: transparent;
}

.administration-section h2 {
    text-align: center;
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 800;
    margin-bottom: 50px;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    justify-content: center;
}

.admin-card {
    background-color: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    transition: transform 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
    position: relative;
    overflow: hidden;
}

.admin-card::before, .category-card::before {
    content: '';
    position: absolute;
    top: var(--y, 0);
    left: var(--x, 0);
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, var(--primary-color) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.admin-card:hover::before, .category-card:hover::before {
    opacity: 0.15;
}

.admin-card:hover {
    transform: translateY(-10px);
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.admin-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 3px solid var(--primary-color);
    margin-bottom: 20px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.admin-card:hover .admin-avatar {
    transform: scale(1.05);
}

.admin-card h4 {
    margin: 0 0 5px;
    font-size: 1.4em;
}

.admin-card p {
    margin: 0;
    opacity: 0.6;
    font-size: 0.9em;
}

/* Categories & CTA */
.categories {
    padding: 100px 0;
    background-color: transparent;
}

.categories h2 {
    text-align: center;
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 800;
    margin-bottom: 50px;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.category-card {
    background-color: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 30px;
    position: relative;
    overflow: hidden;
    transition: transform 0.4s ease, background-color 0.4s ease, border-color 0.4s ease;
    z-index: 1;
}

.category-card span {
    display: none;
}

.category-card:hover {
    transform: translateY(-10px);
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.category-card:hover span {
    opacity: 0;
}

.category-card h4 {
    margin: 0 0 10px;
    font-size: 1.5em;
    transition: color 0.3s ease;
}

.category-card:hover h4 {
    color: var(--primary-color);
}

.category-card p {
    margin: 0;
    opacity: 0.6;
}

.cta {
    padding: 100px 0;
    text-align: center;
}

.cta h2 {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 800;
    margin-bottom: 15px;
}

.cta p {
    font-size: 1.2rem;
    opacity: 0.6;
    max-width: 500px;
    margin: 0 auto 30px;
}

/* Footer */
footer {
    text-align: center;
    padding: 40px 0;
    background-color: transparent;
    border-top: 1px solid var(--border-color);
    margin-top: 50px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-content p {
    margin: 0;
    opacity: 0.7;
}

.social-links {
    display: flex;
    gap: 20px;
}

.social-links a {
    color: var(--text-color);
    font-size: 1.4rem;
    opacity: 0.7;
    transition: opacity 0.3s, transform 0.3s;
}

.social-links a:hover {
    opacity: 1;
    transform: translateY(-3px);
    color: var(--primary-color);
}

/* Animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Splitting.js animation */
[data-splitting] .char {
    opacity: 0;
    transform: translateY(30px) rotate(5deg);
    transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.is-visible[data-splitting] .char {
    opacity: 1;
    transform: translateY(0) rotate(0);
}

.hero .animate-on-scroll:nth-child(2) { transition-delay: 0.2s; }
.hero .animate-on-scroll:nth-child(3) { transition-delay: 0.4s; }
.admin-card.animate-on-scroll:nth-child(2) { transition-delay: 0.15s; }
.admin-card.animate-on-scroll:nth-child(3) { transition-delay: 0.3s; }
.category-card.animate-on-scroll:nth-child(2) { transition-delay: 0.15s; }
.category-card.animate-on-scroll:nth-child(3) { transition-delay: 0.3s; }
.category-card.animate-on-scroll:nth-child(4) { transition-delay: 0.45s; }


/* Responsive */
@media (max-width: 768px) {
    .cursor-follower {
        display: none;
    }
    body {
        cursor: auto;
    }
    .container {
        padding: 0 20px;
    }
    .footer-content {
        flex-direction: column;
        justify-content: center;
    }
    .topic-feature.alt .topic-card {
        margin-left: 0;
        text-align: left;
    }
    .topic-feature.alt .card-footer {
        justify-content: flex-start;
    }
    .topic-feature.alt .card-footer a {
        margin-left: 20px;
        margin-right: 0;
    }
}

