/* Base styles */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { 
    font-family: 'Inter', sans-serif; 
    color: #1c1917; 
    background: #f0fdfa; 
    padding-top: 80px;
    margin-top: 0 !important;
}
a { text-decoration: none; color: inherit; }

/* Custom mavoor colors */
.bg-mavoor-dark { background: #134e4a; }
.bg-mavoor-teal { background: #0f766e; }
.bg-mavoor-amber { background: #f59e0b; }
.bg-mavoor-mint { background: #f0fdfa; }
.text-mavoor-dark { color: #134e4a; }
.text-mavoor-teal { color: #0f766e; }
.text-mavoor-amber { color: #f59e0b; }

/* Typography */
.font-display { font-family: 'Playfair Display', serif; }
.font-body { font-family: 'Inter', sans-serif; }
.font-malay { font-family: 'Noto Sans Malayalam', sans-serif; }

/* Navigation (legacy - for fallback) */
nav.sticky { box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); }
nav.sticky a { transition: color 0.3s; }
nav.sticky a:hover { color: #f59e0b; }

/* Modern Navigation - High Priority */
nav.modern-nav {
    display: flex !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    background: #134e4a !important;
    backdrop-filter: none !important;
}

/* Buttons */
.btn-primary {
    background: #0f766e;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    font-weight: 600;
    transition: background 0.3s;
}
.btn-primary:hover { background: #134e4a; }

/* Cards */
.card {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 10px 15px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}
.card:hover { transform: scale(1.02); }

/* Wave SVG */
.wave { position: absolute; bottom: 0; left: 0; right: 0; }
.wave svg { display: block; width: 100%; height: auto; }

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
}
.badge-teal { background: #ccfbf1; color: #0f766e; }
.badge-amber { background: #fef3c7; color: #d97706; }
.badge-green { background: #d1fae5; color: #059669; }

/* Forms */
input, textarea, select {
    width: 100%;
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #0f766e;
    box-shadow: 0 0 0 3px rgba(15,118,110,0.2);
}

/* Tables */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.75rem; text-align: left; }
th { border-bottom: 2px solid #e5e7eb; font-weight: 600; }
td { border-bottom: 1px solid #e5e7eb; }

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in { animation: fadeIn 0.5s ease-out; }

/* Footer */
footer { background: #134e4a; color: #ccfbf1; }
footer a:hover { color: white; }

/* Modern Navigation */
.modern-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 12px 0;
    background: #134e4a;
    box-shadow: 0 4px 30px rgba(0,0,0,0.15);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    margin-right: 40px;
}

.nav-logo-icon {
    width: 92px;
    height: 92px;
    background: transparent;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
}

.nav-logo-img {
    width: 88px;
    height: 88px;
    object-fit: contain;
}

.nav-logo-icon svg {
    width: 22px;
    height: 22px;
    color: #1c1917;
}

.nav-logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.nav-logo-malay {
    font-family: 'Noto Sans Malayalam', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #fbbf24;
}

.nav-logo-english {
    font-family: 'Playfair Display', serif;
    font-size: 16px;
    font-weight: 600;
    color: white;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: auto;
}

.nav-link {
    position: relative;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: white;
    background: rgba(255,255,255,0.1);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    width: 0;
    height: 2px;
    background: #fbbf24;
    border-radius: 2px;
    transition: all 0.2s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after {
    width: 20px;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.lang-toggle {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    color: white;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lang-toggle:hover {
    background: #fbbf24;
    color: #1c1917;
    transform: scale(1.05);
}

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

.mobile-toggle span {
    position: absolute;
    left: 8px;
    width: 24px;
    height: 2px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-toggle span:nth-child(1) { top: 12px; }
.mobile-toggle span:nth-child(2) { top: 19px; }
.mobile-toggle span:nth-child(3) { top: 26px; }

.mobile-toggle.active span:nth-child(1) { transform: rotate(45deg); top: 19px; }
.mobile-toggle.active span:nth-child(2) { opacity: 0; }
.mobile-toggle.active span:nth-child(3) { transform: rotate(-45deg); top: 19px; }

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: linear-gradient(180deg, #134e4a 0%, #0f766e 100%);
    z-index: 999;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -10px 0 40px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
}

.mobile-menu.open {
    right: 0;
}

.mobile-menu-content {
    flex: 1;
    padding: 80px 24px 24px;
    overflow-y: auto;
}

.mobile-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    font-size: 15px;
    font-weight: 500;
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    border-radius: 12px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.mobile-link:hover {
    background: rgba(255,255,255,0.1);
    color: white;
    transform: translateX(8px);
}

.mobile-link-icon {
    font-size: 18px;
}

.mobile-menu-footer {
    padding: 20px 24px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.lang-toggle-mobile {
    font-size: 13px;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
}

.lang-toggle-mobile strong {
    color: #fbbf24;
}

/* Responsive */
@media (max-width: 1024px) {
    .nav-links {
        display: none;
    }
    .mobile-toggle {
        display: block;
    }
}

@media (max-width: 640px) {
    .nav-logo-english {
        display: none;
    }
    .nav-container {
        padding: 0 16px;
    }
}

/* CSS Variables */
:root {
    --cream: #faf8f5;
    --cream-2: #f5f2ed;
    --ink: #1c1917;
    --ink-faint: #57534e;
    --gold: #d4a44a;
    --gold-light: #e8c068;
}

/* Hero */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.hero-bg {
    position: absolute;
    inset: 0;
    background-image: url('https://ejatlas.org/media/CACHE/images/conflict/mavoor-gwalior-rayons-factory/a12a85b1c64c0e4e4474edcfe7cde5ec/0004_abandoned_factory_premises.jpg');
    background-size: cover;
    background-position: center;
    filter: grayscale(30%);
}
.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(19,78,74,0.95) 0%, rgba(15,118,110,0.85) 50%, rgba(30,96,145,0.9) 100%);
}
.hero-inner {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 24px;
    text-align: center;
    color: white;
}
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.75);
    margin-bottom: 28px;
    font-weight: 500;
    padding: 10px 20px;
    background: rgba(255,255,255,0.1);
    border-radius: 50px;
    backdrop-filter: blur(10px);
}
.hero-badge-dot {
    width: 8px;
    height: 8px;
    background: #fbbf24;
    border-radius: 50%;
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.2); }
}
.hero h1 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(36px, 6vw, 64px);
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 24px;
    letter-spacing: -0.02em;
}
.hero-title-sub {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: clamp(16px, 2.5vw, 22px);
    font-weight: 400;
    font-style: italic;
    color: rgba(255,255,255,0.8);
    margin-top: 12px;
    letter-spacing: 0;
}
.hero-sub {
    font-size: 17px;
    line-height: 1.75;
    color: rgba(255,255,255,0.85);
    max-width: 640px;
    margin: 0 auto 48px;
}
.hero-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 48px;
}
.hero-meta-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 24px;
    background: rgba(255,255,255,0.08);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    min-width: 100px;
}
.hero-meta-num {
    font-family: 'Playfair Display', serif;
    font-size: 28px;
    font-weight: 700;
    color: #fbbf24;
    line-height: 1;
    margin-bottom: 6px;
}
.hero-meta-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.7);
}
.hero-meta-divider {
    width: 1px;
    height: 40px;
    background: rgba(255,255,255,0.2);
}
.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    background: #fbbf24;
    color: #1c1917;
    font-weight: 600;
    font-size: 14px;
    border-radius: 50px;
    transition: all 0.3s ease;
    text-decoration: none;
}
.hero-cta:hover {
    background: #f59e0b;
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(251,191,36,0.3);
}
.hero-cta svg {
    animation: bounce 2s infinite;
}
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(4px); }
}
.hero-scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
}
.hero-scroll-line {
    width: 2px;
    height: 40px;
    background: linear-gradient(to bottom, rgba(255,255,255,0.5), transparent);
    animation: scrollLine 2s infinite;
}
@keyframes scrollLine {
    0% { transform: scaleY(0); transform-origin: top; }
    50% { transform: scaleY(1); transform-origin: top; }
    50.1% { transform: scaleY(1); transform-origin: bottom; }
    100% { transform: scaleY(0); transform-origin: bottom; }
}

@media (max-width: 768px) {
    .hero-meta {
        gap: 12px;
    }
    .hero-meta-item {
        padding: 12px 16px;
        min-width: 70px;
    }
    .hero-meta-num {
        font-size: 22px;
    }
    .hero-meta-divider {
        display: none;
    }
}

/* Container */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 60px 24px;
}

/* Section Title */
.section-title {
    text-align: center;
    margin-bottom: 48px;
}
.section-label {
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #b07c2a;
    font-weight: 600;
    margin-bottom: 8px;
}
.section-title h2 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(24px, 4vw, 36px);
    color: var(--ink);
    font-weight: 700;
}

/* Timeline */
.timeline {
    padding: 60px 24px;
}
.tl-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--ink-faint);
}
.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid;
}
.tl-track {
    max-width: 700px;
    margin: 0 auto;
}
.tl-item {
    position: relative;
    padding-left: 40px;
    padding-bottom: 32px;
}
.tl-item::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 8px;
    bottom: -24px;
    width: 2px;
    background: #e5e5e5;
}
.tl-item:last-child::before {
    display: none;
}
.tl-dot {
    position: absolute;
    left: 0;
    top: 6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: white;
    border: 3px solid;
}
.dot-found { border-color: #2a7a5a; }
.dot-innov { border-color: #1e4d6b; }
.dot-crisis { border-color: #b07c2a; }
.dot-pollut { border-color: #8b2e0f; }
.dot-close { border-color: #6b1a0a; }
.dot-legacy { border-color: #9c8c75; }

.tl-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    cursor: pointer;
    transition: box-shadow 0.2s;
}
.tl-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}
.tl-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}
.tl-year-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 4px;
    margin-bottom: 6px;
}
.yr-found { background: #d1fae5; color: #059669; }
.yr-innov { background: #dbeafe; color: #2563eb; }
.yr-crisis { background: #fef3c7; color: #d97706; }
.yr-pollut { background: #fee2e2; color: #dc2626; }
.yr-close { background: #f3e8ff; color: #7c3aed; }
.yr-legacy { background: #f5f5f4; color: #78716c; }

.tl-card-title {
    font-weight: 600;
    color: var(--ink);
    font-size: 15px;
}
.tl-pill {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
}
.pill-found { background: #d1fae5; color: #059669; }
.pill-innov { background: #dbeafe; color: #2563eb; }
.pill-crisis { background: #fef3c7; color: #d97706; }
.pill-pollut { background: #fee2e2; color: #dc2626; }
.pill-close { background: #f3e8ff; color: #7c3aed; }
.pill-legacy { background: #f5f5f4; color: #78716c; }
.tl-chevron {
    font-size: 10px;
    color: #a8a29e;
    transition: transform 0.2s;
}
.tl-card.open .tl-chevron {
    transform: rotate(180deg);
}
.tl-body {
    display: none;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e5e5e5;
    font-size: 14px;
    line-height: 1.7;
    color: var(--ink-faint);
}
.tl-card.open .tl-body {
    display: block;
}
.tl-body p {
    margin-bottom: 12px;
}
.tl-body p:last-child {
    margin-bottom: 0;
}
.tl-img-wrap {
    margin-top: 16px;
}
.tl-img-wrap img {
    width: 100%;
    border-radius: 6px;
}
.tl-img-cap {
    font-size: 12px;
    color: #a8a29e;
    font-style: italic;
    margin-top: 8px;
}

/* Key Figures */
.figures {
    padding: 60px 24px;
    background: var(--cream);
}
.figures-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}
.figure-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: transform 0.2s, box-shadow 0.2s;
}
.figure-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}
.figure-icon {
    font-size: 32px;
    margin-bottom: 12px;
}
.figure-name {
    font-weight: 700;
    font-size: 18px;
    color: var(--ink);
    margin-bottom: 4px;
}
.figure-role {
    font-size: 12px;
    color: #b07c2a;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}
.figure-desc {
    font-size: 14px;
    line-height: 1.6;
    color: var(--ink-faint);
}

/* References */
.references {
    padding: 60px 24px;
    background: var(--cream-2);
}
.refs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}
.ref-card {
    display: block;
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    transition: box-shadow 0.2s, transform 0.2s;
}
.ref-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}
.ref-source {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #b07c2a;
    font-weight: 600;
    margin-bottom: 8px;
}
.ref-title {
    font-weight: 600;
    color: var(--ink);
    font-size: 14px;
    margin-bottom: 4px;
    line-height: 1.4;
}
.ref-url {
    font-size: 12px;
    color: #a8a29e;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-meta {
        flex-direction: column;
        gap: 12px;
    }
    .tl-legend {
        gap: 12px;
    }
}

/* Chaliyar Miracle Section */
.chaliyar-miracle {
    display: flex;
    align-items: center;
    gap: 40px;
    background: linear-gradient(135deg, #0d2d42 0%, #1e4d6b 50%, #0d2d42 100%);
    border-radius: 20px;
    padding: 48px;
    color: white;
    position: relative;
    overflow: hidden;
}

.chaliyar-miracle::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.chaliyar-miracle-content {
    flex: 1;
    position: relative;
    z-index: 1;
}

.chaliyar-miracle-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.15);
    padding: 6px 14px;
    border-radius: 20px;
    margin-bottom: 16px;
}

.chaliyar-miracle-title {
    font-family: 'Playfair Display', serif;
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.2;
}

.chaliyar-miracle-desc {
    font-size: 16px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 28px;
    max-width: 500px;
}

.chaliyar-miracle-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #38bdf8;
    color: #0d2d42;
    font-weight: 600;
    font-size: 15px;
    padding: 14px 28px;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.chaliyar-miracle-btn:hover {
    background: #7dd3fc;
    transform: translateX(4px);
    box-shadow: 0 8px 25px rgba(56, 189, 248, 0.35);
}

.chaliyar-miracle-visual {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chaliyar-miracle-icon {
    font-size: 100px;
    line-height: 1;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.3));
    animation: float 4s ease-in-out infinite;
}

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

@media (max-width: 768px) {
    .chaliyar-miracle {
        flex-direction: column;
        padding: 32px 24px;
        text-align: center;
    }
    .chaliyar-miracle-desc {
        margin-left: auto;
        margin-right: auto;
    }
    .chaliyar-miracle-icon {
        font-size: 70px;
    }
}