:root {
    --navy: #050A18;
    --navy2: #0A1428;
    --navy3: #0F1E3A;
    --cyan: #29B8D8;
    --cyan2: #1A9EBD;
    --cyan-glow: rgba(41, 184, 216, 0.15);
    --white: #E8EDF5;
    --white2: #B0BDD4;
    --coral: #FF6B6B;
    --glass: rgba(255,255,255,0.04);
    --glass-border: rgba(41,184,216,0.18);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Tajawal', sans-serif;
    background: var(--navy);
    color: var(--white);
    direction: rtl;
    overflow-x: hidden;
}

/* ─── CURSOR GLOW ─── */
#cursor-glow {
    position: fixed;
    width: 300px; height: 300px;
    border-radius: 50%;
    pointer-events: none;   /* ✅ never blocks the grid */
    z-index: 9999;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(41,184,216,0.09) 0%, rgba(41,184,216,0.03) 45%, transparent 70%);
    transition: left 0.03s linear, top 0.03s linear;
    mix-blend-mode: screen;
}

/* ─── NAVBAR ─── */
nav {
    position: fixed; top: 0; right: 0; left: 0; z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    height: 70px;
    background: rgba(5, 10, 24, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    transition: all 0.3s ease;
}
nav.scrolled {
    height: 60px;
    background: rgba(5, 10, 24, 0.97);
}
.nav-logo { display: flex; align-items: center; }
.nav-logo img {
    height: 48px;
    object-fit: contain;
    filter: drop-shadow(0 0 8px rgba(41,184,216,0.4));
}
.nav-links {
    display: flex; align-items: center; gap: 0.15rem;
    list-style: none;
}
.nav-links a {
    color: var(--white2);
    text-decoration: none;
    font-family: 'Cairo', sans-serif;
    font-size: 0.83rem;
    font-weight: 600;
    padding: 0.4rem 0.65rem;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
    white-space: nowrap;
}
.nav-links a:hover { color: var(--cyan); background: var(--cyan-glow); }
.nav-links a.active { color: var(--cyan); }

.nav-members-wrap { display: flex; align-items: center; }
.btn-members {
    background: var(--cyan);
    color: var(--navy) !important;
    font-family: 'Cairo', sans-serif;
    font-weight: 700 !important;
    font-size: 0.9rem;
    border-radius: 8px;
    padding: 0.5rem 1.2rem;
    text-decoration: none;
    transition: background 0.2s, box-shadow 0.2s;
    box-shadow: 0 0 16px rgba(41,184,216,0.3);
    white-space: nowrap;
    display: inline-block;
}
.btn-members:hover {
    background: var(--cyan2) !important;
    box-shadow: 0 0 24px rgba(41,184,216,0.5) !important;
}
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    z-index: 1001;
}
.hamburger span {
    width: 24px; height: 2px;
    background: var(--white);
    border-radius: 2px;
    transition: 0.3s;
}
.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ─── GRID SECTION (HOME) ─── */
.grid-section {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    background: var(--navy);
}

/* 3D viewport */
.perspective-bg {
    position: absolute;
    inset: 0;
    perspective: 2000px;
    overflow: hidden;
    z-index: 0;
}

/* Rotated grid */
.grid-container {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 80rem;
    aspect-ratio: 1 / 1;
    display: grid;
    /* adjusted transform for better hover coverage */
    transform: translate(-50%, -50%)
               rotateX(25deg)
               rotateY(-3deg)
               rotateZ(15deg)
               scale(1);
    transform-style: preserve-3d;
}

/* Individual tiles (created by JS) */
.grid-tile {
  border: 1px solid var(--glass-border);
  background: transparent;
  /* faster transition – feels instantaneous */
  transition: background-color 0.1s ease-out;
  /* remove will-change – it hurts performance with thousands of tiles */
  will-change: auto;
  pointer-events: auto;
}

.grid-tile:hover {
  transition-duration: 0s;   /* instantly turn on */
  background-color: var(--cyan-glow);
}

/* Fade the edges of the grid */
.grid-fade {
    position: absolute;
    inset: 0;
    pointer-events: none;   /* ✅ never blocks */
    z-index: 1;
    background: radial-gradient(
        circle,
        transparent 15%,
        var(--navy) 85%
    );
}

/* Content layer (text + buttons) */
.section-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    text-align: center;
    color: var(--white);
    pointer-events: none;   /* ✅ let clicks/hovers pass to grid */
}

/* Re-enable pointer events ONLY on interactive elements */
.section-content a,
.section-content button,
.section-content .btn-primary,
.section-content .btn-outline {
    pointer-events: auto;
}

/* Typography (your original sizes) */
.content-eyebrow {
    font-size: 1.2rem;
    letter-spacing: 2px;
    margin-bottom: 1rem;
    color: var(--cyan);
}
.content-title {
    font-size: 3.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
    color: var(--white);
    text-shadow: 0 0 40px rgba(41,184,216,0.25);
}
.content-title span { color: var(--cyan); }
.content-sub {
    font-size: 1.25rem;
    max-width: 600px;
    margin-bottom: 2rem;
    color: var(--white2);
    line-height: 1.8;
}
.content-cta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* Buttons */
.btn-primary, .btn-outline {
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s, border-color 0.2s;
}
.btn-primary {
    background: var(--cyan);
    color: var(--navy);
    box-shadow: 0 0 24px rgba(41,184,216,0.4);
}
.btn-primary:hover { background: var(--cyan2); }
.btn-outline {
    border: 2px solid var(--cyan);
    color: var(--cyan);
    background: transparent;
}
.btn-outline:hover {
    background: var(--cyan-glow);
    color: var(--white);
}

/* Scroll hint */
.scroll-hint {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    color: var(--white2);
    font-size: 0.9rem;
    letter-spacing: 2px;
    pointer-events: none;   /* ✅ never blocks the grid */
    animation: bounce 2s infinite;
}
.scroll-hint::after {
    content: '';
    width: 1px; height: 50px;
    background: linear-gradient(to bottom, var(--cyan), transparent);
    display: block;
    margin-top: 6px;
}
@keyframes bounce {
    0%,100% { transform: translateX(-50%) translateY(0); }
    50%     { transform: translateX(-50%) translateY(6px); }
}

/* ─── HERO (OLD, NOT USED ON HOME, BUT KEPT FOR OTHER PAGES) ─── */
#hero {
    position: relative;
    height: 100vh;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
#hero-video {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    opacity: 0.55;
    z-index: 0;
}
.hero-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to bottom, rgba(5,10,24,0.3) 0%, rgba(5,10,24,0.5) 60%, var(--navy) 100%);
    z-index: 1;
}
.hero-content {
    position: relative; z-index: 2;
    text-align: center;
    padding: 0 1.5rem;
    animation: fadeUp 1s ease both;
    animation-delay: 0.3s;
}
@keyframes fadeUp {
    from { opacity:0; transform:translateY(30px); }
    to   { opacity:1; transform:translateY(0); }
}
.hero-eyebrow {
    font-family: 'Cairo', sans-serif;
    font-size: 0.85rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--cyan);
    margin-bottom: 1rem;
}
.hero-title {
    font-family: 'Cairo', sans-serif;
    font-size: clamp(2.8rem, 7vw, 5.5rem);
    font-weight: 900;
    line-height: 1.1;
    color: #fff;
    text-shadow: 0 0 40px rgba(41,184,216,0.25);
    margin-bottom: 1.2rem;
}
.hero-title span { color: var(--cyan); }
.hero-sub {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    color: var(--white2);
    max-width: 560px; margin: 0 auto 2.5rem;
    line-height: 1.8;
}
.hero-cta {
    display: inline-flex; gap: 1rem; flex-wrap: wrap; justify-content: center;
}

/* ─── SECTIONS (GENERAL) ─── */
section { padding: 7rem 3rem; }
.section-eyebrow {
    font-family: 'Cairo', sans-serif;
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--cyan);
    margin-bottom: 0.6rem;
}
.section-title {
    font-family: 'Cairo', sans-serif;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 900;
    color: #fff;
    margin-bottom: 1rem;
}
.section-desc {
    color: var(--white2);
    font-size: 1.05rem;
    line-height: 1.9;
    max-width: 580px;
}
.section-header { margin-bottom: 3.5rem; }

/* ─── STATS BAR ─── */
#stats-bar {
    background: var(--navy2);
    padding: 3rem;
    border-top: 1px solid var(--glass-border);
    border-bottom: 1px solid var(--glass-border);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 2rem;
    text-align: center;
}
.stat-item .stat-num {
    font-family: 'Cairo', sans-serif;
    font-size: 2.6rem;
    font-weight: 900;
    color: var(--cyan);
    line-height: 1;
}
.stat-item .stat-label {
    font-size: 0.9rem;
    color: var(--white2);
    margin-top: 0.4rem;
}

/* ─── GRID CARDS ─── */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}
.card {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
    cursor: default;
}
.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(41,184,216,0.12);
    border-color: rgba(41,184,216,0.4);
}
.card-icon {
    width: 52px; height: 52px;
    background: var(--cyan-glow);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1.2rem;
}
.card h3 {
    font-family: 'Cairo', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.6rem;
}
.card p { font-size: 0.92rem; color: var(--white2); line-height: 1.8; }
.card-tag {
    display: inline-block;
    margin-top: 1rem;
    font-size: 0.75rem;
    background: var(--cyan-glow);
    border: 1px solid var(--glass-border);
    color: var(--cyan);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-family: 'Cairo', sans-serif;
}

/* ─── QUICK LINKS (HOME) ─── */
.quick-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.2rem;
}
.qlink {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 1.8rem 1.5rem;
    text-decoration: none;
    display: flex; align-items: center; gap: 1rem;
    transition: all 0.25s;
    cursor: pointer;
}
.qlink:hover {
    border-color: rgba(41,184,216,0.5);
    background: rgba(41,184,216,0.06);
    transform: translateY(-3px);
}
.qlink-icon { font-size: 1.8rem; flex-shrink: 0; }
.qlink-text { font-family: 'Cairo', sans-serif; font-size: 1rem; font-weight: 700; color: var(--white); }
.qlink-sub { font-size: 0.8rem; color: var(--white2); margin-top: 0.2rem; }

  /* ─── TABLE (Study Plan) ─── */
  .plan-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
  }
  .plan-table th {
    background: var(--navy3);
    color: var(--cyan);
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
    padding: 1rem 1.2rem;
    text-align: right;
    border-bottom: 2px solid var(--glass-border);
  }
  .plan-table td {
    padding: 0.85rem 1.2rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    color: var(--white2);
  }
  .plan-table tr:hover td { background: rgba(41,184,216,0.04); color: var(--white); }
  .plan-table .badge {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-family: 'Cairo', sans-serif;
  }
  .badge-core { background: rgba(41,184,216,0.15); color: var(--cyan); }
  .badge-elec { background: rgba(255,107,107,0.12); color: var(--coral); }
  .badge-free { background: rgba(100,255,150,0.12); color: #6dffaa; }

  /* ─── PLAN IMAGE + HOTSPOTS ─── */
  .plan-img-wrap {
    position: relative;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    background: #fff;
  }
  .plan-img { display: block; width: 100%; height: auto; user-select: none; }
  .plan-hotspots { position: absolute; inset: 0; }
  .plan-hotspot {
    position: absolute;
    cursor: pointer;
    border-radius: 6px;
    border: 2px solid transparent;
    background: rgba(41,184,216,0);
    transition: background 0.15s, border-color 0.15s;
  }
  .plan-hotspot:hover {
    background: rgba(41,184,216,0.22);
    border-color: var(--cyan);
  }
  .plan-hotspot.link-type:hover { background: rgba(41,184,216,0.22); border-color: var(--cyan); }
  .plan-hotspot.subject-type:hover { background: rgba(255,107,107,0.18); border-color: var(--coral); }
  .calib-mode .plan-hotspot { border-color: rgba(255,107,107,0.6); background: rgba(255,107,107,0.08); }

  .plan-actions {
    display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap;
    margin-top: 2rem;
  }
  .calib-readout {
    text-align: center; margin-top: 1rem; font-family: monospace;
    color: var(--cyan); font-size: 0.85rem;
  }

  /* ─── SUBJECT MODAL ─── */
  .subject-modal-overlay {
    position: fixed; inset: 0; z-index: 2000;
    background: rgba(5,10,24,0.85);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center; justify-content: center;
    padding: 1.5rem;
  }
  .subject-modal-overlay.open { display: flex; }
  .subject-modal {
    position: relative;
    background: var(--navy2);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    max-width: 820px; width: 100%;
    max-height: 88vh; overflow-y: auto;
    padding: 2rem;
    box-shadow: 0 0 60px rgba(41,184,216,0.15);
  }
  .subject-modal-close {
    position: absolute; top: 1rem; left: 1rem;
    background: var(--glass); border: 1px solid var(--glass-border);
    color: var(--white); width: 36px; height: 36px; border-radius: 50%;
    cursor: pointer; font-size: 1rem;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
  }
  .subject-modal-close:hover { color: var(--cyan); border-color: var(--cyan); }

  /* Header: title on the RIGHT, close btn on the LEFT (RTL layout) */
  .subject-modal-header {
    display: flex; align-items: center; justify-content: flex-end;
    gap: 1rem;
    margin-bottom: 1.5rem; padding-bottom: 1.2rem;
    border-bottom: 1px solid var(--glass-border);
  }
  .subject-header-text { text-align: right; }
  .subject-eyebrow {
    font-family: 'Cairo', sans-serif; font-size: 0.72rem; letter-spacing: 0.15em;
    color: var(--cyan); margin-bottom: 0.25rem; text-transform: uppercase;
  }
  #subjectTitle {
    font-family: 'Cairo', sans-serif; font-size: 1.5rem; font-weight: 900; color: var(--white);
  }
  .subject-title-icon {
    width: 52px; height: 52px; border-radius: 14px;
    background: var(--cyan-glow); border: 1px solid var(--glass-border);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem; flex-shrink: 0;
  }

  /* Section blocks */
  .subject-block { margin-bottom: 1.8rem; }
  .subject-block-title {
    font-family: 'Cairo', sans-serif; font-size: 0.95rem; font-weight: 700;
    color: var(--cyan); margin-bottom: 0.85rem;
    display: flex; align-items: center; gap: 0.5rem;
  }

  /* BOOKS: grid of clickable cover mockups */
  .subject-books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 1rem;
  }
  .subject-book-card {
    display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
    text-decoration: none; cursor: pointer;
    transition: transform 0.2s;
  }
  .subject-book-card:hover { transform: translateY(-4px); }
  .subject-book-cover {
    width: 100%; aspect-ratio: 3/4;
    border-radius: 8px; overflow: hidden;
    border: 1px solid var(--glass-border);
    background: linear-gradient(135deg, var(--navy3), var(--navy2));
    display: flex; align-items: center; justify-content: center;
    position: relative;
    box-shadow: 3px 4px 14px rgba(0,0,0,0.45);
    transition: box-shadow 0.2s, border-color 0.2s;
  }
  .subject-book-card:hover .subject-book-cover {
    box-shadow: 4px 6px 22px rgba(41,184,216,0.3);
    border-color: rgba(41,184,216,0.5);
  }
  .subject-book-cover img {
    width: 100%; height: 100%; object-fit: cover;
  }
  /* Fallback placeholder when no image */
  .subject-book-cover-placeholder {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    width: 100%; height: 100%; gap: 0.3rem; padding: 0.5rem;
  }
  .subject-book-cover-placeholder span:first-child { font-size: 2rem; }
  .subject-book-cover-placeholder span:last-child {
    font-family: 'Cairo', sans-serif; font-size: 0.62rem; color: var(--white2);
    text-align: center; line-height: 1.3;
  }
  .subject-book-label {
    font-family: 'Cairo', sans-serif; font-size: 0.75rem; color: var(--white2);
    text-align: center; line-height: 1.4;
  }

  /* Simple link list (summaries, videos, papers) */
  .subject-link-list { display: flex; flex-direction: column; gap: 0.45rem; }
  .subject-link-item {
    display: flex; align-items: center; gap: 0.6rem;
    color: var(--white); text-decoration: none;
    font-family: 'Cairo', sans-serif; font-size: 0.9rem;
    padding: 0.5rem 0.75rem; border-radius: 8px;
    transition: background 0.15s, color 0.15s;
  }
  .subject-link-item:hover { background: var(--cyan-glow); color: var(--cyan); }
  .subject-link-item .link-arrow { color: var(--cyan); font-size: 0.75rem; margin-right: auto; }
  .subject-list-empty { color: var(--white2); font-size: 0.82rem; padding: 0.3rem 0; }

  /* Past papers: mid + final side by side */
  .subject-papers-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem;
  }
  .subject-papers-col-title {
    font-family: 'Cairo', sans-serif; font-weight: 700; font-size: 0.82rem;
    color: var(--white2); margin-bottom: 0.6rem;
    padding-bottom: 0.4rem; border-bottom: 1px solid var(--glass-border);
  }

  @media (max-width: 600px) {
    .subject-papers-grid { grid-template-columns: 1fr; }
    .subject-books-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }
  }

  /* ─── ARTICLE CARD ─── */
  .article-card {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.25s;
  }
  .article-card:hover { transform:translateY(-5px); box-shadow:0 12px 40px rgba(41,184,216,0.12); border-color:rgba(41,184,216,0.4); }
  .article-img {
    height: 180px;
    background: linear-gradient(135deg, var(--navy3) 0%, var(--navy2) 100%);
    display: flex; align-items: center; justify-content: center;
    font-size: 3rem;
    border-bottom: 1px solid var(--glass-border);
  }
  .article-body { padding: 1.5rem; }
  .article-body h3 { font-family: 'Cairo', sans-serif; font-size: 1.05rem; font-weight: 700; color: #fff; margin-bottom: 0.5rem; }
  .article-body p { font-size: 0.88rem; color: var(--white2); line-height: 1.75; }
  .article-meta { margin-top: 1rem; display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
  .article-meta span { font-size: 0.75rem; color: var(--white2); }
  .article-meta .tag { background: var(--cyan-glow); color: var(--cyan); border: 1px solid var(--glass-border); padding: 0.2rem 0.65rem; border-radius: 20px; font-family: 'Cairo', sans-serif; }

  /* ─── ABOUT ─── */
  .about-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
  }
  .about-visual {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 3rem;
    display: flex; align-items: center; justify-content: center;
    min-height: 340px;
    position: relative;
    overflow: hidden;
  }
  .about-visual img { max-width: 100%; max-height: 280px; object-fit: contain; filter: drop-shadow(0 0 30px rgba(41,184,216,0.3)); }
  .about-visual::before {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(ellipse at center, rgba(41,184,216,0.08) 0%, transparent 70%);
  }
  .about-text .section-desc { max-width: 100%; }
  .team-values {
    margin-top: 2rem;
    display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
  }
  .value-item {
    display: flex; gap: 0.75rem; align-items: flex-start;
  }
  .value-dot {
    width: 8px; height: 8px; border-radius: 50%; background: var(--cyan);
    margin-top: 7px; flex-shrink: 0;
    box-shadow: 0 0 8px var(--cyan);
  }
  .value-label { font-family: 'Cairo', sans-serif; font-size: 0.9rem; font-weight: 600; color: var(--white); }
  .value-sub { font-size: 0.8rem; color: var(--white2); }

  /* ─── FOOTER ─── */
  footer {
    background: var(--navy2);
    border-top: 1px solid var(--glass-border);
    padding: 3rem;
    text-align: center;
  }
  footer img { height: 50px; margin-bottom: 1rem; filter: drop-shadow(0 0 8px rgba(41,184,216,0.3)); }
  footer p { color: var(--white2); font-size: 0.85rem; margin-top: 1.2rem; }
  .footer-socials { display: flex; justify-content: center; gap: 1.2rem; margin: 1.4rem 0 0.5rem; flex-wrap: wrap; }
  .footer-socials a {
    display: flex; align-items: center; gap: 0.5rem;
    color: var(--white2); text-decoration: none;
    font-family: 'Cairo', sans-serif; font-size: 0.88rem;
    background: var(--glass); border: 1px solid var(--glass-border);
    border-radius: 10px; padding: 0.55rem 1rem;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
  }
  .footer-socials a:hover { color: var(--cyan); border-color: rgba(41,184,216,0.4); background: var(--cyan-glow); }

  /* ─── SCROLL REVEAL ─── */
  .reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
  }
  .reveal.visible { opacity: 1; transform: translateY(0); }

  /* ─── MOBILE RESPONSIVENESS ─── */
  @media (max-width: 860px) {
    nav { padding: 0 1.5rem; }
    
    /* Completely reworked mobile nav tray */
    .nav-links { 
      display: flex;
      flex-direction: column; 
      position: absolute; 
      top: 70px; right: 0; left: 0; 
      background: rgba(5, 10, 24, 0.96); 
      backdrop-filter: blur(25px);
      padding: 1.5rem; 
      gap: 0.5rem; 
      border-bottom: 1px solid var(--glass-border);
      opacity: 0;
      visibility: hidden;
      transform: translateY(-10px);
      transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    /* When navigation menu is open on mobile */
    .nav-links.open { 
      opacity: 1;
      visibility: visible;
      transform: translateY(0);
    }
    
    /* Make active links look structured inside the dropdown menu */
    .nav-links li { width: 100%; text-align: center; }
    .nav-links a { 
      display: block; 
      padding: 0.75rem 1rem; 
      font-size: 1rem;
    }
    
    /* Hide the standalone left-side button to avoid overlapping */
    .nav-members-wrap { display: none; }
    
    /* Create a dedicated item variant for "للأعضاء" within the mobile tray */
    .nav-links .mobile-member-li {
      display: block;
      margin-top: 0.5rem;
      border-top: 1px solid rgba(255,255,255,0.08);
      padding-top: 1rem;
    }
    .nav-links .mobile-member-li .btn-members {
      display: block;
      text-align: center;
      width: 100%;
    }

    .hamburger { display: flex; }
    section { padding: 5rem 1.5rem; }
    .about-split { grid-template-columns: 1fr; gap: 2.5rem; }
    .team-values { grid-template-columns: 1fr; }
    #stats-bar { padding: 2rem 1.5rem; }
  }
  /* ─── GPA MODAL ─── */
  .gpa-overlay {
    display: none;
    position: fixed; inset: 0; z-index: 5000;
    background: rgba(5,10,24,0.88);
    backdrop-filter: blur(12px);
    align-items: center; justify-content: center;
    padding: 1rem;
  }
  .gpa-overlay.open { display: flex; }
  .gpa-modal {
    background: var(--navy2);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    width: 100%; max-width: 680px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    position: relative;
    box-shadow: 0 0 60px rgba(41,184,216,0.12);
    animation: modalIn 0.3s ease;
  }
  @keyframes modalIn {
    from { opacity:0; transform: translateY(20px) scale(0.97); }
    to   { opacity:1; transform: translateY(0) scale(1); }
  }
  .gpa-close {
    position: absolute; top: 1.2rem; left: 1.2rem;
    background: var(--glass); border: 1px solid var(--glass-border);
    color: var(--white2); width: 34px; height: 34px;
    border-radius: 50%; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; transition: all 0.2s;
  }
  .gpa-close:hover { background: rgba(255,107,107,0.15); color: var(--coral); border-color: var(--coral); }
  .gpa-modal h2 {
    font-family: 'Cairo', sans-serif; font-weight: 900;
    font-size: 1.5rem; color: var(--cyan);
    margin-bottom: 1.5rem; text-align: center;
  }
  .gpa-current {
    display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
    margin-bottom: 1.2rem;
  }
  .gpa-field label {
    display: block; font-family: 'Cairo', sans-serif;
    font-size: 0.82rem; color: var(--white2); margin-bottom: 0.4rem; font-weight: 600;
  }
  .gpa-field input, .gpa-field select {
    width: 100%; background: rgba(0,0,0,0.3);
    border: 1px solid var(--glass-border); color: var(--white);
    padding: 0.65rem 0.9rem; border-radius: 8px;
    font-family: 'Cairo', sans-serif; font-size: 0.95rem;
    outline: none; transition: border-color 0.2s;
  }
  .gpa-field input:focus, .gpa-field select:focus { border-color: var(--cyan); }
  .gpa-field select { background-color: var(--navy3); }
  .gpa-course {
    background: var(--glass); border: 1px solid var(--glass-border);
    border-radius: 12px; padding: 1rem 1.2rem; margin-bottom: 0.8rem;
    transition: opacity 0.2s;
  }
  .gpa-course.off { opacity: 0.4; }
  .gpa-course-header {
    display: flex; align-items: center; gap: 0.8rem; margin-bottom: 0.8rem;
  }
  .gpa-toggle {
    position: relative; width: 40px; height: 22px; flex-shrink: 0;
  }
  .gpa-toggle input { opacity:0; width:0; height:0; }
  .gpa-toggle-slider {
    position: absolute; inset: 0; background: #334155;
    border-radius: 34px; cursor: pointer; transition: 0.3s;
  }
  .gpa-toggle-slider::before {
    content:''; position:absolute;
    width:16px; height:16px; left:3px; bottom:3px;
    background:#fff; border-radius:50%; transition:0.3s;
  }
  .gpa-toggle input:checked + .gpa-toggle-slider { background: var(--cyan); }
  .gpa-toggle input:checked + .gpa-toggle-slider::before { transform: translateX(18px); }
  .gpa-course-name {
    background: transparent; border: none; color: var(--white);
    font-family: 'Cairo', sans-serif; font-size: 0.95rem;
    flex: 1; outline: none;
  }
  .gpa-course-name:focus { color: var(--cyan); }
  .gpa-course-name::placeholder { color: var(--white2); }
  .gpa-course-body {
    display: grid; grid-template-columns: 1fr 1.5fr; gap: 0.8rem;
  }
  .gpa-rep-row {
    display: flex; align-items: center; gap: 0.5rem; margin-top: 0.8rem;
    font-family: 'Cairo', sans-serif; font-size: 0.85rem; color: var(--white2);
  }
  .gpa-rep-row input[type=checkbox] { accent-color: var(--cyan); width:15px; height:15px; }
  .gpa-old-section {
    margin-top: 0.8rem; padding: 0.8rem;
    background: rgba(0,0,0,0.2); border-radius: 8px;
  }
  .gpa-radio-row {
    display: flex; gap: 1rem; margin-bottom: 0.6rem;
    font-family: 'Cairo', sans-serif; font-size: 0.8rem; color: var(--white2);
  }
  .gpa-radio-row label { display:flex; align-items:center; gap:4px; cursor:pointer; }
  .gpa-radio-row input { accent-color: var(--cyan); }
  .gpa-result-bar {
    position: sticky; bottom: -2rem; margin: 1.5rem -2rem -2rem;
    background: rgba(10,20,40,0.97); border-top: 1px solid var(--glass-border);
    padding: 1rem 2rem; display: flex; align-items: center;
    justify-content: space-around; gap: 1rem;
    border-bottom-left-radius: 20px; border-bottom-right-radius: 20px;
  }
  .gpa-res-item { text-align: center; }
  .gpa-res-label { font-size: 0.72rem; color: var(--white2); margin-bottom: 2px; font-family:'Cairo',sans-serif; }
  .gpa-res-value { font-family:'Cairo',sans-serif; font-size: 1.5rem; font-weight: 900; color: var(--cyan); }
  .gpa-res-value.white { color: #fff; font-size: 1.2rem; }
  .gpa-divider { width:1px; height:36px; background: var(--glass-border); }
  .gpa-reset-btn {
    background: transparent; border: 1px solid var(--coral);
    color: var(--coral); width: 32px; height: 32px; border-radius: 50%;
    cursor: pointer; display: flex; align-items:center; justify-content:center;
    font-size: 0.9rem; transition: all 0.2s;
  }
  .gpa-reset-btn:hover { background: rgba(255,107,107,0.15); }
  .gpa-warn {
    display:none; color: var(--coral); font-size: 0.82rem;
    background: rgba(255,107,107,0.08); border: 1px solid rgba(255,107,107,0.25);
    padding: 0.6rem 0.9rem; border-radius: 8px; margin-bottom: 0.8rem;
    font-family:'Cairo',sans-serif;
  }
/* ========== WATCH-STYLE DRAGGABLE GRID ========== */
.watch-grid-section {
    margin-top: 4rem;
    padding: 2rem 0;
}
.watch-grid-section .section-header {
    margin-bottom: 1.5rem;
}

.watch-grid-stage {
    position: relative;
    width: 100%;
    height: 500px;
    overflow: hidden;
    background: var(--glass, rgba(255,255,255,0.05));
    border-radius: 24px;
    border: 1px solid var(--glass-border, rgba(255,255,255,0.1));
    cursor: grab;
    user-select: none;
    -webkit-mask-image: radial-gradient(circle at center, black 60%, transparent 100%);
    mask-image: radial-gradient(circle at center, black 60%, transparent 100%);
}
.watch-grid-stage:active {
    cursor: grabbing;
}

.watch-grid-container {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    will-change: transform;
    transition: transform 0.15s ease-out;  /* smooth snap when releasing */
}

/* Square thumbnail with rounded corners */
.watch-grid-item {
    position: absolute;
    width: 88px;
    height: 88px;
    border-radius: 18px;                  /* rounded square, not a circle */
    background: linear-gradient(145deg, #1e2a3a, #0f1a26);
    box-shadow: 0 4px 15px rgba(0,0,0,0.4), 0 0 0 2px rgba(41,184,216,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    transform-origin: center center;
    pointer-events: auto;
}
.watch-grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 18px;                 /* match parent */
}
.watch-grid-item:hover,
.watch-grid-stage:active .watch-grid-item {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(41,184,216,0.4), 0 0 0 3px var(--cyan);
}
/* ─── GRID SECTION (HOME) ─── */
.grid-section {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    background: var(--navy);
}

/* 3D viewport */
.perspective-bg {
    position: absolute;
    inset: 0;
    perspective: 2000px;
    overflow: hidden;
    z-index: 0;
}

/* Rotated grid */
.grid-container {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 80rem;
    aspect-ratio: 1 / 1;
    display: grid;
    /* adjusted transform for better hover coverage */
    transform: translate(-50%, -50%)
               rotateX(25deg)
               rotateY(-3deg)
               rotateZ(15deg)
               scale(1);
    transform-style: preserve-3d;
}

/* Individual tiles (created by JS) */
.grid-tile {
  border: 1px solid var(--glass-border);
  background: transparent;
  /* faster transition – feels instantaneous */
  transition: background-color 0.1s ease-out;
  /* remove will-change – it hurts performance with thousands of tiles */
  will-change: auto;
  pointer-events: auto;
}

.grid-tile:hover {
  transition-duration: 0s;   /* instantly turn on */
  background-color: var(--cyan-glow);
}

/* Fade the edges of the grid */
.grid-fade {
    position: absolute;
    inset: 0;
    pointer-events: none;   /* ✅ never blocks */
    z-index: 1;
    background: radial-gradient(
        circle,
        transparent 15%,
        var(--navy) 85%
    );
}

/* Content layer (text + buttons) */
.section-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    text-align: center;
    color: var(--white);
    pointer-events: none;   /* ✅ let clicks/hovers pass to grid */
}

/* Re-enable pointer events ONLY on interactive elements */
.section-content a,
.section-content button,
.section-content .btn-primary,
.section-content .btn-outline {
    pointer-events: auto;
}

/* Typography (your original sizes) */
.content-eyebrow {
    font-size: 1.2rem;
    letter-spacing: 2px;
    margin-bottom: 1rem;
    color: var(--cyan);
}
.content-title {
    font-size: 3.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
    color: var(--white);
    text-shadow: 0 0 40px rgba(41,184,216,0.25);
}
.content-title span { color: var(--cyan); }
.content-sub {
    font-size: 1.25rem;
    max-width: 600px;
    margin-bottom: 2rem;
    color: var(--white2);
    line-height: 1.8;
}
.content-cta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* Buttons */
.btn-primary, .btn-outline {
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s, border-color 0.2s;
}
.btn-primary {
    background: var(--cyan);
    color: var(--navy);
    box-shadow: 0 0 24px rgba(41,184,216,0.4);
}
.btn-primary:hover { background: var(--cyan2); }
.btn-outline {
    border: 2px solid var(--cyan);
    color: var(--cyan);
    background: transparent;
}
.btn-outline:hover {
    background: var(--cyan-glow);
    color: var(--white);
}

/* Scroll hint */
.scroll-hint {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    color: var(--white2);
    font-size: 0.9rem;
    letter-spacing: 2px;
    pointer-events: none;   /* ✅ never blocks the grid */
    animation: bounce 2s infinite;
}
.scroll-hint::after {
    content: '';
    width: 1px; height: 50px;
    background: linear-gradient(to bottom, var(--cyan), transparent);
    display: block;
    margin-top: 6px;
}
@keyframes bounce {
    0%,100% { transform: translateX(-50%) translateY(0); }
    50%     { transform: translateX(-50%) translateY(6px); }
}

.subject-folder {
  margin-bottom: 4px;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 6px;
  background: rgba(255,255,255,0.02);
}

.subject-folder-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  user-select: none;
  font-weight: 500;
  color: #e0e4f0;
  transition: background 0.2s;
}
.subject-folder-header:hover {
  background: rgba(255,255,255,0.06);
}

.subject-folder-count {
  font-size: 12px;
  color: #6a6f88;
  background: rgba(255,255,255,0.06);
  padding: 1px 8px;
  border-radius: 10px;
}

.subject-folder-content {
  padding: 4px 0 6px 0;
  border-top: 1px solid rgba(255,255,255,0.04);
  margin: 0 6px;
}

/* Remove default triangle if you want */
details summary::-webkit-details-marker {
  display: none;
}
details summary {
  list-style: none;
}
/* optional custom arrow via ::before */
details summary::before {
  content: "▶";
  margin-left: 8px;
  color: #8a8fa8;
  font-size: 11px;
  transition: transform 0.2s;
}
details[open] summary::before {
  content: "▼";
}
