:root {
    --apple-blue: #007aff;
    --apple-green: #34c759;
    --apple-gray: #86868b;
    --glass-bg: rgba(255, 255, 255, 0.6);
    --glass-border: rgba(255, 255, 255, 0.3);
    --bg-light: #f5f5f7;
    --text-dark: #1d1d1f;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

/* Preloader */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.8s;
}

.preloader-content {
    text-align: center;
}

.preloader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 122, 255, 0.1);
    border-top: 3px solid var(--apple-blue);
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: preloader-spin 1s infinite cubic-bezier(0.16, 1, 0.3, 1);
}

.preloader-text {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 1.1rem;
    letter-spacing: -0.01em;
}

@keyframes preloader-spin {
    to { transform: rotate(360deg); }
}

.preloader-hidden {
    opacity: 0;
    visibility: hidden;
}

/* Optimized Noise Overlay */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.02; /* Lower opacity for less visibility */
    /* Minimalist noise pattern - much faster than feTurbulence */
    background-image: url("../images/noise.png");
    background-repeat: repeat;
}

/* Background Blobs - GPU Optimized */
.bg-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.blob {
    position: absolute;
    width: 60vw; /* Increased size for softer look */
    height: 60vw;
    /* Soft radial-gradient replaces expensive filter: blur() */
    background: radial-gradient(circle, rgba(0, 122, 255, 0.12) 0%, rgba(255, 255, 255, 0) 70%);
    border-radius: 50%;
    will-change: transform;
    transform: translateZ(0); /* Force GPU layer */
}

.blob-1 { top: -10%; left: -10%; background: radial-gradient(circle, rgba(0, 122, 255, 0.15) 0%, transparent 70%); }
.blob-2 { bottom: -10%; right: -10%; background: radial-gradient(circle, rgba(88, 86, 214, 0.15) 0%, transparent 70%); }
.blob-3 { top: 40%; left: 30%; background: radial-gradient(circle, rgba(255, 45, 85, 0.08) 0%, transparent 70%); }

/* Glass UI Elements - Ultra Optimized */
.glass-nav {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(4px); /* Further reduced for performance */
    -webkit-backdrop-filter: blur(4px);
    border-bottom: 1px solid var(--glass-border);
    transition: background 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateZ(0);
}

.glass-card {
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(4px); /* Drastically reduced for 60FPS scrolling */
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.05);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.5s ease;
    will-change: transform;
    transform: translateZ(0);
}

.glass-card:hover {
    transform: translateY(-8px); /* Simplified transition */
    box-shadow: 0 20px 60px -15px rgba(0, 0, 0, 0.1);
}

/* Liquid Glass Buttons - Optimized */
.btn-glass {
    background: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: var(--text-dark);
    font-weight: 500;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s ease, color 0.4s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}

.btn-glass:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(0,0,0,0.08);
    color: var(--apple-blue);
}

.btn-glass-primary {
    background: rgba(0, 122, 255, 0.1);
    border: 1px solid rgba(0, 122, 255, 0.2);
    color: var(--apple-blue);
    font-weight: 600;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s ease, border-color 0.4s ease;
    box-shadow: 0 4px 15px rgba(0, 122, 255, 0.05);
}

.btn-glass-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(0, 122, 255, 0.15);
    border-color: rgba(0, 122, 255, 0.4);
}

/* Typography & Links */
.brand-accent { color: var(--apple-blue); }
.brand-accent-green { color: var(--apple-green); }

.nav-link {
    font-weight: 500;
    color: var(--text-dark) !important;
    margin: 0 0.5rem;
    padding: 0.5rem 1rem !important;
    border-radius: 12px;
    opacity: 0.8;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), color 0.3s ease, background 0.3s ease;
}

.nav-link:hover { 
    opacity: 1; 
    color: var(--apple-blue) !important;
    background: rgba(0, 122, 255, 0.08); /* Slightly more opaque background */
}

h1, h2, h3 { font-weight: 700; letter-spacing: -0.02em; }

.section-title {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2.5rem;
}

/* First Section Wrapper */
.first-section-wrapper {
    min-height: 92vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Hero Section */
header, main {
    margin: 0;
    padding: 0;
}

section {
    position: relative;
    contain: paint; /* Helps browser skip rendering of off-screen sections */
    overflow: hidden;
}

.hero-section {
    min-height: auto;
    padding-top: 1rem;
    padding-bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
}

.hero-subtitle {
    color: var(--apple-blue);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-weight: 600;
    font-size: 0.9rem;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    display: block;
}

.hero-title {
    font-size: clamp(2.5rem, 8vw, 5rem);
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.hero-description {
    font-size: 1.25rem;
    color: var(--apple-gray);
    max-width: 600px;
    margin: 0 auto 2rem;
}

/* Profile Image (Enlarged) */
.profile-mini-container {
    margin-top: -1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.profile-img-mini {
    width: 162px;
    height: 162px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--apple-blue);
    padding: 4px;
    box-shadow: 0 15px 35px rgba(0, 122, 255, 0.2);
}

.profile-name {
    font-size: 2.6rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 0.25rem;
}

.profile-title-mini {
    font-size: 1.5rem;
    color: var(--apple-gray);
    font-weight: 500;
}

/* Reveal Animation Base */
.reveal {
    opacity: 0;
    will-change: transform, opacity;
    transform: translateZ(0);
}

/* Skill Tag - Performance First */
.skill-tag {
    background: rgba(0, 122, 255, 0.05);
    color: var(--apple-blue);
    padding: 0.6rem 1.2rem;
    border: 1px solid rgba(0, 122, 255, 0.1);
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-block;
    margin: 0.35rem;
    transition: transform 0.3s ease;
    will-change: transform;
}

.skill-tag:hover {
    background: rgba(0, 122, 255, 0.12);
    transform: scale(1.05);
    border-color: rgba(0, 122, 255, 0.3);
}

/* Logo Pills for DevOps & Data */
.logo-pill {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.6rem 1.2rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform, box-shadow;
    white-space: nowrap;
}

.logo-pill.pill-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    gap: 8px;
    border-radius: 10px;
}

.logo-pill:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
    border-color: var(--apple-blue);
    background: white;
}

.pill-logo {
    height: 24px;
    width: auto;
    object-fit: contain;
}

.pill-sm .pill-logo {
    height: 18px;
}

/* Code Glass - Optimized */
.code-glass {
    perspective: 1000px;
    transform-style: preserve-3d;
    background: rgba(29, 29, 31, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 2rem;
    font-family: 'SF Mono', 'Fira Code', 'JetBrains Mono', monospace;
    font-size: 0.95rem;
    line-height: 1.7;
    color: #f8f8f2;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
    overflow-x: auto;
    transition: transform 0.1s ease-out;
    will-change: transform;
}

.code-keyword { color: #ff79c6; font-weight: 600; }
.code-type { color: #8be9fd; }
.code-method { color: #50fa7b; }
.code-string { color: #f1fa8c; }
.code-comment { color: #6272a4; font-style: italic; }
.code-task { color: #bd93f9; }

/* Test Pyramid Visual */
.test-pyramid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin: 2rem 0;
}

.pyramid-tier {
    padding: 1.25rem;
    border-radius: 12px;
    background: rgba(0, 122, 255, 0.08);
    border: 1px solid rgba(0, 122, 255, 0.2);
    text-align: center;
    transition: transform 0.4s ease, background 0.4s ease, border-color 0.4s ease;
    cursor: default;
    transform: translateZ(0);
    will-change: transform;
}

.pyramid-tier:hover {
    background: rgba(0, 122, 255, 0.15);
    transform: scale(1.02);
    border-color: rgba(0, 122, 255, 0.4);
}

.tier-e2e { width: 40%; background: rgba(255, 45, 85, 0.1); border-color: rgba(255, 45, 85, 0.2); }
.tier-integration { width: 65%; background: rgba(88, 86, 214, 0.1); border-color: rgba(88, 86, 214, 0.2); }
.tier-unit { width: 90%; background: rgba(52, 199, 89, 0.1); border-color: rgba(52, 199, 89, 0.2); }

/* Pipeline Visual */
.pipeline-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 0;
    position: relative;
}

.pipeline-container::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 10%;
    right: 10%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--apple-blue), transparent);
    background-size: 200% 100%;
    animation: pipeline-flow 4s infinite linear;
    z-index: 0;
    opacity: 0.4;
}

@keyframes pipeline-flow {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.pipeline-node {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--apple-blue);
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    z-index: 1;
    border: 1px solid rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    will-change: transform;
    transform: translateZ(0);
}

.pipeline-node:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 15px 35px rgba(0, 122, 255, 0.2);
}

/* Performance Visual */
.load-bar-container {
    height: 8px;
    width: 100%;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.load-bar-fill {
    height: 100%;
    width: 0%;
    background: var(--apple-blue);
    border-radius: 10px;
    will-change: width, background-color;
    transition: background-color 0.3s ease;
}

#load-value {
    font-size: 0.85rem;
    font-weight: 600;
    transition: color 0.3s ease;
}

.load-critical {
    color: #ff3b30;
}

.load-warning {
    color: #ff9500;
}

.load-normal {
    color: var(--apple-blue);
}

/* Programming Section Enhancements */
.writing-type-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(0, 122, 255, 0.1);
    padding: 0.75rem 1rem;
    border-radius: 14px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--apple-blue);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

.writing-type-card:hover {
    background: rgba(0, 122, 255, 0.08);
    transform: translateX(8px) scale(1.02);
    border-color: var(--apple-blue);
    box-shadow: 0 8px 20px rgba(0, 122, 255, 0.1);
}

.lang-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 1.25rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid var(--glass-border);
    min-width: 120px;
}

.lang-item:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.6);
    box-shadow: 0 15px 35px rgba(0, 0, 122, 0.08);
    border-color: var(--apple-blue);
}

.lang-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark);
}

/* Utility Classes */
.bg-white-50 { background: rgba(255, 255, 255, 0.5); }

/* Section Icons */
.section-icon-large {
    font-size: 3.5rem;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, var(--apple-blue), #5856d6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

/* Performance & Security Metrics */
.metric-card {
    text-align: center;
    padding: 1.5rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.metric-card:hover {
    background: rgba(0, 122, 255, 0.05);
    border-color: rgba(0, 122, 255, 0.2);
    transform: translateY(-5px);
}

.metric-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    display: block;
    color: var(--apple-blue);
}

.metric-value {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.metric-label {
    font-size: 0.85rem;
    color: var(--apple-gray);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Timeline */
.timeline-item {
    position: relative;
    padding-left: 2rem;
    border-left: 2px solid var(--apple-blue);
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

.timeline-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    background: white;
    padding: 6px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--glass-border);
    flex-shrink: 0;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -7px;
    top: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--apple-blue);
}

/* Timeline Vertical Line */
.timeline-item::after {
    content: '';
    position: absolute;
    left: -2px;
    top: 12px;
    width: 2px;
    height: calc(100% + 1rem);
    background: var(--apple-blue);
    opacity: 0.2;
}

.timeline-item:last-child::after {
    display: none;
}

.certification-clickable {
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}

.certification-clickable:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 20px rgba(0, 122, 255, 0.2);
}

.cert-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(0, 122, 255, 0.1);
    color: var(--apple-blue);
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.cert-badge:hover {
    background: var(--apple-blue);
    color: white;
    transform: translateY(-1px);
}

/* Modal for Certificates */
.cert-modal {
    display: none;
    position: fixed;
    z-index: 10001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.cert-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.cert-modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    transform: scale(0.9);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.cert-modal.active .cert-modal-content {
    transform: scale(1);
}

.cert-modal-content img {
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
}

.cert-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: #f1f1f1;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.cert-close:hover {
    color: var(--apple-blue);
}


/* Footer */
.social-icon {
    font-size: 1.5rem;
    color: var(--text-dark);
    margin: 0 1rem;
    transition: color 0.3s ease;
}

.social-icon:hover { color: var(--apple-blue); }

.badge-blue {
    background-color: var(--apple-blue);
    padding: 0.5em 1em;
    border-radius: 100px;
    font-weight: 500;
}
/* Mobile Adjustments */
@media (max-width: 768px) {
    .first-section-wrapper {
        min-height: auto;
    }
}

/* Scroll Progress Indicator */
.scroll-progress-container {
    position: fixed;
    right: 3px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 150px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
    z-index: 9999;
}

.scroll-progress-bar {
    width: 100%;
    height: 0%;
    background: var(--apple-blue);
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 122, 255, 0.3);
}
