/* ============================================
   INFINITY AI — DESIGN TOKENS
   ============================================ */
:root {
    --color-bg: #06080f;
    --color-bg-elevated: #0a0f1e;
    --color-surface: rgba(13, 18, 30, 0.55);
    --color-border: rgba(100, 180, 255, 0.12);
    --color-primary: #00d2ff;
    --color-secondary: #3a7bd5;
    --color-accent: #00f2ff;
    --color-text: #e0e6f1;
    --color-text-muted: #8a95b5;
    --font-display: 'Orbitron', system-ui, sans-serif;
    --font-body: 'Rajdhani', system-ui, sans-serif;
    --transition-base: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --radius: 12px;
    --glass: rgba(255, 255, 255, 0.03);
}

/* ============================================
   RESET & BASE
   ============================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-body);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* ============================================
   TYPOGRAPHY & UTILITIES
   ============================================ */
.container {
    max-width: 1280px;
    margin-inline: auto;
    padding-inline: 2rem;
}

.section {
    padding-block: 7rem;
    position: relative;
}

.section-header {
    margin-bottom: 3.5rem;
}

.section-header.centered {
    text-align: center;
    max-width: 720px;
    margin-inline: auto;
    margin-bottom: 4rem;
}

.section-tag {
    display: inline-block;
    padding: 0.4rem 1.1rem;
    background: rgba(0, 210, 255, 0.08);
    border: 1px solid rgba(0, 210, 255, 0.2);
    color: var(--color-primary);
    font-family: var(--font-display);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 1rem;
    border-radius: 2px;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 4vw, 3rem);
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 0.75rem;
    color: var(--color-text);
}

.section-subtitle {
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    color: var(--color-text-muted);
    font-weight: 400;
}

.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.9s ease, transform 0.9s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   HEADER & NAVIGATION
   ============================================ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding-block: 1.25rem;
    transition: background var(--transition-base), backdrop-filter var(--transition-base), box-shadow var(--transition-base);
}

.header.scrolled {
    background: rgba(6, 8, 15, 0.88);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--color-border);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 1.4rem;
    color: var(--color-text);
    letter-spacing: 0.02em;
}

.logo-icon {
    color: var(--color-primary);
    font-size: 2rem;
    line-height: 0.9;
    text-shadow: 0 0 20px rgba(0, 210, 255, 0.4);
}

.nav-list {
    display: flex;
    gap: 2.5rem;
    align-items: center;
}

.nav-link {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    position: relative;
    padding-block: 0.25rem;
    transition: color var(--transition-base);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
    transition: width var(--transition-base);
}

.nav-link:hover,
.nav-link:focus-visible {
    color: var(--color-text);
}

.nav-link:hover::after,
.nav-link:focus-visible::after {
    width: 100%;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    width: 40px;
    height: 40px;
    position: relative;
    z-index: 1001;
}

.hamburger,
.hamburger::before,
.hamburger::after {
    display: block;
    width: 28px;
    height: 2px;
    background: var(--color-text);
    position: absolute;
    left: 6px;
    transition: all var(--transition-base);
}

.hamburger {
    top: 50%;
    transform: translateY(-50%);
}

.hamburger::before,
.hamburger::after {
    content: '';
}

.hamburger::before {
    top: -8px;
}

.hamburger::after {
    top: 8px;
}

.mobile-menu-toggle.active .hamburger {
    transform: translateY(-50%) rotate(45deg);
}

.mobile-menu-toggle.active .hamburger::before {
    transform: rotate(90deg) translateX(-8px);
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger::after {
    transform: rotate(-90deg) translateX(8px);
    top: 0;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
    background: radial-gradient(ellipse at 50% 0%, #0f172a 0%, #020617 70%);
}

.hero-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(6, 8, 15, 0.2) 0%, rgba(6, 8, 15, 0.85) 100%);
    z-index: 1;
}

.hero-container {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 4rem;
    align-items: center;
    padding-top: 6rem;
    padding-bottom: 6rem;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.1rem;
    background: var(--glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--color-border);
    border-radius: 100px;
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-primary);
    margin-bottom: 1.5rem;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 5.5vw, 4.2rem);
    font-weight: 900;
    line-height: 1.08;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #ffffff 0%, #a5f3fc 30%, var(--color-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: clamp(1.05rem, 2vw, 1.35rem);
    color: var(--color-text-muted);
    max-width: 540px;
    margin-bottom: 2.75rem;
    font-weight: 400;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.1rem 2.75rem;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform var(--transition-base), box-shadow var(--transition-base);
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-secondary), var(--color-primary));
    color: #020617;
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    opacity: 0;
    transition: opacity var(--transition-base);
}

.btn-primary:hover,
.btn-primary:focus-visible {
    transform: translateY(-3px);
    box-shadow: 0 12px 48px -12px rgba(0, 210, 255, 0.55);
}

.btn-primary:hover::before,
.btn-primary:focus-visible::before {
    opacity: 1;
}

.btn-primary span,
.btn-primary::after {
    position: relative;
    z-index: 1;
}

/* 3D Machine (Stylized TBM) */
.hero-machine {
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1000px;
}

.machine-3d {
    position: relative;
    width: 300px;
    height: 300px;
    transform-style: preserve-3d;
    animation: floatMachine 6s ease-in-out infinite;
}

@keyframes floatMachine {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-18px); }
}

.machine-body {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 90px;
    height: 210px;
    transform: translate(-50%, -50%) rotateX(70deg);
    background: linear-gradient(90deg, #121a2e, #25355c, #121a2e);
    border-radius: 50% / 8%;
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.7), 0 0 80px -10px rgba(0, 210, 255, 0.15);
}

.machine-head {
    position: absolute;
    left: 50%;
    top: 34px;
    width: 130px;
    height: 44px;
    transform: translateX(-50%) rotateX(60deg);
    background: radial-gradient(circle at 30% 30%, var(--color-secondary), #121a2e);
    border-radius: 50%;
    border: 2px solid rgba(0, 210, 255, 0.35);
    box-shadow: 0 0 40px rgba(0, 210, 255, 0.25), inset 0 0 20px rgba(0, 0, 0, 0.6);
}

.machine-ring {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    animation: spinRing linear infinite;
    transform-style: preserve-3d;
}

.ring-1 {
    width: 170px;
    height: 170px;
    border: 2px solid rgba(0, 210, 255, 0.25);
    animation-duration: 7s;
}

.ring-2 {
    width: 220px;
    height: 220px;
    border: 1.5px solid rgba(58, 123, 213, 0.2);
    animation-duration: 11s;
}

.ring-3 {
    width: 270px;
    height: 270px;
    border: 1px solid rgba(0, 242, 255, 0.12);
    animation-duration: 16s;
}

@keyframes spinRing {
    from { transform: translate(-50%, -50%) rotateX(70deg) rotateZ(0deg); }
    to { transform: translate(-50%, -50%) rotateX(70deg) rotateZ(360deg); }
}

.machine-glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(0, 210, 255, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.scroll-indicator {
    position: absolute;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    color: var(--color-text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-family: var(--font-display);
    opacity: 0.7;
    animation: fadeUpDown 3s ease-in-out infinite;
}

.mouse {
    width: 22px;
    height: 36px;
    border: 2px solid var(--color-text-muted);
    border-radius: 11px;
    position: relative;
}

.wheel {
    width: 4px;
    height: 8px;
    background: var(--color-text-muted);
    border-radius: 2px;
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    animation: scrollWheel 2s ease-in-out infinite;
}

@keyframes scrollWheel {
    0% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(10px); }
}

@keyframes fadeUpDown {
    0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.7; }
    50% { transform: translateX(-50%) translateY(8px); opacity: 1; }
}

/* ============================================
   ABOUT SECTION
   ============================================ */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-content p {
    font-size: 1.15rem;
    color: var(--color-text-muted);
    margin-bottom: 1.25rem;
    font-weight: 400;
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-top: 2.5rem;
    padding: 1.75rem;
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-family: var(--font-display);
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}

.about-media {
    position: relative;
}

.about-media img {
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.6);
    transition: transform var(--transition-base);
}

.about-media:hover img {
    transform: scale(1.02);
}

.media-decoration {
    position: absolute;
    inset: -20px;
    border: 1px solid rgba(0, 210, 255, 0.15);
    border-radius: 20px;
    z-index: -1;
    pointer-events: none;
}

/* ============================================
   PROGRAMS SECTION
   ============================================ */
.programs {
    background: linear-gradient(to bottom, var(--color-bg), var(--color-bg-elevated));
}

.programs-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.75rem;
}

.program-card {
    position: relative;
    padding: 2.5rem;
    background: var(--glass);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
    transform-style: preserve-3d;
}

.program-card:nth-child(odd) {
    transform: translateY(16px);
}

.program-card:nth-child(odd):hover {
    transform: translateY(10px);
}

.program-card:nth-child(even):hover {
    transform: translateY(-6px);
}

.program-card:hover {
    box-shadow: 0 24px 64px -20px rgba(0, 210, 255, 0.15);
    border-color: rgba(0, 210, 255, 0.35);
}

.card-hologram {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--color-primary), transparent);
    opacity: 0.6;
}

.card-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(0, 210, 255, 0.06);
    border: 1px solid rgba(0, 210, 255, 0.15);
    color: var(--color-primary);
    margin-bottom: 1.75rem;
}

.card-icon svg {
    width: 32px;
    height: 32px;
}

.program-card h3 {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--color-text);
}

.program-card p {
    color: var(--color-text-muted);
    font-size: 1.05rem;
    line-height: 1.55;
    margin-bottom: 1.5rem;
}

.card-link {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-primary);
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: gap var(--transition-base);
}

.card-link:hover,
.card-link:focus-visible {
    gap: 0.75rem;
    color: var(--color-accent);
}

/* ============================================
   ENGINEERING LAB SECTION
   ============================================ */
.lab-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.project-card {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.project-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.5);
    border-color: rgba(0, 210, 255, 0.25);
}

.project-visual {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    position: relative;
}

.project-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s ease;
}

.project-card:hover .project-visual img {
    transform: scale(1.08);
}

.project-visual::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(6, 8, 15, 0.6), transparent 50%);
    pointer-events: none;
}

.project-info {
    padding: 1.5rem;
    position: relative;
    z-index: 1;
    background: linear-gradient(to bottom, rgba(255,255,255,0.02), transparent);
    border-top: 1px solid var(--color-border);
}

.project-info h4 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
    color: var(--color-text);
}

.project-info p {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    line-height: 1.5;
}

/* ============================================
   CONTACTS SECTION
   ============================================ */
.contacts {
    background: linear-gradient(to bottom, var(--color-bg-elevated), var(--color-bg));
}

.contacts-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.contact-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 2rem;
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    transition: border-color var(--transition-base), transform var(--transition-base);
}

.contact-card:hover,
.contact-card:focus-visible {
    transform: translateY(-4px);
    border-color: rgba(0, 210, 255, 0.3);
    outline: none;
}

.contact-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(0, 210, 255, 0.08);
    color: var(--color-primary);
}

.contact-icon svg {
    width: 22px;
    height: 22px;
}

.contact-label {
    font-family: var(--font-display);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-muted);
}

.contact-value {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1.15rem;
    color: var(--color-text);
    line-height: 1.35;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    padding-block: 2.5rem;
    border-top: 1px solid var(--color-border);
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.footer-year {
    color: var(--color-primary);
    font-family: var(--font-display);
}

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

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 1024px) {
    .programs-grid {
        grid-template-columns: 1fr;
    }

    .program-card:nth-child(odd) {
        transform: none;
    }

    .lab-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .contacts-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .about-grid {
        gap: 2.5rem;
    }
}

@media (max-width: 768px) {
    .header {
        padding-block: 1rem;
    }

    .nav-list {
        position: fixed;
        inset: 0;
        background: rgba(6, 8, 15, 0.97);
        backdrop-filter: blur(30px);
        -webkit-backdrop-filter: blur(30px);
        flex-direction: column;
        justify-content: center;
        gap: 2.5rem;
        transform: translateX(100%);
        transition: transform var(--transition-base);
    }

    .nav-list.active {
        transform: translateX(0);
    }

    .nav-link {
        font-size: 1.25rem;
        color: var(--color-text);
    }

    .mobile-menu-toggle {
        display: block;
    }

    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 3rem;
        padding-top: 8rem;
        padding-bottom: 5rem;
    }

    .hero-subtitle {
        margin-inline: auto;
    }

    .hero-machine {
        order: -1;
    }

    .machine-3d {
        transform: scale(0.85);
    }

    .about-grid {
        grid-template-columns: 1fr;
    }

    .about-media {
        order: -1;
    }

    .about-stats {
        grid-template-columns: 1fr;
    }

    .lab-grid {
        grid-template-columns: 1fr;
    }

    .contacts-grid {
        grid-template-columns: 1fr;
    }

    .section {
        padding-block: 5rem;
    }

    .scroll-indicator {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}