/* ============================================
   ASoftware — Modern Dark Theme System
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    /* Backgrounds */
    --bg-primary: #07070d;
    --bg-secondary: #0f0f1a;
    --bg-tertiary: #16162a;
    --bg-card: #111122;
    --bg-elevated: #1a1a33;

    /* Accent Colors */
    --accent-primary: #6c63ff;
    --accent-secondary: #00d4ff;
    --accent-tertiary: #ff6b9d;
    --accent-gradient: linear-gradient(135deg, #6c63ff 0%, #00d4ff 100%);
    --accent-gradient-hover: linear-gradient(135deg, #7b73ff 0%, #1adfff 100%);
    --accent-glow: 0 0 20px rgba(108, 99, 255, 0.4);
    --accent-glow-strong: 0 0 40px rgba(108, 99, 255, 0.6);

    /* Text */
    --text-primary: #eaeaf0;
    --text-secondary: #a1a1b5;
    --text-muted: #5c5c75;
    --text-accent: #6c63ff;
    --text-link: #00d4ff;

    /* Borders */
    --border-subtle: rgba(108, 99, 255, 0.12);
    --border-light: rgba(255, 255, 255, 0.06);
    --border-accent: rgba(108, 99, 255, 0.4);

    /* Glass */
    --glass-bg: rgba(15, 15, 26, 0.75);
    --glass-bg-strong: rgba(15, 15, 26, 0.92);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    --space-4xl: 6rem;

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 50%;

    /* Typography */
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --font-display: 'Inter', sans-serif;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
    --transition-spring: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);

    /* Z-index scale */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-overlay: 300;
    --z-modal: 400;
    --z-preloader: 500;

    /* Container widths */
    --container-sm: 640px;
    --container-md: 768px;
    --container-lg: 1024px;
    --container-xl: 1200px;
}

/* --- Global Reset --- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.5rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.75rem); }
h4 { font-size: 1.25rem; }

p {
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: 1rem;
}

a {
    color: var(--text-link);
    text-decoration: none;
    transition: color var(--transition-base);
}

a:hover {
    color: var(--accent-primary);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    list-style: none;
}

/* --- Layout --- */
.container {
    width: 100%;
    max-width: var(--container-xl);
    margin: 0 auto;
    padding: 0 var(--space-xl);
}

.container--narrow {
    max-width: var(--container-md);
}

.section {
    padding: var(--space-4xl) 0;
    position: relative;
}

.section--hero {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Grid System --- */
.grid {
    display: grid;
    gap: var(--space-xl);
}

.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

.grid--auto-fill {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

@media (max-width: 1024px) {
    .grid--3 { grid-template-columns: repeat(2, 1fr); }
    .grid--4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .grid--2,
    .grid--3,
    .grid--4 { grid-template-columns: 1fr; }
    
    .grid--auto-fill {
        grid-template-columns: 1fr;
    }

    .container {
        padding: 0 var(--space-md);
    }

    .section {
        padding: var(--space-2xl) 0;
    }

    .section-header {
        margin-bottom: var(--space-xl);
    }

    h1 { font-size: clamp(1.8rem, 7vw, 2.5rem); }
    h2 { font-size: clamp(1.4rem, 5vw, 2rem); }
}

/* === Extra Small (< 380px) === */
@media (max-width: 380px) {
    :root {
        font-size: 14px;
    }

    .container {
        padding: 0 var(--space-sm);
    }
}

/* === Safe area support for notched phones === */
@supports (padding: env(safe-area-inset-bottom)) {
    body {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
}

/* === Touch-friendly tap targets === */
@media (pointer: coarse) {
    .btn, input, select, textarea {
        min-height: 44px;
    }
    
    .btn--sm {
        min-height: 40px;
    }
}

/* --- Gradient Text --- */
.gradient-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* --- Section Header --- */
.section-header {
    text-align: center;
    margin-bottom: var(--space-3xl);
}

.section-header h2 {
    margin-bottom: var(--space-md);
}

.section-header p {
    max-width: 600px;
    margin: 0 auto;
}

.section-divider {
    width: 60px;
    height: 3px;
    background: var(--accent-gradient);
    border: none;
    border-radius: 2px;
    margin: var(--space-lg) auto;
}

/* --- Background Effects --- */
.bg-dots {
    background-image: radial-gradient(rgba(108, 99, 255, 0.08) 1px, transparent 1px);
    background-size: 30px 30px;
}

.bg-gradient-radial {
    background: radial-gradient(ellipse at 50% 0%, rgba(108, 99, 255, 0.1) 0%, transparent 60%);
}

/* --- Visibility Utilities --- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* --- Reveal Animation Targets --- */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
