/* ==================================================
   T.A. ENGINEERING WEBSITE - MAIN STYLESHEET
   Defense & Naval Systems Company
   ================================================== */

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

/* ==================================================
   GLOBAL FOUNDATION STYLES
   ================================================== */

/* Base body styling with defense-themed background */
body {
    font-family: 'Inter', sans-serif;
    background-image: url('https://images.unsplash.com/photo-1554147090-e1221a04a025?q=80&w=2070&auto=format&fit=crop');
    background-size: cover;
    background-position: center center;
    background-attachment: fixed;
    background-color: #111827;
    overflow-x: hidden;
}

/* ==================================================
   HEADER & NAVIGATION SYSTEM
   ================================================== */

/* Main header - transforms from transparent to glass morphism */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    height: 88px;
    background-color: transparent;
    box-shadow: none;
    transition: background-color 0.5s ease-out, box-shadow 0.5s ease-out, backdrop-filter 0.5s ease-out;
}

/* Header background when scrolled or on inner pages */
body.scrolled .main-header,
body.inner-page .main-header {
    background-color: rgba(255, 255, 255, 0.7);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

/* Header content wrapper - centers content within header */
.header-content-wrapper {
    position: relative;
    max-width: 1280px;
    height: 100%;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ==================================================
   LOGO & BRAND SYSTEM
   ================================================== */

/* Main logo text - complex positioning system for hero/header states */
.logo-text {
    position: absolute;
    top: 56px;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 900;
    letter-spacing: -0.05em;
    color: var(--logo-color, #111827);
    line-height: 0.9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: 1002;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    transition: top 1s cubic-bezier(0.86, 0, 0.07, 1),
                left 1s cubic-bezier(0.86, 0, 0.07, 1),
                transform 1s cubic-bezier(0.86, 0, 0.07, 1),
                font-size 1s cubic-bezier(0.86, 0, 0.07, 1),
                flex-direction 1s cubic-bezier(0.86, 0, 0.07, 1);
}

/* Hero state logo (shown in homepage center) */
.logo-text .hero-logo {
    width: 120px;
    height: auto;
    margin-bottom: 0;
    display: block;
}

/* Hide hero logo when scrolled or on inner pages */
body.scrolled .logo-text .hero-logo,
body.inner-page .logo-text .hero-logo {
    display: none;
}

/* Logo positioning when header is scrolled - horizontal layout */
body.scrolled .logo-text {
    top: 56px;
    left: calc(1rem + 32px + 0.5rem);
    transform: translateY(-50%);
    flex-direction: row;
    gap: 0.5ch;
    align-items: center;
}

/* Inner page logo positioning - same as scrolled state */
body.inner-page .logo-text {
    top: 56px;
    left: calc(1rem + 32px + 0.5rem);
    transform: translateY(-50%);
    flex-direction: row;
    gap: 0.5ch;
    align-items: center;
    color: #111827;
}

/* Left header icon - appears when scrolled */
.header-logo-left {
    position: absolute;
    top: 56px;
    left: 1rem;
    transform: translateY(-50%);
    width: 32px;
    height: auto;
    display: none;
    z-index: 1004;
}

/* Show left logo when scrolled or on inner pages */
body.scrolled .header-logo-left,
body.inner-page .header-logo-left {
    display: block;
}

/* ==================================================
   NAVIGATION MENU
   ================================================== */

/* Main navigation - slides in when header transforms */
.header-nav {
    position: absolute;
    top: 56px;
    right: 1rem;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    opacity: 0;
    transition: opacity 0.5s ease-out 0.3s;
}

/* Show navigation when scrolled or on inner pages */
body.scrolled .header-nav,
body.inner-page .header-nav {
    opacity: 1;
}

/* Navigation links with underline hover effect */
.header-nav a {
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    color: #1f2937;
    position: relative;
}

/* Animated underline for navigation links */
.header-nav a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    height: 2px;
    width: 100%;
    background-color: currentColor;
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 200ms ease-in-out;
}

.header-nav a:hover::after,
.header-nav a:focus-visible::after {
    transform: scaleX(1);
}

/* ==================================================
   SLIDING TEXT ANNOUNCEMENT BAR
   ================================================== */

/* Top announcement bar - shows on scroll */
.sliding-text-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 24px;
    background-color: black;
    color: white;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease-out;
    z-index: 1003;
}

/* Show sliding text when scrolled or on inner pages */
body.scrolled .sliding-text-container,
body.inner-page .sliding-text-container {
    opacity: 1;
    pointer-events: auto;
}

/* Sliding text content styling */
.sliding-text-content p {
    padding: 0 1rem;
    font-size: 10px;
    white-space: nowrap;

    /* Use Flexbox for perfect centering */
    height: 24px; /* Ensure each item has a consistent height */
    display: flex;
    align-items: center;     /* Vertically centers the text */
    justify-content: center; /* Horizontally centers the text */
}

/* ==================================================
   PAGE LAYOUT & CONTENT AREAS
   ================================================== */

/* Main content area - adjusts padding based on header state */
.content-area {
    padding-top: 0;
    background-color: #f3f4f6;
}

/* Content padding for inner pages */
body.inner-page .content-area {
    padding-top: 84px;
}

/* Content padding when homepage is scrolled */
body.scrolled:not(.inner-page) .content-area {
    padding-top: 88px;
}

/* ==================================================
   HOMEPAGE HERO BANNER
   ================================================== */

/* Full-screen homepage banner */
.home-banner {
    width: 100%;
    height: 100vh;
    background-size: cover;
    background-position: center;
    position: relative;
    margin-top: 0;
    z-index: 0;
}

/* Dark overlay for banner readability */
.home-banner .banner-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0,0,0,0.4), rgba(0,0,0,0.15));
    z-index: 0;
}

/* ==================================================
   SECTION BACKGROUND UTILITIES
   ================================================== */

/* Standard background image utility */
.glance-background {
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
}

/* Fixed parallax background utility */
.fixed-glance-background {
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    background-attachment: fixed !important;
}

/* ==================================================
   EXPLORE US SECTION
   ================================================== */

/* Main explore section styling */
.explore-us {
    background-color: #c8c9cb;
    padding: 4rem 1rem;
}

/* Grid layout for explore cards */
.explore-us-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    align-items: stretch;
}

/* Responsive grid - 2 columns on tablet+ */
@media (min-width: 768px) {
    .explore-us-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Individual explore card with hover effects */
.explore-card {
    border-radius: 0.5rem;
    overflow: hidden;
    position: relative;
    display: block;
    transition: transform 200ms ease, box-shadow 200ms ease;
}

.explore-card:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: 0 12px 24px rgba(0,0,0,0.15);
}

/* Image-based explore cards with overlays */
.explore-image-card {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 180px;
    border-radius: 0.5rem;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: stretch;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    cursor: pointer;
    text-decoration: none;
}

/* Responsive heights for explore cards */
@media (min-width: 640px) { 
    .explore-image-card { min-height: 220px; } 
}

@media (min-width: 1024px) { 
    .explore-image-card { min-height: 260px; } 
}

/* Default overlay with gradient */
.explore-image-card .overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.45) 100%);
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    padding: 1.25rem;
    transition: background 0.3s ease;
}

/* Hover text overlay */
.explore-image-card .hover-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    text-align: center;
    opacity: 0;
    transition: opacity 220ms ease;
}

.explore-image-card .hover-text p {
    color: #fff;
    max-width: 28rem;
    font-size: 0.95rem;
}

/* Hover state transitions */
.explore-image-card .overlay > * {
    transition: opacity 0.18s ease;
}

.explore-image-card:hover .overlay {
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(6px);
}

.explore-image-card:hover .overlay > * {
    opacity: 0;
}

.explore-image-card:hover .hover-text {
    opacity: 1;
}

/* Statistics display in cards */
.stat-number {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1;
    margin: 0 0 0.25rem 0;
    color: #ffffff;
    text-shadow: 0 6px 12px rgba(0,0,0,0.45);
}

.stat-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: rgba(255,255,255,0.95);
}

/* ==================================================
   REVEAL ON SCROLL ANIMATION
   ================================================== */

/* Initial hidden state for scroll animations */
.reveal-on-scroll {
    opacity: 0 !important;
    transform: translateY(20px) scale(0.95) !important;
    filter: blur(2px) !important;
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* Visible state when element enters viewport */
.reveal-on-scroll.in-view {
    opacity: 1 !important;
    transform: translateY(0) scale(1) !important;
    filter: blur(0) !important;
}

/* ==================================================
   FOOTER SECTION
   ================================================== */

/* Main footer styling */
.site-footer {
    background-color: #f3f4f6;
    color: #4b5563;
    font-size: 0.875rem;
    padding: 2.5rem 1rem;
}

/* Footer grid layout */
.footer-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 2rem;
}

/* Responsive footer - 2 columns on tablet+ */
@media (min-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr 2fr;
    }
}

/* Footer section headings */
.footer-heading {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #d1d5db;
    margin-bottom: 1rem;
}

/* Footer navigation links */
.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    text-decoration: none;
    color: #4b5563;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #1f2937;
}

/* Footer contact information */
.footer-contact p {
    margin-bottom: 0.75rem;
}

/* Copyright section */
.footer-copyright {
    border-top: 1px solid #d1d5db;
    padding-top: 1.5rem;
    margin-top: 2rem;
    text-align: center;
    font-size: 0.75rem;
    color: #6b7280;
}

/* ==================================================
   RESPONSIVE HERO SIZING SYSTEM
   ================================================== */

/* Homepage hero state - large centered text */
body:not(.inner-page):not(.scrolled) .logo-text {
    position: fixed;
    top: 50vh;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--logo-color, #ffffff);
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 10vw;
}

/* Force block display for hero text spans */
body:not(.inner-page):not(.scrolled) .logo-text span {
    display: block;
}

/* Scrolled header text size */
body.scrolled .logo-text {
    font-size: 2.25rem;
}

/* Inline display for header text spans */
body.scrolled .logo-text span,
body.inner-page .logo-text span {
    display: inline;
}

/* Inner page text size */
body.inner-page .logo-text {
    font-size: 1.25rem;
}

/* ==================================================
   RESPONSIVE BREAKPOINTS
   ================================================== */

/* Large tablet and small desktop (max-width: 1007px) */
@media (max-width: 1007px) {
    body:not(.inner-page):not(.scrolled) .logo-text { font-size: 14vw; }
    body.scrolled .logo-text { font-size: 2rem; }
    body.inner-page .logo-text { font-size: 1.125rem; }
    .header-nav { gap: 1rem; }
}

/* Mobile landscape and tablet portrait (max-width: 640px) */
@media (max-width: 640px) {
    body:not(.inner-page):not(.scrolled) .logo-text { 
        font-size: 10vw;
        max-width: calc(100vw - 120px);
    }
    
    body:not(.inner-page):not(.scrolled) .logo-text .hero-logo {
        width: 55px;
        height: auto;
        margin-bottom: 0;
        display: block;
    }
    
    body.scrolled:not(.inner-page) .logo-text {
        font-size: 1rem;
        left: calc(1rem + 32px + 0.5rem);
        transform: translateY(-50%);
        flex-direction: row;
        gap: 1ch;
        align-items: center;
        max-width: calc(100vw - 200px);
    }
    
    body.inner-page .logo-text { font-size: 1rem; }
    body.inner-page .content-area { padding-top: 70px; }
    
    .header-nav { gap: 1rem; }
    .header-nav a { font-size: 10px; }
}

/* Mobile portrait (max-width: 480px) */
@media (max-width: 480px) {
    body:not(.inner-page):not(.scrolled) .logo-text { 
        font-size: 8vw;
        max-width: calc(100vw - 100px);
        gap: 0.5rem;
    }
    
    body:not(.inner-page):not(.scrolled) .logo-text .hero-logo {
        width: 50px;
        height: auto;
    }
    
    body.scrolled:not(.inner-page) .logo-text {
        font-size: 0.9rem;
        left: calc(1rem + 32px + 0.5rem);
        gap: 0.8ch;
        max-width: calc(100vw - 180px);
    }
    
    body.inner-page .content-area { padding-top: 60px; }
    
    .header-nav { gap: 0.75rem; }
    .header-nav a { font-size: 9px; }
}

/* Small mobile (max-width: 380px) */
@media (max-width: 380px) {
    body:not(.inner-page):not(.scrolled) .logo-text { 
        font-size: 7vw;
        max-width: calc(100vw - 80px);
        gap: 0.4rem;
    }
    
    body:not(.inner-page):not(.scrolled) .logo-text .hero-logo {
        width: 35px;
        height: auto;
    }
    
    body.scrolled:not(.inner-page) .logo-text {
        font-size: 0.8rem;
        left: calc(1rem + 32px + 0.4rem);
        gap: 0.6ch;
        max-width: calc(100vw - 160px);
    }
    
    body.scrolled .logo-text { font-size: 0.8rem; }
    body.inner-page .logo-text { font-size: 0.8rem; }
    
    .header-nav { gap: 0.5rem; }
    .header-nav a { font-size: 8px; }
}

/* ==================================================
   IMAGE CAROUSEL COMPONENT
   ================================================== */

/* Carousel container with overflow hidden */
.carousel-container {
    position: relative;
    overflow: hidden;
}

/* Individual carousel slides */
.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

/* Active slide display */
.carousel-slide.active {
    opacity: 1;
}

/* Carousel images */
.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Carousel navigation buttons */
.carousel-btn {
    z-index: 10;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
}

.carousel-btn:hover {
    transform: translateY(-50%) scale(1.1);
}

/* Carousel dot indicators */
.carousel-dot {
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-dot.active {
    background-color: white !important;
    opacity: 1 !important;
}

/* ==================================================
   PROJECT PAGE ANIMATIONS
   ================================================== */

/* Base animation state for project elements */
.project-animate {
    opacity: 0;
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* Animation directions */
.project-animate.slide-in-left { 
    transform: translateX(-50px); 
}

.project-animate.slide-in-right { 
    transform: translateX(50px); 
}

.project-animate.fade-in { 
    transform: translateY(20px); 
}

/* Visible state for project animations */
.project-visible {
    opacity: 1;
    transform: translateX(0) translateY(0);
}

/* ==================================================
   FIX FOR SLIDING ANNOUNCEMENT BAR ANIMATION
   ================================================== */

/* 1. Define the keyframe animation for a smooth vertical slide */
@keyframes slide-vertically {
  /* Start with the first message */
  0%    { transform: translateY(0); }
  22%   { transform: translateY(0); } /* Pause on the first message */

  /* Slide to and pause on the second message */
  25%   { transform: translateY(-24px); }
  47%   { transform: translateY(-24px); }

  /* Slide to and pause on the third message */
  50%   { transform: translateY(-48px); }
  72%   { transform: translateY(-48px); }

  /* Slide to and pause on the fourth message */
  75%   { transform: translateY(-72px); }
  97%   { transform: translateY(-72px); }

  /* Slide to the final item (a copy of the first) to create a seamless loop */
  100%  { transform: translateY(-96px); }
}

/* 2. Apply this animation to the sliding content when it's visible */
body.scrolled .sliding-text-content,
body.inner-page .sliding-text-content {
  animation: slide-vertically 15s ease-in-out infinite;
}