/* Base Setup */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { font-family: 'Inter', sans-serif; background: #0c0a09; color: #f5f5f4; overflow-x: hidden; }
h1, h2, h3, h4, .font-serif { font-family: 'Playfair Display', serif; }
html { scroll-behavior: smooth; }

/* Custom Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #1c1917; }
::-webkit-scrollbar-thumb { background: #78716c; border-radius: 3px; }

/* Premium Grain Overlay */
.grain-overlay {
    position: fixed;
    top: -50%; left: -50%; right: -50%; bottom: -50%;
    width: 200%; height: 200%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.04;
    pointer-events: none;
    z-index: 9999;
}

/* Custom Cursor Follower */
#cursor-follower {
    position: fixed;
    width: 20px; height: 20px;
    background: rgba(243, 239, 224, 0.15);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    transition: transform 0.2s ease-out, width 0.3s ease, height 0.3s ease, background 0.3s ease;
    transform: translate(-50%, -50%);
    mix-blend-mode: difference;
}
#cursor-follower.hovering {
    width: 50px; height: 50px;
    background: rgba(243, 239, 224, 0.3);
}

/* Background Gradient Helper */
.section-bg-gradient {
    background: linear-gradient(to bottom, #0c0a09, rgba(28,25,23,0.2), #0c0a09);
}

/* Section Divider */
.section-divider {
    width: 60px; height: 2px;
    background: linear-gradient(to right, #F3EFE0, transparent);
}

/* Hero Background Orbs */
.hero-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    animation: float-orb 8s ease-in-out infinite;
}
.hero-orb-1 {
    width: 500px; height: 500px;
    background: #F3EFE0;
    top: -100px; right: -100px;
}
.hero-orb-2 {
    width: 400px; height: 400px;
    background: #78716c;
    bottom: -100px; left: -100px;
    animation-delay: 4s;
}

@keyframes float-orb {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(30px, -20px) scale(1.05); }
}

/* Hero Image Masking Animation */
.hero-image-wrapper {
    position: relative;
    width: 240px; height: 300px;
}
@media (min-width: 768px) {
    .hero-image-wrapper {
        width: 300px; height: 380px;
    }
}
.hero-image-clip {
    width: 100%; height: 100%;
    border-radius: 50%;
    overflow: hidden;
    clip-path: circle(0% at 50% 50%);
    animation: clip-reveal 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards;
    position: relative; z-index: 2;
    border: 3px solid rgba(243, 239, 224, 0.2);
}
.hero-image {
    width: 100%; height: 100%;
    object-fit: cover;
    object-position: center top;
    transform: scale(1.2);
    transition: transform 0.6s ease;
}
.hero-image-clip:hover .hero-image {
    transform: scale(1);
}

@keyframes clip-reveal {
    to { clip-path: circle(100% at 50% 50%); }
}

/* Text Reveal Animation */
.reveal-text {
    overflow: hidden;
    display: inline-block;
}
.reveal-text > * {
    transform: translateY(110%);
    display: inline-block;
    transition: transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-text.is-visible > * {
    transform: translateY(0);
}

/* Scroll Reveal UP Animation Classes */
.reveal-up {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-up.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Scroll Line Animation */
.scroll-line-fill {
    height: 100%;
    animation: scroll-fill 2s ease-in-out infinite;
}
@keyframes scroll-fill {
    0% { transform: translateY(-100%); }
    50% { transform: translateY(0%); }
    100% { transform: translateY(100%); }
}

/* Glass Card & 3D Tilt Setup */
.glass-card {
    background: rgba(28, 25, 23, 0.4);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease, border-color 0.3s ease;
    transform-style: preserve-3d;
}
.glass-card:hover {
    background: rgba(28, 25, 23, 0.6);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

/* Disable 3D tilt on mobile to fix scrolling bugs and animation freezing */
@media (max-width: 767px) {
    .tilt-card {
        transform: none !important;
        transform-style: flat !important;
    }
}

/* Skill Pill */
.skill-pill {
    background: rgba(243, 239, 224, 0.05);
    border: 1px solid rgba(243, 239, 224, 0.1);
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #d6d3d1;
    transition: all 0.3s ease;
    cursor: default;
    display: inline-flex;
    align-items: center;
}
.skill-pill:hover {
    background: rgba(243, 239, 224, 0.12);
    border-color: rgba(243, 239, 224, 0.3);
    color: #f5f5f4;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

/* Tech Icon Card & 3D Tilt Setup */
.tech-icon-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px;
    background: rgba(243, 239, 224, 0.03);
    border: 1px solid rgba(243, 239, 224, 0.08);
    border-radius: 20px;
    transition: all 0.3s ease;
    cursor: default;
    transform-style: preserve-3d;
}
.tech-icon-card:hover {
    background: rgba(243, 239, 224, 0.08);
    border-color: rgba(243, 239, 224, 0.2);
}

/* Contact Link */
.contact-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: rgba(243, 239, 224, 0.03);
    border: 1px solid rgba(243, 239, 224, 0.08);
    border-radius: 16px;
    transition: all 0.3s ease;
    text-decoration: none;
    color: #d6d3d1;
}
.contact-link:hover {
    background: rgba(243, 239, 224, 0.08);
    border-color: rgba(243, 239, 224, 0.15);
    color: #f5f5f4;
    transform: translateX(6px);
}

/* Cert Badge & 3D Tilt Setup */
.cert-badge {
    padding: 16px 20px;
    background: rgba(243, 239, 224, 0.03);
    border: 1px solid rgba(243, 239, 224, 0.08);
    border-radius: 16px;
    transition: all 0.3s ease;
    transform-style: preserve-3d;
}
.cert-badge:hover {
    background: rgba(243, 239, 224, 0.08);
    border-color: rgba(243, 239, 224, 0.15);
}

/* Timeline Self-Drawing Line */
.timeline-line {
    position: absolute;
    left: 7px; top: 20px; bottom: 20px;
    width: 2px;
    background: rgba(243, 239, 224, 0.1);
}
.timeline-line::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 0;
    background: #F3EFE0;
    transition: height 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.timeline-line.is-visible::after {
    height: 100%;
}

.timeline-dot-wrap {
    position: absolute;
    left: 0; top: 20px;
    width: 16px; height: 16px;
    justify-content: center;
    align-items: center;
    z-index: 2;
}
.timeline-dot {
    width: 16px; height: 16px;
    border-radius: 50%;
    background: transparent;
    border: 2px solid rgba(243,239,224,0.3);
    transition: all 0.5s ease;
}
.timeline-item.is-visible .timeline-dot {
    background: #F3EFE0;
    border-color: #F3EFE0;
    box-shadow: 0 0 15px rgba(243, 239, 224, 0.4);
}

/* Nav Link Animation */
.nav-link {
    position: relative;
    padding: 4px 0;
    color: #a8a29e;
    transition: color 0.3s ease;
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 0;
    width: 0; height: 1px;
    background: #F3EFE0;
    transition: width 0.3s ease;
}
.nav-link:hover, .nav-link.active { color: #f5f5f4; }
.nav-link:hover::after, .nav-link.active::after { width: 100%; }

/* Mobile Menu Animation */
.mobile-menu {
    transform: translateX(100%);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.mobile-menu.open { transform: translateX(0); }