/* ********** Theme Variables ********** */
:root, [data-theme="dark"] {
    /* Ultron Modern Default (Dark) */
    --bg-color: #131314;
    --sidebar-bg: #1e1f20;
    --text-color: #e3e3e3;
    --text-muted: #888888;
    --input-bg: #282a2c;
    --accent-color: #4c8df6;
    --border-color: #444746;
    --user-msg-bg: #303134;
    --header-height: 60px;
    --ai-msg-text: #e3e3e3;
    --code-bg: #0d0d0d;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --heading-color: #a8c7fa;

    /* Legacy Compatibility Mappings */
    --primary-color: var(--accent-color);
    --primary-hover: #8ab4f8;
    --secondary-color: var(--sidebar-bg);
    --secondary-hover: #303134;
    --card-bg: var(--sidebar-bg);
    --solid-shadow: 0 10px 30px var(--shadow-color);
    --gradient-start: #4c8df6;
    --gradient-end: #e94235;
}

[data-theme="light"] {
    /* Corporate (Light) */
    --bg-color: #f8f9fa;
    --sidebar-bg: #ffffff;
    --text-color: #1f1f1f;
    --text-muted: #5f6368;
    --input-bg: #f1f3f4;
    --accent-color: #188038;
    --border-color: #e0e0e0;
    --user-msg-bg: #e8f0fe;
    --ai-msg-text: #1f1f1f;
    --code-bg: #1e1f20;
    --shadow-color: rgba(0, 0, 0, 0.08);
    --heading-color: #0d652d;
    
    /* Legacy Compatibility Mappings */
    --primary-color: var(--accent-color);
    --primary-hover: #137333;
    --secondary-color: var(--sidebar-bg);
    --secondary-hover: #f1f3f4;
    --card-bg: var(--sidebar-bg);
    --solid-shadow: 0 10px 30px var(--shadow-color);
    --gradient-start: #188038;
    --gradient-end: #137333;
}

[data-theme="green"] {
    /* Ultron Prime (Green) */
    --bg-color: #0d1b14;
    --sidebar-bg: #15291f;
    --text-color: #e0f2e9;
    --text-muted: #81c784;
    --input-bg: #1a3326;
    --accent-color: #4caf50;
    --border-color: #2e523e;
    --user-msg-bg: #1f3d2e;
    --ai-msg-text: #e0f2e9;
    --code-bg: #0a140f;
    --shadow-color: rgba(0, 0, 0, 0.35);
    --heading-color: #81c784;

    /* Legacy Compatibility Mappings */
    --primary-color: var(--accent-color);
    --primary-hover: #81c784;
    --secondary-color: var(--sidebar-bg);
    --secondary-hover: #1f3d2e;
    --card-bg: var(--sidebar-bg);
    --solid-shadow: 0 10px 30px var(--shadow-color);
    --gradient-start: #4caf50;
    --gradient-end: #388e3c;
}

[data-theme="red"] {
    /* Critical (Red) */
    --bg-color: #1b0d0d;
    --sidebar-bg: #291515;
    --text-color: #f2e0e0;
    --text-muted: #e57373;
    --input-bg: #331a1a;
    --accent-color: #f44336;
    --border-color: #522e2e;
    --user-msg-bg: #3d1f1f;
    --ai-msg-text: #f2e0e0;
    --code-bg: #140a0a;
    --shadow-color: rgba(0, 0, 0, 0.35);
    --heading-color: #e57373;

    /* Legacy Compatibility Mappings */
    --primary-color: var(--accent-color);
    --primary-hover: #e57373;
    --secondary-color: var(--sidebar-bg);
    --secondary-hover: #3d1f1f;
    --card-bg: var(--sidebar-bg);
    --solid-shadow: 0 10px 30px var(--shadow-color);
    --gradient-start: #f44336;
    --gradient-end: #d32f2f;
}

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

body {
    font-family: 'Google Sans', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color 0.4s ease, color 0.4s ease;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ********** Solid Panel Utilities ********** */
.glass-panel {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 1.5rem;
    box-shadow: var(--solid-shadow);
}

/* ********** Navbar ********** */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 4px 20px var(--shadow-color);
    transition: all 0.3s ease;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-text {
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: 0.05em;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
}

.nav-link {
    font-weight: 600;
    color: var(--text-muted);
    transition: color 0.2s ease;
    position: relative;
    padding: 0.5rem 0;
    cursor: pointer;
}

.nav-link:hover, .nav-link.active {
    color: var(--text-color);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--primary-color);
    border-radius: 2px;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.theme-select-inline {
    width: auto;
    padding: 0.5rem 2rem 0.5rem 1rem;
    font-size: 0.85rem;
    border-radius: 2rem;
    height: 36px;
    appearance: auto;
}

.lang-toggle-btn, .theme-toggle-btn {
    width: 36px;
    height: 36px;
    font-size: 1.2rem;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.lang-toggle-btn:hover, .theme-toggle-btn:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.settings-dropdown {
    position: relative;
}

.settings-btn {
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.settings-btn:hover {
    background: var(--primary-color);
    color: #fff;
    transform: rotate(30deg);
    border-color: var(--primary-color);
}

.settings-menu {
    position: absolute;
    top: 130%;
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 1.25rem;
    padding: 1.5rem;
    width: 260px;
    box-shadow: var(--solid-shadow);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.settings-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.settings-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.settings-group label {
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.theme-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    background: var(--input-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    font-family: 'Google Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.theme-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    padding: 0.5rem;
}

/* ********** Main Content & SPA Layout ********** */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 8rem 2rem 4rem; 
    min-height: 100vh;
}

.spa-section {
    display: none;
}

.spa-section.active {
    display: block;
    animation: fadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    font-size: 2.75rem;
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    color: var(--text-color);
}

.section-desc {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 650px;
    margin: 0 auto;
    line-height: 1.7;
}

/* ********** Hero Section & Supremacy Grid ********** */
#intro.active {
    display: block;
}

.hero-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: calc(100vh - 12rem);
    margin-bottom: 6rem;
}

.supremacy-section {
    padding-top: 4rem;
    border-top: 1px solid var(--border-color);
}

.supremacy-header {
    text-align: center;
    margin-bottom: 5rem;
}

.supremacy-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.supremacy-layout {
    display: flex;
    flex-direction: column;
    gap: 8rem;
    margin-top: 4rem;
}

.supremacy-feature {
    display: flex;
    align-items: center;
    gap: 5rem;
}

.supremacy-feature:nth-child(even) {
    flex-direction: row-reverse;
}

.supremacy-feature-text {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.supremacy-icon {
    width: 64px;
    height: 64px;
    background: var(--input-bg);
    color: var(--primary-color);
    border-radius: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.75rem;
    font-size: 2rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.supremacy-feature-text h3 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.3;
    letter-spacing: -0.02em;
    color: var(--text-color);
    display: flex;
    align-items: flex-start;
}

.num-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: #fff;
    border-radius: 12px;
    font-size: 1.4rem;
    font-weight: 900;
    margin-right: 0.85rem;
    box-shadow: 0 6px 20px var(--shadow-color);
    font-family: 'Google Sans', sans-serif;
    border: 2px solid rgba(255, 255, 255, 0.2);
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    flex-shrink: 0;
    margin-top: 2px;
}

.supremacy-feature-text p {
    font-size: 1.15rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 2rem;
}

.feature-highlights {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.feature-highlights li {
    font-size: 1.05rem;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
}

.feature-highlights li::before {
    content: 'check_circle';
    font-family: 'Material Symbols Rounded';
    color: var(--primary-color);
    font-size: 1.4rem;
}

.supremacy-feature-visual {
    flex: 1;
    display: flex;
    justify-content: center;
    position: relative;
    padding: 1rem;
}

.visual-mockup-panel { 
    background: var(--card-bg); 
    border: 1px solid var(--border-color); 
    border-radius: 1.5rem; 
    padding: 2rem; 
    width: 100%; 
    max-width: 520px; 
    box-shadow: var(--solid-shadow); 
    font-family: 'Google Sans', sans-serif; 
    position: relative; 
    overflow: hidden; 
    margin-top: auto; 
}
.vm-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border-color); padding-bottom: 1rem; margin-bottom: 1.5rem; font-weight: 800; font-size: 1rem; color: var(--text-color); }
.vm-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--primary-color); box-shadow: 0 0 10px var(--primary-color); animation: blink 2s infinite; }
.vm-layer { background: var(--bg-color); border: 1px solid var(--border-color); border-left: 4px solid var(--primary-color); padding: 1.25rem; border-radius: 0.75rem; margin-bottom: 1rem; display: flex; justify-content: space-between; align-items: center; font-size: 0.95rem; font-weight: 700; color: var(--text-color); box-shadow: 0 2px 8px rgba(0,0,0,0.02); }
.vm-layer.done { border-left-color: #10b981; animation: vmLayerGlow 2.5s infinite alternate; }
.vm-layer.error { border-left-color: #ef4444; animation: vmErrorShake 3s infinite; }
.vm-badge { background: rgba(16, 185, 129, 0.1); color: #10b981; padding: 0.35rem 0.85rem; border-radius: 2rem; font-size: 0.8rem; font-weight: 700; border: 1px solid rgba(16, 185, 129, 0.2); }
.vm-badge.warn { background: rgba(239, 68, 68, 0.1); color: #ef4444; border-color: rgba(239, 68, 68, 0.2); }
.vm-badge.blue { background: rgba(59, 130, 246, 0.1); color: #3b82f6; border-color: rgba(59, 130, 246, 0.2); }
.vm-chat { display: flex; flex-direction: column; gap: 1.25rem; }
.vm-bubble { max-width: 85%; padding: 1rem 1.25rem; border-radius: 1rem; font-size: 0.95rem; line-height: 1.6; }
.vm-bubble.user { align-self: flex-end; background: var(--primary-color); color: #fff; border-bottom-right-radius: 4px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); animation: vmBubblePop 3s infinite; transform-origin: bottom right; }
.vm-bubble.ai { align-self: flex-start; background: var(--user-msg-bg); color: var(--text-color); border-bottom-left-radius: 4px; border: 1px solid var(--border-color); animation: vmBubblePop 3s infinite 0.5s; transform-origin: bottom left; }
.vm-infra-box { margin-top: 1.25rem; background: var(--bg-color); padding: 1.25rem; border-radius: 0.75rem; border: 1px dashed var(--primary-color); font-family: 'JetBrains Mono', monospace; font-size: 0.85rem; color: var(--primary-color); animation: vmFadeInUp 2s infinite alternate; }
.vm-split { display: flex; gap: 1.5rem; }
.vm-split-pane { flex: 1; background: var(--input-bg); border: 1px solid var(--border-color); border-radius: 1rem; padding: 1.5rem; text-align: center; transition: all 0.3s ease; }
.vm-split-pane.active { border-color: var(--primary-color); box-shadow: 0 8px 24px rgba(59, 130, 246, 0.15); background: var(--bg-color); animation: vmSplitActive 3s infinite alternate; }
.vm-btn-old { background: var(--text-muted); color: #fff; padding: 0.75rem 1.75rem; border-radius: 0.5rem; font-size: 0.95rem; display: inline-block; font-weight: 600; }
.vm-btn-new { background: var(--primary-color); color: #fff; padding: 0.75rem 2rem; border-radius: 2rem; font-size: 0.95rem; display: inline-block; box-shadow: 0 6px 20px rgba(59, 130, 246, 0.3); font-weight: 700; transition: transform 0.2s; animation: vmPulseBtn 2s infinite ease-in-out; }
.vm-arrow { color: var(--primary-color); font-size: 0.95rem; font-weight: 800; margin: 1.5rem 0; display: block; text-align: center; font-family: 'JetBrains Mono', monospace; letter-spacing: 0.05em; animation: vmArrowFlash 2s infinite; }
.vm-node-graph { display: flex; align-items: center; justify-content: space-between; padding: 1rem 0; margin: 1.5rem 0; }
.vm-node { background: var(--card-bg); border: 2px solid var(--border-color); padding: 1.25rem; border-radius: 1rem; font-size: 0.9rem; font-weight: 800; z-index: 2; box-shadow: 0 4px 15px rgba(0,0,0,0.05); animation: vmNodePulse 3s infinite alternate; }
.vm-line { flex: 1; height: 3px; background: var(--primary-color); position: relative; margin: 0 15px; opacity: 0.6; border-radius: 2px; }
.vm-line::after { content: ''; position: absolute; top: -5px; left: 50%; width: 12px; height: 12px; background: #fff; border-radius: 50%; box-shadow: 0 0 15px var(--primary-color); animation: slideRight 1.5s ease-in-out infinite; }
@keyframes slideRight { 0% { left: 0; opacity: 0; } 50% { opacity: 1; } 100% { left: calc(100% - 12px); opacity: 0; } }
.vm-chart-bar { height: 32px; border-radius: 16px; display: flex; align-items: center; padding: 0 1.25rem; color: #000; font-size: 0.9rem; font-weight: 800; margin-bottom: 0.75rem; box-shadow: 0 4px 12px rgba(0,0,0,0.08); white-space: nowrap; overflow: hidden; animation: vmBarFill 2.5s infinite ease-out; }

/* Custom Animations for Visual Mockup Panels */
@keyframes vmLayerGlow { 0% { box-shadow: 0 2px 8px rgba(0,0,0,0.02); } 100% { box-shadow: 0 4px 15px rgba(16, 185, 129, 0.1); border-left-width: 6px; } }
@keyframes vmErrorShake { 0%, 80%, 100% { transform: translateX(0); } 85%, 95% { transform: translateX(-4px); } 90% { transform: translateX(4px); } }
@keyframes vmBubblePop { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.02); } }
@keyframes vmFadeInUp { 0% { opacity: 0.7; transform: translateY(5px); } 100% { opacity: 1; transform: translateY(0); } }
@keyframes vmSplitActive { 0% { transform: translateY(0); box-shadow: 0 8px 24px rgba(59, 130, 246, 0.15); } 100% { transform: translateY(-5px); box-shadow: 0 15px 30px rgba(59, 130, 246, 0.25); } }
@keyframes vmPulseBtn { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes vmArrowFlash { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
@keyframes vmNodePulse { 0% { transform: scale(1); } 100% { transform: scale(1.05); border-color: var(--primary-hover); } }
@keyframes vmBarFill { 0% { max-width: 0; opacity: 0; } 30%, 100% { max-width: 100%; opacity: 1; } }
.vm-device { border: 6px solid var(--border-color); border-radius: 1.5rem; border-bottom-width: 24px; height: 250px; position: relative; background: var(--bg-color); overflow: hidden; display: flex; align-items: center; justify-content: center; box-shadow: var(--solid-shadow); animation: vmDeviceGlow 3s infinite alternate; }
.vm-device::before { content: ''; position: absolute; top: 0; width: 80px; height: 18px; background: var(--border-color); border-bottom-left-radius: 12px; border-bottom-right-radius: 12px; }
.vm-screen-content { font-size: 1.6rem; font-weight: 800; color: var(--primary-color); letter-spacing: 2px; animation: vmScreenFlash 2.5s infinite; }

@keyframes vmDeviceGlow { 0% { box-shadow: var(--solid-shadow); } 100% { box-shadow: 0 10px 30px rgba(59, 130, 246, 0.2); } }
@keyframes vmScreenFlash { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; text-shadow: 0 0 15px var(--primary-color); } }

/* Ghost Text Animation */
.vm-ghost-text { animation: vmGhostPulse 2s infinite alternate; }
@keyframes vmGhostPulse { 0% { opacity: 0.3; } 100% { opacity: 0.8; } }

.hero-container {
    flex: 1;
    max-width: 650px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    background: var(--input-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 2rem;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 1.75rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.hero-title {
    font-size: 4.8rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.75rem;
    letter-spacing: -0.03em;
}

.gradient-text {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    max-width: 550px;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    gap: 1.25rem;
}

.btn {
    padding: 1rem 2rem;
    border-radius: 1rem;
    font-weight: 700;
    font-family: 'Google Sans', sans-serif;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary-color);
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.25);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(59, 130, 246, 0.35);
}

.btn-secondary {
    background: var(--input-bg);
    color: var(--text-color);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.05);
}

.w-100 { width: 100%; }
.mb-4 { margin-bottom: 1.5rem; }

.hero-visual {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.glass-sphere {
    width: 380px;
    height: 380px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    opacity: 0.7;
    filter: blur(45px);
    animation: pulse 8s ease-in-out infinite alternate;
}

@keyframes pulse {
    0% { transform: scale(1) translateY(0); opacity: 0.6; }
    50% { transform: scale(1.05) translateY(-25px); opacity: 0.8; }
    100% { transform: scale(0.95) translateY(15px); opacity: 0.6; }
}

/* ********** Showcase Grid ********** */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 2.5rem;
}

.project-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 1.5rem;
    padding: 0;
    overflow: hidden;
    box-shadow: var(--solid-shadow);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

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

.project-preview {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-color);
    overflow: hidden;
}

.project-preview iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 400%; 
    height: 400%; 
    transform: scale(0.25); 
    transform-origin: top left;
    border: none;
    pointer-events: none; 
    background-color: #ffffff; 
}

.preview-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.3) 100%);
    z-index: 1;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.project-card:hover .preview-overlay {
    opacity: 0.6;
}

.project-card-content {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1.5rem;
}

.project-score {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    font-weight: 800;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    padding: 0.4rem 1rem;
    border-radius: 2rem;
    font-size: 0.95rem;
}

.card-body {
    flex-grow: 1;
    margin-bottom: 2rem;
}

.project-name {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    line-height: 1.3;
    color: var(--text-color);
}

.project-owner {
    color: var(--text-muted);
    font-size: 1rem;
}

.card-footer {
    display: flex;
}

.project-link {
    width: 100%;
}

/* ********** Guide Section ********** */
.guide-detailed-layout .supremacy-feature {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5rem;
}
.guide-detailed-layout .supremacy-feature:last-child {
    border-bottom: none;
}

/* ********** Community Section (3-Column Layout & UI/UX Upgrade) ********** */

/* 1. Dashboard Layout Grid (2-Column) */
.community-dashboard {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 2.5rem;
    align-items: start;
}

/* 2. Sidebar & User Profile */
.comm-sidebar {
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: sticky;
    top: 100px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 1.5rem;
    box-shadow: var(--solid-shadow);
    transition: box-shadow 0.3s ease;
}

.comm-sidebar:hover {
    box-shadow: 0 15px 40px var(--shadow-color);
}

.comm-user-profile {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding-bottom: 2rem;
    border-bottom: 1px dashed var(--border-color);
}

.profile-avatar-large {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.4rem;
    color: #fff;
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
    margin-bottom: 0.75rem;
    position: relative;
    border: 3px solid var(--card-bg);
}
.profile-avatar-large::after {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 2px dashed var(--primary-color);
    opacity: 0.6;
    animation: spin 10s linear infinite;
}
@keyframes spin { 100% { transform: rotate(360deg); } }

.profile-name { 
    font-size: 1.35rem; 
    font-weight: 800; 
    color: var(--text-color);
    letter-spacing: -0.01em;
}

.profile-rank { 
    font-size: 0.95rem; 
    color: var(--text-muted); 
    display: flex; 
    align-items: center; 
    gap: 6px; 
    font-weight: 600;
}

.profile-credits { 
    font-weight: 800; 
    color: var(--primary-color); 
    display: flex; 
    align-items: center; 
    gap: 6px; 
    font-size: 1.15rem;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1.25rem;
    border-radius: 2rem;
    margin-top: 0.5rem;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.comm-nav { 
    display: flex; 
    flex-direction: column; 
    gap: 0.5rem; 
}

.comm-nav-item {
    display: flex; 
    align-items: center; 
    gap: 1rem;
    padding: 1rem 1.25rem; 
    border-radius: 1rem;
    color: var(--text-muted); 
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border: 1px solid transparent;
    background: transparent;
    overflow: hidden;
}

.comm-nav-item:hover { 
    background: var(--input-bg); 
    color: var(--text-color); 
    transform: translateX(6px); 
    border-color: var(--border-color);
}

.comm-nav-item.active { 
    background: var(--input-bg); 
    color: var(--primary-color); 
    border-color: var(--border-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

.comm-nav-item.active::before {
    content: '';
    position: absolute;
    left: 0; top: 0;
    height: 100%; width: 4px;
    background: var(--primary-color);
    box-shadow: 0 0 12px var(--primary-color);
    border-radius: 4px 0 0 4px;
}

/* 3. Main Feed & Filters */
.comm-main {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.comm-filters { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 1.25rem 2rem; 
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 1.5rem;
    box-shadow: var(--solid-shadow);
}

.filter-tabs { 
    display: flex; 
    gap: 2rem; 
}

.filter-tab {
    background: transparent; 
    border: none; 
    color: var(--text-muted);
    font-weight: 800; 
    font-size: 1.05rem; 
    cursor: pointer;
    padding: 0.5rem 0; 
    position: relative;
    transition: color 0.3s ease;
    font-family: 'Google Sans', sans-serif;
}

.filter-tab:hover {
    color: var(--text-color);
}

.filter-tab.active { 
    color: var(--primary-color); 
}

.filter-tab::after {
    content: ''; 
    position: absolute; 
    bottom: -5px; 
    left: 50%; 
    width: 0; 
    height: 4px;
    border-radius: 4px;
    background: var(--primary-color); 
    transition: width 0.3s ease, left 0.3s ease;
}

.filter-tab.active::after, .filter-tab:hover::after { 
    width: 100%;
    left: 0;
}

.filter-search {
    display: flex; 
    align-items: center; 
    gap: 0.75rem;
    background: var(--input-bg); 
    padding: 0.75rem 1.5rem; 
    border-radius: 2rem;
    border: 2px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-search:focus-within {
    border-color: var(--primary-color);
    background: var(--bg-color);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
    transform: scale(1.02);
}

.filter-search input { 
    background: transparent; 
    border: none; 
    color: var(--text-color); 
    outline: none; 
    font-family: 'Google Sans', sans-serif; 
    font-size: 1rem; 
    width: 280px;
    transition: width 0.3s ease;
}

.filter-search input:focus {
    width: 360px;
}

/* Feed Cards */
.message-list {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.message-card {
    display: flex;
    gap: 1.75rem;
    padding: 2.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 1.5rem;
    box-shadow: var(--solid-shadow);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s ease, border-color 0.4s ease;
    position: relative;
    overflow: hidden;
}

.message-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 4px; height: 100%;
    background: transparent;
    transition: background 0.4s ease;
}

.message-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

.message-card:hover::before {
    background: var(--primary-color);
}

.msg-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 800;
    font-size: 1.8rem;
    flex-shrink: 0;
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.3);
    border: 3px solid var(--bg-color);
}

.msg-content {
    flex-grow: 1;
}

.msg-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.25rem;
}

.msg-author-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.msg-author {
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--text-color);
}

.msg-time {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 600;
}

.msg-meta-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.msg-body {
    color: var(--text-muted);
    line-height: 1.8;
    font-size: 1.05rem;
}

/* Badges & Bounties */
.badge-category {
    display: inline-flex; 
    align-items: center; 
    padding: 0.4rem 1.2rem;
    border-radius: 2rem; 
    font-size: 0.8rem; 
    font-weight: 800;
    background: var(--input-bg); 
    color: var(--text-color);
    border: 1px solid var(--border-color); 
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-bounty {
    display: inline-flex; 
    align-items: center; 
    gap: 6px;
    padding: 0.4rem 1.2rem; 
    border-radius: 2rem; 
    font-size: 0.85rem; 
    font-weight: 800;
    background: rgba(245, 158, 11, 0.1); 
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.15);
}

/* Glowing card for high bounties */
.message-card.bounty-glow {
    border-color: rgba(245, 158, 11, 0.4);
    box-shadow: 0 8px 30px rgba(245, 158, 11, 0.1), var(--solid-shadow);
}

.message-card.bounty-glow::before {
    background: #f59e0b; 
    box-shadow: 0 0 20px #f59e0b;
}

@keyframes bountyPulse {
    0% { box-shadow: 0 8px 30px rgba(245, 158, 11, 0.1), var(--solid-shadow); }
    50% { box-shadow: 0 12px 40px rgba(245, 158, 11, 0.25), var(--solid-shadow); border-color: rgba(245, 158, 11, 0.6); }
    100% { box-shadow: 0 8px 30px rgba(245, 158, 11, 0.1), var(--solid-shadow); }
}

.message-card.bounty-glow:hover {
    animation: bountyPulse 2.5s infinite ease-in-out;
    transform: translateY(-6px);
}

/* 4. Right Panel & Leaderboard */
.comm-right {
    position: sticky;
    top: 100px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.btn-glow {
    position: relative;
    z-index: 1;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-glow::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: -1;
}

.btn-glow:hover::before {
    left: 100%;
}

.btn-glow:hover {
    box-shadow: 0 0 25px var(--primary-color);
    transform: translateY(-3px);
}

.leaderboard-widget { 
    padding: 2.5rem 2rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 1.5rem;
    box-shadow: var(--solid-shadow);
}

.widget-title { 
    font-size: 1.25rem; 
    font-weight: 800; 
    margin-bottom: 2rem; 
    display: flex; 
    align-items: center; 
    gap: 0.75rem;
    color: var(--text-color);
    border-bottom: 2px dashed var(--border-color);
    padding-bottom: 1.25rem;
}

.leaderboard-list { 
    list-style: none; 
    display: flex; 
    flex-direction: column; 
    gap: 1.25rem; 
}

.leaderboard-list li { 
    display: flex; 
    align-items: center; 
    gap: 1.25rem; 
    padding: 1.25rem; 
    border-radius: 1rem;
    background: var(--input-bg);
    border: 1px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    cursor: pointer;
}

.leaderboard-list li:hover { 
    transform: translateX(10px);
    background: var(--bg-color);
    border-color: var(--primary-color);
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
}

.lb-rank {
    width: 40px; 
    height: 40px; 
    border-radius: 50%;
    background: var(--bg-color); 
    color: var(--text-color);
    border: 1px solid var(--border-color);
    display: flex; 
    align-items: center; 
    justify-content: center;
    font-weight: 800; 
    font-size: 1.1rem; 
    flex-shrink: 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.leaderboard-list li:nth-child(1) .lb-rank { 
    background: linear-gradient(135deg, #fcd34d, #d97706); 
    color: #fff; 
    border-color: #f59e0b;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4); 
}
.leaderboard-list li:nth-child(2) .lb-rank { 
    background: linear-gradient(135deg, #cbd5e1, #475569); 
    color: #fff; 
    border-color: #94a3b8;
    box-shadow: 0 4px 15px rgba(148, 163, 184, 0.4);
}
.leaderboard-list li:nth-child(3) .lb-rank { 
    background: linear-gradient(135deg, #d97706, #78350f); 
    color: #fff; 
    border-color: #b45309;
    box-shadow: 0 4px 15px rgba(180, 83, 9, 0.4);
}

.lb-info { 
    display: flex; 
    flex-direction: column;
    justify-content: center; 
    flex-grow: 1; 
}

.lb-name { 
    font-weight: 800; 
    font-size: 1.05rem; 
    color: var(--text-color);
}

.lb-score { 
    color: var(--primary-color); 
    font-weight: 800; 
    font-size: 0.95rem; 
}

/* 5. Modal Overlay & Form */
#ext-auth-login-view.hidden,
#ext-auth-register-view.hidden,
#ext-auth-profile-view.hidden {
    display: none;
}

.modal-overlay {
    position: fixed; 
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex; 
    align-items: center; 
    justify-content: center;
    opacity: 1; 
    visibility: visible;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 1rem;
}

.modal-overlay.hidden { 
    opacity: 0; 
    visibility: hidden; 
    pointer-events: none; 
}

.modal-content {
    width: 100%; 
    max-width: 650px;
    padding: 3.5rem;
    transform: scale(1) translateY(0);
    opacity: 1;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 2rem;
    box-shadow: 0 30px 60px rgba(0,0,0,0.4);
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.hidden .modal-content { 
    transform: scale(0.9) translateY(40px); 
    opacity: 0; 
}

.modal-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    border-bottom: 2px solid var(--input-bg); 
    padding-bottom: 1.5rem; 
    margin-bottom: 2.5rem; 
}

.btn-icon { 
    background: var(--input-bg); 
    border: 1px solid var(--border-color); 
    color: var(--text-color); 
    cursor: pointer; 
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    width: 44px;
    height: 44px;
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
}

.btn-icon:hover { 
    color: #fff; 
    background: #ef4444; 
    border-color: #ef4444;
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.modern-form .form-group {
    margin-bottom: 2rem;
}

.modern-form label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 800;
    font-size: 1rem;
    color: var(--text-color);
}

.modern-form input,
.modern-form select,
.modern-form textarea {
    width: 100%;
    padding: 1.2rem 1.5rem;
    border-radius: 1rem;
    border: 2px solid var(--border-color);
    background: var(--input-bg);
    color: var(--text-color);
    font-family: 'Google Sans', sans-serif;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Override inline styling strictly for authentication modals */
#ext-auth-modal input {
    background: var(--input-bg) !important;
}

.modern-form input:focus,
.modern-form select:focus,
.modern-form textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
    background: var(--bg-color) !important;
    transform: translateY(-2px);
}

/* ********** Footer ********** */
.footer {
    padding: 4rem 2rem;
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 5rem;
    border-top: 1px solid var(--border-color);
    background: var(--card-bg);
    line-height: 1.8;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.5rem;
}

.footer-info p {
    margin-bottom: 0.25rem;
}

.footer-info .copyright {
    margin-top: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
}

.footer-social {
    display: flex;
    gap: 1rem;
    font-weight: 700;
}

.footer-social a {
    color: var(--text-color);
    transition: color 0.3s ease;
}

.footer-social a:hover {
    color: var(--primary-color);
}

@media (min-width: 768px) {
    .footer-container {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
        align-items: flex-end;
    }
    .footer-info .copyright {
        margin-top: 1rem;
    }
}

/* ********** Responsive Design ********** */
@media (max-width: 1024px) {
    .community-dashboard {
        grid-template-columns: 1fr;
    }
    .comm-sidebar {
        position: relative;
        top: 0;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        flex-wrap: wrap;
        padding: 2rem;
    }
    .comm-user-profile {
        flex-direction: row;
        text-align: left;
        border-bottom: none;
        padding-bottom: 0;
        width: 100%;
        margin-bottom: 1.5rem;
    }
    .comm-nav {
        flex-direction: row;
        overflow-x: auto;
        width: 100%;
        padding-bottom: 0.5rem;
    }
    .comm-nav-item {
        white-space: nowrap;
        padding: 0.75rem 1.5rem;
    }
    .comm-nav-item.active::before {
        height: 4px; width: 60%;
        top: auto; bottom: -2px; left: 20%;
        border-radius: 4px;
    }
    .comm-right {
        position: relative;
        top: 0;
    }
    .filter-tabs {
        overflow-x: auto;
        white-space: nowrap;
    }
}

@media (max-width: 992px) {
    .hero-wrapper {
        flex-direction: column;
        text-align: center;
        justify-content: center;
        padding-top: 2rem;
        position: relative;
    }
    .hero-visual {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 0;
        pointer-events: none;
    }
    .hero-container {
        position: relative;
        z-index: 1;
    }
    .hero-subtitle {
        margin: 0 auto 2.5rem auto;
    }
    .hero-actions {
        justify-content: center;
    }
    .hero-title {
        font-size: 4rem;
    }
    .supremacy-feature, .supremacy-feature:nth-child(even) {
        flex-direction: column;
        gap: 4rem;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none; 
    }
    .mobile-menu-btn {
        display: block;
    }
    .desktop-only-btn {
        display: none !important;
    }
    .mobile-theme-lang {
        display: flex !important;
    }
    .hero-title {
        font-size: 3rem;
    }
    .section-title {
        font-size: 2.25rem;
    }
            .hero-actions {
            flex-direction: column;
        }
        .btn {
            width: 100%;
        }
        .nav-controls .btn {
            width: auto;
            padding: 0.4rem 0.8rem !important;
            font-size: 0.85rem !important;
        }
        .mobile-only-link {
            display: block !important;
        }
        .glass-sphere {
        width: 280px;
        height: 280px;
    }
    
    .modal-content {
        padding: 2.5rem 1.5rem;
    }
    .form-row {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
    }
    .comm-filters {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
        padding: 1.5rem;
    }
    .filter-search input { width: 100%; }
    .filter-search input:focus { width: 100%; }
    .message-card {
        flex-direction: column;
        padding: 2rem 1.5rem;
    }
    .msg-header {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    /* 커뮤니티 모바일 최적화 */
    .comm-sidebar {
        padding: 1.5rem 1rem;
        border-radius: 1rem;
    }
    .comm-user-profile {
        gap: 1rem;
        margin-bottom: 1rem;
        justify-content: flex-start;
        align-items: center;
        flex-wrap: wrap;
    }
    .profile-avatar-large {
        width: 60px;
        height: 60px;
        font-size: 1.8rem;
    }
    .profile-name { 
        font-size: 1.15rem; 
    }
    .profile-credits { 
        font-size: 0.95rem; 
        padding: 0.4rem 1rem; 
        margin-top: 0;
    }
    .comm-nav {
        gap: 0.5rem;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    .comm-nav::-webkit-scrollbar {
        display: none;
    }
    .comm-nav-item {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
    .filter-tabs {
        width: 100%;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    .filter-tabs::-webkit-scrollbar {
        display: none;
    }
}
```