/* =============================================
   CSS VARIABLES & RESET
   ============================================= */
:root {
    --primary-color: #000000;
    --secondary-color: #00f2ff;
    --text-color: #ffffff;
    --light-bg: #001320;
    --neon-glow: 0 0 10px #00f2ff, 0 0 20px #00f2ff, 0 0 30px #00f2ff;
    --grid-color: rgba(0, 242, 255, 0.1);
    --card-bg: rgba(0, 19, 32, 0.7);
    --success-color: #00e676;
    --error-color: #ff5252;
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    line-height: 1.7;
    color: var(--text-color);
    background-color: #000;
    overflow-x: hidden;
}

#background {
    position: fixed;
    width: 100%;
    height: 100%;
    z-index: -1;
    top: 0;
    left: 0;
}

/* =============================================
   SECTION ANIMATIONS (IntersectionObserver)
   ============================================= */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

.animate-on-scroll.visible .stagger {
    opacity: 0;
    animation: staggerIn 0.5s ease forwards;
}

.animate-on-scroll.visible .stagger:nth-child(1) { animation-delay: 0.1s; }
.animate-on-scroll.visible .stagger:nth-child(2) { animation-delay: 0.2s; }
.animate-on-scroll.visible .stagger:nth-child(3) { animation-delay: 0.3s; }
.animate-on-scroll.visible .stagger:nth-child(4) { animation-delay: 0.4s; }
.animate-on-scroll.visible .stagger:nth-child(5) { animation-delay: 0.5s; }
.animate-on-scroll.visible .stagger:nth-child(6) { animation-delay: 0.6s; }
.animate-on-scroll.visible .stagger:nth-child(7) { animation-delay: 0.7s; }
.animate-on-scroll.visible .stagger:nth-child(8) { animation-delay: 0.8s; }
.animate-on-scroll.visible .stagger:nth-child(9) { animation-delay: 0.9s; }

@keyframes staggerIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =============================================
   SECTION TITLES
   ============================================= */
.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-color);
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--secondary-color);
    border-radius: 2px;
    margin: 0.75rem auto 0;
    box-shadow: var(--neon-glow);
}

.text-center .section-title {
    margin-left: auto;
    margin-right: auto;
}

/* =============================================
   NAVBAR
   ============================================= */
.navbar {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 0.8rem 0;
    border-bottom: 1px solid rgba(0, 242, 255, 0.15);
    transition: background 0.3s;
}

.navbar.scrolled {
    background: rgba(0, 0, 0, 0.95);
}

.navbar-brand {
    color: var(--secondary-color) !important;
    font-weight: 800;
    font-size: 1.4rem;
    letter-spacing: 1px;
    text-shadow: 0 0 8px rgba(0, 242, 255, 0.5);
}

.navbar-nav {
    gap: 0.25rem;
}

.nav-link {
    color: rgba(255, 255, 255, 0.7) !important;
    font-weight: 500;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 0.5rem 1rem !important;
    transition: color 0.3s, text-shadow 0.3s;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--secondary-color);
    transition: all 0.3s ease;
    transform: translateX(-50%);
    border-radius: 1px;
}

.nav-link:hover,
.nav-link.active {
    color: var(--secondary-color) !important;
    text-shadow: 0 0 8px rgba(0, 242, 255, 0.4);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 70%;
    box-shadow: 0 0 6px var(--secondary-color);
}

@media (max-width: 991px) {
    .navbar-collapse {
        background: rgba(0, 0, 0, 0.97);
        padding: 1rem;
        border-radius: 12px;
        border: 1px solid rgba(0, 242, 255, 0.15);
        margin-top: 0.75rem;
    }

    .nav-link::after {
        left: 0;
        transform: none;
    }

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

/* =============================================
   HERO
   ============================================= */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 120px 0 80px;
    overflow: hidden;
    background: transparent;
}

.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, transparent 0%, rgba(0, 0, 0, 0.8) 100%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-content h1 {
    font-size: 4rem;
    font-weight: 800;
    color: var(--secondary-color);
    text-shadow: var(--neon-glow);
    letter-spacing: -1px;
    margin-bottom: 0.5rem;
}

/* Typewriter wrapper */
.typewriter-wrapper {
    font-size: 1.8rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.9);
    min-height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
}

#typewriter {
    display: inline;
}

.cursor {
    display: inline-block;
    width: 3px;
    height: 1.8rem;
    background: var(--secondary-color);
    margin-left: 2px;
    animation: blink 0.7s step-end infinite;
    vertical-align: text-bottom;
}

@keyframes blink {
    from, to { opacity: 1; }
    50% { opacity: 0; }
}

.hero-subtitle {
    font-size: 1.1rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 0.75rem;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2.5rem;
}

/* =============================================
   BUTTONS
   ============================================= */
.btn-neon {
    background: var(--secondary-color);
    color: var(--primary-color);
    border: 2px solid var(--secondary-color);
    padding: 12px 32px;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.btn-outline-neon {
    background: transparent;
    color: var(--secondary-color);
    border: 2px solid var(--secondary-color);
    padding: 12px 32px;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.btn-neon:hover,
.btn-outline-neon:hover {
    box-shadow: var(--neon-glow);
    transform: translateY(-3px);
    color: var(--primary-color);
    background: var(--secondary-color);
    text-decoration: none;
}

.btn-sm {
    padding: 8px 18px;
    font-size: 0.78rem;
}

/* =============================================
   ABOUT
   ============================================= */
#about {
    padding: 100px 0;
}

.about-image-container {
    position: relative;
    padding: 20px;
    max-width: 380px;
    margin-left: auto;
    aspect-ratio: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.about-image {
    position: relative;
    z-index: 2;
    overflow: hidden;
    border-radius: 20px;
    box-shadow: var(--neon-glow);
    width: calc(100% - 30px);
    height: calc(100% - 30px);
}

.about-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.about-image:hover img {
    transform: scale(1.05);
}

.about-content {
    padding-right: 2rem;
}

.about-content h3 {
    color: var(--secondary-color);
    font-size: 2.2rem;
    font-weight: 800;
    text-shadow: 0 0 12px rgba(0, 242, 255, 0.3);
    margin-bottom: 1.25rem;
}

.about-content .lead {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.8;
}

.point {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding: 1.25rem;
    border: 1px solid rgba(0, 242, 255, 0.2);
    border-radius: 12px;
    transition: all 0.3s ease;
    background: rgba(0, 0, 0, 0.2);
}

.point:hover {
    box-shadow: 0 0 15px rgba(0, 242, 255, 0.15);
    transform: translateX(8px);
    border-color: var(--secondary-color);
}

.point-content {
    margin-left: 1rem;
}

.point-content h4 {
    color: var(--secondary-color);
    margin-bottom: 0.3rem;
    font-size: 1rem;
    font-weight: 600;
}

.point-content p {
    margin-bottom: 0;
    font-size: 0.88rem;
    opacity: 0.7;
}

.neon-icon {
    color: var(--secondary-color);
    font-size: 1.8rem;
    text-shadow: 0 0 8px rgba(0, 242, 255, 0.4);
}

/* =============================================
   SKILLS — PROGRESS BARS
   ============================================= */
#skills {
    padding: 100px 0;
}

.skill-item {
    margin-bottom: 1.75rem;
    padding: 1.25rem 1.5rem;
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid rgba(0, 242, 255, 0.1);
    transition: all 0.3s ease;
}

.skill-item:hover {
    border-color: rgba(0, 242, 255, 0.3);
    transform: translateX(5px);
}

.skill-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.6rem;
}

.skill-name {
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.skill-name img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.skill-level {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    background: rgba(0, 242, 255, 0.1);
    color: var(--secondary-color);
    letter-spacing: 0.5px;
}

.skill-bar-bg {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
}

.skill-bar-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--secondary-color), #00d4aa);
    width: 0;
    transition: width 1.2s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 0 8px rgba(0, 242, 255, 0.3);
}

/* =============================================
   PROJECTS
   ============================================= */
#projects {
    padding: 100px 0;
    background: rgba(0, 19, 32, 0.4);
}

.project-card {
    background: var(--card-bg);
    border: 1px solid rgba(0, 242, 255, 0.12);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    height: 100%;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(8px);
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 60px rgba(0, 242, 255, 0.1), 0 0 20px rgba(0, 242, 255, 0.05);
    border-color: rgba(0, 242, 255, 0.3);
}

.project-img {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #0a0a1a 0%, #001320 50%, #0d2137 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: rgba(0, 242, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.project-img::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 60%, var(--card-bg));
}

.project-img i {
    z-index: 1;
    text-shadow: 0 0 30px rgba(0, 242, 255, 0.15);
}

.project-body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.project-body h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 0.6rem;
}

.project-body p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.7;
    margin-bottom: 1rem;
    flex: 1;
}

.project-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 0.75rem;
}

.chip {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(0, 242, 255, 0.08);
    color: var(--secondary-color);
    border: 1px solid rgba(0, 242, 255, 0.15);
    letter-spacing: 0.3px;
}

.project-role {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 1rem;
    font-style: italic;
}

.project-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.badge-production {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(0, 230, 118, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(0, 230, 118, 0.2);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 1rem;
}

.badge-production::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--success-color);
    border-radius: 50%;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* =============================================
   CONTACT FORM
   ============================================= */
#contact {
    padding: 100px 0;
}

.contact-form-card {
    padding: 2.5rem;
    background: var(--card-bg);
    border: 1px solid rgba(0, 242, 255, 0.12);
    border-radius: 16px;
    backdrop-filter: blur(8px);
}

.form-floating-group {
    position: relative;
    margin-bottom: 1.25rem;
}

.form-floating-group label {
    position: absolute;
    top: 50%;
    left: 16px;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.9rem;
    transition: all 0.3s ease;
    pointer-events: none;
}

.form-floating-group textarea ~ label {
    top: 20px;
    transform: none;
}

.form-floating-group input,
.form-floating-group textarea {
    width: 100%;
    padding: 16px;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(0, 242, 255, 0.15);
    border-radius: 10px;
    color: var(--text-color);
    font-family: var(--font-main);
    font-size: 0.95rem;
    transition: all 0.3s ease;
    outline: none;
}

.form-floating-group input:focus,
.form-floating-group textarea:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 12px rgba(0, 242, 255, 0.15);
}

.form-floating-group input:focus ~ label,
.form-floating-group input:not(:placeholder-shown) ~ label,
.form-floating-group textarea:focus ~ label,
.form-floating-group textarea:not(:placeholder-shown) ~ label {
    top: -10px;
    left: 12px;
    font-size: 0.72rem;
    color: var(--secondary-color);
    background: var(--card-bg);
    padding: 0 6px;
    border-radius: 4px;
    transform: none;
}

.form-floating-group input.valid,
.form-floating-group textarea.valid {
    border-color: var(--success-color);
}

.form-floating-group input.invalid,
.form-floating-group textarea.invalid {
    border-color: var(--error-color);
}

.form-floating-group textarea {
    resize: vertical;
    min-height: 120px;
}

.optional-tag {
    font-size: 0.7rem;
    opacity: 0.5;
    font-weight: 400;
}

/* Form success message */
.form-success {
    display: none;
    text-align: center;
    padding: 2rem;
    animation: fadeScaleIn 0.5s ease;
}

.form-success.show { display: block; }

.form-success i {
    font-size: 3.5rem;
    color: var(--success-color);
    margin-bottom: 1rem;
    display: block;
}

.form-success h4 { color: var(--success-color); font-weight: 700; }
.form-success p { color: rgba(255, 255, 255, 0.6); }

@keyframes fadeScaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* Submit button spinner */
.btn-submit { position: relative; }

.btn-submit .spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.btn-submit.loading .spinner { display: inline-block; }
.btn-submit.loading .btn-text { opacity: 0; }

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

/* =============================================
   BACK TO TOP
   ============================================= */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    background: var(--secondary-color);
    color: var(--primary-color);
    border: none;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
    box-shadow: 0 4px 20px rgba(0, 242, 255, 0.3);
}

.back-to-top.show { opacity: 1; visibility: visible; }
.back-to-top:hover { transform: translateY(-4px); box-shadow: var(--neon-glow); }

/* =============================================
   FOOTER
   ============================================= */
footer {
    padding: 1.5rem 0;
    background: rgba(0, 0, 0, 0.9);
    border-top: 1px solid rgba(0, 242, 255, 0.1);
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
    .hero-content h1 { font-size: 2.5rem; }
    .typewriter-wrapper { font-size: 1.3rem; }
    .hero-buttons { flex-direction: column; align-items: center; }
    .hero-buttons a { width: 100%; max-width: 280px; justify-content: center; }
    .about-image-container { padding: 10px; margin: 0 auto 2rem; max-width: 280px; }
    .about-content { padding-right: 0; text-align: center; }
    .about-content h3 { font-size: 1.8rem; }
    .section-title { font-size: 2rem; }
    .contact-form-card { padding: 1.5rem; }
}