/* --- Global Styles & Volcanic Variables --- */
:root {
    --primary-color: #ff073a; /* Crimson Red */
    --secondary-color: #e11d48; /* Darker Crimson */
    --dark-bg: #0a0a0a;
    --light-bg: #121212;
    --text-color: #d1d1d1;
    --heading-color: #ffffff;
    --border-color: rgba(255, 7, 58, 0.25);
    --glow-shadow: 0 0 15px rgba(255, 7, 58, 0.7), 0 0 30px rgba(255, 7, 58, 0.4);
    --dark-glow-shadow: 0 0 10px rgba(225, 29, 72, 0.5);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Exo 2', sans-serif;
    background-color: var(--dark-bg);
    color: var(--text-color);
    line-height: 1.7;
    overflow-x: hidden;
}
body.modal-open { overflow: hidden; } /* Prevents background scroll when modal is open */

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; position: relative; z-index: 2; }
h1, h2, h3 { color: var(--heading-color); font-family: 'Orbitron', sans-serif; text-transform: uppercase; letter-spacing: 2px; }
h1 { font-size: 3.5rem; text-shadow: var(--glow-shadow); }
h2 { font-size: 2.8rem; }
p { margin-bottom: 1.5rem; font-weight: 300; }
a { color: var(--primary-color); text-decoration: none; transition: color 0.3s ease; }
a:hover { color: #fff; text-shadow: 0 0 5px var(--primary-color); }
section { padding: 100px 0; text-align: center; position: relative; }
img { max-width: 100%; height: auto; display: block; }

/* --- Particle & Texture Background --- */
#particles-js { position: fixed; width: 100%; height: 100%; top: 0; left: 0; z-index: 0; }
.background-texture {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 0;
    background-image: url('https://www.transparenttextures.com/patterns/cracks.png');
    opacity: 0.05;
}

/* --- Section Title & Glitch Effect --- */
.section-title { margin-bottom: 20px; position: relative; display: inline-block; text-shadow: var(--glow-shadow); }
.section-title::before, .section-title::after { content: attr(data-text); position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: transparent; overflow: hidden; clip: rect(0, 900px, 0, 0); }
.section-title::before { left: 2px; text-shadow: -2px 0 var(--secondary-color); animation: glitch-anim-1 2s infinite linear alternate-reverse; }
.section-title::after { left: -2px; text-shadow: -2px 0 var(--primary-color), 2px 2px var(--secondary-color); animation: glitch-anim-2 3s infinite linear alternate-reverse; }
.section-subtitle { max-width: 700px; margin: 0 auto 50px auto; color: #a1a1a1; font-size: 1.1rem; }

/* --- Buttons --- */
.btn, button.btn-secondary {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    padding: 14px 32px; border-radius: 4px; font-weight: 700;
    font-family: 'Orbitron', sans-serif; text-transform: uppercase; letter-spacing: 1px;
    transition: all 0.4s ease; border: 2px solid var(--primary-color); cursor: pointer; text-align: center;
    position: relative; overflow: hidden; z-index: 1;
}
.btn-primary { background-color: var(--primary-color); color: #fff; }
.btn-primary:hover { background-color: transparent; color: var(--primary-color); box-shadow: var(--glow-shadow); }
.btn-secondary, button.btn-secondary { background-color: transparent; color: var(--text-color); border-color: #555; }
.btn-secondary:hover, button.btn-secondary:hover { background-color: #fff; color: #0a0a0a; border-color: #fff; }
.btn-large { padding: 18px 40px; font-size: 1.1rem; }
.pulse-glow { animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 5px var(--primary-color), 0 0 10px var(--primary-color); } 50% { box-shadow: 0 0 20px var(--primary-color), 0 0 40px var(--primary-color); } 100% { box-shadow: 0 0 5px var(--primary-color), 0 0 10px var(--primary-color); } }

/* --- Header & Navbar --- */
.header {
    background: rgba(10, 10, 10, 0.7); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    padding: 20px 0; position: sticky; top: 0; z-index: 1000;
    border-bottom: 1px solid var(--border-color);
}
.navbar { display: flex; justify-content: space-between; align-items: center; }
.nav-logo { font-size: 1.8rem; font-weight: 900; color: var(--heading-color); font-family: 'Orbitron', sans-serif; text-shadow: 0 0 10px var(--primary-color); }

/* --- Hero Section --- */
.hero { min-height: 90vh; display: flex; align-items: center; justify-content: center; }
.hero-content { text-align: center; }
.hero-logo { max-width: 250px; margin: 0 auto 2.5rem auto; filter: drop-shadow(0 0 15px var(--primary-color)); }
.hero .subtitle { font-size: 1.3rem; max-width: 650px; margin: 25px auto 40px auto; color: var(--text-color); }
.hero-buttons { display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; }

/* --- Features Section --- */
.features { background: linear-gradient(rgba(18,18,18,0), var(--light-bg), rgba(18,18,18,0)); }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 30px; text-align: left; }
.forge-card {
    background: var(--light-bg); padding: 35px; border-radius: 8px;
    border: 1px solid var(--border-color); transition: transform 0.4s ease, box-shadow 0.4s ease;
    position: relative; overflow: hidden;
}
.forge-card::after {
    content: ''; position: absolute; bottom: 0; left: 0; width: 100%; height: 5px;
    background: var(--primary-color); transform: scaleX(0); transition: transform 0.4s ease-in-out;
    transform-origin: left; box-shadow: var(--glow-shadow);
}
.forge-card:hover { transform: translateY(-10px); box-shadow: 0 20px 40px rgba(0,0,0,0.5); }
.forge-card:hover::after { transform: scaleX(1); }
.forge-card .feature-icon { font-size: 2.5rem; color: var(--primary-color); margin-bottom: 20px; }
.forge-card h3 { font-size: 1.5rem; margin-bottom: 10px; }

/* --- Showcase Sections (Panel, Backtests, etc.) --- */
.showcase-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 50px; align-items: center; text-align: left; margin-top: 60px; }
.showcase-grid.reverse .magma-showcase { order: -1; }
.magma-showcase {
    background-color: #000; border: 1px solid var(--border-color);
    padding: 15px; border-radius: 8px; position: relative;
    box-shadow: 0 0 25px rgba(0,0,0,0.6);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}
.magma-showcase:hover { transform: scale(1.03); box-shadow: 0 0 30px rgba(255, 7, 58, 0.3); }
.magma-showcase img { border-radius: 4px; }
.showcase-content h3 { font-size: 2rem; margin-bottom: 15px; color: var(--primary-color); }
.backtest-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 50px; }

/* --- Performance Section --- */
.performance { background-color: var(--light-bg); }
.widget-container {
    border: 1px solid var(--border-color); border-radius: 10px; overflow: hidden;
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
    transition: transform 0.4s ease, box-shadow 0.4s ease; display: inline-block;
}
.widget-container:hover { transform: scale(1.03); box-shadow: var(--glow-shadow); }

/* --- Engineered for Performance Section --- */
.engineered-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center; text-align: left; }
.engineered-content .icon-list { list-style: none; padding: 0; margin: 30px 0; }
.engineered-content .icon-list li { display: flex; align-items: center; gap: 20px; margin-bottom: 25px; font-size: 1.1rem; }
.engineered-content .icon-list i { color: var(--secondary-color); font-size: 1.8rem; width: 40px; text-align: center; text-shadow: var(--dark-glow-shadow); transition: transform 0.3s; }
.engineered-content .icon-list li:hover i { transform: scale(1.2); color: var(--primary-color); }

/* --- Purchase Section --- */
.purchase-section { background: linear-gradient(rgba(18,18,18,0), var(--light-bg), rgba(18,18,18,0)); }
.purchase-options { display: flex; justify-content: center; gap: 40px; flex-wrap: wrap; margin-top: 50px; }
.core-card {
    background-color: var(--light-bg); border: 1px solid var(--border-color);
    border-radius: 8px; padding: 30px; width: 100%; max-width: 350px;
    display: flex; flex-direction: column; align-items: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.core-card:hover { transform: translateY(-15px); box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5), var(--glow-shadow); border-color: var(--primary-color); }
.core-card .logo { width: 120px; height: 120px; border-radius: 50%; margin-bottom: 25px; object-fit: cover; border: 3px solid #333; }
.core-card .icon-wrapper { font-size: 60px; width: 120px; height: 120px; line-height: 120px; border-radius: 50%; margin-bottom: 25px; background-color: var(--dark-bg); color: var(--secondary-color); border: 3px solid #333; }
.core-card h3 { font-size: 1.6rem; margin-bottom: 15px; }
.core-card p { color: var(--text-color); font-size: 1rem; flex-grow: 1; margin-bottom: 30px; }
.core-card .btn, .core-card button.btn-secondary { margin-top: auto; width: 100%; }

/* --- Footer Section --- */
.footer { background-color: #000; padding: 50px 0; text-align: center; border-top: 1px solid var(--border-color); }
.footer .disclaimer { font-size: 0.8rem; color: #666; max-width: 800px; margin: 20px auto 0 auto; line-height: 1.5; }

/* --- Glitch Keyframes --- */
@keyframes glitch-anim-1 { 0%, 100% { clip: rect(23px, 9999px, 92px, 0); } 25% { clip: rect(78px, 9999px, 100px, 0); } 50% { clip: rect(42px, 9999px, 78px, 0); } 75% { clip: rect(13px, 9999px, 52px, 0); } }
@keyframes glitch-anim-2 { 0%, 100% { clip: rect(5px, 9999px, 85px, 0); } 25% { clip: rect(20px, 9999px, 42px, 0); } 50% { clip: rect(90px, 9999px, 23px, 0); } 75% { clip: rect(42px, 9999px, 62px, 0); } }

/* --- Responsive Design --- */
@media (max-width: 992px) {
    .engineered-grid { grid-template-columns: 1fr; }
    .engineered-grid .magma-showcase { order: -1; margin-bottom: 30px; }
    .showcase-grid.reverse .magma-showcase { order: 1; }
    .backtest-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    h1 { font-size: 2.5rem; } h2 { font-size: 2rem; }
    .hero { min-height: 70vh; padding-top: 50px; }
    .navbar { flex-direction: column; gap: 20px; }
    .features-grid, .showcase-grid { grid-template-columns: 1fr; }
    .showcase-grid.reverse .magma-showcase { order: -1; }
}

/* ===== NEW: Crypto Payment Modal Styles ===== */
#crypto-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(10, 10, 10, 0.85); backdrop-filter: blur(8px);
    z-index: 1001; display: none; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.3s ease-in-out;
}
#crypto-modal-overlay.visible { display: flex; opacity: 1; }

#crypto-modal {
    background-color: var(--light-bg); border: 1px solid var(--border-color);
    border-radius: 12px; padding: 30px 40px; max-width: 800px;
    width: 95%; text-align: center; position: relative;
    box-shadow: 0 0 50px rgba(0,0,0,0.7), var(--glow-shadow);
    transform: scale(0.95); transition: transform 0.3s ease-in-out;
}
#crypto-modal-overlay.visible #crypto-modal { transform: scale(1); }

.modal-close-btn {
    position: absolute; top: 15px; right: 20px; background: none; border: none;
    color: #888; font-size: 2.5rem; cursor: pointer; transition: color 0.3s, transform 0.3s;
    line-height: 1;
}
.modal-close-btn:hover { color: var(--primary-color); transform: rotate(90deg); }

.modal-title { font-size: 2.2rem; text-shadow: var(--glow-shadow); }
.modal-subtitle { color: #aaa; margin-bottom: 30px; }
.modal-subtitle strong { color: var(--primary-color); font-weight: 700; }

.crypto-selector { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 30px; }
.crypto-selector button {
    background: transparent; color: var(--text-color); border: 1px solid #444;
    padding: 8px 16px; border-radius: 5px; cursor: pointer; font-family: 'Exo 2', sans-serif;
    transition: all 0.3s ease; display: inline-flex; align-items: center; gap: 8px;
}
.crypto-selector button:hover { border-color: var(--primary-color); color: var(--primary-color); }
.crypto-selector button.active {
    background-color: var(--primary-color); color: #fff; border-color: var(--primary-color);
    box-shadow: var(--glow-shadow);
}

.payment-details {
    display: flex; align-items: center; justify-content: center; gap: 30px;
    background: var(--dark-bg); padding: 25px; border-radius: 8px;
    border: 1px solid #222; margin-bottom: 30px; flex-wrap: wrap;
}

.qr-code-container { padding: 10px; background: #fff; border-radius: 6px; }
#qrcode { width: 150px; height: 150px; }
#qrcode img { width: 100% !important; height: 100% !important; }

.address-container { text-align: left; flex: 1; min-width: 300px; }
.address-label { color: #888; font-size: 0.9rem; margin-bottom: 5px; }
.address-label span { color: var(--primary-color); font-weight: bold; }
.address-box {
    display: flex; align-items: center; background: #000; padding: 10px 15px;
    border: 1px solid #333; border-radius: 5px;
}
#wallet-address {
    font-family: monospace; font-size: 1rem; color: #eee; word-break: break-all;
    flex-grow: 1;
}
#copy-address-btn {
    background: none; border: none; color: #888; font-size: 1.2rem;
    cursor: pointer; margin-left: 15px; transition: color 0.3s;
}
#copy-address-btn:hover { color: var(--primary-color); }

.post-payment-instructions {
    background: rgba(255, 7, 58, 0.05); border: 1px solid var(--border-color);
    padding: 20px; border-radius: 8px;
}
.post-payment-instructions h3 { color: var(--secondary-color); font-size: 1.2rem; margin-bottom: 10px; }
.post-payment-instructions p { margin-bottom: 10px; color: #ccc; }
.support-email {
    font-weight: bold; color: #fff; background: var(--secondary-color);
    padding: 5px 10px; border-radius: 4px; display: inline-block;
}