:root {
    --primary-purple: #7d359b;
    --primary-blue: #1f618d;
    --accent-color: #ff9f43;
    --dark-bg: #fdfdfd;
    --card-bg: rgba(0, 0, 0, 0.01);
    --light-text: #2d3436;
    --muted-text: #636e72;
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(0, 0, 0, 0.06);
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
    --transition-smooth: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.05);
}

body.dark-mode {
    --dark-bg: #121212;
    --light-text: #fdfdfd;
    --muted-text: #a0a0a0;
    --glass-bg: rgba(20, 20, 20, 0.85);
    --glass-border: rgba(255, 255, 255, 0.1);
    --card-bg: rgba(255, 255, 255, 0.03);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--dark-bg);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(var(--primary-purple), var(--primary-blue));
    border-radius: 10px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--dark-bg);
    color: var(--light-text);
    overflow-x: hidden;
    line-height: 1.6;
}

/* Typography */
h1,
h2,
h3 {
    font-weight: 700;
    letter-spacing: -1px;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary-purple), var(--primary-blue));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Glassmorphism utility */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 28px;
    box-shadow: var(--shadow-soft);
    transition: var(--transition-smooth);
}

.glass:hover {
    border-color: rgba(125, 53, 155, 0.15);
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

/* Layout */
header {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 30px 10%;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition-smooth);
}

header.scrolled {
    padding: 5px 10%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(16px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}

body.dark-mode header.scrolled {
    background: rgba(18, 18, 18, 0.2);
}

header.scrolled .logo img {
    height: 50px;
}

.logo img {
    height: 100px;
    /* Significantly increased from 60px */
    border-radius: 12px;
    transition: var(--transition-smooth);
}

.logo img:hover {
    transform: scale(1.02);
}

nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
}

nav a {
    text-decoration: none;
    color: var(--light-text);
    font-weight: 600;
    font-size: 1.05rem;
    transition: var(--transition-smooth);
    opacity: 0.9;
}

nav a:hover {
    opacity: 1;
    color: var(--primary-purple);
    transform: scale(1.05);
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 10%;
    background: linear-gradient(rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0.75)),
        url('cybergram_group.jpg');
    background-size: cover;
    background-position: center center;
    background-attachment: fixed;
    position: relative;
    overflow: hidden;
    color: white;
}

/* Floating Blobs */
.blob {
    position: absolute;
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, var(--primary-purple), var(--primary-blue));
    filter: blur(80px);
    border-radius: 50%;
    z-index: 0;
    opacity: 0.2;
    animation: move 20s infinite alternate;
}

.blob-1 {
    top: -100px;
    left: -100px;
}

.blob-2 {
    bottom: -100px;
    right: -100px;
    animation-delay: -5s;
}

@keyframes move {
    from {
        transform: translate(0, 0) scale(1);
    }

    to {
        transform: translate(50px, 100px) scale(1.2);
    }
}

/* Typing Effect Cursor */
#typing-text::after {
    content: '|';
    animation: blink 0.7s infinite;
    margin-left: 5px;
    color: var(--primary-purple);
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    opacity: 0.8;
    animation: bounce 2s infinite;
    z-index: 2;
    color: white;
}

.mouse {
    width: 26px;
    height: 40px;
    border: 2px solid white;
    border-radius: 20px;
    position: relative;
}

.wheel {
    width: 4px;
    height: 8px;
    background: white;
    position: absolute;
    left: 50%;
    top: 8px;
    transform: translateX(-50%);
    border-radius: 2px;
    animation: scroll 2s infinite;
}

@keyframes scroll {
    0% {
        transform: translate(-50%, 0);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, 15px);
        opacity: 0;
    }
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translate(-50%, 0);
    }

    40% {
        transform: translate(-50%, -10px);
    }

    60% {
        transform: translate(-50%, -5px);
    }
}

.hero::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, var(--primary-purple), transparent, var(--primary-blue), transparent);
    animation: rotate 20s linear infinite;
    opacity: 0.1;
    z-index: 0;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.hero>* {
    position: relative;
    z-index: 1;
}

.hero-content {
    width: 100%;
}

.hero h1 {
    font-size: 4.5rem;
    line-height: 1.1;
    margin-bottom: 25px;
    font-weight: 800;
}

.hero p {
    font-size: 1.25rem;
    max-width: 750px;
    margin: 0 auto 40px auto;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.8;
}

.btn {
    padding: 12px 30px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition-smooth);
    cursor: pointer;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-purple), var(--primary-blue));
    color: white;
    border: none;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(142, 68, 173, 0.3);
}

/* Sections */
section {
    padding: 100px 10%;
}

.section-title {
    text-align: center;
    margin-bottom: 60px;
}

.section-title h2 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

/* About Section */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.about-content h3 {
    font-size: 1.8rem;
    margin-bottom: 20px;
}

/* Gallery Section */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.gallery-item {
    height: 450px;
    overflow: hidden;
    border-radius: 20px;
    position: relative;
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-smooth);
}

.gallery-item:hover img {
    transform: scale(1.1);
}

/* Impact Section */
.impact-stats {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    padding: 60px 0;
    gap: 30px;
}

.stat-card {
    text-align: center;
    flex: 1;
    min-width: 200px;
}

.stat-card h1 {
    font-size: 3.5rem;
    margin-bottom: 10px;
}

/* Gallery Overlay */
.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(142, 68, 173, 0.4);
    background: linear-gradient(to top, rgba(18, 18, 18, 0.8), transparent);
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding-bottom: 30px;
    opacity: 0;
    transition: var(--transition-smooth);
}

.gallery-overlay span {
    color: white;
    font-weight: 600;
    font-size: 1.2rem;
    transform: translateY(20px);
    transition: var(--transition-smooth);
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-item:hover .gallery-overlay span {
    transform: translateY(0);
}

/* Team Section */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.team-card {
    padding: 30px;
    text-align: center;
    transition: var(--transition-smooth);
}

.team-card:hover {
    transform: translateY(-10px);
}

.team-image {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 20px;
    border: 4px solid var(--primary-purple);
    box-shadow: 0 10px 30px rgba(142, 68, 173, 0.4);
}

.team-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.team-info h3 {
    margin-bottom: 5px;
    color: white;
}

.team-info p {
    color: var(--primary-blue);
    font-weight: 500;
    font-size: 0.9rem;
}

/* Reveals */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: fadeInUp 0.8s ease forwards;
}

/* Partner Schools */
.school-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    transition: var(--transition-smooth);
}

.school-logo {
    width: 150px;
    height: 150px;
    object-fit: contain;
    border-radius: 12px;
    background: white;
    padding: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Mobile Navigation Toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 6px;
    z-index: 1001;
}

.menu-toggle .bar {
    width: 30px;
    height: 3px;
    background-color: var(--primary-purple);
    border-radius: 2px;
    transition: var(--transition-smooth);
}

/* Animations for Toggle */
.menu-toggle.active .bar:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active .bar:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.menu-toggle.active .bar:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* Responsive */
@media (max-width: 992px) {
    header {
        padding: 20px 5%;
    }

    .logo img {
        height: 70px;
    }

    nav ul {
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    nav {
        position: fixed;
        right: -100%;
        top: 0;
        width: 100%;
        height: 100vh;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        display: flex;
        justify-content: center;
        align-items: center;
        transition: var(--transition-smooth);
        z-index: 1000;
    }

    nav.active {
        right: 0;
    }

    nav ul {
        flex-direction: column;
        text-align: center;
        gap: 40px;
    }

    nav a {
        font-size: 1.5rem;
        opacity: 1;
    }

    .hero h1 {
        font-size: 2.8rem;
    }

    .hero p {
        font-size: 1rem;
        padding: 0 5%;
    }

    .hero-btns {
        display: flex;
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }

    .hero-btns .btn {
        margin: 0 !important;
        width: 200px;
    }

    .about-grid {
        grid-template-columns: 1fr !important;
        gap: 30px;
    }

    section {
        padding: 60px 5%;
    }

    .section-title h2 {
        font-size: 2rem;
    }

    .impact-stats {
        flex-direction: column;
    }

    .stat-card h1 {
        font-size: 2.5rem;
    }

    .gallery-grid {
        grid-template-columns: 1fr !important;
    }

    .gallery-item {
        height: 350px;
    }

    .team-grid {
        grid-template-columns: 1fr !important;
    }

    .school-logo {
        width: 120px;
        height: 120px;
    }

    #contact .glass {
        padding: 25px;
    }

    footer {
        padding: 40px 5%;
    }

    /* Page specific adjustments */
    .hero {
        background-attachment: scroll !important;
        /* Fixed backgrounds often fail on mobile */
    }

    .reveal {
        opacity: 1;
        /* Safety fallback */
        transform: none;
        transition: opacity 0.8s ease-out, transform 0.8s ease-out;
    }

    .reveal.revealed {
        opacity: 1;
        transform: translateY(0);
    }

    /* Use @supports to only hide if the browser likely supports IntersectionObserver/transitions well */
    @supports (opacity: 0) {
        .reveal:not(.revealed) {
            opacity: 0;
            transform: translateY(20px);
        }
    }

    .volunteer-header,
    .resources-hero {
        padding: 120px 5% 40px;
    }

    .volunteer-header h1,
    .resources-hero h1 {
        font-size: 2.5rem !important;
    }

    .form-section {
        margin: -20px 0 60px;
        padding: 25px;
    }

    .step-indicator {
        gap: 15px;
    }

    .step span {
        display: none;
    }

    .resource-grid {
        grid-template-columns: 1fr !important;
        padding: 0 5% 60px;
        margin-top: 0;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2.2rem;
    }

    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}