@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #004c6d;
    --secondary-color: #007a3d;
    --accent-color: #00a26d;
    --accent-hover: #00c285;
    --heading-color: #4aba91;
    --dark-bg: #10151a;
    --card-bg: #1b2833;
    --text-color: #ffffff;
    --text-secondary: #e3e8ee;
    --transition-smooth: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    --transition-fast: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --transition-bounce: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.15);
    --shadow-strong: 0 15px 40px rgba(0, 0, 0, 0.25);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', 'Inter', sans-serif;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 2rem;
}

body {
    min-height: 100vh;
    background: var(--dark-bg);
    color: var(--text-color);
    line-height: 1.6;
}

/* Main container styles */
section {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 76, 109, 0.97), rgba(16, 21, 26, 0.95));
    overflow-y: auto;
    scroll-behavior: smooth;
    perspective: 1000px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Close button */
.x-btn {
    position: fixed;
    top: 18px;
    right: 18px;
    background: rgba(0, 0, 0, 0.3);
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
    z-index: 100;
}

.x-btn:hover {
    background: rgba(0, 0, 0, 0.5);
    transform: rotate(90deg);
}

/* Header section */
.header-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 3rem;
    animation: fadeIn 1s ease-out;
}

.header-image {
    width: 100%;
    max-width: 800px;
    height: auto;
    border-radius: 12px;
    box-shadow: var(--shadow-soft);
    margin-bottom: 2rem;
    transition: var(--transition-bounce);
    transform: perspective(1000px) rotateX(0deg) translateY(0);
    will-change: transform, box-shadow;
}

.header-image:hover {
    transform: perspective(1000px) rotateX(2deg) translateY(-5px);
    box-shadow: var(--shadow-strong);
}

/* Award badge overlay for header images */
.header-image-wrap {
    position: relative;
    display: inline-block;
}

.award-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-weight: 800;
    letter-spacing: 0.3px;
    font-size: 0.95rem;
    color: #d1f7ee;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(22,34,44,0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.25);
    z-index: 2;
}

.award-badge.gold { color:#ffe8a3; border-color: rgba(255,232,163,.35); }
.award-badge.silver { color:#d7e3ff; border-color: rgba(215,227,255,.35); }
.award-badge.bronze { color:#ffd0a3; border-color: rgba(255,208,163,.25); }

@media (max-width: 480px) {
    .award-badge {
        font-size: 0.85rem;
        padding: 0.25rem 0.6rem;
        top: 8px;
        right: 8px;
    }
}

.header-section h1 {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1.5rem;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Description section */
.description-section {
    margin-bottom: 4rem;
    background: rgba(27, 40, 51, 0.7);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    animation: slideUp 1s ease-out;
}

.description-section h2 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    text-align: center;
    color: var(--heading-color);
}

.description-text {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 2rem;
    color: var(--text-secondary);
    text-align: justify;
}

/* Timeline section */
.timeline-section {
    margin-bottom: 4rem;
    animation: fadeIn 1.5s ease-out;
    position: relative;
}

.timeline-section h2 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 2.5rem;
    text-align: center;
    color: var(--heading-color);
}

.timeline {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
    padding: 2rem 0;
    overflow-x: hidden;
    padding: 2rem 1rem;
}

/* Timeline is now integrated with the page flow for all devices */

/* Timeline connector */
.timeline::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(to bottom, 
        rgba(0, 76, 109, 0.2), 
        rgba(0, 122, 61, 0.8), 
        rgba(0, 76, 109, 0.2));
    border-radius: 4px;
    z-index: 0;
}

/* Mobile-specific timeline connector adjustments */
@media (max-width: 768px) {
    .timeline::after {
        width: 3px; /* Slightly thinner line on mobile */
    }
    
    /* Ensure the connector extends through all items */
    .timeline-section {
        position: relative;
    }
}

/* Enhanced mobile timeline experience */
@media (max-width: 768px) {
    /* Adjust timeline connector for better mobile display */
    .timeline::after {
        left: 20px; /* Move connector to the left side */
        width: 4px; /* Slightly thicker line for better visibility */
        background: linear-gradient(to bottom, 
            rgba(0, 76, 109, 0.3), 
            rgba(0, 194, 133, 0.9), 
            rgba(0, 76, 109, 0.3)); /* Enhanced gradient */
        box-shadow: 0 0 10px rgba(0, 194, 133, 0.3); /* Subtle glow effect */
    }
    
    /* Adjust timeline markers for left-aligned layout */
    .timeline-item::before {
        left: 20px;
        transform: translate(0, -50%) rotate(45deg);
        width: 14px;
        height: 14px;
    }
    
    /* Adjust timeline items for left-aligned layout */
    .timeline-item {
        padding-left: 50px; /* Add padding to accommodate left-aligned connector */
        align-items: flex-start; /* Align items to the left */
    }
    
    /* Improve spacing and flow for mobile */
    .timeline-section {
        padding: 0 0.5rem 2rem 0.5rem; /* Add bottom padding */
    }
}

/* Small screen timeline adjustments */
@media (max-width: 480px) {
    .timeline::after {
        left: 15px; /* Further adjust for very small screens */
    }
    
    .timeline-item::before {
        left: 15px;
        width: 12px;
        height: 12px;
    }
    
    .timeline-item {
        padding-left: 40px; /* Adjust padding for very small screens */
    }
}

.timeline-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 6rem;
    opacity: 0.4;
    transform: translateY(60px) scale(0.92);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.6s ease;
    width: 100%;
    position: relative;
    z-index: 1;
    will-change: transform, opacity;
    /* Performance optimizations */
    contain: layout style; /* Isolate layout and style changes */
    backface-visibility: hidden; /* Reduce composite layers */
}

.timeline-item::before {
    content: '';
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    width: 16px;
    height: 16px;
    border-radius: 2px;
    background: var(--accent-color);
    border: 2px solid var(--dark-bg);
    z-index: 2;
    transition: var(--transition-smooth);
    box-shadow: 0 0 8px rgba(0, 162, 109, 0.6);
}

.timeline-img {
    width: 80%;
    max-width: 600px;
    height: 350px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    background: var(--card-bg);
    margin-bottom: 1.5rem;
    transform: perspective(1000px) rotateY(0deg) translateZ(0);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), 
                box-shadow 0.3s ease;
    will-change: transform;
    position: relative;
    display: block;
    cursor: zoom-in;
    /* Performance optimizations */
    contain: content;
    backface-visibility: hidden;
    transform-style: preserve-3d; /* Better 3D performance */
}

.timeline-img::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 76, 109, 0.2), transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
    /* Avoid creating a new stacking context */
    will-change: opacity;
    pointer-events: none;
}

.timeline-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
    transform: scale(1);
    /* Optimize image rendering */
    image-rendering: auto;
    backface-visibility: hidden;
}

.timeline-content {
    width: 80%;
    max-width: 600px;
    padding: 1.5rem 2rem;
    background: var(--card-bg);
    border-radius: 12px;
    position: relative;
    color: var(--text-secondary);
    text-align: center;
    z-index: 1;
    box-shadow: var(--shadow-soft);
    transform: perspective(1000px) rotateX(0deg) translateY(0);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.3s ease;
    will-change: transform;
    /* Performance optimizations */
    contain: content;
    backface-visibility: hidden;
}

/* Mobile-specific timeline item styling */
@media (max-width: 768px) {
    .timeline-item {
        margin-bottom: 4rem; /* Reduced spacing between items */
    }
    
    .timeline-img {
        width: 90%;
        height: auto;
        aspect-ratio: 16/9; /* Maintain aspect ratio instead of fixed height */
    }
    
    .timeline-content {
        width: 90%;
        padding: 1.25rem 1.5rem;
    }
    
    /* Improve spacing and flow for mobile */
    .timeline-section {
        padding: 0 0.5rem;
    }
    
}

.timeline-content h3 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: var(--accent-hover);
}

.timeline-content p {
    font-size: 1.05rem;
}

/* Timeline item hover and active states */
.timeline-item:hover .timeline-img {
    transform: perspective(1000px) rotateY(-2deg) translateZ(10px);
    box-shadow: var(--shadow-strong);
}

.timeline-item:hover .timeline-img::after {
    opacity: 1;
}

.timeline-item:hover .timeline-img img {
    transform: scale(1.05);
}

.timeline-item:hover .timeline-content {
    transform: perspective(1000px) rotateX(2deg) translateY(-5px);
    box-shadow: var(--shadow-strong);
}

.timeline-item:hover::before {
    background: var(--accent-hover);
    transform: translate(-50%, -50%) rotate(45deg) scale(1.2);
    box-shadow: 0 0 15px rgba(0, 162, 109, 0.8);
}

.timeline-item.show {
    opacity: 0.8;
}

.timeline-item.active {
    opacity: 1;
    transform: translateY(0) scale(1.02);
    z-index: 5;
    filter: brightness(1.1);
}

.timeline-item.active .timeline-img {
    box-shadow: var(--shadow-strong);
    transform: perspective(1000px) rotateY(-3deg) translateZ(15px);
}

.timeline-item.active .timeline-img::after {
    opacity: 0.8;
    background: linear-gradient(135deg, rgba(0, 194, 133, 0.3), transparent 70%);
}

.timeline-item.active .timeline-content {
    box-shadow: var(--shadow-strong);
    transform: perspective(1000px) rotateX(3deg) translateY(-8px);
}

.timeline-item.active::before {
    background: var(--accent-hover);
    transform: translate(-50%, -50%) rotate(45deg) scale(1.5);
    box-shadow: 0 0 25px rgba(0, 194, 133, 0.9);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 25px rgba(0, 194, 133, 0.9);
    }
    50% {
        box-shadow: 0 0 35px rgba(0, 194, 133, 0.7);
    }
    100% {
        box-shadow: 0 0 25px rgba(0, 194, 133, 0.9);
    }
}

/* Team section */
.team-section {
    margin-bottom: 4rem;
    animation: slideUp 2s ease-out;
}

.team-section h2 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 3rem;
    text-align: center;
    color: var(--heading-color);
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2.5rem;
    justify-items: center;
}

.team-member {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: var(--transition-bounce);
    transform: translateY(0);
    will-change: transform;
    position: relative;
}

.team-member:hover {
    transform: translateY(-10px);
}

.profile-pic {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 1.2rem;
    position: relative;
    border: 4px solid var(--accent-color);
    box-shadow: var(--shadow-soft);
    transition: var(--transition-bounce);
    cursor: pointer;
    will-change: transform, box-shadow, border-color;
}

.profile-pic::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 162, 109, 0.2), transparent 50%);
    z-index: 1;
    opacity: 0;
    transition: var(--transition-fast);
}

.team-member:hover .profile-pic {
    border-color: var(--accent-hover);
    box-shadow: var(--shadow-strong);
    transform: translateY(-5px) scale(1.03);
}

.team-member:hover .profile-pic::after {
    opacity: 1;
    background: linear-gradient(135deg, rgba(0, 194, 133, 0.3), transparent 60%);
}

.profile-pic img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-smooth);
    will-change: transform, filter;
    filter: brightness(1) contrast(1);
}

.team-member:hover .profile-pic img {
    transform: scale(1.1) rotate(1deg);
    filter: brightness(1.05) contrast(1.05);
}

.team-member h3 {
    font-size: 1.3rem;
    margin-bottom: 0.8rem;
    color: var(--text-color);
}

.linkedin-link {
    display: inline-flex;
    align-items: center;
    color: var(--accent-color);
    text-decoration: none;
    font-size: 1rem;
    transition: var(--transition-smooth);
}

.linkedin-link i {
    margin-right: 0.5rem;
    font-size: 1.2rem;
}

.linkedin-link:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.no-linkedin {
    color: #888;
    font-style: italic;
    font-size: 0.9rem;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(50px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive styles */
@media (max-width: 992px) {
    .timeline::after {
        left: 30px;
    }
    
    .timeline-item {
        margin-left: 20px;
    }
    
    .timeline-item::before {
        left: 30px;
        top: 50px;
    }
    
    .timeline-img, 
    .timeline-content {
        width: 90%;
        max-width: none;
        margin-left: auto;
    }
    
    .team-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

@media (max-width: 768px) {
    .container {
        padding: 1.5rem;
    }
    
    .header-section h1 {
        font-size: 2rem;
    }
    
    .description-section {
        padding: 1.75rem;
    }
    
    .description-section h2,
    .timeline-section h2,
    .team-section h2 {
        font-size: 1.8rem;
        margin-bottom: 1.25rem;
    }
    
    .description-text {
        font-size: 1rem;
        line-height: 1.7;
    }
    
    .timeline {
        max-height: 75vh;
        padding: 1.75rem 1rem;
    }
    
    .timeline-img {
        height: 250px;
    }
    
    .timeline-content {
        padding: 1.25rem 1.5rem;
    }
    
    .timeline-content h3 {
        font-size: 1.3rem;
    }
    
    .team-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 2rem;
    }
    
    .profile-pic {
        width: 140px;
        height: 140px;
        margin-bottom: 1rem;
        clip-path: polygon(12% 0, 88% 0, 100% 12%, 100% 88%, 88% 100%, 12% 100%, 0 88%, 0 12%);
    }
    
    .profile-pic::before {
        border-width: 3px;
        clip-path: polygon(12% 0, 88% 0, 100% 12%, 100% 88%, 88% 100%, 12% 100%, 0 88%, 0 12%);
    }
    
    .team-member:hover .profile-pic {
        transform: translateY(-3px);
    }
    
    .team-member h3 {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 1rem;
    }
    
    .header-section h1 {
        font-size: 1.5rem;
    }
    
    .description-section {
        padding: 1.25rem;
    }
    
    .description-section h2,
    .timeline-section h2,
    .team-section h2 {
        font-size: 1.6rem;
        margin-bottom: 1rem;
    }
    
    .description-text {
        font-size: 0.95rem;
        line-height: 1.6;
        margin-bottom: 1.5rem;
    }
    
    .timeline {
        max-height: 70vh;
        padding: 1.5rem 0.75rem;
    }
    
    .timeline-img {
        height: 180px;
    }
    
    .timeline-content {
        padding: 1.25rem;
    }
    
    .timeline-content h3 {
        font-size: 1.2rem;
    }
    
    .timeline-content p {
        font-size: 0.95rem;
    }
    
    .team-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 1.25rem;
    }
    
    .profile-pic {
        width: 110px;
        height: 110px;
        margin-bottom: 0.8rem;
        clip-path: polygon(15% 0, 85% 0, 100% 15%, 100% 85%, 85% 100%, 15% 100%, 0 85%, 0 15%);
    }
    
    .profile-pic::before {
        border-width: 2px;
        clip-path: polygon(15% 0, 85% 0, 100% 15%, 100% 85%, 85% 100%, 15% 100%, 0 85%, 0 15%);
    }
    
    .team-member:hover .profile-pic {
        transform: translateY(-2px);
    }
    
    .team-member:hover .profile-pic::before {
        transform: scale(1.03);
    }
    
    .team-member:hover .profile-pic img {
        transform: scale(1.05);
    }
    
    .team-member h3 {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }
    
    .linkedin-link {
        font-size: 0.9rem;
    }
}

/* Extra small devices */
@media (max-width: 360px) {
    .container {
        padding: 0.75rem;
    }
    
    .header-section h1 {
        font-size: 1.3rem;
    }
    
    .description-section {
        padding: 1rem;
    }
    
    .team-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .profile-pic {
        width: 100px;
        height: 100px;
        clip-path: polygon(18% 0, 82% 0, 100% 18%, 100% 82%, 82% 100%, 18% 100%, 0 82%, 0 18%);
    }
    
    .profile-pic::before {
        border-width: 2px;
        clip-path: polygon(18% 0, 82% 0, 100% 18%, 100% 82%, 82% 100%, 18% 100%, 0 82%, 0 18%);
    }
    
    /* Simplify hover effects for very small screens */
    .team-member:hover .profile-pic {
        transform: translateY(-1px);
    }
    
    .team-member:hover .profile-pic::before {
        transform: none;
    }
    
    .team-member:hover .profile-pic img {
        transform: scale(1.03);
    }
}

/* === Mobile-friendly core utilities (sitewide, shared by project pages) === */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
img, video, canvas, svg { max-width: 100%; height: auto; }
iframe { max-width: 100%; }
html, body { overflow-x: hidden; }
.wrap-text, .text-wrap { overflow-wrap: anywhere; word-break: break-word; }
pre, code, kbd, samp { white-space: pre-wrap; word-break: break-word; }
.table-responsive { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-responsive > table { width: 100%; border-collapse: collapse; }
/* Touch targets */
a, button { -webkit-tap-highlight-color: rgba(255,255,255,0.15); }
@media (max-width: 480px) {
  .sec-btn, button, .x-btn, .info-section a { min-height: 44px; }
}
