/* 
   Bio-Mech Futurist Design System v2.0
   Inspired by: Cyberpunk, Biology, and High-Tech Robotics
*/

@import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@400;600;700&family=Rajdhani:wght@400;500;600;700&display=swap');

:root {
    /* Color Palette - High Contrast Industrial */
    --bg-core: #08080a;
    /* Slightly lighter than pure black */
    --bg-card: rgba(30, 30, 35, 0.8);
    /* More opaque */
    --bg-card-border: rgba(255, 255, 255, 0.15);

    --accent-primary: #ffcc00;
    /* Industrial Amber - High Vis */
    --accent-secondary: #4cc9f0;
    /* Bright Sky Blue */
    --accent-tertiary: #ff4d4d;
    /* Bright Red */

    --text-main: #ffffff;
    /* Pure White */
    --text-muted: #d0d0d0;
    /* Light Grey - High Contrast */
    --text-dark: #000000;

    /* Typography */
    --font-header: 'Chakra Petch', sans-serif;
    --font-body: 'Rajdhani', sans-serif;
    --font-mono: 'Courier New', monospace;
    /* Fallback for technical look */

    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 2rem;
    --space-lg: 5rem;
    --space-xl: 10rem;

    /* Effects */
    --glow-primary: 0 0 15px rgba(255, 204, 0, 0.4);
    --glow-secondary: 0 0 15px rgba(76, 201, 240, 0.4);
    --glass-blur: blur(15px);
    --border-radius: 2px;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--bg-core);
    color: var(--text-main);
    font-family: var(--font-body);
    font-weight: 500;
    line-height: 1.7;
    overflow-x: hidden;
    position: relative;
}

/* Animated Background - Softened */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -2;
    animation: gridMove 30s linear infinite;
    pointer-events: none;
}

body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, transparent 0%, var(--bg-core) 90%);
    z-index: -1;
    pointer-events: none;
}

@keyframes gridMove {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(50px);
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-core);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-secondary);
    border-radius: 0;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-header);
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #fff;
    text-wrap: balance;
}

h1 {
    font-size: clamp(3rem, 6vw, 6rem);
    line-height: 1;
    margin-bottom: var(--space-md);
    background: linear-gradient(90deg, #fff, var(--accent-secondary));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(0, 240, 255, 0.3);
}

h2 {
    font-size: clamp(2rem, 4vw, 3.5rem);
    margin-bottom: var(--space-md);
    display: inline-block;
    position: relative;
}

h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--accent-primary);
    margin-top: 10px;
    box-shadow: var(--glow-primary);
}

h3 {
    font-size: 1.5rem;
    color: var(--accent-secondary);
    margin-bottom: var(--space-sm);
    display: flex;
    align-items: center;
}

h3::before {
    content: '//';
    margin-right: 10px;
    color: var(--accent-primary);
    font-size: 0.8em;
}

p {
    margin-bottom: var(--space-sm);
    font-size: 1.15rem;
    max-width: 75ch;
    color: var(--text-muted);
}

strong {
    color: var(--text-main);
    font-weight: 700;
}

a {
    color: var(--accent-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

a:hover {
    color: var(--accent-primary);
    text-shadow: var(--glow-primary);
}

/* Layout Utilities */
.container {
    width: 90%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-sm);
}

section {
    padding: var(--space-lg) 0;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

/* Header is also a "section" in terms of visibility for tabs, 
   but it has ID #hero. We need to handle it. 
   Actually, let's make #hero a section too or handle it in JS.
   For now, let's assume #hero is the "Home" tab. */
#hero {
    display: flex;
    /* Hero uses flex */
    animation: fadeInSection 0.5s ease-out;
}

@keyframes fadeInSection {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Components */
.btn {
    display: inline-block;
    padding: 1.2rem 3rem;
    background: rgba(204, 255, 0, 0.05);
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
    font-family: var(--font-header);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 3px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: 0 0 10px rgba(204, 255, 0, 0.1);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--accent-primary);
    transition: all 0.4s ease;
    z-index: -1;
}

.btn:hover {
    color: var(--bg-core);
    box-shadow: 0 0 30px rgba(204, 255, 0, 0.6);
}

.btn:hover::before {
    left: 0;
}

/* Card Style */
.card {
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    backdrop-filter: var(--glass-blur);
    padding: var(--space-md);
    border-radius: var(--border-radius);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent-primary);
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-primary);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.card:hover::before {
    transform: scaleY(1);
    transform-origin: top;
}

/* Animations */
@keyframes backgroundPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

body::after {
    animation: backgroundPulse 8s ease-in-out infinite;
}

/* Animations */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 1s cubic-bezier(0.5, 0, 0, 1);
}

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

/* Navigation */
nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 0;
    background: rgba(5, 5, 5, 0.7);
    backdrop-filter: blur(20px);
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

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

.logo {
    font-family: var(--font-header);
    font-weight: 700;
    font-size: 1.8rem;
    color: #fff;
    letter-spacing: 2px;
}

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

.nav-links {
    display: flex;
    gap: 3rem;
    align-items: center;
}

.nav-links a {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--accent-secondary);
}

/* Hero Section */
#hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

#hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../images/fig_concept.png') no-repeat center center;
    background-size: cover;
    opacity: 0.15;
    filter: grayscale(100%) contrast(1.5) brightness(0.8);
    z-index: -1;
    mask-image: radial-gradient(circle, black 40%, transparent 100%);
    -webkit-mask-image: radial-gradient(circle, black 40%, transparent 100%);
}

.hero-content {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-content h1 {
    text-wrap: balance;
}

.hero-content p {
    text-wrap: balance;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.hero-content h1 span {
    display: block;
    color: var(--accent-primary);
    font-size: 0.3em;
    margin-bottom: 1rem;
    letter-spacing: 5px;
    text-shadow: none;
    background: none;
    -webkit-text-fill-color: var(--accent-primary);
}

/* Grid Layouts */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    /* Vertically center content */
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    align-items: start;
    /* Align tops of cards */
}

/* Image Styling */
/* Image Styling & Figures */
figure {
    margin: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

figure img {
    width: 100%;
    height: 300px;
    /* Fixed height for consistency in grids */
    object-fit: contain;
    /* Ensure whole image is visible */
    background: rgba(0, 0, 0, 0.2);
    /* Background for transparent PNGs */
    border-radius: var(--border-radius);
    border: 1px solid var(--bg-card-border);
    transition: all 0.3s ease;
}

/* Specific overrides for standalone figures */
.figure-large img {
    height: auto;
    max-height: 500px;
}

figcaption {
    margin-top: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-family: var(--font-mono);
    text-align: center;
    border-left: 2px solid var(--accent-primary);
    padding-left: 0.5rem;
    display: inline-block;
}

.diagram {
    filter: invert(1) hue-rotate(180deg) contrast(1.2);
    mix-blend-mode: screen;
    border: none;
    background: transparent !important;
}

figure:hover img {
    filter: grayscale(0%);
    border-color: var(--accent-secondary);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.2);
}

/* Prototype Gallery */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--bg-card-border);
    border-radius: var(--border-radius);
    background: var(--bg-card);
    transition: all 0.3s ease;
    aspect-ratio: 4/3;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: none;
    border-radius: 0;
    transition: transform 0.5s ease;
}

.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 0.8rem 1rem;
    background: rgba(10, 14, 20, 0.9);
    border-top: 1px solid var(--bg-card-border);
    color: var(--text-muted);
    font-size: 0.85rem;
    font-family: var(--font-mono);
    /* Assuming mono font or fallback */
    backdrop-filter: blur(4px);
    transform: translateY(0);
    transition: all 0.3s ease;
}

.gallery-item:hover {
    border-color: var(--accent-secondary);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-item:hover .gallery-caption {
    color: var(--text-main);
    background: rgba(10, 14, 20, 0.95);
}

/* Restored Figure Styles */
figure:hover .diagram {
    filter: invert(1) hue-rotate(180deg) contrast(1.2) drop-shadow(0 0 5px var(--accent-secondary));
    box-shadow: none;
}

figure {
    margin: var(--space-md) 0;
}

/* Team Section */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.team-member {
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    padding: 2rem;
    text-align: center;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
}

.team-member:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 0 20px rgba(204, 255, 0, 0.1);
    transform: translateY(-5px);
}

.member-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--accent-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent-primary);
    font-family: var(--font-header);
    box-shadow: 0 0 15px rgba(204, 255, 0, 0.2);
}

.member-role {
    color: var(--accent-secondary);
    text-transform: uppercase;
    font-size: 0.85rem;
    margin-bottom: 1rem;
    letter-spacing: 1px;
    font-weight: 600;
}

/* MathJax Overrides */
mjx-container {
    color: var(--text-main) !important;
    font-size: 1.3rem !important;
    overflow-x: auto;
    padding: var(--space-sm) 0;
}

/* Footer */
footer {
    border-top: 1px solid var(--bg-card-border);
    padding: var(--space-md) 0;
    text-align: center;
    color: var(--text-muted);
    background: #000;
}

footer p {
    max-width: 100%;
}

.footer-credit {
    font-size: 1rem;
    margin-top: 0.5rem;
    color: var(--accent-secondary);
    font-family: var(--font-mono);
    opacity: 0.8;
}

/* Responsive */
@media (max-width: 900px) {
    h1 {
        font-size: 3rem;
    }

    .grid-2 {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .nav-links {
        display: none;
    }

    /* TODO: Mobile Menu */
    .container {
        width: 95%;
    }
}

/* Expanded Content Styles */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5rem;
    color: var(--text-muted);
    font-size: 1rem;
}

.data-table th {
    text-align: left;
    padding: 1rem;
    color: var(--accent-primary);
    border-bottom: 1px solid var(--accent-secondary);
    font-family: var(--font-header);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--bg-card-border);
}

.data-table tr:hover td {
    color: #fff;
    background: rgba(0, 240, 255, 0.05);
}

.literature-list {
    list-style: none;
    margin-top: 1.5rem;
}

.literature-list li {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
    border-left: 2px solid var(--accent-secondary);
    position: relative;
}

.literature-list li::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 0;
    width: 10px;
    height: 10px;
    background: var(--bg-core);
    border: 2px solid var(--accent-secondary);
}

.literature-list strong {
    color: var(--accent-secondary);
    display: block;
    margin-bottom: 0.2rem;
}

.equation {
    background: rgba(0, 0, 0, 0.6);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--bg-card-border);
    margin: 1.5rem 0;
    text-align: center;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
}

ol li {
    margin-bottom: 0.8rem;
}

/* Tab Navigation Styles */
/* Tab Navigation Styles */
.tab-content {
    display: none;
    animation: fadeInTab 0.5s ease-out;
}

.tab-content.active-tab {
    display: block;
}

/* Ensure sections are visible within tabs */
section {
    display: block;
    position: relative;
    padding: var(--space-lg) 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

header#hero {
    display: flex;
    /* Hero uses flex centering */
    min-height: 100vh;
}

@keyframes fadeInTab {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Navigation Controls */
.nav-controls {
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 1.5rem 0;
    background: rgba(10, 10, 10, 0.95);
    /* Semi-transparent background */
    backdrop-filter: blur(10px);
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    border-top: 1px solid var(--bg-card-border);
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.5);
}

.nav-btn {
    min-width: 150px;
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    border-color: var(--text-muted);
    color: var(--text-muted);
}

/* Navigation Controls */
.nav-controls {
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 1.5rem 0;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    border-top: 1px solid var(--bg-card-border);
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.5);
}

.nav-btn {
    min-width: 150px;
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    box-shadow: none;
    background: transparent;
    border-color: var(--text-muted);
    color: var(--text-muted);
}

/* GitHub Web Button Pop-out Style */
.nav-links a.nav-github-btn {
    border: 1px solid var(--accent-primary);
    padding: 0.5rem 1.2rem;
    color: var(--accent-primary);
    border-radius: var(--border-radius);
    background: rgba(255, 204, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-left: 1rem;
}

.nav-links a.nav-github-btn:hover {
    background: var(--accent-primary);
    color: var(--bg-core);
    box-shadow: 0 0 20px rgba(255, 204, 0, 0.5);
    transform: translateY(-2px);
    text-shadow: none;
}