@import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@400;500;600;700&family=Inter:wght@300;400;600&display=swap');

/* Webkit Scrollbar Customization */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #0f1115;
    border-left: 1px solid #334155;
}

::-webkit-scrollbar-thumb {
    background: #334155;
    border: 1px solid #475569;
}

::-webkit-scrollbar-thumb:hover {
    background: #7dd3fc;
    box-shadow: 0 0 10px #7dd3fc;
    cursor: pointer;
}

:root {
    --bg-dark: #0f1115;
    --bg-panel: #1a1d24;
    --text-main: #e0e6ed;
    --text-muted: #94a3b8;
    --accent-steel: #7dd3fc;
    --accent-armor: #334155;
    --accent-danger: #ef4444;
    --border-metal: #475569;
    --glass-bg: rgba(26, 29, 36, 0.7);
    --font-heading: 'Chakra Petch', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

html {
    scroll-padding-top: 120px;
    /* Global fix for all anchor links */
    scroll-behavior: smooth;
}

/* Texture overlay for that "grainy metal" feel */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: -1;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
    color: #fff;
}

h1 {
    font-size: 3.5rem;
    font-weight: 700;
    text-shadow: 0 0 20px rgba(125, 211, 252, 0.2);
}

h2 {
    font-size: 2rem;
    border-left: 4px solid var(--accent-steel);
    padding-left: 1rem;
}

p {
    margin-bottom: 1.5rem;
    color: var(--text-muted);
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

/* Navigation */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5%;
    background: rgba(15, 17, 21, 0.95);
    /* Slightly more opaque for sticky */
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-metal);
    position: sticky;
    /* Sticky ensures it takes up space in the document flow */
    top: 0;
    z-index: 1000;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-link {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    position: relative;
    padding: 0.5rem 0;
}

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

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-steel);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Layout */
main {
    flex: 1;
    /* Margin removed because sticky navbar takes up space naturally */
    padding: 2rem 5%;
}

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

/* Components */
.btn {
    display: inline-block;
    padding: 1rem 2rem;
    font-family: var(--font-heading);
    font-weight: 600;
    text-transform: uppercase;
    border: 1px solid var(--accent-steel);
    background: rgba(125, 211, 252, 0.1);
    color: var(--accent-steel);
    cursor: pointer;
    clip-path: polygon(10% 0, 100% 0, 100% 70%, 90% 100%, 0 100%, 0 30%);
    transition: all 0.3s ease;
}

.btn:hover {
    background: var(--accent-steel);
    color: var(--bg-dark);
    box-shadow: 0 0 15px rgba(125, 211, 252, 0.4);
}

.panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-metal);
    padding: 2rem;
    margin-bottom: 2rem;
    position: relative;
    clip-path: polygon(0 0,
            100% 0,
            100% calc(100% - 20px),
            calc(100% - 20px) 100%,
            0 100%);
}

.panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent-armor);
}

section {
    scroll-margin-top: 180px;
    /* Increased significantly to fix overlap */
}

/* Home Specific */
.hero {
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.hero-logo {
    max-width: 300px;
    margin-bottom: 2rem;
    filter: drop-shadow(0 0 20px rgba(0, 0, 0, 0.5));
}

.typing-container {
    font-family: var(--font-heading);
    color: var(--accent-steel);
    font-size: 1.2rem;
    margin-bottom: 2rem;
    min-height: 1.5em;
}

/* Download Specific */
.download-page {
    /* Refactored to flow naturally */
    position: relative;
    width: 100%;
    height: calc(100vh - 120px);
    /* Exact fit for viewport minus header */
    background-color: #000;
    /* Pure black to match image */
    background-image: url('banner.png');
    background-size: contain;
    /* Ensure full image is visible */
    background-repeat: no-repeat;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    /* Push content to right */
    padding-right: 10%;
    margin-top: 0;
    /* aligned */
}

/* Overlay to ensure text readability on the right side if banner is bright */
.download-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Gradient from transparent left to dark right */
    background: linear-gradient(90deg, rgba(15, 17, 21, 0) 0%, rgba(15, 17, 21, 0.9) 70%);
    pointer-events: none;
}

.download-content {
    position: relative;
    z-index: 1;
    max-width: 400px;
    text-align: right;
}

.download-content h1 {
    font-size: 4rem;
    margin-bottom: 0.5rem;
}

.download-stat {
    display: block;
    font-family: var(--font-heading);
    font-size: 0.9rem;
    color: var(--accent-danger);
    margin-bottom: 2rem;
}

/* About & Docs Specific */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.feature-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-metal);
    padding: 1.5rem;
    transition: transform 0.3s;
}

.feature-card:hover {
    border-color: var(--accent-steel);
    transform: translateY(-5px);
}

.feature-icon {
    font-size: 2rem;
    color: var(--accent-steel);
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .download-page {
        position: relative;
        height: auto;
        padding: 4rem 5%;
        justify-content: center;
        text-align: center;
        background-position: center left;
    }

    .download-page::before {
        background: linear-gradient(0deg, var(--bg-dark) 0%, rgba(15, 17, 21, 0.8) 100%);
    }

    .download-content {
        text-align: center;
        max-width: 100%;
    }

    .grid-2 {
        grid-template-columns: 1fr;
    }

    .nav-links {
        display: none;
        /* simple mobile hide for now, or hamburger if advanced */
    }

    h1 {
        font-size: 2.5rem;
    }
}

/* Footer */
footer {
    border-top: 1px solid var(--border-metal);
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    background: var(--bg-dark);
    margin-top: auto;
}

/* Warning Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: #1a0505;
    /* Dark red/black background for danger */
    border: 2px solid var(--accent-danger);
    padding: 3rem;
    max-width: 800px;
    /* Wider for long text */
    width: 95%;
    max-height: 85vh;
    /* Limit height */
    overflow-y: auto;
    /* Allow internal scrolling for long text */
    text-align: center;
    position: relative;
    box-shadow: 0 0 50px rgba(239, 68, 68, 0.2);
    /* Custom Scrollbar for modal */
    scrollbar-width: thin;
    scrollbar-color: var(--accent-danger) #1a0505;
}

.modal-content::-webkit-scrollbar-track {
    background: #1a0505;
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--accent-danger);
    border: none;
}

.modal-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    display: block;
}

.modal-title {
    color: var(--accent-danger);
    font-family: var(--font-heading);
    font-size: 2rem;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.modal-body {
    color: #ffd1d1;
    margin-bottom: 2rem;
    font-size: 1.1rem;
    line-height: 1.8;
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--accent-danger);
    color: var(--accent-danger);
}

.btn-danger:hover {
    background: var(--accent-danger);
    color: #fff;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.6);
}