@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* 
 * ADECODER DESIGN SYSTEM 
 * Premium Security-Focused CSS Architecture
 */

:root {
    /* Color Palette - Dark Mode Primary */
    --bg-void: #05060A;
    --bg-elevated: #0B0D14;
    --bg-glass: rgba(255, 255, 255, 0.04);
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(99, 102, 241, 0.24);

    --accent-primary: #6366F1;
    --accent-cyan: #06B6D4;
    --accent-violet: #8B5CF6;
    --accent-emerald: #10B981;

    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;

    /* Semantic Mappings */
    --surface: var(--bg-void);
    --surface-raised: var(--bg-elevated);
    --border: var(--border-subtle);
    --primary: var(--accent-primary);
    
    /* Layout */
    --max-width: 1280px;
    --section-padding: clamp(64px, 10vw, 120px);
    --header-height: 72px;
    --header-height-scrolled: 56px;
    
    /* Transitions */
    --ease-standard: cubic-bezier(0.16, 1, 0.3, 1);
    --transition-speed: 300ms;
}

/* Light Mode Overrides */
[data-theme="light"] {
    --bg-void: #F8FAFC;
    --bg-elevated: #FFFFFF;
    --bg-glass: rgba(0, 0, 0, 0.04);
    --border-subtle: rgba(0, 0, 0, 0.08);
    --border-glow: rgba(99, 102, 241, 0.15);

    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #64748B;
}

/* 1. Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background: var(--bg-void);
    color: var(--text-primary);
    font-family: 'Inter', system-ui, sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    transition: background-color var(--transition-speed) var(--ease-standard);
}

/* 2. Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.04em;
    color: var(--text-primary);
}

h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); }
h2 { font-size: clamp(2rem, 5vw, 3.5rem); }
h3 { font-size: clamp(1.5rem, 4vw, 2.5rem); }

p {
    font-size: clamp(1rem, 1.1vw, 1.125rem);
    color: var(--text-secondary);
    max-width: 65ch;
}

.mono {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9em;
    letter-spacing: 0;
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-violet) 50%, var(--accent-cyan) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

/* 3. Layout Components */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
}

section {
    padding: var(--section-padding) 0;
    position: relative;
}

.grid {
    display: grid;
    gap: 2rem;
}

.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

/* 4. Navigation */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    z-index: 1000;
    display: flex;
    align-items: center;
    transition: all var(--transition-speed) var(--ease-standard);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid transparent;
}

header.scrolled {
    height: var(--header-height-scrolled);
    background: var(--bg-glass);
    border-bottom: 1px solid var(--border-subtle);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    font-weight: 900;
    font-size: 1.5rem;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.05em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9375rem;
    transition: color var(--transition-speed);
}

.nav-links a:hover, .nav-links a.active {
    color: var(--text-primary);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* 5. Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-speed) var(--ease-standard);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid transparent;
    font-size: 0.9375rem;
}

.btn-primary {
    background: var(--accent-primary);
    color: white;
    border-top: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: var(--bg-glass);
    color: var(--text-primary);
    border-color: var(--border-subtle);
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.08);
    border-color: var(--text-muted);
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
}

/* 6. Cards & Glassmorphism */
.glass-card {
    background: var(--bg-glass);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 2.5rem;
    transition: all var(--transition-speed) var(--ease-standard);
    position: relative;
    overflow: hidden;
}

.glass-card:hover {
    border-color: var(--border-glow);
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

/* 7. Animations */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s var(--ease-standard);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

@keyframes mesh-animate {
    0% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(10%, 5%) scale(1.1); }
    66% { transform: translate(-5%, 15%) scale(0.9); }
    100% { transform: translate(0, 0) scale(1); }
}

.mesh-bg {
    position: fixed;
    top: -20%;
    left: -20%;
    width: 140%;
    height: 140%;
    z-index: -1;
    overflow: hidden;
    filter: blur(120px);
    opacity: 0.4;
}

.blob {
    position: absolute;
    width: 40vw;
    height: 40vw;
    border-radius: 50%;
    animation: mesh-animate 20s infinite ease-in-out;
}

.blob-1 { top: 10%; left: 10%; background: var(--accent-primary); animation-delay: -2s; }
.blob-2 { top: 40%; right: 10%; background: var(--accent-violet); animation-delay: -5s; }
.blob-3 { bottom: 10%; left: 30%; background: var(--accent-cyan); animation-delay: -8s; }

/* 8. Specialized Elements */
.counter-grid {
    background: var(--bg-elevated);
    padding: 4rem 0;
    border-top: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
}

.counter-item {
    text-align: center;
}

.counter-value {
    font-size: 3rem;
    font-weight: 900;
    color: var(--text-primary);
    display: block;
    margin-bottom: 0.5rem;
}

.counter-label {
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* Portfolio Marquee */
.marquee-container {
    overflow: hidden;
    white-space: nowrap;
    padding: 2rem 0;
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.marquee-content {
    display: inline-flex;
    animation: marquee 40s linear infinite;
}

.marquee-content:hover {
    animation-play-state: paused;
}

@keyframes marquee {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

.marquee-item {
    margin-right: 4rem;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--text-muted);
    transition: color 0.3s;
}

.marquee-item:hover {
    color: var(--text-primary);
}

/* Terminal Mockup */
.terminal {
    background: #0D1117;
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    overflow: hidden;
    box-shadow: 0 24px 48px rgba(0,0,0,0.5);
}

.term-header {
    background: #161B22;
    padding: 0.75rem 1rem;
    display: flex;
    gap: 0.5rem;
}

.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot-red { background: #FF5F56; }
.dot-yellow { background: #FFBD2E; }
.dot-green { background: #27C93F; }

.term-body {
    padding: 1.5rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
}

.term-line { display: flex; gap: 0.75rem; margin-bottom: 0.5rem; }
.term-prompt { color: var(--accent-emerald); font-weight: bold; }
.term-cursor { width: 8px; height: 1.2em; background: var(--text-primary); animation: blink 1s infinite; }

@keyframes blink { 50% { opacity: 0; } }

/* Footer */
footer {
    background: var(--bg-elevated);
    padding: 80px 0 40px;
    border-top: 1px solid var(--border-subtle);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 4rem;
    margin-bottom: 4rem;
}

.footer-logo {
    margin-bottom: 1.5rem;
}

.footer-links h4 {
    margin-bottom: 1.5rem;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--accent-primary);
}

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Mobile Adjustments */
@media (max-width: 1024px) {
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
}

@media (max-width: 768px) {
    .nav-links { display: none; }
    .footer-grid { grid-template-columns: 1fr; }
    .footer-bottom { flex-direction: column; gap: 1rem; text-align: center; }
}
