/* Modern Style for Where Grains Meet - Enhanced */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Montserrat:wght@400;600;700&display=swap');

:root {
    --primary-color: #0e7490;
    /* Cyan 700 - Deep Teal */
    --secondary-color: #0891b2;
    /* Cyan 600 */
    --accent-color: #f59e0b;
    /* Amber 500 */
    --dark-bg: #0f172a;
    /* Slate 900 */
    --light-bg: #f8fafc;
    /* Slate 50 */
    --text-color: #334155;
    /* Slate 700 */
    --heading-color: #1e293b;
    /* Slate 800 */
    --white: #ffffff;
    --card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --hover-shadow: 0 25px 50px -12px rgba(14, 116, 144, 0.25);
    /* Colored shadow for dynamic feel */
}

html {
    scroll-behavior: smooth;
}

/* Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-color);
    background-color: var(--light-bg);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Grain Overlay for Texture */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.03;
    pointer-events: none;
    z-index: 9999;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Montserrat', sans-serif;
    color: var(--heading-color);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

a {
    text-decoration: none;
    transition: all 0.3s ease;
    color: inherit;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section-padding {
    padding: 80px 0;
}

.text-center {
    text-align: center;
}

.grid {
    display: grid;
    gap: 30px;
}

@media (min-width: 768px) {
    .grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Centering hanging items in grid */
    .grid:has(> *:last-child:nth-child(odd)) {
        justify-content: center;
    }
}

/* Enhanced Grid with Flex fallback for centering */
.team-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: center;
}

.team-grid .card {
    flex: 0 1 calc(50% - 15px);
    min-width: 300px;
}

@media (max-width: 768px) {
    .team-grid .card {
        flex: 1 1 100%;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 1s cubic-bezier(0.19, 1, 0.22, 1), transform 1s cubic-bezier(0.19, 1, 0.22, 1);
}

.fade-in-up.active {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered text reveal */
.reveal-text {
    opacity: 0;
    clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
    transition: opacity 0.8s ease, clip-path 1.2s cubic-bezier(0.19, 1, 0.22, 1);
}

.reveal-text.active {
    opacity: 1;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}

/* Header Reveal Effect */
h1.active,
h2.active {
    animation: revealEffect 1.2s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

@keyframes revealEffect {
    from {
        clip-path: inset(0 100% 0 0);
    }

    to {
        clip-path: inset(0 0 0 0);
    }
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: transparent;
    backdrop-filter: blur(0px);
    padding: 25px 0;
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    padding: 15px 0;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.6rem;
    font-weight: 800;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
    text-transform: uppercase;
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-link {
    font-weight: 500;
    color: var(--heading-color);
    position: relative;
    padding: 5px 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.nav-link:hover {
    color: var(--primary-color);
}

/* Hero Section Refined */
.hero-slider-container {
    position: relative;
    height: 80vh;
    min-height: 550px;
    width: 100%;
    overflow: hidden;
    margin-top: 0;
    /* Let it start behind transparent nav */
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1.2s ease-in-out, transform 8s ease-out;
    background-size: cover;
    background-position: center;
    z-index: 1;
}

.hero-slide.active {
    opacity: 1;
    z-index: 2;
    transform: scale(1.08);
    /* Stronger zoom */
}

/* More dramatic gradient for text pop */
.hero-slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.4) 60%, rgba(0, 0, 0, 0.7) 100%);
    z-index: 3;
}

.hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
    color: var(--white);
    width: 90%;
    max-width: 1000px;
    padding: 40px 20px;
    /* Added vertical padding */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: 50px;
    /* Offset for better balance */
}

.hero-content h1 {
    font-size: clamp(2.5rem, 8vw, 5rem);
    color: var(--white) !important;
    margin-bottom: 20px;
    text-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 0, 0, 0.4);
    letter-spacing: -2px;
    line-height: 0.9;
    font-weight: 900;
    text-transform: uppercase;
}

.hero-content p {
    font-size: clamp(1.1rem, 3vw, 1.6rem);
    margin-bottom: 40px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    text-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    line-height: 1.3;
    max-width: 800px;
}

/* Slider Dots - Explicit Visibility */
.slider-dots {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    z-index: 100;
    /* Above everything */
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.4s ease;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.dot.active {
    background: var(--white);
    transform: scale(1.4);
    border-color: var(--white);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
}

/* Hero Button explicit visibility */
.hero-content .btn {
    margin-top: 10px;
    padding: 20px 50px;
    min-width: 250px;
    position: relative;
    z-index: 15;
}

/* Redesigned button */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 18px 42px;
    background: var(--primary-color);
    color: var(--white);
    font-weight: 700;
    border-radius: 100px;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    border: 2px solid var(--primary-color);
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(14, 116, 144, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
}

.btn:hover {
    background: transparent;
    color: var(--white);
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(14, 116, 144, 0.4);
}

/* Cards Section */
.card-link-wrapper {
    display: block;
    color: inherit;
    text-decoration: none !important;
    height: 100%;
}

.card-link-wrapper:hover {
    color: inherit;
    text-decoration: none !important;
}

.card {
    background: var(--white);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.6s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.card:hover {
    transform: translateY(-12px) scale(1.02) rotateX(2deg);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.12);
    border-color: rgba(14, 116, 144, 0.2);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
    z-index: 2;
}

.card:hover::before {
    transform: translateX(100%);
}

.card-img-wrapper {
    height: 240px;
    overflow: hidden;
    position: relative;
}

.card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 25%;
    /* Slightly higher focus for general portraits */
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* Portrait Focus Overrides */
.focus-top {
    object-position: center 10% !important;
}

.focus-high {
    object-position: center 25% !important;
}

.focus-mid {
    object-position: center 35% !important;
}

.focus-center {
    object-position: center 50% !important;
}

.focus-low {
    object-position: center 75% !important;
}

.focus-bottom {
    object-position: center 100% !important;
}

.focus-v-low {
    object-position: center 90% !important;
}

.card-img-wrapper img:hover {
    transform: scale(1.1);
}

.card-body {
    padding: 30px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 1.4rem;
    color: var(--heading-color);
    margin-bottom: 15px;
    font-weight: 700;
}

.card-text {
    font-size: 1rem;
    color: var(--text-color);
    margin-bottom: 20px;
    flex-grow: 1;
    line-height: 1.7;
}

.read-more-indicator {
    color: var(--primary-color);
    font-weight: 600;
    margin-top: auto;
    display: flex;
    align-items: center;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.card:hover .read-more-indicator {
    opacity: 1;
}

.read-more-indicator::after {
    content: '→';
    margin-left: 8px;
    transition: transform 0.3s ease;
}

.card:hover .read-more-indicator::after {
    transform: translateX(8px);
}

/* Contact Section Styling Fixes */
.contact-section {
    background-color: var(--dark-bg);
    color: var(--white);
}

.contact-section .section-title,
.contact-section h2,
.contact-section h3,
.contact-section p {
    color: var(--white) !important;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 16px;
    margin-bottom: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    /* Subtle dark background */
    color: var(--white);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
}

/* News Section Fixes */
.testimonial-img {
    height: 350px;
    width: 100%;
    object-fit: cover;
    /* Use cover for identical size */
    object-position: center;
    background: #f1f5f9;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.testimonial-item {
    padding: 0 15%;
    max-width: 1000px;
    margin: 0 auto;
}

.testimonial-author {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.testimonial-text {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-color);
}

/* Footer */
footer {
    background-color: #020617;
    /* Slate 950 */
    color: #94a3b8;
    /* Slate 400 */
    padding: 60px 0;
    font-size: 0.95rem;
}

footer a {
    color: var(--white);
    opacity: 0.7;
    transition: opacity 0.3s;
}

footer a:hover {
    opacity: 1;
    color: var(--primary-color);
    text-decoration: none;
}

/* Reveal animations */
.reveal {
    mask-image: linear-gradient(to right, black 50%, transparent 50%);
    mask-size: 200% 100%;
    mask-position: 100% 0;
    transition: mask-position 0.8s ease-out;
}

.reveal.active {
    mask-position: 0 0;
}

/* Institutional Support Section */
.institutional-support {
    padding: 40px 0;
    background: #fff;
    border-top: 1px solid #f1f5f9;
}

.support-logos {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 60px;
    filter: grayscale(1);
    opacity: 0.6;
    transition: all 0.4s ease;
}

.support-logos:hover {
    filter: grayscale(0);
    opacity: 1;
}

.support-logo {
    height: 60px;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }

    .hero-slider-container {
        height: 60vh;
    }

    .hero-content h1 {
        font-size: 2.2rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    .nav-links {
        display: none;
    }

    .section-padding {
        padding: 60px 0;
    }

    .grid {
        gap: 20px;
    }

    .testimonial-item {
        padding: 0 20px;
    }
}