:root {
    --primary: #5e5ce6;
    --accent: #00d4ff;
    --bg: #000000;
    --surface: rgba(28, 28, 28, 0.4);
    --text: #ffffff;
    --text-muted: #8e8e93;
    --glass-border: rgba(255, 255, 255, 0.12);
    --dock-bg: rgba(28, 28, 30, 0.6);
    --font-main: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', system-ui, sans-serif;
}

@media (prefers-color-scheme: light) {
    :root {
        --bg: #f5f5f7;
        --surface: rgba(255, 255, 255, 0.45);
        --text: #1d1d1f;
        --text-muted: #86868b;
        --glass-border: rgba(0, 0, 0, 0.08);
        --dock-bg: rgba(255, 255, 255, 0.75);
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: none !important;
    /* Hide default cursor for custom logic */
}

body {
    font-family: var(--font-main);
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    scroll-behavior: smooth;
}

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

@media (prefers-color-scheme: light) {
    .cursor-dot {
        background-color: #000;
    }

    .cursor-outline {
        border-color: rgba(0, 0, 0, 0.3);
    }
}

.cursor-outline {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    position: fixed;
    top: 0;
    left: 0;
    border-radius: 50%;
    z-index: 10000;
    pointer-events: none;
    transform: translate(-50%, -50%);
    transition: width 0.3s cubic-bezier(0.23, 1, 0.32, 1), height 0.3s cubic-bezier(0.23, 1, 0.32, 1), background-color 0.3s ease, border-color 0.3s ease;
    will-change: transform, width, height;
}

/* Hover state for cursor */
body.cursor-hover .cursor-outline {
    width: 80px;
    height: 80px;
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.1);
    mix-blend-mode: difference;
}

body.cursor-hover .cursor-dot {
    opacity: 0;
}

/* Floating Dock Navigation */
header {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9000;
    width: auto;
}

nav {
    background: var(--dock-bg);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    padding: 0.8rem 2rem;
    border-radius: 100px;
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    gap: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.logo {
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: -0.5px;
    color: var(--text);
    padding-right: 1.5rem;
    border-right: 1px solid var(--glass-border);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.3s ease, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text);
    transform: scale(1.1) translateY(-2px);
}

/* Main Content */
main {
    padding-top: 100px;
    min-height: 100vh;
}

/* Hero Section */
.hero {
    height: 85vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 2rem;
}

.hero h1 {
    font-size: clamp(3.5rem, 12vw, 7rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    margin-bottom: 2rem;
    line-height: 1;
    background: linear-gradient(180deg, #fff 0%, #888 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

@media (prefers-color-scheme: light) {
    .hero h1 {
        background: linear-gradient(180deg, #1d1d1f 0%, #434345 100%);
        -webkit-background-clip: text;
        background-clip: text;
    }
}

.hero p {
    font-size: clamp(1.1rem, 3vw, 1.5rem);
    color: var(--text-muted);
    max-width: 800px;
    margin-bottom: 4rem;
    font-weight: 400;
    line-height: 1.4;
}

/* Buttons */
.btn {
    padding: 1.2rem 3rem;
    border-radius: 18px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    display: inline-block;
    border: 1px solid var(--glass-border);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--text);
    color: var(--bg);
    border: none;
}

.btn-primary:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.btn:not(.btn-primary) {
    background: rgba(128, 128, 128, 0.1);
    color: var(--text);
}

.btn:not(.btn-primary):hover {
    background: rgba(128, 128, 128, 0.2);
    transform: translateY(-5px);
}

/* Container & Grid */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 8rem 2rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 2rem;
}

.card {
    background: var(--surface);
    padding: 3.5rem;
    border-radius: 32px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    transition: all 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.card:hover {
    transform: translateY(-15px);
    border-color: var(--primary);
    background: rgba(128, 128, 128, 0.08);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.2);
}

.card h3 {
    font-size: clamp(1.4rem, 4vw, 1.8rem);
    margin-bottom: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.card p {
    color: var(--text-muted);
    font-size: clamp(0.95rem, 2.5vw, 1.1rem);
    line-height: 1.6;
}

/* Feature Page Specifics */
.highlight-card {
    border-color: var(--primary);
}

/* Contribute Page Forms */
form .card {
    max-width: 800px;
    margin: 0 auto;
}

input,
select,
textarea {
    width: 100%;
    padding: 1.2rem;
    background: rgba(128, 128, 128, 0.05) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: 14px !important;
    color: var(--text) !important;
    font-family: var(--font-main) !important;
    font-size: 1rem !important;
    margin-top: 0.5rem;
    transition: all 0.3s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary) !important;
    background: rgba(255, 255, 255, 0.08) !important;
}

label {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* Scroll Reveal */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s cubic-bezier(0.19, 1, 0.22, 1);
    will-change: transform, opacity;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Ambient Background */
.prism-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background:
        radial-gradient(circle at 80% 20%, rgba(94, 92, 230, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 20% 80%, rgba(100, 210, 255, 0.1) 0%, transparent 40%);
    filter: blur(100px);
    z-index: -1;
    pointer-events: none;
    will-change: filter;
    transform: translateZ(0);
    /* Hardware acceleration */
}

@media (prefers-color-scheme: light) {
    .prism-bg {
        background:
            radial-gradient(circle at 80% 20%, rgba(94, 92, 230, 0.08) 0%, transparent 40%),
            radial-gradient(circle at 20% 80%, rgba(100, 210, 255, 0.06) 0%, transparent 40%);
    }
}

footer {
    padding: 8rem 2rem;
    text-align: center;
    border-top: 1px solid var(--glass-border);
    color: var(--text-muted);
    font-size: 0.95rem;
}

footer a {
    color: var(--accent);
    text-decoration: none;
}

/* Responsive */
@media (max-width: 1024px) {
    .container {
        padding: 6rem 2rem;
    }

    .grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

@media (max-width: 768px) {
    * {
        cursor: auto !important;
    }

    .cursor-dot,
    .cursor-outline {
        display: none;
    }

    header {
        top: 20px;
        width: 90%;
    }

    nav {
        padding: 0.6rem 1.2rem;
        gap: 1.2rem;
    }

    .logo {
        display: none;
    }

    .nav-links {
        width: 100%;
        justify-content: space-around;
        gap: 0;
    }

    .hero h1 {
        font-size: clamp(3rem, 15vw, 4.5rem);
    }

    .hero p {
        font-size: 1.1rem;
        margin-bottom: 2.5rem;
    }

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

    .container {
        padding: 4rem 1.5rem;
    }

    .btn {
        padding: 1rem 2rem;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    nav {
        padding: 0.5rem 1rem;
    }

    .nav-links a {
        font-size: 0.8rem;
    }

    .hero {
        height: auto;
        padding-top: 15vh;
        padding-bottom: 10vh;
    }

    .card {
        padding: 2rem;
    }
}

/* High Resolution / 4K optimization */
@media (min-width: 2000px) {
    .container {
        max-width: 1800px;
    }
}