:root {
    --primary-bg: #121212;   /* Deep Dark */
    --surface-bg: #1E1E1E;   /* Card / Section */
    --accent-color: #FF6B6B; /* Flame Red */
    --hover-color: #FF8E8E;  /* Soft Highlight (Natural) */
    --text-main: #E0E0E0;    /* Light Gray */
    --text-dim: #A0A0A0;     /* Dim Gray */
    --border-color: #333333;
    --app-canvas-bg: #000000;
    --header-height: 60px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
    color: var(--text-main);
    background-color: var(--primary-bg);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Engineer-friendly fonts */
code, pre, .mono {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
    background-color: #252525;
    color: var(--accent-color);
    padding: 0.2em 0.4em;
    border-radius: 3px;
}

/* Header */
header {
    background-color: var(--primary-bg);
    border-bottom: 1px solid var(--border-color);
    height: var(--header-height);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-main);
    text-decoration: none;
    letter-spacing: -0.5px;
}

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

nav {
    display: flex;
    align-items: center;
    height: 100%;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 20px;
    align-items: center;
    margin: 0;
    padding: 0;
}

nav a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
    transition: color 0.3s, transform 0.2s;
    display: flex;
    align-items: center;
}

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

.lang-switch a {
    font-size: 0.9rem;
    color: var(--text-dim);
}

/* Main Content */
main {
    flex: 1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Hero Section */
.hero {
    position: relative;
    background-color: var(--primary-bg);
    padding: 140px 20px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    overflow: hidden; /* Prevent blurred edges from leaking */
}

/* 1. Background Image Layer (Blurred) */
.hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-size: cover;
    background-position: center;
    filter: blur(3px); /* Reduced blur as requested */
    z-index: 0;
    opacity: 0.8;
    
    /* Animation: Fade in + Slow Zoom */
    animation: hero-reveal 1.5s ease-out forwards;
}

@keyframes hero-reveal {
    0% {
        opacity: 0;
        transform: scale(1.15); /* Start slightly zoomed in */
    }
    100% {
        opacity: 0.8;
        transform: scale(1.05); /* End at normal scale (still slightly zoomed to hide blur edges) */
    }
}

/* 2. Dark Overlay Layer */
.hero::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6); /* Adjust darkness here */
    z-index: 1;
}

/* 3. Specific Image Modifiers */
.hero.hero-brand::before,
.hero.hero-mol::before {
    background-image: url('mol/img/mol_top.webp');
}

.hero.hero-md::before {
    background-image: url('md_sandbox/img/md_top.webp');
}

/* Ensure content is on top */
.hero .container {
    position: relative;
    z-index: 2;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 25px;
    color: #FFFFFF;
    letter-spacing: -1px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-dim);
    margin-bottom: 40px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.btn {
    display: inline-block;
    padding: 14px 36px;
    background-color: var(--accent-color);
    color: var(--primary-bg); /* Dark text on bright background */
    text-decoration: none;
    border-radius: 6px;
    font-weight: bold;
    transition: background-color 0.3s, transform 0.2s;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.btn:hover {
    background-color: var(--hover-color);
    transform: translateY(-2px);
}

/* Features Section */
.features {
    padding: 80px 20px;
    background-color: var(--surface-bg);
}

.features h2 {
    text-align: center;
    margin-bottom: 50px;
    font-size: 2rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-card {
    background: var(--primary-bg);
    padding: 40px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    text-align: left;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.feature-card:hover {
    border-color: var(--accent-color);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.feature-card h3 {
    color: var(--accent-color);
    margin-bottom: 15px;
    font-size: 1.4rem;
}

.feature-card p {
    color: var(--text-dim);
}

/* Documentation Styles */
.docs-content {
    max-width: 800px;
    margin: 0 auto;
}

.docs-content h1 {
    margin-bottom: 40px;
    font-size: 2.5rem;
    color: #FFFFFF;
}

.docs-content h2 {
    margin-top: 50px;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    color: var(--accent-color);
}

.docs-content p {
    margin-bottom: 24px;
    color: var(--text-main);
}

.docs-content ul {
    margin-bottom: 24px;
    padding-left: 20px;
}

.docs-content li {
    margin-bottom: 12px;
    color: var(--text-main);
}

/* App Page Layout */
.app-layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.app-main-wrapper {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.ad-sidebar {
    display: none; /* Hide for cleaner UI and better SEO evaluation */
}

.app-container {
    flex: 1;
    display: flex;
    position: relative;
    background-color: var(--app-canvas-bg);
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#bevy-canvas {
    width: 100%;
    height: 100%;
    display: block;
    outline: none;
}

.app-footer-area {
    height: 150px;
    background-color: #ffffff;
    border-top: 1px solid #e5e7eb;
    padding: 20px 0; /* Changed to use inner container for consistent margins */
    box-sizing: border-box;
    overflow-y: auto;
    color: #374151; /* Dark gray for readability */
}

.app-footer-area .container {
    max-width: calc(100% - 400px); /* Account for 200px margins on both sides */
    padding: 0 20px;
}

@media (max-width: 1200px) {
    .ad-sidebar {
        width: 100px;
    }
    .app-footer-area .container {
        max-width: calc(100% - 200px);
    }
}

@media (max-width: 800px) {
    .ad-sidebar {
        display: none;
    }
    .app-footer-area .container {
        max-width: 100%;
    }
}

.app-footer-area h3 {
    font-size: 1rem;
    margin-bottom: 10px;
    color: #111827;
}

.app-footer-area p {
    font-size: 0.85rem;
    line-height: 1.5;
    color: #4b5563;
}

.app-footer-area a {
    color: var(--accent-color);
    text-decoration: underline;
}

/* Footer */
footer {
    background-color: var(--primary-bg);
    color: var(--text-dim);
    text-align: center;
    padding: 60px 20px;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

.footer-nav {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.footer-nav a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
}

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

footer p {
    font-size: 0.8rem;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        height: auto;
        padding: 15px;
    }

    nav ul {
        margin-top: 15px;
        font-size: 0.9rem;
        gap: 15px;
        justify-content: center;
    }

    .hero h1 {
        font-size: 2rem;
    }
}

.github-link {
    display: flex;
    align-items: center;
}

.github-link img {
    transition: opacity 0.2s;
    vertical-align: middle;
}

.github-link a:hover img {
    opacity: 0.7;
}