:root {
    /* Brand Palette */
    --bg: #ffffff;
    --fg: #001358;
    --teal: #0095A9;
    --gold: #FDB60E;
    --navy: #001358;
    
    --muted: #64748b;
    --border: rgba(0, 19, 88, 0.08);
    
    /* Custom Brand Font: Inter Variable (Unified Neo-Grotesk) */
    --font-display: 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    /* Spacing */
    --gap: 1.5rem;
    --radius: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg);
    color: var(--fg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-y: auto; /* Allow scrolling when zoomed or on small viewports */
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* --- Premium Academic Loading Scene --- */
#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.88); /* Sophisticated white glass background overlay */
    backdrop-filter: blur(25px); /* Apple-grade depth blur */
    -webkit-backdrop-filter: blur(25px);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1), transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

#loader::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(0, 149, 169, 0.05) 0%, rgba(0, 19, 88, 0.02) 50%, rgba(0, 19, 88, 0) 100%);
    pointer-events: none;
    z-index: 0;
    animation: pulse-glow 6s infinite ease-in-out;
}

@keyframes pulse-glow {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.15); opacity: 1; }
}

.academic-loader-wrapper {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

.emblem-container {
    position: relative;
    width: 180px;
    height: 180px;
    animation: emblem-breath 4s ease-in-out infinite alternate;
}

.academic-emblem {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 10px 30px rgba(0, 19, 88, 0.05));
}

/* --- Premium ggenIcon.svg Loader Animations --- */
.ggen-book-element {
    transform-origin: 549px 980px; /* Center bottom of the book */
    opacity: 0;
    fill: none;
}

.ggen-fire-element {
    transform-origin: 549px 545px; /* Base of the flame */
    opacity: 0;
    fill: none;
}

.ggen-emblem-base-left {
    stroke: #017188;
    stroke-width: 12px;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    animation: ggen-book-draw 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.1s,
               ggen-book-fill-teal 1s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.8s;
}

.ggen-emblem-base-right {
    stroke: #017188;
    stroke-width: 12px;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    animation: ggen-book-draw 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.1s,
               ggen-book-fill-teal 1s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.8s;
}

.ggen-emblem-wing-left {
    stroke: #017188;
    stroke-width: 12px;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    animation: ggen-book-draw 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.3s,
               ggen-book-fill-teal 1s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.9s;
}

.ggen-emblem-wing-right {
    stroke: #017188;
    stroke-width: 12px;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    animation: ggen-book-draw 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.3s,
               ggen-book-fill-teal 1s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.9s;
}

.ggen-emblem-main {
    opacity: 0;
    transform-origin: 549px 545px;
    animation: ggen-fade-in 1.6s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.8s;
}

.ggen-flame-burn {
    transform-origin: 549px 545px;
    animation: ggen-flame-flicker 2.4s infinite ease-in-out alternate;
}

/* --- Keyframes for Book Opening & Drawing --- */
@keyframes ggen-book-draw {
    0% {
        opacity: 0;
        transform: scale(0) translateY(50px);
        stroke-dashoffset: 2000;
    }
    15% {
        opacity: 1;
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
        stroke-dashoffset: 0;
    }
}

@keyframes ggen-book-fill-teal {
    to {
        fill: #017188;
        stroke-width: 0px;
        opacity: 1;
    }
}

/* --- Keyframes for Smooth Fade In --- */
@keyframes ggen-fade-in {
    0% {
        opacity: 0;
        transform: scale(0.96) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* --- Keyframes for Realistic Flame Burning/Flicker --- */
@keyframes ggen-flame-flicker {
    0% {
        transform: scale(1) rotate(0deg);
        filter: drop-shadow(0 0 2px rgba(251, 152, 6, 0.2));
    }
    20% {
        transform: scale(1.03) rotate(-1.5deg) skewX(-1deg);
        filter: drop-shadow(0 0 6px rgba(251, 152, 6, 0.5));
    }
    40% {
        transform: scale(0.97) rotate(1deg) skewX(1.5deg);
        filter: drop-shadow(0 0 3px rgba(251, 152, 6, 0.3));
    }
    60% {
        transform: scale(1.04) rotate(-0.5deg) skewX(-0.5deg);
        filter: drop-shadow(0 0 7px rgba(210, 12, 23, 0.45));
    }
    80% {
        transform: scale(0.98) rotate(1.5deg) skewX(1deg);
        filter: drop-shadow(0 0 4px rgba(251, 152, 6, 0.35));
    }
    100% {
        transform: scale(1.01) rotate(-0.5deg) skewX(-1deg);
        filter: drop-shadow(0 0 5px rgba(251, 152, 6, 0.4));
    }
}

@keyframes emblem-breath {
    0% { transform: translateY(0) scale(1); }
    100% { transform: translateY(-5px) scale(1.03); }
}

/* Typography Animation */
.academic-welcome-text {
    text-align: center;
    color: var(--navy);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
}

.academic-prefix {
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: var(--muted);
    opacity: 0;
    transform: translateY(12px);
    animation: slide-up-fade 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.5s;
}

.academic-title {
    font-family: var(--font-body); /* Unified Inter font family */
    font-size: clamp(1.1rem, 2.5vh, 1.4rem);
    font-weight: 500; /* Structured medium weight */
    text-transform: uppercase; /* Structured capitalized format */
    letter-spacing: 0.14em; /* Classic track layout */
    color: var(--navy);
    opacity: 0;
    transform: translateY(15px);
    animation: slide-up-fade 1.4s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.8s;
}

.academic-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    width: 140px;
    margin-top: 0.2rem;
    opacity: 0;
    animation: fade-in-simple 1.4s ease forwards 1.2s;
}

.academic-divider .line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(0, 19, 88, 0) 0%, rgba(0, 19, 88, 0.2) 50%, rgba(0, 19, 88, 0) 100%);
}

.academic-divider .star-icon {
    font-size: 0.7rem;
    color: var(--gold);
    animation: pulse-star 2s infinite alternate ease-in-out;
}

@keyframes slide-up-fade {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fade-in-simple {
    to {
        opacity: 1;
    }
}

@keyframes pulse-star {
    0% { transform: scale(0.85); opacity: 0.6; text-shadow: 0 0 0 rgba(253, 182, 14, 0); }
    100% { transform: scale(1.15); opacity: 1; text-shadow: 0 0 6px rgba(253, 182, 14, 0.4); }
}

body.loaded #loader {
    opacity: 0;
    transform: scale(1.03);
    pointer-events: none;
}

#content {
    min-height: 100vh; /* Fill body height, allow expansion */
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.2s, transform 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.2s;
}

body.loaded #content {
    opacity: 1;
    transform: translateY(0);
}

.ambient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-color: #fafbfc;
    background-image: 
        linear-gradient(rgba(0, 19, 88, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 19, 88, 0.02) 1px, transparent 1px),
        radial-gradient(circle at 10% 20%, rgba(253, 182, 14, 0.09) 0%, rgba(253, 182, 14, 0) 45%),
        radial-gradient(circle at 90% 80%, rgba(0, 149, 169, 0.06) 0%, rgba(0, 149, 169, 0) 50%);
    background-size: 48px 48px, 48px 48px, 100% 100%, 100% 100%;
    opacity: 1;
}

header {
    padding: clamp(1.5rem, 4vh, 3.5rem) 1.5rem clamp(1rem, 2vh, 1.5rem);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(0.8rem, 1.5vh, 1.2rem);
}

.network-logo { max-width: clamp(160px, 15vh, 220px); height: auto; filter: drop-shadow(0 15px 40px rgba(0, 19, 88, 0.08)); }

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(1.2rem, 2.5vh, 1.5rem);
    font-weight: 500; /* Elegant medium weight */
    letter-spacing: -0.02em; /* Clean tight letter spacing */
    color: var(--navy);
    opacity: 0.95;
    position: relative;
    max-width: 800px;
}

.hero-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 1px;
    background: var(--gold);
    margin: clamp(0.6rem, 1.5vh, 1.2rem) auto 0;
}

main {
    flex: 1;
    width: 100%;
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
}

.bento-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: repeat(2, minmax(max-content, 1fr)); /* Equal flexible rows that grow with content */
    gap: var(--gap);
    width: 100%;
    height: 100%;
    max-height: 620px; /* Force grid layout to fit perfectly with extra breathing room */
}

/* Liquid Hover Architecture */
.card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: clamp(1.2rem, 2.5vh, 1.8rem) clamp(1.5rem, 3vw, 2.2rem);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center; /* Center-align items */
    text-align: center; /* Center-align typography */
    position: relative;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    box-shadow: 0 4px 40px rgba(0, 19, 88, 0.02);
    z-index: 1;
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 45px rgba(0, 19, 88, 0.05);
}

.card-ggiss:hover { border-color: var(--teal); }
.card-ggic:hover { border-color: var(--gold); }
.card-cosmos:hover { border-color: #C4161B; }
.card-acem:hover { border-color: #2A429D; }

.card-ggiss:hover .institution-name { color: var(--teal); }
.card-ggic:hover .institution-name { color: var(--gold); }
.card-cosmos:hover .institution-name { color: #C4161B; }
.card-acem:hover .institution-name { color: #2A429D; }

.institution-logo, .institution-name { transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1); }

.grid-headers {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--gap);
    width: 100%;
    max-width: 1300px;
    margin: 0 0 clamp(0.5rem, 1.2vh, 1rem);
    padding: 0;
    flex-shrink: 0;
}

.header-left, .header-right {
    font-family: var(--font-body);
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--navy);
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.header-left .header-sub, .header-right .header-sub {
    font-family: var(--font-body);
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    color: var(--muted);
    text-transform: uppercase;
    opacity: 0.85;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.header-left .header-sub::before, .header-right .header-sub::before {
    content: '•';
    color: var(--muted);
    font-size: 0.7rem;
    opacity: 0.6;
}

.header-label-highlight {
    position: relative;
    display: inline-block;
    padding: 0 4px;
}

/* Highlighter marker sweep — sweeps the background color across the text */
.header-label-highlight::before {
    content: '';
    position: absolute;
    inset: -3px -5px;
    z-index: -1;
    border-radius: 2px;
    width: 0;
    /* each label gets its own animation defined below */
}

#label-plus2::before {
    background: rgba(0, 149, 169, 0.22);
    animation:
        sweep-marker 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards 3.3s,
        glow-teal    0.5s ease              forwards 3.8s;
}

#label-higher::before {
    background: rgba(253, 182, 14, 0.28);
    animation:
        sweep-marker 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards 5.2s,
        glow-gold    0.5s ease              forwards 5.85s;
}

@keyframes sweep-marker {
    0%   { width: 0; }
    100% { width: calc(100% + 10px); }
}

@keyframes glow-teal {
    0%, 100% { box-shadow: 0 0 0px rgba(0, 149, 169, 0); }
    50%      { box-shadow: 0 0 8px 1px rgba(0, 149, 169, 0.2); }
}

@keyframes glow-gold {
    0%, 100% { box-shadow: 0 0 0px rgba(253, 182, 14, 0); }
    50%      { box-shadow: 0 0 8px 1px rgba(253, 182, 14, 0.25); }
}

/* Subtle dust particles sprinkle */
.dust-particle {
    position: absolute;
    pointer-events: none;
    border-radius: 50%;
    z-index: 10;
    opacity: 0;
    animation: dust-float 1.2s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes dust-float {
    0% {
        opacity: 0;
        transform: translateY(0) scale(0.5);
    }
    20% {
        opacity: 0.6;
    }
    100% {
        opacity: 0;
        transform: translateY(-16px) translateX(var(--drift, 0px)) scale(1);
    }
}

.header-left {
    grid-column: span 4;
}

.header-right {
    grid-column: span 8;
}

.institution-logo {
    max-width: 100%;
    width: auto;
    height: clamp(105px, 15vh, 145px); /* Bigger logo for prominent branding */
    object-fit: contain;
    margin-bottom: clamp(0.8rem, 1.8vh, 1.2rem);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    z-index: 2;
    align-self: center; /* Centered horizontally */
}

.card-ggiss .institution-logo {
    height: clamp(165px, 23vh, 215px); /* Tall card gets extra large logo */
    margin-top: auto;
    margin-bottom: auto;
}

.card-cosmos .institution-logo {
    height: clamp(35px, 5vh, 48px); /* Make it even smaller */
    margin-top: auto;
    margin-bottom: auto; /* Center it vertically in the upper area */
}

.card:hover .institution-logo {
    transform: scale(1.06);
}

.institution-name {
    font-family: var(--font-display);
    font-size: clamp(1.15rem, 2.6vh, 1.7rem); /* Unified harmonious font size */
    font-weight: 600; /* Highly professional semibold weight */
    line-height: 1.15;
    letter-spacing: -0.02em; /* Perfectly balanced tight letter spacing */
    margin-top: auto;
    color: var(--navy);
    width: 100%;
    position: relative;
    z-index: 2;
}

/* === Cohesive Card Patterns === */
.card-pattern {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.055;
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.card:hover .card-pattern { opacity: 0.13; }

.card-pattern svg {
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
}

/* Single shared drift animation for all pattern elements */
@keyframes pat-drift {
    0%   { transform: translateY(0px) translateX(0px); }
    33%  { transform: translateY(-6px) translateX(2px); }
    66%  { transform: translateY(-3px) translateX(-3px); }
    100% { transform: translateY(0px) translateX(0px); }
}
@keyframes pat-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
@keyframes pat-spin-rev {
    from { transform: rotate(0deg); }
    to   { transform: rotate(-360deg); }
}
@keyframes pat-pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}
@keyframes pat-dash {
    from { stroke-dashoffset: 120; }
    to   { stroke-dashoffset: 0; }
}

.card-ggiss { grid-column: span 4; grid-row: span 2; }
.card-ggic { 
    grid-column: span 8; 
    grid-row: span 1; 
}
.card-cosmos { grid-column: span 4; grid-row: span 1; }
.card-acem { grid-column: span 4; grid-row: span 1; }

footer { padding: clamp(0.8rem, 1.5vh, 1.2rem) 2rem; background: #fafbfc; border-top: 1px solid var(--border); margin-top: auto; }
.footer-inner { max-width: 1300px; margin: 0 auto; width: 100%; display: flex; justify-content: space-between; align-items: center; }
.copyright { font-size: 0.76rem; color: var(--muted); letter-spacing: 0.02em; }
.social-links { display: flex; gap: 1.5rem; }
.social-link { 
    color: var(--navy); 
    opacity: 0.55; 
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1); 
    display: flex;
    align-items: center;
    justify-content: center;
}
.social-link:hover { 
    opacity: 1; 
    color: var(--teal); 
    transform: translateY(-4px); 
}
.social-icon { 
    width: 17px; 
    height: 17px; 
    fill: currentColor;
    display: block;
}
.social-link svg[fill="none"] {
    fill: none;
    stroke: currentColor;
}

@media (max-width: 1200px) {
    body {
        height: auto;
        overflow: auto;
    }
    #content {
        height: auto;
        display: block;
    }
    .grid-headers {
        grid-template-columns: repeat(2, 1fr);
    }
    .header-left {
        grid-column: span 1;
    }
    .header-right {
        grid-column: span 1;
    }
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: auto;
        max-height: none;
        height: auto;
    }
    .card-ggiss { grid-column: span 1; grid-row: span 2; }
    .card-ggic { grid-column: span 1; grid-row: span 2; }
    .institution-name { font-size: clamp(1.2rem, 3.2vw, 1.6rem); }
}

@media (max-width: 768px) {
    .grid-headers {
        display: none;
    }
    .bento-grid { grid-template-columns: 1fr; gap: 2rem; }
    .card-ggiss, .card-ggic, .card-cosmos, .card-acem { grid-column: span 1; grid-row: span 1; padding: 3.5rem; }
    .institution-name { font-size: clamp(1.15rem, 4.5vw, 1.45rem); }
    .footer-inner { flex-direction: column; gap: 5rem; text-align: center; }
}

@media (max-height: 820px) {
    .bento-grid {
        max-height: none;
        height: auto;
        min-height: 520px;
    }
}


/* --- Premium Custom Entertaining Cursor --- */
@media (pointer: fine) {
    body {
        cursor: none;
    }
    
    a, button, [role="button"], .card, .social-link {
        cursor: none !important;
    }

    .custom-cursor-dot {
        position: fixed;
        top: 0;
        left: 0;
        width: 12px;
        height: 12px;
        border-radius: 50%;
        pointer-events: none;
        z-index: 9999;
        opacity: 0;
        background-color: var(--teal);
        box-shadow: 0 0 10px rgba(0, 149, 169, 0.4);
        transition: opacity 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
    }

    .custom-cursor-visible {
        opacity: 1;
    }

    /* Brand color overrides for hover states */
    body.hover-ggiss .custom-cursor-dot { 
        background-color: var(--teal); 
        box-shadow: 0 0 14px rgba(0, 149, 169, 0.7);
    }
    body.hover-ggic .custom-cursor-dot { 
        background-color: var(--gold); 
        box-shadow: 0 0 14px rgba(253, 182, 14, 0.7);
    }
    body.hover-cosmos .custom-cursor-dot { 
        background-color: #C4161B; 
        box-shadow: 0 0 14px rgba(196, 22, 27, 0.7);
    }
    body.hover-acem .custom-cursor-dot { 
        background-color: #2A429D; 
        box-shadow: 0 0 14px rgba(42, 66, 157, 0.7);
    }
}