:root {
    --bg-black: #020617;
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --accent-violet: #8b5cf6; /* Matches the nebula center */
    --accent-cyan: #22d3ee;   /* Matches the wave fringes */
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --code-bg: #000000;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-black);
    color: var(--text-main);
    line-height: 1.6;
}

/* Typography */
h1, h2, h3 { color: var(--text-main); letter-spacing: -0.025em; }
a { color: var(--accent-cyan); text-decoration: none; transition: 0.2s; }
a:hover { color: var(--accent-violet); }

/* Navigation */
nav {
    display: flex;
    justify-content: space-between;
    padding: 1.25rem 5%;
    background: rgba(2, 6, 23, 0.95);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid #1e293b;
}

.nav-links a {
    margin-left: 1.5rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.nav-links a:hover { color: var(--text-main); }

/* Hero Section */
.hero {
    position: relative;
    height: 85vh;
    min-height: 600px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 2rem;
    background: linear-gradient(rgba(2, 6, 23, 0.6), rgba(2, 6, 23, 0.8)),
                url('Images/NearField.vis.2048x1245px.jpg') center/cover no-repeat;
}

.hero h1 { font-size: 3.5rem; margin-bottom: 0.5rem; }
.hero p { font-size: 1.5rem; color: var(--text-muted); margin-bottom: 2rem; }

.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    border-radius: 6px;
    font-weight: 600;
    margin: 0.5rem;
    text-decoration: none;
    /* Match the timing of your info-box transition */
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Primary Button (Violet Glow) */
.btn-primary {
    background: var(--accent-violet);
    color: white;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.btn-primary:hover {
    background: #7c3aed;
    transform: scale(1.05); /* Match the pop-out effect */
    border-color: rgba(139, 92, 246, 0.6);
    /* Outer glow and subtle inner glow */
    box-shadow: 0 0 25px rgba(139, 92, 246, 0.45),
                inset 0 0 10px rgba(255, 255, 255, 0.1);
}

/* Secondary Button (Cyan Glow - Matches Info Box) */
.btn-secondary {
    border: 1px solid var(--accent-cyan);
    color: var(--accent-cyan);
    background: rgba(0, 255, 255, 0.02);
}

.btn-secondary:hover {
    background: rgba(0, 255, 255, 0.1); /* Slight fill change */
    color: white; /* Changed from black to white for better contrast with the glow */
    transform: scale(1.05);
    border-color: rgba(0, 255, 255, 0.6);
    /* Exact same glow settings as your active-glow info box */
    box-shadow: 0 0 25px rgba(0, 255, 255, 0.45),
                inset 0 0 20px rgba(0, 255, 255, 0.05);
}



/* Layout Sections */
section { padding: 5rem 10%; }
.section-dark { background: var(--bg-dark); }
.section-slate { background: #1e293b; }

.container-narrow { max-width: 800px; margin: 0 auto; }

/* Code Blocks */
pre {
    background: var(--code-bg);
    padding: 1.5rem;
    border-left: 4px solid var(--accent-violet);
    overflow-x: auto;
    border-radius: 4px;
}

code { font-family: 'IBM Plex Mono', monospace; color: var(--accent-cyan); }

/* Matrix Grid */
.matrix-wrapper {
    overflow-x: auto;
    margin: 2rem 0;
}

.matrix-grid {
    display: grid;
    grid-template-columns: 50px repeat(4, 1fr);
    gap: 15px;
    min-width: 800px;
}

.matrix-cell {
    background: var(--bg-card);
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    transition: transform 0.2s;
}

.matrix-cell:hover {
    transform: translateY(-5px);
    border-color: var(--accent-cyan);
}

.matrix-cell img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 8px;
}

.matrix-label {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--accent-violet);
}

.model-step {
    padding-left: 1.5rem;
    border-left: 2px solid #334155;
    transition: border-color 0.3s;
}
.model-step:hover {
    border-left-color: var(--accent-cyan);
}
.model-step h3 {
    margin-top: 0;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* --- Interactive Graphic Styles --- */
.interactive-container {
    display: flex;
    flex-wrap: wrap;
    gap: 3rem;
    align-items: flex-start;
    padding: 2rem 0;
}

.svg-wrapper {
    flex: 1;
    min-width: 300px;
    max-width: 600px;
    filter: drop-shadow(0 0 20px rgba(139, 92, 246, 0.3)); /* Violet glow to match nebula */
}

/* Base Styles for all clickable parts */
.level-group {
    cursor: pointer;
    transition: filter 0.2s, transform 0.2s;
}

/* Focus state: Make the rest dim */
#f5-hierarchy-svg:hover .level-group {
    filter: opacity(0.5) blur(1px);
}

/* Hover/Active State: Illuminate the selected level */
.level-group:hover {
    filter: opacity(1) blur(0px) brightness(1.3) !important;
    transform: translateX(5px);
}

/* Details Panel Style */
.details-panel {
    flex: 1;
    min-width: 300px;
    background: var(--bg-card);
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 2rem;
    transition: opacity 0.3s;
}

.details-panel.fade {
    opacity: 0.1;
}

#details-title {
    margin-top: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 1.1rem;
}

#details-content p {
    color: var(--text-muted);
}

#details-ai-note {
    margin-top: 1.5rem;
    padding: 0.75rem;
    background: var(--bg-black);
    border-radius: 4px;
    border-left: 2px solid var(--accent-cyan);
    font-size: 0.9rem;
    color: var(--text-main);
}


/* Footer */
footer {
    padding: 2rem 5%;
    background: var(--bg-black);
    border-top: 1px solid #1e293b;
    text-align: center;
}

iframe.impressum {
    width: 100%;
    height: 150px;
    border: none;
    filter: invert(1) opacity(0.7); /* Adjust for dark mode if source is light */
}

@media (max-width: 768px) {
    .hero h1 { font-size: 2.2rem; }
    section { padding: 3rem 5%; }
}



/* --- Base Layout (Mobile First) --- */
.model-hero-container {
    display: flex;
    flex-direction: column; /* Stack vertically on mobile */
    gap: 30px;
}

.model-hero-column-left,
.model-hero-column-right {
    width: 100%;
    position: static; /* No sticking on mobile */
}

/* --- Desktop Layout (Screens wider than 900px) --- */
@media (min-width: 900px) {
    .model-hero-container {
        flex-direction: row; /* Side-by-side on desktop */
        align-items: flex-start;
    }

    .model-hero-column-left {
        flex: 1.2;
    }

    .model-hero-column-right {
        flex: 1;
        position: sticky; /* Only stick on desktop */
        top: 100px;       /* Distance from top of screen */
        height: fit-content;
    }
}




/* Capabilities Grid */
.capabilities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.cap-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 25px;
    border-radius: 12px;
    transition: transform 0.3s ease;
}

.cap-card:hover {
    background: rgba(0, 255, 255, 0.02);
    border-color: var(--accent-cyan);
}

.cap-header {
    color: var(--accent-cyan);
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
    margin-bottom: 15px;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
}

.cap-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cap-card ul li {
    font-size: 0.95rem;
    padding: 5px 0;
    color: #ccc;
    position: relative;
    padding-left: 15px;
}

.cap-card ul li::before {
    content: "\2022";
    position: absolute;
    left: 0;
    color: var(--accent-cyan);
}

.f5-hit-zone {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    cursor: pointer;
    background: rgba(0, 255, 255, 0); /* Keep it invisible */
    /* TEMP: Change this to see the boxes while adjusting */
    temp-background: rgba(255, 0, 0, 0.3);
    transition: all 0.2s ease;
    border-radius: 4px;
}


.f5-hit-zone:hover {
    background: rgba(0, 255, 255, 0.15); /* Slightly stronger hover now that it's the main interaction */
    border: 1px solid rgba(0, 255, 255, 0.5);
}

#layer-info-box {
    margin-top: 15px;
    padding: 20px;
    background: rgba(15, 23, 42, 0.9); /* Slightly more opaque for readability */
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-left: 4px solid var(--accent-cyan);
    border-radius: 8px;
    opacity: 1; /* Default to visible */

    /* The Glow */
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);

    /* Ensure text stays crisp */
    backdrop-filter: blur(8px);
}

/* This class will be toggled by JavaScript */
#layer-info-box.active-glow {
    border-color: rgba(0, 255, 255, 0.6);
    box-shadow: 0 0 25px rgba(0, 255, 255, 0.45),
                inset 0 0 20px rgba(0, 255, 255, 0.05);
    transform: scale(1.02); /* Subtle pop-out effect */
}

.theory-box h3 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.theory-box p {
    font-size: 0.85rem;
    line-height: 1.6;
    color: #cbd5e1; /* Slate-300 for readability */
}

/* Optional: adjust the math box to be more subtle if needed */
.theory-box div p {
    color: var(--accent-cyan);
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.2);
}
