/* ===== CSS Variables & Reset ===== */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.06);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f0f0f5;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --accent-primary: #6366f1;
    --accent-secondary: #a855f7;
    --accent-tertiary: #ec4899;
    --gradient-main: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
    --gradient-subtle: linear-gradient(135deg, rgba(99,102,241,0.15) 0%, rgba(168,85,247,0.15) 100%);
    --success: #22c55e;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 24px;
    --shadow-glow: 0 0 40px rgba(99,102,241,0.15);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ===== Background Particles ===== */
.bg-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    animation: float 20s ease-in-out infinite;
}

.particle:nth-child(1) { background: var(--accent-primary); top: 10%; left: 10%; animation-delay: 0s; }
.particle:nth-child(2) { background: var(--accent-secondary); top: 60%; right: 10%; animation-delay: -5s; animation-duration: 25s; }
.particle:nth-child(3) { background: var(--accent-tertiary); bottom: 10%; left: 50%; animation-delay: -10s; animation-duration: 30s; }
.particle:nth-child(4) { background: var(--accent-primary); top: 40%; left: 70%; animation-delay: -7s; width: 200px; height: 200px; }
.particle:nth-child(5) { background: var(--accent-secondary); top: 80%; left: 20%; animation-delay: -12s; width: 250px; height: 250px; }
.particle:nth-child(6) { background: var(--accent-tertiary); top: 20%; right: 30%; animation-delay: -3s; width: 180px; height: 180px; }

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -40px) scale(1.1); }
    50% { transform: translate(-20px, 30px) scale(0.9); }
    75% { transform: translate(40px, 20px) scale(1.05); }
}

/* ===== Navbar ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    transition: var(--transition);
    backdrop-filter: blur(0px);
}

.navbar.scrolled {
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    display: flex;
    align-items: center;
}

.brand-text {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.brand-accent {
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-link:hover {
    color: var(--text-primary);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-main);
    transition: width 0.3s ease;
    border-radius: 1px;
}

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

.nav-link-api {
    background: var(--gradient-subtle);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
}

.nav-link-api::after { display: none; }

.nav-link-api:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

/* ===== Hero Section ===== */
.hero {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6rem 4rem 4rem;
    max-width: 1400px;
    margin: 0 auto;
    gap: 4rem;
}

.hero-content {
    flex: 1;
    max-width: 650px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.2);
    padding: 0.375rem 1rem;
    border-radius: 50px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--success);
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.6s ease-out;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.5); }
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.6s ease-out 0.1s both;
}

.gradient-text {
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 2.5rem;
    max-width: 520px;
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.hero-stats {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
    animation: fadeInUp 0.6s ease-out 0.3s both;
}

.stat-card {
    display: flex;
    flex-direction: column;
    padding: 1rem 1.5rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

.stat-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.stat-number {
    font-size: 1.75rem;
    font-weight: 700;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    animation: fadeInUp 0.6s ease-out 0.4s both;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--gradient-main);
    color: white;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: var(--glass-bg);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

/* ===== Hero Visual ===== */
.hero-visual {
    flex: 0.8;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 1s ease-out 0.5s both;
}

.orbit-container {
    position: relative;
    width: 350px;
    height: 350px;
}

.orbit {
    position: absolute;
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    animation: spin linear infinite;
}

.orbit-1 {
    width: 200px;
    height: 200px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-duration: 10s;
}

.orbit-2 {
    width: 280px;
    height: 280px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-duration: 15s;
    animation-direction: reverse;
}

.orbit-3 {
    width: 350px;
    height: 350px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-duration: 20s;
}

.orbit-dot {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--gradient-main);
    border-radius: 50%;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.5);
}

@keyframes spin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.core-circle {
    position: absolute;
    width: 80px;
    height: 80px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--gradient-subtle);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    backdrop-filter: blur(10px);
    animation: glow 3s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 30px rgba(99, 102, 241, 0.2); }
    50% { box-shadow: 0 0 60px rgba(99, 102, 241, 0.4); }
}

/* ===== Sections ===== */
.section {
    position: relative;
    z-index: 1;
    padding: 6rem 2rem;
}

.section-dark {
    background: var(--bg-secondary);
}

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

.section-title {
    font-size: 2.25rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.section-desc {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 3.5rem;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}

/* ===== Architecture Grid ===== */
.arch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

.arch-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: var(--transition);
    opacity: 0;
    transform: translateY(20px);
}

.arch-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.arch-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
}

.arch-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.arch-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.arch-card p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.6;
}

/* ===== Skills Grid ===== */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}

.skill-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: var(--transition);
    opacity: 0;
    transform: translateY(20px);
}

.skill-card.visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.5s ease, transform 0.5s ease, background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.skill-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
}

.skill-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.skill-name {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.skill-desc {
    color: var(--text-secondary);
    font-size: 0.8125rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.skill-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.skill-tag {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.1);
    padding: 0.25rem 0.625rem;
    border-radius: 50px;
    letter-spacing: 0.03em;
}

.skill-status {
    font-size: 0.75rem;
    color: var(--success);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.skill-status::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--success);
    border-radius: 50%;
}

/* ===== Status Grid ===== */
.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.25rem;
}

.status-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: var(--transition);
    opacity: 0;
    transform: translateY(20px);
}

.status-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.status-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-2px);
}

.status-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

.status-online .status-indicator {
    background: var(--success);
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
}

.status-warning .status-indicator {
    background: #f59e0b;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.45);
}

.status-disabled .status-indicator {
    background: #64748b;
    box-shadow: 0 0 10px rgba(100, 116, 139, 0.45);
}

.status-offline .status-indicator {
    background: #ef4444;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.45);
}

.status-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.status-card p {
    color: var(--text-secondary);
    font-size: 0.8125rem;
    margin-bottom: 0.5rem;
}

.status-label {
    display: inline-flex;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
    background: rgba(255, 255, 255, 0.03);
}

/* ===== Footer ===== */
.footer {
    position: relative;
    z-index: 1;
    border-top: 1px solid var(--glass-border);
    padding: 2rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-brand p {
    color: var(--text-muted);
    font-size: 0.8125rem;
    margin-top: 0.25rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--text-primary);
}

/* ===== Animations ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .hero {
        flex-direction: column;
        text-align: center;
        padding: 6rem 2rem 4rem;
    }
    .hero-content { max-width: 100%; }
    .hero-subtitle { margin-left: auto; margin-right: auto; }
    .hero-stats { justify-content: center; }
    .hero-actions { justify-content: center; }
    .hero-visual { margin-top: 2rem; }
    .orbit-container { width: 280px; height: 280px; }
    .orbit-1 { width: 160px; height: 160px; }
    .orbit-2 { width: 220px; height: 220px; }
    .orbit-3 { width: 280px; height: 280px; }
}

@media (max-width: 768px) {
    .navbar { padding: 0.75rem 1rem; }
    .nav-links { gap: 1rem; }
    .nav-link { font-size: 0.8rem; }
    .hero { padding: 5rem 1.5rem 3rem; }
    .hero-title { font-size: 2rem; }
    .hero-stats { flex-direction: column; gap: 0.75rem; }
    .stat-card { flex-direction: row; gap: 1rem; align-items: center; }
    .hero-actions { flex-direction: column; }
    .btn { justify-content: center; }
    .section { padding: 4rem 1.5rem; }
    .skills-grid { grid-template-columns: 1fr; }
    .footer-content { flex-direction: column; gap: 1rem; text-align: center; }
}

@media (max-width: 480px) {
    .nav-links { display: none; }
    .hero-title { font-size: 1.75rem; }
    .hero-subtitle { font-size: 1rem; }
    .orbit-container { width: 220px; height: 220px; }
}
