/* =========================================================
   1. GLOBAL VARIABLES & RESET
   ========================================================= */
:root {
    --bg-dark: #02040a;
    --text-light: #ffffff;
    --accent-gold: #d4af37;
    --accent-blue: #8ab4f8;
    --font-serif: 'Playfair Display', serif;
    --font-sans: 'Inter', sans-serif;
}
body.team-page-body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-dark);
    color: var(--text-light);
    font-family: var(--font-sans);
    overflow-x: hidden;
    position: relative;
}
body.no-scroll {
    overflow: hidden;
}

/* =========================================================
   2. BACKGROUND EFFECTS (Meteors, Glow & Photo)
   ========================================================= */
.team-bg-photo {
    position: absolute !important;
    top: 0;
    left: 0;
    width: 100%;
    height: 120vh;
    background-size: cover;
    background-position: center 15%;
    background-repeat: no-repeat;
    opacity: 0.15 !important;
    z-index: 0;
    pointer-events: none;
    -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 40%, rgba(0,0,0,0) 90%);
    mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 40%, rgba(0,0,0,0) 90%);
}
.background-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    pointer-events: none;
}
.ambient-glow {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80vw;
    height: 80vh;
    background: radial-gradient(circle, rgba(138, 180, 248, 0.03) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
}
.horizon-glow {
    position: fixed;
    bottom: -150px;
    left: 50%;
    transform: translateX(-50%);
    width: 150vw;
    height: 300px;
    background: radial-gradient(
        50% 50% at 50% 100%,
        rgba(212, 175, 55, 0.3) 0%,
        rgba(255, 120, 0, 0.15) 40%,
        rgba(2, 4, 10, 0) 80%
    );
    z-index: -1;
    pointer-events: none;
    filter: blur(40px);
    opacity: 0.8;
}
.horizon-glow::after {
    content: '';
    position: absolute;
    bottom: 150px;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent 10%, rgba(212, 175, 55, 0.5) 50%, transparent 90%);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.8);
}

/* =========================================================
   3. HERO SECTION
   ========================================================= */
.team-hero {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    z-index: 1;
}
.subtitle {
    font-size: 12px;
    letter-spacing: 6px;
    color: var(--accent-blue);
    margin-bottom: 20px;
    text-transform: uppercase;
}
.team-title {
    font-family: var(--font-serif);
    font-size: clamp(3rem, 6vw, 6rem);
    font-weight: 700;
    line-height: 1.1;
    margin: 0 0 20px 0;
}
.highlight {
    background: linear-gradient(90deg, #fff, var(--accent-gold));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.team-manifesto {
    font-size: 1.1rem;
    color: #a0aabf;
    max-width: 600px;
    line-height: 1.6;
}
.scroll-prompt {
    position: absolute;
    bottom: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    font-size: 10px;
    letter-spacing: 3px;
    color: rgba(255, 255, 255, 0.5);
}
.scroll-line {
    width: 1px;
    height: 60px;
    background: linear-gradient(to bottom, rgba(255,255,255,0.5), transparent);
    animation: scrollPulse 2s infinite;
}
@keyframes scrollPulse {
    0% { transform: scaleY(0); transform-origin: top; opacity: 1; }
    50% { transform: scaleY(1); transform-origin: top; opacity: 1; }
    51% { transform: scaleY(1); transform-origin: bottom; opacity: 1; }
    100% { transform: scaleY(0); transform-origin: bottom; opacity: 0; }
}

/* =========================================================
   4. ABOUT US SECTION (Tightened Spacing, No Watermark)
   ========================================================= */
.foundation-initiative-section {
    position: relative;
    z-index: 10;
    padding: 40px 5% 0px 5%; /* Top 40, Bottom 0 */
    max-width: 1200px;
    margin: 0 auto;
    clear: both;
    display: block;
}

.initiative-container {
    position: relative;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 45px 60px; 
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    text-align: center;
    overflow: hidden;
    margin-bottom: 0;
}

.initiative-content {
    position: relative;
    z-index: 2;
}

.foundation-heading {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    color: #ffffff;
    margin-top: 0;
    margin-bottom: 10px;
    font-weight: 700;
}

.foundation-divider {
    width: 60px;
    height: 2px;
    background: var(--accent-gold); 
    margin: 0 auto 25px auto; 
}

.initiative-text {
    font-family: var(--font-sans);
    font-size: 1.1rem;
    line-height: 1.7;
    color: #d4d4d8;
    font-weight: 300;
    margin-bottom: 25px; 
    text-align: justify;
    text-align-last: center; 
}

.foundation-footer-branding {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
    padding-top: 25px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.foundation-footer-branding img {
    height: 65px;
    transition: transform 0.3s ease;
}

.foundation-footer-branding img:hover {
    transform: scale(1.05);
}

.initiative-tag {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.8rem;
    color: var(--accent-gold);
    letter-spacing: 3px;
    text-transform: uppercase;
    font-weight: 600;
}

@media (max-width: 768px) {
    .foundation-initiative-section { padding: 20px 5% 0px 5%; }
    .initiative-container { padding: 30px 20px; }
    .foundation-heading { font-size: 2rem; }
    .initiative-text { font-size: 0.95rem; text-align: left; text-align-last: left; }
    .foundation-footer-branding img { height: 50px; }
    .initiative-tag { font-size: 0.65rem; letter-spacing: 2px; }
}

/* =========================================================
   5. TEAM SHOWCASE (Slider)
   ========================================================= */
.team-showcase {
    /* 🌟 FIX: Reduced padding to eliminate dead space 🌟 */
    padding: 30px 0 80px 0; 
    width: 100vw;
    overflow: hidden;
    position: relative;
    background: transparent;
    z-index: 5;
}
.showcase-header {
    text-align: center;
    /* 🌟 FIX: Reduced margin to tighten header to the cards 🌟 */
    margin-bottom: 30px; 
}
.section-heading {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    margin: 0 0 20px 0;
    color: #fff;
}
.heading-line {
    width: 60px;
    height: 2px;
    background: var(--accent-gold);
    margin: 0 auto;
}
.team-showcase::before,
.team-showcase::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 10vw;
    z-index: 10;
    pointer-events: none;
}
.team-showcase::before { left: 0; background: linear-gradient(to right, var(--bg-dark), transparent); }
.team-showcase::after { right: 0; background: linear-gradient(to left, var(--bg-dark), transparent); }
.team-slider-container {
    display: flex;
    align-items: center;
    gap: 2.5rem;
    overflow-x: auto;
    padding: 20px 5vw 40px 5vw;
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
    user-select: none;
}
.team-slider-container::-webkit-scrollbar { display: none; }
.team-slider-container:active { cursor: grabbing; }
.royal-card {
    width: 320px;
    height: 480px;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
}
.card-frame {
    width: 100%; height: 100%; position: relative; overflow: hidden;
    background: var(--bg-dark);
    border: 1px solid rgba(212, 175, 55, 0.15); border-radius: 4px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.8);
    transition: border-color 0.5s ease, transform 0.5s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.5s ease;
    pointer-events: none;
}
.card-frame::before {
    content: ''; position: absolute; inset: 10px; border: 1px solid rgba(212, 175, 55, 0); z-index: 2;
    transition: border-color 0.5s ease, inset 0.5s ease; pointer-events: none;
}
.royal-card:hover .card-frame {
    border-color: rgba(212, 175, 55, 0.8);
    transform: translateY(-10px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.9), 0 0 30px rgba(212, 175, 55, 0.15);
}
.royal-card:hover .card-frame::before { border-color: rgba(212, 175, 55, 0.4); inset: 15px; }
.card-image {
    width: 100%; height: 100%;
    object-fit: cover;
    object-position: center 15%;
    filter: grayscale(100%) brightness(0.6) contrast(1.2);
    transition: filter 0.8s ease, transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
    position: relative;
    z-index: 1;
}
.royal-card:hover .card-image { filter: grayscale(0%) brightness(1) contrast(1.05); transform: scale(1.08); }
.card-overlay {
    position: absolute; inset: 0; z-index: 20; display: flex; flex-direction: column; justify-content: flex-end;
    padding: 40px 30px;
    background: linear-gradient(to top, rgba(2, 4, 10, 1) 0%, rgba(2, 4, 10, 0.95) 25%, rgba(2, 4, 10, 0.5) 50%, transparent 100%);
    opacity: 0; transition: opacity 0.5s ease; pointer-events: auto;
}
.royal-card:hover .card-overlay { opacity: 1; }
.member-name { font-family: var(--font-serif); font-size: 1.8rem; font-weight: 700; color: #fff; margin: 0; transform: translateY(20px); transition: transform 0.5s ease; position: relative; z-index: 30;}
.member-role { font-family: 'Montserrat', sans-serif; font-size: 0.8rem; letter-spacing: 2px; text-transform: uppercase; color: var(--accent-gold); margin: 5px 0 0 0; transform: translateY(20px); transition: transform 0.5s ease 0.05s; font-weight: 500; position: relative; z-index: 30;}
.royal-card:hover .member-name, .royal-card:hover .member-role { transform: translateY(0); }
.card-actions { display: flex; gap: 10px; margin-top: 15px; transform: translateY(20px); opacity: 0; transition: transform 0.5s ease 0.1s, opacity 0.5s ease 0.1s; position: relative; z-index: 30;}
.royal-card:hover .card-actions { transform: translateY(0); opacity: 1; }
.view-details-btn { background: transparent; border: 1px solid var(--accent-gold); color: var(--accent-gold); padding: 8px 15px; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; cursor: pointer; transition: all 0.3s ease; font-family: var(--font-sans); flex-grow: 1; pointer-events: auto; }
.view-details-btn:hover { background: var(--accent-gold); color: #000; }
.linkedin-btn { display: flex; align-items: center; justify-content: center; background: transparent; border: 1px solid rgba(255,255,255,0.3); color: #fff; width: 36px; height: 36px; border-radius: 2px; transition: all 0.3s ease; pointer-events: auto; }
.linkedin-btn:hover { border-color: #0077b5; color: #0077b5; background: rgba(255,255,255,0.05); }

/* =========================================================
   6. CAREERS CTA
   ========================================================= */
.careers-cta { padding: 120px 20px; text-align: center; position: relative; z-index: 1; }
.cta-content { max-width: 800px; margin: 0 auto; }
.cta-title { font-family: var(--font-serif); font-size: 3rem; margin: 0 0 20px 0; color: #fff; }
.cta-text { color: #a0aabf; font-size: 1.1rem; line-height: 1.6; margin-bottom: 40px; }
.btn-primary { display: inline-block; padding: 15px 40px; font-size: 0.9rem; letter-spacing: 2px; text-transform: uppercase; color: #000; background: var(--accent-gold); text-decoration: none; border-radius: 4px; font-weight: 600; transition: all 0.3s ease; }
.btn-primary:hover { background: #fff; transform: scale(1.05); box-shadow: 0 10px 20px rgba(212, 175, 55, 0.2); }
.team-footer { text-align: center; padding: 0 50px 50px 50px; position: relative; z-index: 1; }
.footer-divider { width: 100%; height: 1px; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent); margin-bottom: 30px; }
.back-home-link { color: var(--accent-blue); text-decoration: none; font-size: 14px; letter-spacing: 2px; text-transform: uppercase; transition: color 0.3s; }
.back-home-link:hover { color: #fff; }

/* =========================================================
   7. TEAM MODAL
   ========================================================= */
.team-modal {
    position: fixed; inset: 0; z-index: 10000;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    perspective: 1500px;
}
.team-modal.active { opacity: 1; visibility: visible; }
.modal-backdrop {
    position: absolute; inset: 0;
    background: radial-gradient(circle at center, rgba(2, 4, 10, 0.75) 0%, rgba(2, 4, 10, 0.95) 100%);
    backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px); cursor: pointer;
}
.modal-content {
    position: relative; z-index: 1;
    width: 90%; max-width: 900px;
    border-radius: 8px;
    box-shadow: 0 35px 60px rgba(0,0,0,0.9), 0 0 50px rgba(212, 175, 55, 0.15);
    overflow: hidden; padding: 2px; background: transparent;
    transform-origin: top center; transform: rotateX(-70deg) translateY(-50px) scale(0.9);
    opacity: 0; transition: transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.5s ease;
}
.team-modal.active .modal-content { transform: rotateX(0deg) translateY(0) scale(1); opacity: 1; }
.modal-content::before {
    content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
    background: conic-gradient(transparent 70%, rgba(212, 175, 55, 1) 100%);
    animation: borderSpin 4s linear infinite; z-index: 0;
}
@keyframes borderSpin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.modal-body {
    position: relative; z-index: 1; display: flex; flex-direction: column;
    height: auto; background: linear-gradient(145deg, rgba(15,15,18,0.98), rgba(5,5,7,0.98));
    border-radius: 6px; overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05), inset 0 10px 30px rgba(0,0,0,0.8);
}
@media (min-width: 768px) { .modal-body { flex-direction: row; height: 500px; } }
.close-modal {
    position: absolute; top: 15px; right: 20px; background: none; border: none; color: rgba(255,255,255,0.5);
    font-size: 2.5rem; font-weight: 300; cursor: pointer; z-index: 20; transition: color 0.3s, transform 0.3s; line-height: 1;
}
.close-modal:hover { color: var(--accent-gold); transform: rotate(90deg); }
.modal-image-container { flex: 0 0 45%; height: 300px; position: relative; z-index: 10; }
@media (min-width: 768px) { .modal-image-container { height: 100%; } }
.modal-image-container::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to right, transparent, rgba(5,5,7,1)); }
@media (max-width: 767px) { .modal-image-container::after { background: linear-gradient(to bottom, transparent, rgba(5,5,7,1)); } }
.modal-image-container img { width: 100%; height: 100%; object-fit: cover; object-position: center 15%; filter: grayscale(40%); }
.modal-info {
    padding: 35px 45px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    overflow: hidden;
    position: relative;
    z-index: 1;
}
.modal-info::before {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 150%; height: 150%;
    transform: translate(-50%, -50%);
    background-image: url("data:image/svg+xml,%3Csvg width='500' height='500' viewBox='0 0 500 500' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='250' cy='250' r='200' fill='none' stroke='%23d4af37' stroke-width='1' stroke-dasharray='4 12'/%3E%3Ccircle cx='250' cy='250' r='150' fill='none' stroke='%23d4af37' stroke-width='0.5'/%3E%3Ccircle cx='250' cy='250' r='100' fill='none' stroke='%23d4af37' stroke-width='1' stroke-dasharray='20 10 5 10'/%3E%3Cpath d='M250 50 L250 450 M50 250 L450 250' stroke='%23d4af37' stroke-width='0.5' opacity='0.3'/%3E%3Ccircle cx='250' cy='250' r='2' fill='%23d4af37'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.08;
    z-index: -2;
    animation: slowRotateBg 120s linear infinite;
    pointer-events: none;
}
@keyframes slowRotateBg {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}
#modal-bg-icon-layer {
    position: absolute;
    bottom: -30px;
    right: -20px;
    width: 320px;
    height: 320px;
    opacity: 0.05 !important;
    z-index: 0;
    pointer-events: none;
    color: var(--accent-gold);
}
#modal-bg-icon-layer svg {
    width: 100%;
    height: 100%;
    stroke-width: 0.1px;
    fill: none;
}
.modal-info .member-name,
.modal-info .member-role,
.modal-info .modal-data-grid {
    position: relative;
    z-index: 10;
    text-shadow: 0 2px 10px rgba(0,0,0,0.9);
}
.modal-info .member-name {
    font-size: 2.2rem;
    line-height: 1.1;
    margin-bottom: 2px;
    transform: none;
    font-family: var(--font-serif);
    flex-shrink: 0;
    position: relative; z-index: 2;
}
.modal-info .member-role {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.75rem;
    margin-bottom: 6px;
    transform: none;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--accent-gold);
    font-weight: 600;
    flex-shrink: 0;
    position: relative; z-index: 2;
}
.modal-info .royal-divider {
    border: none;
    border-top: 1px solid rgba(212, 175, 55, 0.3);
    margin: 5px 0 15px 0;
    width: 50px;
    flex-shrink: 0;
}
.modal-data-grid {
    display: flex; flex-direction: column;
    gap: 12px;
    margin-top: 0;
    margin-bottom: 15px;
    overflow-y: auto;
    flex-grow: 1;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-gold) rgba(255,255,255,0.05);
    padding-right: 10px;
    position: relative; z-index: 2;
}
.modal-data-grid::-webkit-scrollbar { width: 4px; }
.modal-data-grid::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.05); border-radius: 4px; }
.modal-data-grid::-webkit-scrollbar-thumb { background: var(--accent-gold); border-radius: 4px; }
.data-group { display: flex; flex-direction: column; gap: 4px; }
.data-label {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.7rem; font-family: var(--font-sans);
    letter-spacing: 2px; color: var(--accent-gold); opacity: 0.9; font-weight: 700;
    flex-shrink: 0;
}
.data-value {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.95rem;
    color: #d4d4d8;
    line-height: 1.5;
    font-weight: 400;
    letter-spacing: 0.3px;
}
.modal-info > * { opacity: 0; transform: translateY(15px); transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.165, 0.84, 0.44, 1); }
.team-modal.active .modal-info > * { opacity: 1; transform: translateY(0); }
.team-modal.active .modal-info .member-name { transition-delay: 0.2s; }
.team-modal.active .modal-info .member-role { transition-delay: 0.25s; }
.team-modal.active .modal-info .royal-divider { transition-delay: 0.3s; }
.team-modal.active .modal-info .modal-data-grid { transition-delay: 0.35s; }
.team-modal.active .modal-info .modal-linkedin-btn { transition-delay: 0.4s; }
.modal-linkedin-btn {
    margin-top: auto;
    flex-shrink: 0; padding: 10px 20px;
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 0.75rem; width: max-content;
    text-transform: uppercase; letter-spacing: 2px; font-weight: 700;
    text-decoration: none; color: #000; background: var(--accent-gold);
    border-radius: 4px; transition: all 0.3s ease;
    position: relative; overflow: hidden; z-index: 2;
}
.modal-linkedin-btn:hover { background: #fff; box-shadow: 0 5px 15px rgba(212, 175, 55, 0.4); transform: translateY(-2px); }
.modal-linkedin-btn::after {
    content: ''; position: absolute; top: 0; left: -100%; width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent);
    transform: skewX(-25deg); animation: btnShine 4s infinite;
}
@keyframes btnShine { 0% { left: -100%; opacity: 0; } 10% { opacity: 1; } 20% { left: 200%; opacity: 0; } 100% { left: 200%; opacity: 0; } }

@media (max-width: 1024px) {
    .pillars-container { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .pillars-container { grid-template-columns: 1fr; }
    .royal-card { width: 280px; height: 420px; }
    .cta-title { font-size: 2.2rem; }
    .modal-content { width: 95%; max-height: 85vh; }
    .modal-body { display: block; max-height: 85vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
    .modal-image-container { height: 300px; width: 100%; flex-shrink: 0; }
    .modal-info { padding: 25px 20px 40px 20px; height: auto; overflow: visible; }
    .modal-info .member-name { font-size: 1.8rem; }
    .modal-data-grid { max-height: none; overflow-y: visible; }
    .team-bg-photo { height: 100vh; background-size: 200% auto; background-position: center 10%; -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 15%, rgba(0,0,0,0) 65%); mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 15%, rgba(0,0,0,0) 65%); }
}