/* 
  Gestalt Educational Institute - Official Stylesheet
  Theme: Dark Olive, Academic, Dignified.
*/

:root {
    /* --- Core Palette (Base) --- */
    --color-primary-base: #2F3E2F;
    /* Deep Olive */
    --color-secondary-base: #8C7B5B;
    /* Bronze/Gold */

    /* --- LIGHT MODE (Default) --- */
    --color-primary: #2F3E2F;
    --color-primary-rgb: 47, 62, 47;
    --color-primary-dark: #1F2A1F;
    --color-secondary: #8C7B5B;
    --color-accent: #D4AF37;
    /* Gold */
    --color-primary-faded: #8fa38f;
    /* Faded Green for dark mode */

    --color-bg-body: #F9F9F4;
    /* Cream/Chalk-white */
    --color-bg-light: #F9F9F4;
    /* Alias for legacy sections */
    --color-bg-card: #FFFFFF;
    --color-bg-surface: #F0F0E8;
    /* Light UI elements */

    --color-white: #FFFFFF;
    --color-text-main: #2C2C2C;
    /* Charcoal */
    --color-text-muted: #555555;
    --color-text-light: #FFFFFF;
    /* Text on dark primary */

    --color-border: #E0E0E0;
    --color-shadow: rgba(0, 0, 0, 0.1);

    /* Typography */
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Lato', sans-serif;

    /* Spacing */
    --container-width: 1200px;
    --spacing-section: 6rem;
    --spacing-unit: 1rem;
}

/* --- DARK MODE OVERRIDES --- */
[data-theme="dark"] {
    /* Re-map colors for Dark Mode */
    --color-primary: #3E4F3E;
    /* A slightly lighter version of base #2F3E2F for accessibility */
    --color-primary-rgb: 62, 79, 62;
    --color-primary-dark: #2F3E2F;
    --color-secondary: #8C7B5B;

    --color-bg-body: #0F140F;
    /* Very Deep Green/Black */
    --color-bg-light: #0f140f;
    /* Legacy alias */
    --color-bg-card: #1A221A;
    /* Dark Greenish Card */
    --color-bg-surface: #242D24;
    /* Lighter UI */

    --color-white: #FFFFFF;
    /* Stays white for specific contrast needs */
    --color-text-main: #E0E0E0;
    /* Off-white */
    --color-text-muted: #A0A0A0;
    /* Light Gray */
    --color-text-light: #FFFFFF;
    /* Stays white on dark primary */

    --color-border: #2D3A2D;
    --color-shadow: rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .main-header.scrolled-state {
    background-color: rgba(15, 20, 15, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    overflow-x: hidden;
    /* Prevent horizontal scrollbar globally */
}

body {
    font-family: var(--font-body);
    background-color: var(--color-bg-body);
    color: var(--color-text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: var(--color-primary);
    font-weight: 700;
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* Utility Classes */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

.text-center {
    text-align: center;
}

.section-padding {
    padding: var(--spacing-section) 0;
}

/* Fade-in Animation - Elements start mostly visible, subtle enhancement */
.fade-in {
    opacity: 0.9;
    /* Start almost visible */
    transform: translateY(5px);
    /* Very subtle movement */
    transition: opacity 0.2s ease-out, transform 0.2s ease-out;
    /* Very fast */
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.bg-light {
    background-color: var(--color-bg-light);
}

.bg-dark {
    background-color: var(--color-primary-dark);
    color: var(--color-white);
}

.btn {
    display: inline-block;
    padding: 12px 32px;
    border-radius: 2px;
    font-family: var(--font-body);
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 0.9rem;
    cursor: pointer;
    background-color: var(--color-primary);
    color: var(--color-white);
    border: 1px solid var(--color-primary);
}

.btn:hover {
    background-color: var(--color-primary-dark);
}

.btn-outline {
    background-color: transparent;
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
}

.btn-outline:hover {
    background-color: var(--color-primary);
    color: var(--color-white);
}

/* Header */
/* Header */
.main-header {
    background-color: transparent;
    backdrop-filter: none;
    box-shadow: none;
    position: fixed;
    /* Fixed to overlay hero */
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 15px 10px;
    /* Default: Spacious/Transparent */
    transition: transform 0.3s ease-in-out, background-color 0.3s ease, padding 0.3s ease;
}

/* Scrolled State (White Ribbon) */
.main-header.scrolled-state {
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 2px 10px;
    /* Compact */
}

/* Prevent initial transition flicker */
.main-header.no-transition,
.main-header.no-transition * {
    transition: none !important;
}

.main-header.nav-hidden {
    transform: translateY(-100%);
}

/* Transparent State (At Top) */
.school-crest {
    height: 85px;
    /* Default: Much Bigger */
    width: auto;
    transition: height 0.4s ease;
}

.main-header.scrolled-state .school-crest {
    height: 35px;
    /* Scrolled: Small */
}

/* Base Text Styles (Default: White/Large) */
.school-name h1 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    /* Default: Bigger */
    font-weight: 700;
    color: #ffffff;
    /* Default: White */
    text-shadow: 0 4px 5px rgba(0, 0, 0, 0.3);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0;
    line-height: 1.2;
    transition: font-size 0.4s ease, color 0.4s ease, text-shadow 0.4s ease;
}

.main-header.scrolled-state .school-name h1 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-primary);
    /* Scrolled: Dark */
    text-shadow: none;
}

.school-name .header-tagline {
    font-family: var(--font-body);
    font-size: 0.55rem;
    font-weight: 400;
    opacity: 0;
    /* Default: Hidden */
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.4s ease;
    max-height: 0;
    overflow: hidden;
    display: block;
    letter-spacing: 1px;
}

.main-header.scrolled-state .school-name .header-tagline {
    color: #4A5D4A;
    /* Scrolled: Dark */
    opacity: 1;
    max-height: 20px;
}

/* Contact Page Override: Persistent Tagline */
body.contact-page .school-name .header-tagline {
    opacity: 1 !important;
    max-height: 20px !important;
    display: block !important;
}

.nav-links a {
    font-family: var(--font-body);
    color: #ffffff;
    /* Default: White */
    font-weight: 400;
    font-size: 0.75rem;
    /* Default: Larger */
    letter-spacing: 1px;
    text-decoration: none;
    transition: color 0.3s, transform 0.3s ease;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}



/* Nav Link Hover Animation (The "Ribbon") */
.nav-links a {
    position: relative;
    /* Anchor for pseudo-element */
    padding-bottom: 5px;
    /* Space for the line */
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: #ffffff;
    /* Default White Line */
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

.main-header.scrolled-state .nav-links a::after {
    background-color: #2F3E2F !important;
    /* Scrolled Dark Line - Hardcoded for classic look */
}

[data-theme="dark"] .main-header.scrolled-state .nav-links a::after {
    background-color: var(--color-primary-faded) !important;
    /* High visibility faded green in dark mode scrolled */
}

.btn-nav {
    font-family: var(--font-body);
    background-color: transparent;
    color: #ffffff !important;
    /* Default: White */
    padding: 0;
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    border: none;
    transition: color 0.3s, transform 0.3s ease;
}

.main-header.scrolled-state .btn-nav {
    color: var(--color-text-main) !important;
    /* Scrolled: Dark */
    font-size: 0.55rem;
    text-shadow: none;
}

.main-header.scrolled-state .nav-links a {
    color: var(--color-text-main);
    /* Scrolled: Dark */
    font-size: 0.55rem;
    text-shadow: none;
}

.mobile-menu-toggle {
    color: #ffffff;
}

.main-header.scrolled-state .mobile-menu-toggle {
    color: var(--color-primary);
}

/* Header Tagline - Fade and slide animation */
.school-name {
    transition: transform 0.5s ease-in-out !important;
}

.school-name h1 {
    transition: transform 0.5s ease-in-out !important;
}

.header-tagline {
    opacity: 1 !important;
    transform: translateY(0) !important;
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out !important;
    display: block !important;
    height: auto !important;
}

/* When header is transparent (NOT scrolled) - hide tagline */
.main-header:not(.scrolled-state) .header-tagline {
    opacity: 0 !important;
    transform: translateY(-10px) !important;
    pointer-events: none !important;
    height: 0 !important;
    overflow: hidden !important;
}

.main-header:not(.scrolled-state) .school-name h1 {
    transform: translateY(2px) scale(1.05) !important;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 100%;
    /* Full width to push to extremes */
    margin: 0;
}



/* When scrolled past hero, reveal tagline */
.main-header.scrolled-past-hero .header-tagline {
    opacity: 0.8;
    /* A bit dull/faded */
    transform: translateY(0);
    max-height: 50px;
    margin-top: 4px;
    padding-bottom: 2px;
}

.school-name .location {
    display: none;
}

.nav-links {
    display: flex;
    gap: 30px;
    align-items: center;
}



.btn-nav:hover {
    background-color: transparent;
    color: var(--color-primary) !important;
    transform: scale(1.15);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--color-primary);
}

/* Theme Toggle Button */
.theme-toggle-btn {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.theme-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: white;
    transform: rotate(15deg);
}

.main-header.scrolled-state .theme-toggle-btn {
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.main-header.scrolled-state .theme-toggle-btn:hover {
    background: var(--color-primary);
    color: white;
}

[data-theme="dark"] .theme-toggle-btn {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

/* Hero Section */
.hero {
    position: relative;
    height: 100vh;
    min-height: 800px;
    /* Force spread downwards */
    /* Lengthy downwards (Full Height) */
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    color: white;
}

.hero-bg-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.hero-bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    filter: none;
    /* Blur removed for clarity */
    transform: scale(1);
    /* Animation removed to allow GSAP control */
}

.hero-overlay-blur {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(20, 40, 20, 0.6), rgba(15, 30, 15, 0.8));
    /* Deep aesthetic green */
    mix-blend-mode: multiply;
    /* Aesthetic tint */
    transition: background 0.5s ease;
}

[data-theme="dark"] .hero-overlay-blur {
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), rgba(10, 20, 10, 0.95));
}

/* Dark Green Tint */


.hero-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
    padding: 20px;
}

.hero-top-text {
    font-family: var(--font-body);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: #e0d5b5;
    /* Gold/Beige accent */
    margin-bottom: 20px;
    font-weight: 700;
}

.hero-title {
    font-family: 'Futura', 'Century Gothic', sans-serif;
    /* Geometric Sans */
    font-size: 3.5rem;
    /* Reduced from 5rem for manageability */
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 5px;
    /* Futura needs breathing room */
    margin-bottom: 3rem;
    line-height: 1.1;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    color: #fff;
}

.hero-subtitle {
    display: none;
}

.hero-buttons {
    margin-top: 10px;
    display: flex;
    gap: 20px;
    justify-content: center;
}

/* Neumorphism Button Styling */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0.8em 1.8em;
    border-radius: 50px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    background-color: var(--color-primary);
    color: #fff;
    border: none;
    box-shadow:
        -5px -5px 10px rgba(255, 255, 255, 0.15),
        5px 5px 10px rgba(0, 0, 0, 0.35);
    transition: all 0.3s ease;
}

.btn:hover {
    box-shadow:
        -1px -1px 5px rgba(255, 255, 255, 0.1),
        1px 1px 5px rgba(0, 0, 0, 0.4),
        inset -2px -2px 5px rgba(255, 255, 255, 0.15),
        inset 2px 2px 4px rgba(0, 0, 0, 0.35);
    color: #fff;
    transform: translateY(1px);
}

.btn:active {
    box-shadow:
        inset -3px -3px 6px rgba(255, 255, 255, 0.1),
        inset 3px 3px 6px rgba(0, 0, 0, 0.4);
    transform: translateY(2px);
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0.8em 1.8em;
    border-radius: 50px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    background-color: transparent;
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.5);
    box-shadow:
        -5px -5px 10px rgba(255, 255, 255, 0.1),
        5px 5px 10px rgba(0, 0, 0, 0.25);
    transition: all 0.3s ease;
}

.btn-outline:hover {
    box-shadow:
        -1px -1px 5px rgba(255, 255, 255, 0.08),
        1px 1px 5px rgba(0, 0, 0, 0.3),
        inset -2px -2px 5px rgba(255, 255, 255, 0.1),
        inset 2px 2px 4px rgba(0, 0, 0, 0.25);
    color: var(--color-accent);
    border-color: var(--color-accent);
    transform: translateY(1px);
}

.btn-outline:active {
    box-shadow:
        inset -3px -3px 6px rgba(255, 255, 255, 0.08),
        inset 3px 3px 6px rgba(0, 0, 0, 0.3);
    transform: translateY(2px);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero-title {
        font-size: 3.5rem;
    }
}

/* Fix for "Crowded" Header on Tablet / Mobile Desktop View (980px - 1250px) */
@media (min-width: 769px) and (max-width: 1250px) {
    .container.header-container {
        padding: 0 15px;
    }
    
    .logo-area {
        flex-shrink: 1; /* Allow logo area to shrink if needed */
    }

    .school-crest {
        height: 50px; /* Smaller logo */
    }

    .school-name h1 {
        font-size: 1.0rem; /* Smaller text */
        letter-spacing: 1px;
    }

    .school-name .header-tagline {
        display: none !important; /* Hide tagline to save space */
    }

    .nav-links {
        gap: 12px; /* Much tighter gap */
    }

    .nav-links a {
        font-size: 0.65rem; /* Smaller link text */
        letter-spacing: 0.5px;
    }
    
    .btn-nav {
         font-size: 0.65rem;
    }
}

/* Sections Common */
.section-header {
    margin-bottom: 4rem;
    position: relative;
}

.section-header h3 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

[data-theme="dark"] .section-header h3 {
    color: var(--color-primary-faded);
}

.divider-icon {
    color: var(--color-secondary);
    opacity: 0.6;
}

[data-theme="dark"] .divider-icon {
    color: var(--color-primary-faded);
}

/* About Grid */
.about-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 4rem;
    align-items: center;
}

.about-text p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    color: var(--color-text-muted);
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.stat-card {
    padding: 30px;
    background-color: var(--color-bg-card);
    border: 1px solid var(--color-border);
    text-align: center;
    border-radius: 4px;
    box-shadow: 0 4px 6px var(--color-shadow);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: var(--color-secondary);
}

.stat-card:nth-child(3) {
    grid-column: span 2;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-primary);
    font-family: var(--font-heading);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-text-muted);
}

/* Leadership Grid */
.leadership-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    max-width: 1000px;
    margin: 0 auto;
}

.leader-card {
    background: var(--color-bg-card);
    padding: 40px 30px;
    text-align: center;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: transform 0.8s ease, box-shadow 0.8s ease;
    cursor: pointer;
    min-height: 200px;
}

.leader-card:nth-child(1) {
    grid-column: 1 / -1;
    width: 60%;
    margin: 0 auto;
}

.leader-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.leader-icon {
    width: 60px;
    height: 60px;
    background-color: var(--color-primary);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    margin-bottom: 15px;
    border: 2px solid white;
    box-shadow: 0 0 0 2px var(--color-primary);
}

[data-theme="dark"] .leader-icon {
    background-color: var(--color-primary-dark);
}

.leader-icon .lucide {
    width: 28px;
    height: 28px;
    stroke-width: 2;
}

.leader-card h4 {
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: var(--color-primary);
    font-weight: 700;
}

.leader-card .role {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--color-text-main);
    letter-spacing: 1px;
    font-weight: 600;
    margin-bottom: 15px;
    display: block;
}

.leader-preview {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    line-height: 1.5;
    max-width: 90%;
}

/* Chairman Modal Styling - Cover entire modal including padding */
#modal-bashir.facility-modal {
    overflow: hidden;
    background: transparent;
    border-top-color: var(--color-accent);
}

#modal-bashir.facility-modal::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background-image: url('../assets/chairman.jpg');
    background-size: cover;
    background-position: center top;
    filter: blur(3px);
    z-index: 0;
}

#modal-bashir.facility-modal::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(31, 42, 31, 0.75);
    /* Darker greenish tint like hero */
    z-index: 1;
}

#modal-bashir .modal-content {
    position: relative;
    z-index: 2;
    color: white;
    text-align: center;
}

#modal-bashir .modal-content h3 {
    color: var(--color-accent);
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

#modal-bashir .modal-content p {
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Chairman Modal Close Button - Visible */
#modal-bashir .btn-close {
    background-image: linear-gradient(30deg, var(--color-primary), var(--color-accent)) !important;
    background-color: var(--color-primary) !important;
    color: white !important;
    border: none !important;
    border-radius: 20px;
    padding: 0.6em 1.5em;
    font-size: 0.95rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    position: relative;
    z-index: 10;
}

/* Principal Reyaz Modal Styling (Duplicated from Chairman) */
#modal-reyaz.facility-modal {
    overflow: hidden;
    background: transparent;
    border-top-color: var(--color-accent);
}

#modal-reyaz.facility-modal::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background-image: url('../assets/images/principal-reyaz.jpg');
    background-size: cover;
    background-position: center top;
    filter: blur(3px);
    z-index: 0;
}

#modal-reyaz.facility-modal::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(31, 42, 31, 0.75);
    z-index: 1;
}

#modal-reyaz .modal-content {
    position: relative;
    z-index: 2;
    color: white;
    text-align: center;
}

#modal-reyaz .modal-content h3 {
    color: var(--color-accent);
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

#modal-reyaz .modal-content p {
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

#modal-reyaz .btn-close {
    background-image: linear-gradient(30deg, var(--color-primary), var(--color-accent)) !important;
    background-color: var(--color-primary) !important;
    color: white !important;
    border: none !important;
    border-radius: 20px;
    padding: 0.6em 1.5em;
    font-size: 0.95rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    position: relative;
    z-index: 10;
}

/* Principal Arshid Modal Styling (Gradient Variant) */
#modal-arshid.facility-modal {
    overflow: hidden;
    background: transparent;
    border-top-color: var(--color-accent);
}

#modal-arshid.facility-modal::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    /* Premium Dark Greenish Gradient */
    background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary), #1a241a);
    z-index: 0;
}

#modal-arshid.facility-modal::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* texture overlay optional, or just transparent since gradient is key */
    background: radial-gradient(circle at center, transparent 0%, rgba(0, 0, 0, 0.3) 100%);
    z-index: 1;
}

#modal-arshid .modal-content {
    position: relative;
    z-index: 2;
    color: white;
    text-align: center;
}

#modal-arshid .modal-content h3 {
    color: var(--color-accent);
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

#modal-arshid .modal-content p {
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

#modal-arshid .btn-close {
    background-image: linear-gradient(30deg, var(--color-primary), var(--color-accent)) !important;
    background-color: var(--color-primary) !important;
    color: white !important;
    border: none !important;
    border-radius: 20px;
    padding: 0.6em 1.5em;
    font-size: 0.95rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    position: relative;
    z-index: 10;
}

.academics-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

.methodology h4 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.campus.peak-result {
    background-color: #2F3E2F;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 2.5rem 2rem;
    max-width: 600px;
    margin: 0 auto;
    /* Removed large bottom margin to allow text to center better */
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    /* overflow: hidden; REMOVED to allow button to hang outside */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.peak-result:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.merit-note {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    /* Moved closer to card */
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.campuses-grid {
    display: grid;
    gap: 20px;
}

.campus-card {
    display: flex;
    flex-direction: column;
    padding: 25px;
    background-color: var(--color-bg-card);
    color: var(--color-text-main);
    border-left: 4px solid var(--color-secondary);
    transition: transform 0.8s ease, box-shadow 0.8s ease;
}

.campus-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}

.campus-icon {
    margin-bottom: 10px;
    color: var(--color-primary);
}

.campus-tag {
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--color-secondary);
    margin-bottom: 10px;
}

/* Results Section Gradient Background - Darker & More Gradient */
#results {
    background: linear-gradient(135deg, #0f241c 0%, #1a3a2e 25%, #2d5745 50%, #1a3a2e 75%, #0f241c 100%);
    position: relative;
    overflow: visible;
    /* Changed from hidden to allow button to show outside card */
}

#results::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(124, 179, 66, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(124, 179, 66, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(45, 87, 69, 0.3) 0%, transparent 70%);
    pointer-events: none;
}

#results .container {
    position: relative;
    z-index: 1;
}

.results-highlight {
    perspective: 1000px;
}

/* Results Highlight - 3D Tilt Card */
.peak-result {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    padding: 50px 60px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    margin-bottom: 2rem;
    background: linear-gradient(135deg, rgba(26, 58, 46, 0.6) 0%, rgba(45, 87, 69, 0.4) 100%);
    backdrop-filter: blur(12px);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    transform-style: preserve-3d;
    transition: transform 0.1s ease-out, box-shadow 0.3s ease;
    cursor: pointer;
    position: relative;
}

.peak-result::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(124, 179, 66, 0.05) 0%, transparent 100%);
    border-radius: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.peak-result:hover::before {
    opacity: 1;
}

.peak-result .year {
    text-transform: uppercase;
    letter-spacing: 3px;
    font-size: 0.95rem;
    font-weight: 400;
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.7);
    font-family: var(--font-heading);
}

.peak-result .score {
    font-size: 6rem;
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 0.9;
    color: #B8860B;
    margin-bottom: 15px;
    letter-spacing: -2px;
}

.peak-result .achievement {
    font-size: 1.6rem;
    margin-bottom: 25px;
    color: #ffffff;
    font-family: var(--font-heading);
    font-weight: 600;
    letter-spacing: 1px;
}

.student-name {
    font-size: 1.5rem;
    font-weight: 600;
    color: #B8860B;
    margin: 20px 0 15px 0;
    font-family: var(--font-heading);
    letter-spacing: 2px;
}

.achievement-detail {
    font-size: 1rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.85);
    max-width: 600px;
    text-align: center;
    margin: 0;
    font-family: var(--font-heading);
    font-weight: 300;
}

/* Tap Hint */
.tap-hint {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    font-family: var(--font-body);
    letter-spacing: 0.5px;
    pointer-events: none;
}

/* Colorful Confetti Animation */
.golden-glitter {
    position: fixed;
    pointer-events: none;
    z-index: 1999;
    will-change: transform, opacity;
    animation: glitterBurst 2.5s linear forwards;
}

.golden-glitter.star-shape {
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

@keyframes glitterBurst {
    0% {
        transform: translate(0, 0) rotate(0deg) scale(1);
        opacity: 1;
    }

    20% {
        opacity: 1;
    }

    100% {
        transform: translate(var(--tx), var(--ty)) rotate(var(--rotation)) scale(0);
        opacity: 0;
    }
}

@keyframes cardPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
    }
}

/* Facilities Grid */
.facilities-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.facility-card {
    background: var(--color-bg-card);
    color: var(--color-text-main);
    padding: 30px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    transition: all 0.8s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}

.facility-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
    border-color: var(--color-secondary);
}

.facility-icon {
    color: var(--color-primary);
    margin-bottom: 20px;
}

[data-theme="dark"] .facility-icon {
    color: var(--color-primary-faded);
}

.facility-icon svg {
    width: 32px;
    height: 32px;
}

.facility-card h4 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--color-text-main);
}

.facility-card p {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    line-height: 1.5;
}

/* Modal System */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(8px);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.facility-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: var(--color-bg-card);
    padding: 50px;
    width: 90%;
    max-width: 600px;
    border-top: 5px solid var(--color-primary);
    box-shadow: 0 25px 50px var(--color-shadow);
    z-index: 2001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

[data-theme="dark"] .modal-overlay {
    background-color: rgba(0, 0, 0, 0.85);
}

[data-theme="dark"] .facility-modal {
    background: var(--color-bg-card);
    border-color: var(--color-primary);
}

.facility-modal.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.modal-content {
    text-align: center;
}

.facility-icon.large svg {
    width: 48px;
    height: 48px;
    margin-bottom: 20px;
}

.modal-content h3 {
    margin-bottom: 20px;
    color: var(--color-primary);
}

.modal-content p {
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 30px;
}

.btn-close {
    border: none;
    color: #fff;
    background-color: var(--color-primary);
    border-radius: 20px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    padding: 0.6em 1.5em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.btn-close:hover {
    animation: btnPulse 1.5s infinite;
}

@keyframes btnPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(199, 164, 106, 0.6);
    }

    70% {
        box-shadow: 0 0 0 12px rgba(199, 164, 106, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(199, 164, 106, 0);
    }
}

/* Responsive Grid */
@media (max-width: 900px) {
    .facilities-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .facilities-grid {
        grid-template-columns: 1fr;
    }
}

/* Admissions Section */
.admission-content {
    max-width: 800px;
    margin: 0 auto;
}

.admission-text {
    text-align: center;
}

.admission-text p {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--color-text-main);
    margin-bottom: 1.5rem;
    text-align: justify;
    text-justify: inter-word;
}

.admission-text p:last-child {
    margin-bottom: 0;
}

/* Footer */
footer {
    background-color: var(--color-primary-dark);
    color: rgba(255, 255, 255, 0.7);
    padding: 5rem 0 2rem;
}

.footer-content {
    position: relative;
    z-index: 10;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 3rem;
}

.footer-col-right {
    text-align: right;
}

.footer-col-right a {
    justify-content: flex-end;
}

.footer-bottom {
    position: relative;
    z-index: 10;
}

.footer-col h5 {
    color: var(--color-white);
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}

.footer-col a {
    color: rgba(255, 255, 255, 0.7);
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

.footer-col a:hover {
    color: var(--color-white);
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.5), 0 0 15px rgba(255, 255, 255, 0.3);
}

/* Footer icon styling */
.footer-col a svg {
    transition: filter 0.3s ease;
}

.footer-col a:hover svg {
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.6));
}

/* Responsive */
@media (max-width: 992px) {
    .hero-title {
        font-size: 2.8rem;
    }

    .about-grid,
    .academics-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .leadership-grid {
        grid-template-columns: 1fr;
    }

    /* Make all leader cards look like the chairman card on mobile */
    .leader-card {
        width: 60%;
        margin: 0 auto;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        width: 100%;
        background: rgba(31, 42, 31, 0.95);
        /* Dark Greenish Translucent */
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        /* Safari support */
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 100vh;
        background-color: rgba(10, 15, 10, 0.98);
        /* Deep Dark Backdrop */
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 20px;
        gap: 15px;
        /* Gap between cards */
        transform: translateY(100%);
        /* Slide form bottom */
        opacity: 0;
        transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.6s ease;
        z-index: 2000;
        visibility: hidden;
    }

    .nav-links.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .mobile-menu-toggle {
        display: block;
        position: relative;
        z-index: 2005;
        /* Must be higher than nav-links */
        background: none;
        border: none;
        cursor: pointer;
        padding: 5px;
    }

    .hero-title {
        font-size: 1.5rem;
        /* Smaller for mobile to fit on fewer lines */
        letter-spacing: 1px;
        line-height: 1.2;
    }

    .hero-top-text {
        font-size: 0.45rem;
        /* Very small to fit one line */
        letter-spacing: 1px;
        margin-bottom: 10px;
    }

    .hero-buttons {
        gap: 10px;
        /* Reduced gap */
        flex-direction: row;
        /* Force side by side */
    }

    .hero-buttons .btn {
        padding: 10px 15px;
        /* Smaller buttons */
        font-size: 0.7rem;
    }

    /* Adjust Header for Mobile Transparent State */
    .main-header .school-name h1 {
        font-size: 0.9rem;
        /* Reduced from 1.2rem */
        text-shadow: 0 2px 3px rgba(0, 0, 0, 0.5);
    }

    .main-header .school-crest {
        height: 40px;
        /* Smaller logo on mobile top */
    }

    /* Card Style Menu Items */
    .nav-links li {
        width: 100%;
        max-width: 320px;
        opacity: 0;
        transform: translateY(20px);
        transition: all 0.5s ease;
    }

    .nav-links.active li {
        opacity: 1;
        transform: translateY(0);
    }

    /* Staggered Delay for Menu Items */
    .nav-links.active li:nth-child(1) {
        transition-delay: 0.1s;
    }

    .nav-links.active li:nth-child(2) {
        transition-delay: 0.15s;
    }

    .nav-links.active li:nth-child(3) {
        transition-delay: 0.2s;
    }

    .nav-links.active li:nth-child(4) {
        transition-delay: 0.25s;
    }

    .nav-links.active li:nth-child(5) {
        transition-delay: 0.3s;
    }

    .nav-links.active li:nth-child(6) {
        transition-delay: 0.35s;
    }

    .main-header .nav-links a,
    .nav-links a,
    .main-header .btn-nav,
    .btn-nav {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        padding: 1.2rem 1.5rem;
        background-color: #1a221a;
        /* Default Card Color */
        border-radius: 12px;
        font-family: 'Playfair Display', serif !important;
        font-size: 1.2rem !important;
        font-weight: 600 !important;
        color: #ffffff !important;
        text-shadow: none !important;
        text-decoration: none;
        border: 1px solid rgba(255, 255, 255, 0.05);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }

    /* Strict White Text Override for Dark Mode Mobile Menu */
    [data-theme="dark"] .main-header .nav-links a,
    [data-theme="dark"] .nav-links a,
    [data-theme="dark"] .btn-nav {
        color: #FFFFFF !important;
    }

    .nav-links a:hover,
    .btn-nav:hover {
        transform: scale(1.02);
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    }

    /* Gradient/Card Colors for each item */
    .nav-links li:nth-child(1) a {
        background-color: #0f140f;
    }

    /* Deepest */
    .nav-links li:nth-child(2) a {
        background-color: #151d15;
    }

    .nav-links li:nth-child(3) a {
        background-color: #1a251a;
    }

    .nav-links li:nth-child(4) a {
        background-color: #1f2a1f;
    }

    .nav-links li:nth-child(5) a {
        background-color: #243024;
    }

    /* Contact Button Gold Card */
    .nav-links li:nth-child(6) .btn-nav {
        background-color: #d4af37 !important;
        color: #1a221a !important;
        border: none !important;
        font-weight: 700 !important;
    }

    /* Reveal Arrow for Cards */
    .nav-links a::after,
    .btn-nav::after {
        content: '→';
        font-family: var(--font-body);
        font-weight: 300;
        opacity: 0.5;
    }

    .nav-links li:nth-child(6) .btn-nav::after {
        color: #1a221a;
    }

    /* Mobile Menu Theme Toggle Fix */
    .dropdown-item.theme-toggle-btn {
        color: var(--color-primary) !important;
        /* Dark Green for Light Mode */
        background: transparent !important;
        border: none !important;
        padding: 12px 16px !important;
        width: 100% !important;
        justify-content: flex-start !important;
        border-radius: 8px !important;
        display: flex;
        align-items: center;
        margin-top: 0 !important;
    }

    /* Icon spacing */
    .dropdown-item.theme-toggle-btn .theme-icon {
        width: 18px;
        height: 18px;
        /* No margin needed if gap is on parent, but let's be safe */
    }

    /* Hover State */
    .dropdown-item.theme-toggle-btn:hover {
        background-color: #f0f0f5 !important;
        color: var(--color-primary) !important;
    }

    /* Dark Mode Override */
    [data-theme="dark"] .dropdown-item.theme-toggle-btn {
        color: #FFFFFF !important;
    }

    [data-theme="dark"] .dropdown-item.theme-toggle-btn:hover {
        background-color: rgba(255, 255, 255, 0.1) !important;
    }

    /* Shift Principal Reyaz photo opposite way for mobile visibility */
    #modal-reyaz.facility-modal::before {
        background-position: 10% center;
    }
}

/* Spotlight Animation */
.stat-card,
.leader-card,
.campus-card,
.facility-card {
    position: relative;
    overflow: hidden;
}

.stat-card::after,
.leader-card::after,
.campus-card::after,
.facility-card::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background: radial-gradient(600px circle at var(--mouse-x) var(--mouse-y),
            rgba(212, 175, 55, 0.1),
            transparent 40%);
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 2;
    pointer-events: none;
}

.stat-card:hover::after,
.leader-card:hover::after,
.campus-card:hover::after,
.facility-card:hover::after {
    opacity: 1;
}

/* =========================================
   Mobile Refinements (Desktop-like Density)
   ========================================= */
@media (max-width: 768px) {

    /* --- 1. Compact Header --- */
    .header-container {
        padding: 0.5rem 1rem;
        /* Tighter padding */
        min-height: 50px;
        /* Reduce default height */
    }

    .main-header .school-crest {
        height: 32px;
        /* Smaller Logo */
    }

    .main-header .school-name h1 {
        font-size: 0.85rem;
        /* Smaller Title */
        line-height: 1.1;
    }

    .header-tagline {
        font-size: 0.6rem !important;
        /* Smaller Tagline */
        margin-top: 2px;
    }

    /* --- 2. Scaled Down Hero --- */
    .hero-content {
        padding-top: 0;
        /* Pull content up */
        width: 100%;
        padding-left: 15px;
        padding-right: 15px;
    }

    .hero-title {
        font-size: 1.8rem;
        /* Fit more text */
        margin-bottom: 1rem;
    }

    .hero-top-text {
        font-size: 0.65rem;
        margin-bottom: 0.5rem;
        letter-spacing: 2px;
    }

    .hero-buttons .btn {
        padding: 10px 20px;
        /* Slightly more compact buttons */
        font-size: 0.8rem;
    }

    /* --- 3. Tighter Section Layouts --- */
    section {
        padding: 3rem 0;
        /* Reduce from 5rem */
    }

    .about,
    .academics,
    .leadership,
    .facilities,
    .results {
        padding: 3rem 0;
    }

    .section-header h3 {
        font-size: 1.8rem;
        margin-bottom: 0.5rem;
    }

    .divider-icon {
        margin-top: 0.5rem;
        margin-bottom: 1.5rem;
    }

    /* Reduce horizontal padding on containers to maximize width */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Facilities Icon size */
    .facility-icon svg {
        width: 32px;
        height: 32px;
        /* Smaller icons */
    }

    /* Results Card */
    .peak-result {
        padding: 2rem;
    }

    .peak-result .score {
        font-size: 4rem;
    }

    /* --- 4. Footer Optimization --- */
    footer {
        padding: 2rem 0 1rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding-bottom: 1.5rem;
        text-align: left;
    }

    .footer-col-right {
        text-align: left;
    }

    .footer-col-right a {
        justify-content: flex-start;
    }

    .footer-col h5 {
        font-size: 0.95rem;
        margin-bottom: 0.75rem;
    }

    .footer-col p {
        font-size: 0.85rem;
        line-height: 1.5;
        margin-bottom: 0.5rem;
    }

    .footer-col a {
        font-size: 0.85rem;
    }

    .footer-bottom p {
        font-size: 0.75rem;
        padding-top: 1rem;
    }

    /* --- 5. Contact Page Optimization --- */
    .contact-form-section {
        padding: 2rem 0;
    }

    .contact-container,
    .contact-container-redesign {
        padding: 1.5rem;
        /* Much tighter padding */
        border-top-width: 3px;
    }

    .helpdesk-title {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }

    /* Adjust form inputs for mobile */
    .timeline-row {
        margin-bottom: 1.2rem;
    }

    .timeline-icon-col {
        width: 30px;
        /* Tighter icon column */
        margin-right: 10px;
    }

    .t-icon {
        width: 18px;
        height: 18px;
    }

    /* Chairman Modal - shift image left on mobile */
    #modal-bashir.facility-modal::before {
        background-position: 30% top;
    }
}

/* =========================================
   Scroll Driven Animations (Chrome 115+)
   ========================================= */

@keyframes image-appear {
    from {
        filter: saturate(0) contrast(4) brightness(.1) blur(3px);
        opacity: 0;
        scale: .95;
        transform: translateY(4rem);
    }
}

@keyframes text-appear {
    from {
        opacity: 0;
        transform: translateY(8rem);
    }
}

/* Apply to content inside sections (excluding Hero for safety) */
section:not(#home) p,
section:not(#home) h2,
section:not(#home) h3,
section:not(#home) blockquote,
section:not(#home) hr,
section:not(#home) .campus-card,
section:not(#home) .facility-card,
section:not(#home) .leader-card,
section:not(#home) .stat-card {
    animation: text-appear ease-in both;
    animation-timeline: view();
    animation-range: entry 10% cover 30%;
}

section:not(#home) img {
    animation: image-appear ease-in both;
    animation-timeline: view();
    animation-range: entry 10% cover 30%;
}

@prefers-reduced-motion {

    section:not(#home) p,
    section:not(#home) h2,
    section:not(#home) h3,
    section:not(#home) blockquote,
    section:not(#home) hr,
    section:not(#home) img,
    section:not(#home) .campus-card,
    section:not(#home) .facility-card,
    section:not(#home) .leader-card,
    section:not(#home) .stat-card {
        animation: none;
    }
}

/* --- Back to Top Button --- */
#back-to-top {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-primary);
    /* Dark Green */
    width: 50px;
    height: 50px;
    text-align: center;
    border-radius: 50%;
    position: fixed;
    bottom: 30px;
    right: 30px;
    transition: background-color .3s, opacity .5s, visibility .5s, transform 0.3s;
    opacity: 0;
    visibility: hidden;
    z-index: 1000;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    color: #fff;
}

#back-to-top:hover {
    background-color: var(--color-primary-dark);
    transform: translateY(-3px);
}

#back-to-top.show {
    opacity: 1;
    visibility: visible;
}

/* Mobile optimization for Back to Top */
@media (max-width: 768px) {

    /* Utility to force line break on mobile */
    .mobile-block {
        display: block;
    }

    #back-to-top {
        width: 32px;
        /* Slightly larger than 24px for touch target, but visual can be small */
        height: 32px;
        /* User asked for 24px, 32px is better for tap, let's stick to user request roughly or make it usable */
        /* User said "only 24px in size". */
        width: 24px;
        height: 24px;
        bottom: 20px;
        right: 20px;
    }

    #back-to-top svg {
        width: 14px;
        height: 14px;
        stroke-width: 3;
    }
}