/* General Setup & Variables */
:root {
    --primary-color: #00A3FF; /* Brighter blue for a modern feel */
    --secondary-color: #0F172A; /* Dark blue/slate for text and backgrounds */
    --background-color: #020617; /* Very dark navy, almost black */
    --text-color: #E2E8F0; /* Light gray for text */
    --light-text-color: #94A3B8; /* Muted gray for subtitles */
    --card-bg: #1E293B; /* Dark slate for cards */
    --header-height: 70px;
    --accent-glow: rgba(0, 163, 255, 0.5);
    /* KNR Logo Colors */
    --knr-red: #D9232D;
    --knr-blue: #007BFF;
    --knr-green: #28A745;
}

*, *::before, *::after {
    box-sizing: border-box;
}

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    font-family: 'Roboto', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.7;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-img {
    height: 50px;
    width: 50px;
    object-fit: cover;
    /*border-radius: 70%;*/
}

/* Particle Canvas Background */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

/* Header & Navigation */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--header-height);
    width: 100%;
    padding: 0 5%;
    background-color: rgba(2, 6, 23, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #1e293b;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
}

.nav-logo {
    font-family: 'Exo 2', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 30px;
}

.nav-link {
    text-decoration: none;
    color: var(--light-text-color);
    font-weight: 400;
    font-size: 1rem;
    padding: 5px 0;
    position: relative;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-link:hover, .nav-link.current {
    color: var(--primary-color);
    text-shadow: 0 0 10px var(--accent-glow);
}

.nav-link:hover::after, .nav-link.current::after {
    width: 100%;
}

.hamburger { display: none; cursor: pointer; }
.bar { display: block; width: 25px; height: 3px; margin: 5px auto; background-color: #fff; transition: all 0.3s ease-in-out; }

/* Main Content & Typography */
main { position: relative; z-index: 10; }
.main-home { padding-top: var(--header-height); }
.main-content { padding: calc(var(--header-height) + 40px) 5% 40px; }

h1 { font-family: 'Exo 2', sans-serif; font-size: clamp(2.5rem, 5vw, 4rem); font-weight: 600; color: #fff; margin-bottom: 10px; }
h2 { font-family: 'Exo 2', sans-serif; font-size: clamp(2rem, 4vw, 2.8rem); text-align: center; color: #fff; margin-bottom: 50px; position: relative; }
h2::after { content: ''; position: absolute; width: 80px; height: 3px; background: linear-gradient(90deg, var(--primary-color), transparent); bottom: -15px; left: 50%; transform: translateX(-50%); border-radius: 2px; }
h3 { font-family: 'Exo 2', sans-serif; font-size: 1.5rem; color: #fff; margin-bottom: 10px; }
p { font-size: 1.1rem; font-weight: 300; max-width: 800px; margin: 0 auto 20px auto; color: var(--light-text-color); }
.subtitle { font-size: 1.3rem; color: var(--primary-color); font-weight: 400; margin-bottom: 30px; }

.cta-button {
    display: inline-block;
    background-color: var(--primary-color);
    color: #fff;
    padding: 12px 25px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 1px solid var(--primary-color);
    box-shadow: 0 0 15px var(--accent-glow);
}
.cta-button:hover {
    background-color: transparent;
    color: var(--primary-color);
    transform: translateY(-3px);
}

/* KNR Logo Text Style */
.knr-logo-text {
    background: linear-gradient(90deg, var(--knr-red) 0%, var(--knr-blue) 50%, var(--knr-green) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 600;
}


/* Hero Section (Homepage) */
#threejs-container { position: absolute; top: 0; left: 0; width: 100%; height: 100vh; z-index: 1; }
.hero-section { display: flex; align-items: center; justify-content: center; min-height: calc(100vh - var(--header-height)); text-align: center; position: relative; z-index: 2; }
.hero-text { background: rgba(2, 6, 23, 0.5); padding: 40px; border-radius: 10px; }

/* Summary Section */
.summary-section { padding: 80px 5%; background-color: var(--background-color); position: relative; }
.summary-cards { display: flex; justify-content: space-around; gap: 30px; margin-top: 50px; }
.card {
    background-color: var(--card-bg);
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    flex-basis: 30%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #334155;
}
.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 0 25px var(--accent-glow);
    border-color: var(--primary-color);
}
.card i { font-size: 2.5rem; color: var(--primary-color); margin-bottom: 20px; }
.card p { font-size: 1rem; margin-bottom: 20px; min-height: 110px; }
.card a { color: var(--primary-color); text-decoration: none; font-weight: 600; }

/* General Content Pages */
.page-header { text-align: center; padding: 40px 0; background: radial-gradient(circle, var(--card-bg) 0%, transparent 80%); margin-bottom: 50px; }
.content-section { padding: 50px 0; max-width: 1000px; margin: 0 auto; }
.content-section.alternate-bg { background-color: var(--secondary-color); padding: 50px 5%; max-width: 100%; border-radius: 10px; }
.content-section h2 { text-align: left; }
.content-section h2::after { left: 0; transform: none; }

/* Stats Section (About Page) */
.stats-container { display: flex; justify-content: space-around; text-align: center; padding: 20px 0; }
.stat-item { flex-basis: 25%; }
.stat-number { font-family: 'Exo 2', sans-serif; font-size: 3rem; font-weight: 600; color: var(--primary-color); }
.stat-label { display: block; color: var(--light-text-color); }
.dual-column { display: flex; gap: 40px; align-items: center; }
.column-text { flex: 1; }
.column-image { flex: 1; }
.column-image img { width: 100%; border-radius: 10px; box-shadow: 0 0 20px var(--accent-glow); }

/* Timeline (About Page) */
.timeline { position: relative; margin-top: 40px; }
.timeline::before { content: ''; position: absolute; left: 20px; top: 0; bottom: 0; width: 2px; background-color: #334155; }
.timeline-item { position: relative; padding-left: 60px; margin-bottom: 30px; }
.timeline-icon { position: absolute; left: 0; top: 0; width: 40px; height: 40px; border-radius: 50%; background-color: var(--primary-color); color: #fff; display: flex; justify-content: center; align-items: center; border: 3px solid var(--background-color); transition: transform 0.3s ease; }
.timeline-item:hover .timeline-icon { transform: scale(1.2); }

/* Research Page - Flip Cards */
.research-pillars { display: flex; gap: 30px; margin-top: 40px; }
.pillar-card { background-color: transparent; width: 100%; height: 200px; flex: 1; perspective: 1000px; }
.pillar-card-inner { position: relative; width: 100%; height: 100%; text-align: center; transition: transform 0.6s; transform-style: preserve-3d; }
.pillar-card:hover .pillar-card-inner { transform: rotateY(180deg); }
.pillar-front, .pillar-back { position: absolute; width: 100%; height: 100%; backface-visibility: hidden; display: flex; flex-direction: column; justify-content: center; align-items: center; border-radius: 10px; background: var(--card-bg); border: 1px solid #334155; }
.pillar-front i { font-size: 3rem; color: var(--primary-color); }
.pillar-front h3 { margin-top: 15px; }
.pillar-back { transform: rotateY(180deg); padding: 20px; }

/* Publications Table */
.table-container { overflow-x: auto; }
.publications-table { width: 100%; border-collapse: collapse; margin-top: 40px; }
.publications-table th, .publications-table td { padding: 15px; text-align: left; border-bottom: 1px solid #334155; }
.publications-table th { background-color: var(--secondary-color); color: #fff; }
.publications-table tr { transition: background-color 0.3s ease; }
.publications-table tr:hover { background-color: #2a3a52; }

/* Ventures Page */
.venture-highlight { display: flex; gap: 40px; align-items: center; }
.venture-logo-knr img { max-width: 150px; height: auto; }
.product-list li { list-style: none; padding-left: 20px; position: relative; margin-bottom: 5px; }
.product-list li::before { content: '✓'; color: var(--primary-color); position: absolute; left: 0; }
.venture-timeline { position: relative; padding: 20px 0; }
.venture-timeline::before { content: ''; position: absolute; left: 20px; top: 0; bottom: 0; width: 2px; background: #334155; }
.v-timeline-item { position: relative; padding-left: 60px; margin-bottom: 40px; }
.v-timeline-item::before { content: ''; position: absolute; left: 12px; top: 5px; width: 16px; height: 16px; background: var(--card-bg); border: 2px solid var(--primary-color); border-radius: 50%; z-index: 1; }
.v-timeline-item.current::before { background: var(--primary-color); box-shadow: 0 0 10px var(--accent-glow); }
.v-timeline-date { font-weight: 600; color: var(--primary-color); }

/* Contact Page */
.contact-container { display: flex; gap: 50px; background: var(--card-bg); padding: 40px; border-radius: 10px; }
.contact-info, .contact-form { flex: 1; }
.info-item { display: flex; align-items: center; gap: 15px; margin-bottom: 20px; }
.info-item i { font-size: 1.2rem; color: var(--primary-color); }
.form-group { margin-bottom: 20px; }
.form-group input, .form-group textarea { width: 100%; padding: 12px; border: 1px solid #334155; border-radius: 5px; background: var(--secondary-color); color: var(--text-color); transition: border-color 0.3s; }
.form-group input:focus, .form-group textarea:focus { border-color: var(--primary-color); outline: none; box-shadow: 0 0 10px var(--accent-glow); }

/* Footer */
.site-footer { background-color: var(--secondary-color); color: #f4f7f9; text-align: center; padding: 30px 5%; border-top: 1px solid #334155; }
.social-links a { color: #fff; font-size: 1.5rem; margin: 0 15px; transition: color 0.3s ease, transform 0.3s ease; }
.social-links a:hover { color: var(--primary-color); transform: translateY(-3px); }

/* Scroll Reveal Initial State */
.reveal { visibility: hidden; }

/* Responsive Design */
@media (max-width: 992px) {
    .summary-cards, .venture-cards, .research-pillars { flex-direction: column; }
    .contact-container, .dual-column { flex-direction: column; }
    .column-image { margin-top: 30px; }
}

@media (max-width: 768px) {
    .nav-menu { position: fixed; left: -100%; top: var(--header-height); flex-direction: column; background-color: var(--secondary-color); width: 100%; text-align: center; transition: 0.3s; box-shadow: 0 10px 20px rgba(0,0,0,0.1); }
    .nav-menu.active { left: 0; }
    .nav-item { margin: 1.5rem 0; }
    .hamburger { display: block; }
    .hamburger.active .bar:nth-child(2) { opacity: 0; }
    .hamburger.active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .hamburger.active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
    .venture-highlight { flex-direction: column; text-align: center; }
    .venture-logo-knr { margin: 0 auto 20px; }
    .venture-timeline::before, .v-timeline-item::before { left: 5px; }
    .v-timeline-item { padding-left: 40px; }
    .stats-container { flex-wrap: wrap; }
    .stat-item { flex-basis: 50%; margin-bottom: 20px; }
}
