/* Design System & Variables - Fresh Turquoise (Oceanic Clarity) */

/* Lock Screen Styles */
#site-lock {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lock-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: rgba(255, 255, 255, 0.9);
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--glass-border);
}

.lock-content h2 {
    margin-bottom: 1rem;
    font-family: var(--font-heading);
    color: var(--color-primary);
}

.lock-content input {
    padding: 0.5rem 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-size: 1rem;
    width: 100%;
    max-width: 250px;
}

.lock-content button {
    padding: 0.5rem 1.5rem;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s ease;
}

.lock-content button:hover {
    background: var(--color-secondary);
}

:root {
    /* Palette: Vibrant Teal & Cyan - Fresh & Lively */
    --color-bg: #FFFFFF;
    /* Pure White */
    --color-bg-alt: #F0FDFA;
    /* Very Pale Mint/Teal Tint - Fresh */
    --color-text: #1d2d35;
    /* Dark Cyan-Gray - Sharper than Slate */
    --color-text-muted: #455A64;
    /* Blue Gray */

    /* Primary Colors - Rich & Vibrant */
    --color-primary: #00897B;
    /* Teal 600 - Rich, slightly brighter */
    --color-accent: #00BFA5;
    /* Teal A700 - Vivid Teal Accent */
    --color-accent-warm: #00BCD4;
    /* Cyan 500 - Electric Pop */

    /* Typography */
    --font-ui: 'Inter', system-ui, -apple-system, sans-serif;
    --font-heading: 'Playfair Display', serif;
    /* Reverted to elegant serif */

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 8rem;

    --container-width: 1200px;

    /* Component Colors */
    --card-bg: rgba(255, 255, 255, 0.7);
    --card-bg-hover: rgba(255, 255, 255, 0.95);
    --btn-bg: #0F172A;
    --btn-text: #FFFFFF;

    /* Effects */
    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-border: rgba(0, 191, 165, 0.2);
    /* Vibrant Teal Tint */
    --shadow-soft: 0 10px 40px rgba(17, 94, 89, 0.05);
    /* Deep Teal shadow */
    --radius-lg: 24px;

    --transition-fast: 0.3s ease;
}

/* Dark Mode Variables */
[data-theme="dark"] {
    --color-bg: #0F172A;
    /* Slate 900 */
    --color-bg-alt: #1E293B;
    /* Slate 800 */
    --color-text: #F1F5F9;
    /* Slate 100 */
    --color-text-muted: #CBD5E1;
    /* Slate 300 */

    --color-primary: #2DD4BF;
    /* Teal 400 - Brighter for dark mode */
    --color-accent: #14B8A6;
    /* Teal 500 */
    --color-accent-warm: #22D3EE;
    /* Cyan 400 */

    --glass-bg: rgba(15, 23, 42, 0.85);
    --glass-border: rgba(45, 212, 191, 0.2);
    --shadow-soft: 0 10px 40px rgba(0, 0, 0, 0.3);

    /* Component Colors (Dark Mode) */
    --card-bg: rgba(30, 41, 59, 0.6);
    /* Slate 800 with opacity */
    --card-bg-hover: rgba(30, 41, 59, 0.9);
    --btn-bg: #2DD4BF;
    /* Teal 400 */
    --btn-text: #0F172A;
    /* Slate 900 */
}

/* Toggle Button */
.theme-toggle {
    background: transparent;
    border: none;
    color: var(--color-text);
    padding: 0.5rem;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    opacity: 0.7;
    width: 40px;
    height: 40px;
}

.theme-toggle:hover {
    opacity: 1;
    background: var(--color-bg-alt);
    transform: rotate(15deg);
}

.theme-toggle:hover {
    opacity: 1;
    background: var(--color-bg-alt);
    border-color: var(--color-accent);
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-ui);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

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

a:hover {
    color: var(--color-accent);
}

/* Typography */
h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: var(--color-text);
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    margin-bottom: var(--spacing-sm);
    color: var(--color-text);
    /* No Gradient - Clean Look */
    letter-spacing: -0.02em;
    font-weight: 700;
}

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

h2::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -5px;
    width: 40px;
    height: 3px;
    background: var(--color-accent-warm);
    border-radius: 2px;
}

p {
    margin-bottom: var(--spacing-md);
    color: var(--color-text-muted);
    font-size: 1.125rem;
    max-width: 65ch;
    font-weight: 300;
}

.text-accent {
    color: var(--color-accent);
}

/* Layout Utilities */
.container {
    width: 90%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--spacing-sm);
    position: relative;
    z-index: 2;
    /* Above canvas */
}

section {
    padding: var(--spacing-xl) 0;
    position: relative;
}

/* Canvas Background */
#nature-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.6;
}

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    padding: var(--spacing-md) 0;
    backdrop-filter: blur(12px);
    background: var(--glass-bg);
    border-bottom: 1px solid var(--glass-border);
}

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

.logo {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: 0em;
    color: var(--color-text);
    line-height: 1;
    display: inline-block;
}



nav ul {
    display: flex;
    gap: var(--spacing-md);
    list-style: none;
    align-items: baseline;
}

nav a {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
    opacity: 0.7;
}

nav a:hover,
nav a.active {
    opacity: 1;
    color: var(--color-text);
}

nav a.active {
    border-bottom: 2px solid var(--color-accent-warm);
}

/* Hero Section */
.hero {
    min-height: 90vh;
    display: flex;
    align-items: flex-start;
    /* Aligned to top to match subpages */
    padding-top: 160px;
    /* Consistent Top Padding */
    position: relative;
    /* Ensure positioning context */
    overflow: hidden;
    /* Prevent overflow if logo is large */
}

.hero-small {
    min-height: 40vh;
    padding-top: 160px;
    align-items: flex-start;
}

/* Background Logo Watermark */
/* Background Logo Watermark */
body::before {
    content: '';
    position: fixed;
    /* Fixed to viewport so it doesn't move with scroll/content height */
    top: 15vh;
    /* Lowered from 5vh to clear navbar */
    left: -5%;
    width: 60vh;
    height: 60vh;
    background-image: url('../img/imi_logo.svg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.1;
    z-index: -1;
    pointer-events: none;
}

[data-theme="dark"] body::before {
    background-image: url('../img/imi_logo_inverted.svg');
    opacity: 0.1;
    /* Increased from 0.05 for better visibility */
}

.hero-content {
    max-width: 800px;
}

.hero-subtitle {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    color: var(--color-text);
    margin-bottom: var(--spacing-md);
    font-weight: 400;
    font-style: italic;
    opacity: 0.9;
}

.btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    background: var(--btn-bg);
    color: var(--btn-text);
    font-weight: 500;
    margin-top: var(--spacing-sm);
    border-radius: 4px;
    /* Squared shape */
    transition: all var(--transition-fast);
    border: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(26, 47, 35, 0.2);
    background: var(--color-accent);
}

.btn-secondary {
    background: transparent;
    color: var(--color-text);
    border: 1px solid var(--color-text);
}

.btn-secondary:hover {
    background: rgba(26, 47, 35, 0.05);
    box-shadow: none;
    color: var(--color-text);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2rem;
}

/* Cards / Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--spacing-md);
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    padding: var(--spacing-md);
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-soft);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.text-highlight {
    color: var(--color-primary);
    font-weight: 600;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 50px rgba(20, 184, 166, 0.15);
    background: var(--card-bg-hover);
}

.card h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: var(--spacing-sm);
    color: var(--color-text);
}

.card-icon {
    font-family: var(--font-heading);
    font-size: 3rem;
    color: rgba(20, 184, 166, 0.2);
    /* Very subtle accent */
    margin-bottom: var(--spacing-xs);
    display: block;
    line-height: 1;
}

/* Person Card Specifics */
.person-card {
    text-align: center;
}

.profile-img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1rem;
    border: 3px solid rgba(93, 140, 123, 0.2);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.person-card:hover .profile-img {
    transform: scale(1.05);
    border-color: var(--color-accent);
}

.person-card h3 {
    margin-bottom: 0.25rem;
    font-size: 1.5rem;
}

.person-card .role {
    font-family: var(--font-ui);
    color: var(--color-accent);
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.person-card .topic {
    font-size: 0.95rem;
    margin-bottom: 1rem;
    line-height: 1.4;
    color: var(--color-text);
    opacity: 0.9;
}

.tag-container {
    display: flex;
    gap: 0.4rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 0.8rem;
}

.affiliation-tag {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background: rgba(20, 184, 166, 0.1);
    color: var(--color-primary);
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid rgba(20, 184, 166, 0.2);
}

.person-card .email-link {
    font-size: 0.85rem;
    color: var(--color-accent);
    text-decoration: none;
    border-bottom: 1px dotted var(--color-accent);
    transition: all 0.2s ease;
}

.person-card .email-link:hover {
    color: var(--color-primary);
    border-bottom: 1px solid var(--color-primary);
}

/* Blog Styles */
.blog-grid {
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
}

.blog-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.blog-meta {
    font-size: 0.85rem;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.blog-card .read-more {
    margin-top: auto;
    padding-top: 1rem;
    font-weight: 500;
    color: var(--color-primary);
    font-size: 0.9rem;
}

.article-content {
    line-height: 1.8;
    font-size: 1.15rem;
}

.article-content h2 {
    margin-top: 3rem;
    margin-bottom: 1rem;
}

.article-content h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.article-content p {
    margin-bottom: 1.5rem;
    color: var(--color-text);
}

.article-content blockquote {
    border-left: 4px solid var(--color-accent);
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: var(--color-text-muted);
    font-family: var(--font-heading);
    font-size: 1.4rem;
}

.article-content pre {
    background: var(--color-bg-alt);
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    border: 1px solid var(--glass-border);
    margin: 2rem 0;
    font-size: 0.9rem;
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
}

/* Footer */
footer {
    padding: var(--spacing-lg) 0;
    border-top: 1px solid var(--glass-border);
    margin-top: var(--spacing-xl);
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.9rem;
    background: var(--color-bg);
    position: relative;
    z-index: 10;
}

/* Animations included in JS but helper classes here */
.fade-in {
    opacity: 0;
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {

    /* Header & Navigation */
    header {
        padding: 0.5rem 0;
        /* Reduce padding */
    }

    .container.nav-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .logo {
        font-size: 1.1rem;
        /* Slightly smaller logo */
        white-space: normal;
        /* Allow wrapping */
        max-width: 100%;
        line-height: 1.2;
    }

    nav {
        width: 100%;
        overflow-x: auto;
        /* Enable horizontal scroll */
        -webkit-overflow-scrolling: touch;
        /* Smooth scroll on iOS */
        padding-bottom: 5px;
        /* Space for scrollbar if visible */
        mask-image: linear-gradient(to right, black 90%, transparent 100%);
        -webkit-mask-image: linear-gradient(to right, black 90%, transparent 100%);
    }

    nav ul {
        width: max-content;
        /* Ensure list extends beyond screen */
        gap: 1.5rem;
        padding-right: 1rem;
        /* Right padding to see last item */
        flex-wrap: nowrap;
    }

    /* Hero Section */
    .hero {
        padding-top: 160px;
        /* Increase top padding to account for taller header */
        align-items: flex-start;
        /* Align top on mobile */
    }

    .hero h1 {
        font-size: 2.75rem;
        /* Smaller hero text */
    }

    .hero-actions {
        gap: 0.5rem;
    }

    .hero-actions .btn {
        margin-top: 0;
    }
}