/* ============================================
   INFINITY AI RAILWAY SYSTEMS ACADEMY
   Stylesheet
   ============================================ */

/* 1. CSS Custom Properties */
:root {
    --color-bg-deep: #020617;
    --color-bg-dark: #0b1120;
    --color-bg-panel: #0f172a;
    --color-graphite: #1e293b;
    --color-slate: #475569;
    --color-text-primary: #f8fafc;
    --color-text-secondary: #e2e8f0;
    --color-text-muted: #94a3b8;
    --color-cyan: #00f3ff;
    --color-cyan-soft: rgba(0, 243, 255, 0.15);
    --color-cyan-glow: rgba(0, 243, 255, 0.4);
    --color-blue: #0ea5e9;
    --color-glass-bg: rgba(15, 23, 42, 0.55);
    --color-glass-border: rgba(0, 243, 255, 0.12);
    --font-display: 'Orbitron', sans-serif;
    --font-body: 'Inter', sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --radius: 16px;
    --shadow-glow: 0 0 40px rgba(0, 243, 255, 0.12);
}

/* 2. Reset & Base Styles */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

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

ul {
    list-style: none;
}

/* 3. Typography & Links */
h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

a {
    color: var(--color-cyan);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--color-text-primary);
    text-shadow: 0 0 8px var(--color-cyan);
}

/* 4. Layout Utilities */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.section {
    padding: 100px 0;
    position: relative;
}

.section-dark {
    background: linear-gradient(180deg, var(--color-bg-deep) 0%, var(--color-bg-dark) 100%);
}

.section-gradient {
    background: linear-gradient(180deg, var(--color-bg-dark) 0%, var(--color-bg-panel) 50%, var(--color-bg-dark) 100%);
}

.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 80px;
}

.section-title {
    font-size: clamp(1.8rem, 4vw, 3rem);
    margin-bottom: 1rem;
    background: linear-gradient(to right, var(--color-text-primary), var(--color-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section-tag {
    display: inline-block;
    font-family: var(--font-display);
    font-size: 0.8rem;
    color: var(--color-cyan);
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    border: 1px solid var(--color-cyan-soft);
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
}

.section-desc {
    font-size: 1.1rem;
    color: var(--color-text-muted);
    margin-top: 16px;
}

/* 5. Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 20px 0;
    transition: var(--transition);
}

.navbar.scrolled {
    background: rgba(2, 6, 23, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-glass-border);
    padding: 12px 0;
}

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

.logo {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--color-text-primary);
    letter-spacing: 0.05em;
    text-shadow: none;
}

.logo-accent {
    color: var(--color-cyan);
}

.nav-menu {
    display: flex;
    gap: 40px;
    align-items: center;
}

.nav-link {
    font-family: var(--font-display);
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-text-secondary);
    position: relative;
    padding: 5px 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-cyan);
    transition: width 0.3s ease;
    box-shadow: 0 0 8px var(--color-cyan);
}

.nav-link:hover {
    color: var(--color-text-primary);
    text-shadow: none;
}

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

/* 6. Mobile Navigation */
.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    z-index: 1001;
}

.hamburger-line {
    display: block;
    width: 25px;
    height: 2px;
    background: var(--color-cyan);
    transition: var(--transition);
    box-shadow: 0 0 6px var(--color-cyan);
}

/* 7. Hero Section */
.hero {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: radial-gradient(circle at center, #0f172a 0%, #020617 100%);
}

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

.hero-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, transparent 0%, #020617 80%);
    z-index: 1;
    pointer-events: none;
}

.hero-train-silhouette {
    position: absolute;
    bottom: 15%;
    left: -400px;
    width: 340px;
    height: 70px;
    background: linear-gradient(to bottom, #0f172a, #1e293b);
    border: 2px solid rgba(0, 243, 255, 0.15);
    border-radius: 4px 60px 12px 12px;
    box-shadow: 0 0 60px rgba(0, 243, 255, 0.08), inset 0 0 30px rgba(0, 243, 255, 0.03);
    animation: trainMove 22s linear infinite;
    z-index: 2;
    pointer-events: none;
}

.hero-train-silhouette::before {
    content: '';
    position: absolute;
    top: 12px;
    left: 24px;
    width: 70px;
    height: 28px;
    background: rgba(0, 243, 255, 0.08);
    border: 1px solid rgba(0, 243, 255, 0.25);
    border-radius: 30px 30px 4px 4px;
    box-shadow: inset 0 0 12px rgba(0, 243, 255, 0.15);
}

.hero-train-silhouette::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 5%;
    right: 5%;
    height: 2px;
    background: linear-gradient(to right, transparent, var(--color-cyan), transparent);
    box-shadow: 0 0 20px var(--color-cyan);
}

.hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
    max-width: 900px;
    padding: 0 24px;
}

.hero-badge {
    display: inline-block;
    margin-bottom: 24px;
    padding: 8px 20px;
    border-radius: 999px;
    font-family: var(--font-display);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    color: var(--color-cyan);
}

.hero-title {
    font-size: clamp(2rem, 5vw, 4rem);
    margin-bottom: 24px;
    line-height: 1.1;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--color-text-muted);
    max-width: 700px;
    margin: 0 auto 40px;
    line-height: 1.7;
}

/* 8. Buttons */
.btn {
    display: inline-block;
    font-family: var(--font-display);
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 16px 36px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.btn-glow {
    background: var(--color-cyan);
    color: var(--color-bg-deep);
    font-weight: 600;
    border-color: var(--color-cyan);
    box-shadow: 0 0 30px rgba(0, 243, 255, 0.3), 0 0 60px rgba(0, 243, 255, 0.1);
}

.btn-glow:hover {
    background: transparent;
    color: var(--color-cyan);
    box-shadow: 0 0 40px rgba(0, 243, 255, 0.4);
}

.btn-primary {
    background: transparent;
    color: var(--color-cyan);
    border-color: var(--color-cyan);
}

.btn-primary:hover {
    background: var(--color-cyan);
    color: var(--color-bg-deep);
    box-shadow: var(--shadow-glow);
}

.btn-full {
    width: 100%;
}

/* 9. Glassmorphism Utilities */
.glass {
    background: var(--color-glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--color-glass-border);
    border-radius: var(--radius);
}

/* 10. Reveal Animations */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }
.delay-5 { transition-delay: 0.5s; }
.delay-6 { transition-delay: 0.6s; }

/* 11. About / Features */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 32px;
    position: relative;
    z-index: 2;
}

.feature-card {
    padding: 40px;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.feature-card:hover {
    box-shadow: 0 8px 40px rgba(0, 243, 255, 0.1);
    border-color: var(--color-cyan-glow);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 20px;
    display: block;
}

.feature-card h3 {
    font-size: 1.1rem;
    margin-bottom: 12px;
    color: var(--color-text-primary);
}

.feature-card p {
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

/* 12. Programmes */
.programmes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 28px;
}

.programme-card {
    padding: 36px;
    display: flex;
    flex-direction: column;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.programme-card:hover {
    border-color: var(--color-cyan-glow);
    box-shadow: 0 8px 40px rgba(0, 243, 255, 0.08);
}

.programme-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--color-glass-border);
    padding-bottom: 16px;
}

.programme-number {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--color-cyan-soft);
    line-height: 1;
}

.programme-card h3 {
    font-size: 1.1rem;
    text-align: right;
    max-width: 70%;
}

.programme-card p {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin-bottom: 24px;
    flex-grow: 1;
}

.programme-meta {
    display: flex;
    gap: 16px;
    font-size: 0.75rem;
    font-family: var(--font-display);
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    text-transform: uppercase;
}

.programme-meta li {
    position: relative;
    padding-left: 14px;
}

.programme-meta li::before {
    content: '//';
    position: absolute;
    left: 0;
    color: var(--color-cyan);
}

/* 13. Railway Lab */
.lab-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 28px;
}

.lab-item {
    overflow: hidden;
    transition: border-color 0.3s ease;
}

.lab-item:hover {
    border-color: var(--color-cyan-glow);
}

.lab-visual {
    height: 180px;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--color-glass-border);
    background: linear-gradient(135deg, #0f172a, #1e293b);
}

/* Lab abstract visuals */
.lab-visual-1::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, var(--color-cyan) 1.5px, transparent 1.5px);
    background-size: 20px 20px;
    opacity: 0.3;
    animation: dataPulse 3s infinite;
}

.lab-visual-2::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 20%;
    width: 60%;
    height: 3px;
    background: linear-gradient(to right, transparent, var(--color-cyan), transparent);
    transform: translateY(-50%);
    animation: switchSlide 3s ease-in-out infinite;
}

.lab-visual-3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(90deg, transparent, transparent 10px, rgba(0,243,255,0.2) 10px, rgba(0,243,255,0.2) 12px);
    mask-image: linear-gradient(to top, black, transparent);
    -webkit-mask-image: linear-gradient(to top, black, transparent);
    animation: waveFlow 2s linear infinite;
}

.lab-visual-4::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60px;
    height: 60px;
    border: 2px solid var(--color-cyan);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 0 10px rgba(0,243,255,0.05), 0 0 0 20px rgba(0,243,255,0.05);
    animation: beaconExpand 3s ease-out infinite;
}

.lab-visual-5::after {
    content: '';
    position: absolute;
    top: 40%;
    left: 30%;
    width: 40%;
    height: 3px;
    background: var(--color-cyan);
    box-shadow: 0 14px 0 var(--color-cyan), 0 28px 0 var(--color-cyan);
    animation: shuntMove 4s ease-in-out infinite;
}

.lab-visual-6::after {
    content: '';
    position: absolute;
    bottom: 20%;
    left: 20%;
    width: 60%;
    height: 8px;
    background: rgba(0,243,255,0.1);
    border-radius: 4px;
    overflow: hidden;
}

.lab-visual-6::before {
    content: '';
    position: absolute;
    bottom: 20%;
    left: 20%;
    width: 0%;
    height: 8px;
    background: var(--color-cyan);
    border-radius: 4px;
    animation: energyFill 3s ease-in-out infinite;
}

.lab-content {
    padding: 28px;
}

.lab-content h3 {
    font-size: 1rem;
    margin-bottom: 8px;
}

.lab-content p {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

/* 14. Contact */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

.contact-info {
    padding: 48px;
}

.contact-block {
    margin-bottom: 32px;
}

.contact-block:last-child {
    margin-bottom: 0;
}

.contact-label {
    display: block;
    font-family: var(--font-display);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-cyan);
    margin-bottom: 8px;
}

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

address {
    font-style: normal;
    color: var(--color-text-secondary);
    line-height: 1.8;
}

.contact-form {
    padding: 48px;
}

.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-family: var(--font-display);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    margin-bottom: 8px;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 14px 18px;
    background: rgba(2, 6, 23, 0.6);
    border: 1px solid var(--color-glass-border);
    border-radius: 8px;
    color: var(--color-text-primary);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--color-cyan);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.15);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

::placeholder {
    color: var(--color-slate);
}

/* 15. Footer */
.footer {
    padding: 40px 0;
    text-align: center;
    border-top: 1px solid var(--color-glass-border);
    background: var(--color-bg-deep);
}

.footer p {
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

/* 16. Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    width: 24px;
    height: 40px;
    border: 2px solid var(--color-cyan-soft);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    padding-top: 8px;
}

.scroll-arrow {
    width: 4px;
    height: 8px;
    background: var(--color-cyan);
    border-radius: 2px;
    animation: scrollBounce 2s infinite;
    box-shadow: 0 0 8px var(--color-cyan);
}

/* 17. Railway Track Decoration */
.railway-track-decoration {
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom, transparent, var(--color-cyan), transparent);
    opacity: 0.15;
    transform: translateX(-50%);
    z-index: 0;
    pointer-events: none;
}

.railway-track-decoration::after {
    content: '';
    position: absolute;
    top: -20px;
    left: -3px;
    width: 8px;
    height: 20px;
    background: var(--color-cyan);
    border-radius: 4px;
    box-shadow: 0 0 15px var(--color-cyan);
    animation: trackLight 4s linear infinite;
}

/* 18. Keyframes */
@keyframes trainMove {
    0% { left: -400px; }
    100% { left: 110%; }
}

@keyframes scrollBounce {
    0%, 100% { transform: translateY(0); opacity: 1; }
    50% { transform: translateY(8px); opacity: 0.3; }
}

@keyframes trackLight {
    0% { top: -20px; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

@keyframes dataPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

@keyframes switchSlide {
    0%, 100% { left: 20%; width: 60%; }
    50% { left: 40%; width: 30%; }
}

@keyframes waveFlow {
    0% { transform: translateX(0); }
    100% { transform: translateX(-12px); }
}

@keyframes beaconExpand {
    0% { transform: translate(-50%, -50%) scale(0.8); opacity: 0.8; }
    100% { transform: translate(-50%, -50%) scale(1.4); opacity: 0; }
}

@keyframes shuntMove {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(10px); }
}

@keyframes energyFill {
    0% { width: 0%; }
    50% { width: 80%; }
    100% { width: 0%; }
}

/* 19. Responsive Design */
@media (max-width: 768px) {
    .mobile-nav-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 75%;
        max-width: 320px;
        height: 100vh;
        background: rgba(11, 17, 32, 0.97);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        padding: 60px 40px;
        gap: 32px;
        transition: right 0.3s ease;
        border-left: 1px solid var(--color-glass-border);
    }

    .nav-menu.active {
        right: 0;
    }

    body.nav-open {
        overflow: hidden;
    }

    .section {
        padding: 60px 0;
    }

    .section-header {
        margin-bottom: 48px;
    }

    .contact-wrapper {
        grid-template-columns: 1fr;
    }

    .features-grid,
    .programmes-grid,
    .lab-grid {
        gap: 20px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .contact-info,
    .contact-form {
        padding: 28px;
    }

    .hero-badge {
        font-size: 0.65rem;
        padding: 6px 14px;
    }
}