/* =========================
   ENHANCED INTERACTIVE ELEMENTS
   ========================= */
:root {
    --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =========================
   BASE STYLES
   ========================= */
:root {
    --primary: #b6bac5;
    --primary-light: #d4d7de;
    --accent: #8a8f9d;
    --accent-dark: #6b7080;
    --dark: #1a1d27;
    --mid: #252834;
    --card: rgba(37, 40, 52, 0.65);
    --light: #b6bac5;
    --text-primary: #e8eaed;
    --text-secondary: rgba(182, 186, 197, 0.85);
    --text-muted: rgba(182, 186, 197, 0.55);
    --border: rgba(182, 186, 197, 0.12);
    --border-strong: rgba(182, 186, 197, 0.22);
    --radius-lg: 16px;
    --radius-md: 12px;
    --shadow-lg: 0 24px 60px rgba(0,0,0,0.5);
    --shadow-md: 0 16px 40px rgba(0,0,0,0.4);
}

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

body {
    font-family: 'Space Grotesk', sans-serif;
    background: 
        radial-gradient(circle at 20% 30%, rgba(182, 186, 197, 0.04), transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(138, 143, 157, 0.03), transparent 45%),
        radial-gradient(circle at 50% 50%, rgba(107, 112, 128, 0.02), transparent 60%),
        #1a1d27;
    color: var(--light);
    overflow-x: hidden;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    opacity: 0;
    transition: opacity 0.6s ease;
}

body.loaded {
    opacity: 1;
}

/* Grid Background */
.grid-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(182, 186, 197, 0.012) 1px, transparent 1px),
        linear-gradient(90deg, rgba(182, 186, 197, 0.012) 1px, transparent 1px);
    background-size: 80px 80px;
    z-index: 0;
}

.grid-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 30% 20%, rgba(182, 186, 197, 0.03) 0%, transparent 55%),
        radial-gradient(circle at 70% 80%, rgba(138, 143, 157, 0.025) 0%, transparent 55%);
}

/* Geometric Shapes */
.geometric-shape {
    position: fixed;
    background: linear-gradient(135deg, rgba(182, 186, 197, 0.025), rgba(138, 143, 157, 0.02));
    backdrop-filter: blur(80px);
    border: 1px solid rgba(182, 186, 197, 0.06);
    animation: floatSubtle 25s ease-in-out infinite;
    z-index: 0;
    filter: saturate(0.7);
    transition: transform 0.3s ease-out;
    will-change: transform;
}

.shape1 {
    width: 400px;
    height: 400px;
    top: -100px;
    right: -100px;
    border-radius: 50%;
    animation-delay: 0s;
}

.shape2 {
    width: 300px;
    height: 300px;
    bottom: 100px;
    left: -80px;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    animation-delay: 7s;
}

.shape3 {
    width: 200px;
    height: 200px;
    top: 50%;
    right: 15%;
    border-radius: 20px;
    transform: rotate(45deg);
    animation-delay: 14s;
}

@keyframes floatSubtle {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(20px, -20px) rotate(5deg); }
    66% { transform: translate(-20px, 20px) rotate(-5deg); }
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

h1 {
    font-size: clamp(42px, 8vw, 80px);
    letter-spacing: -0.02em;
    margin-bottom: 1.5rem;
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

/* Layout */
.container {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 60px 40px;
}

/* Header */
header {
    margin-bottom: 80px;
    animation: slideDown 0.8s ease-out;
}

.course-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 2px;
    color: var(--primary-light);
    text-transform: uppercase;
    margin-bottom: 24px;
    display: inline-block;
    padding: 10px 20px;
    background: rgba(182, 186, 197, 0.06);
    border-left: 2px solid var(--primary);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.05);
}

.gradient-text {
    background: linear-gradient(135deg, #d4d7de 0%, #b6bac5 50%, #8a8f9d 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.1));
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin: 80px 0;
}

.module-card {
    background: var(--card);
    position: relative;
    overflow: hidden;
    transition: all var(--transition-base);
    transform: translateZ(0);
    will-change: transform, box-shadow, background;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.module-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: 0.3;
}

.module-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.4);
    background: rgba(45, 48, 63, 0.8);
    border-color: rgba(255, 255, 255, 0.08);
}

.module-card:active {
    transform: translateY(-4px) scale(0.99);
    transition: transform 0.1s ease-out;
}

.module-number {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 500;
    color: var(--primary);
    margin-bottom: 16px;
    display: block;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
}

.tech-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    padding: 4px 10px;
    background: rgba(182, 186, 197, 0.1);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--primary-light);
}

/* CTA Section */
.cta-section {
    text-align: center;
    margin: 120px 0 60px;
    padding: 60px 0;
    position: relative;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
}

.cta-button {
    position: relative;
    background: var(--primary);
    color: var(--dark);
    border: none;
    padding: 14px 36px;
    border-radius: 50px;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all var(--transition-base);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    overflow: hidden;
    z-index: 1;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s ease;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 40px rgba(0,0,0,0.5);
}

.cta-button:hover::before {
    opacity: 1;
}

/* Animations */
@keyframes slideDown {
    from { transform: translateY(-30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Responsive Design */
/* Touch device optimizations */
@media (hover: none) {
    .module-card:active {
        transform: scale(0.98);
        transition: transform 0.1s ease-out;
    }
    
    .cta-button:active {
        transform: scale(0.98);
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 40px 24px;
    }
    
    h1 {
        font-size: 2.5rem;
    }
    
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .cta-section {
        margin: 80px 0 40px;
        padding: 40px 0;
    }
}