/* ==========================================================================
   PORTFOLIO DESIGN SYSTEM
   Developer: Ivan Dave S. Besere (Backend Engineer)
   Color Scheme: Dark Mode, Carbon, Pure White & Cyberpunk Red Accents
   ========================================================================== */

/* --- Import Premium Typography --- */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@300;400;500;600;700&display=swap');

/* --- Core Custom Properties --- */
:root {
    /* Color Palette */
    --bg-main: #050507;          /* Premium pitch dark */
    --bg-card: #0c0c0f;          /* Sleek glass/card dark grey */
    --bg-card-hover: #121216;    /* Card elevation background */
    --bg-nav: rgba(5, 5, 7, 0.75); /* Nav bar glass background */
    
    --primary: #ff3333;          /* High-intensity cyberpunk red */
    --primary-hover: #e02424;    /* Slightly deeper red for hover states */
    --primary-glow: rgba(255, 51, 51, 0.15); /* Ambient red glow */
    --primary-glow-strong: rgba(255, 51, 51, 0.4);
    
    --text-main: #fafafa;        /* Clean high-contrast off-white */
    --text-muted: #a1a1aa;       /* Zinc-400 for structural descriptions */
    --text-dark: #52525b;        /* Zinc-600 for minor details */
    
    --border: #1f1f23;           /* Ultra-thin professional borders */
    --border-hover: #ff3333;     /* Red border accent on hover */
    
    /* Typography */
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    
    /* Animation Speeds */
    --transition-fast: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-normal: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-slow: 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Global Resets & Defaults --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    background-color: var(--bg-main);
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow-x: hidden;
    
    /* Subtle Cybernetic Grid Pattern */
    background-image: 
        linear-gradient(rgba(255, 51, 51, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 51, 51, 0.015) 1px, transparent 1px);
    background-size: 50px 50px;
    background-position: center top;
}

/* --- Reusable Layout Containers --- */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

section {
    padding: 7rem 0;
    position: relative;
}

/* --- Typography Utilities --- */
.highlight {
    color: var(--primary);
    position: relative;
    display: inline-block;
}

.highlight::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: var(--primary);
    opacity: 0.3;
}

.mono {
    font-family: var(--font-mono);
}

/* --- Section Headers --- */
.section-header {
    text-align: center;
    margin-bottom: 4.5rem;
    position: relative;
}

.section-subtitle {
    font-family: var(--font-mono);
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    display: block;
    margin-bottom: 0.75rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-main);
}

.section-title-large {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin-bottom: 1.5rem;
}

.section-line {
    width: 40px;
    height: 3px;
    background-color: var(--primary);
    margin: 1.5rem auto 0;
    border-radius: 2px;
}

/* --- Interactive Elements (Buttons) --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.8rem 1.8rem;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    transition: all var(--transition-normal);
    cursor: pointer;
}

.btn-primary {
    background-color: var(--primary);
    color: #fff;
    border: 1px solid var(--primary);
    box-shadow: 0 4px 20px var(--primary-glow);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(255, 51, 51, 0.3);
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-main);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.03);
    border-color: var(--text-muted);
    transform: translateY(-2px);
}

.btn-large {
    padding: 1rem 2.2rem;
    font-size: 1.05rem;
}

/* ==========================================================================
   NAVIGATION
   ========================================================================== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: var(--bg-nav);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: all var(--transition-normal);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

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

.logo-img {
    height: 48px;
    width: auto;
    display: block;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.1));
    transition: transform var(--transition-normal);
}

.logo-img:hover {
    transform: rotate(5deg) scale(1.05);
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    list-style: none;
    align-items: center;
}

.nav-links li a {
    color: var(--text-muted);
    text-decoration: none;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    transition: color var(--transition-fast);
    position: relative;
    padding: 0.5rem 0;
}

.nav-links li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary);
    transition: width var(--transition-normal);
    border-radius: 2px;
}

.nav-links li a:hover {
    color: var(--text-main);
}

.nav-links li a:hover::after {
    width: 100%;
}

.nav-cta {
    margin-left: 1rem;
}

.nav-cta .btn {
    padding: 0.5rem 1.2rem;
    font-size: 0.85rem;
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */
.hero-section {
    padding-top: 11rem;
    padding-bottom: 7rem;
    min-height: 90vh;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 4rem;
    align-items: center;
}

.hero-text-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: rgba(255, 51, 51, 0.08);
    border: 1px solid rgba(255, 51, 51, 0.2);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    margin-bottom: 2rem;
}

.badge-dot {
    width: 6px;
    height: 6px;
    background-color: var(--primary);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 10px var(--primary);
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.9);
        opacity: 0.6;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
    100% {
        transform: scale(0.9);
        opacity: 0.6;
    }
}

.badge-text {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.hero-title {
    font-size: 3.8rem;
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 1.5rem;
    color: var(--text-main);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 2rem;
    max-width: 600px;
}

.hero-tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
}

.tech-tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    transition: all var(--transition-fast);
}

.tech-tag-pill i {
    color: var(--primary);
    font-size: 0.9rem;
}

.tech-tag-pill:hover {
    color: var(--text-main);
    border-color: rgba(255, 51, 51, 0.4);
    background-color: rgba(255, 51, 51, 0.02);
    transform: translateY(-1px);
}

.hero-actions {
    display: flex;
    gap: 1rem;
}

/* --- Hero Image and Glow --- */
.hero-image-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-glow {
    position: relative;
    border-radius: 24px;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0) 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transition: all var(--transition-slow);
}

.image-glow::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    height: 90%;
    background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
    opacity: 0.15;
    filter: blur(50px);
    z-index: -1;
    pointer-events: none;
    transition: opacity var(--transition-slow);
}

.profile-img {
    width: 100%;
    max-width: 320px;
    height: auto;
    display: block;
    border-radius: 16px;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.5));
    transition: transform var(--transition-slow);
}

.image-glow:hover {
    border-color: rgba(255, 51, 51, 0.3);
    box-shadow: 0 30px 60px rgba(255, 51, 51, 0.08);
    transform: translateY(-5px);
}

.image-glow:hover::before {
    opacity: 0.25;
}

.image-glow:hover .profile-img {
    transform: scale(1.02);
}

/* ==========================================================================
   ABOUT ME SECTION
   ========================================================================== */
.about-section {
    background-color: rgba(255, 255, 255, 0.005);
    border-top: 1px solid rgba(255, 255, 255, 0.01);
    border-bottom: 1px solid rgba(255, 255, 255, 0.01);
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
}

.about-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1.5rem;
    transition: all var(--transition-normal);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.about-card-img-wrapper {
    width: 100%;
    height: 220px;
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.about-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.highlighted-card .about-card-img {
    object-position: top center;
}

.about-card-body {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.about-card-tag {
    font-family: var(--font-mono);
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.about-card-text {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

.about-card-text span {
    color: var(--text-main);
    font-weight: 600;
}

/* Hover effects */
.about-card:hover {
    transform: translateY(-8px);
    border-color: rgba(255, 51, 51, 0.35);
    box-shadow: 0 15px 40px rgba(255, 51, 51, 0.06);
    background-color: var(--bg-card-hover);
}

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

/* Center card highlight feature */
.about-card.highlighted-card {
    border: 1px solid rgba(255, 51, 51, 0.25);
    box-shadow: 0 15px 40px rgba(255, 51, 51, 0.04);
}

.about-card.highlighted-card:hover {
    border-color: var(--primary);
    box-shadow: 0 20px 45px rgba(255, 51, 51, 0.1);
}

/* ==========================================================================
   TECHNICAL STACK (TOOLS)
   ========================================================================== */
.tools-section {
    padding: 4rem 0;
    background-color: var(--bg-main);
}

.section-header-compact {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2.5rem;
    justify-content: center;
}

.tech-stack-title {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-muted);
    letter-spacing: 0.15em;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.tech-stack-title i {
    color: var(--primary);
    font-size: 1.1rem;
}

/* Seamless Marquee Slider */
.logo-slider {
    overflow: hidden;
    padding: 1.5rem 0;
    background-color: rgba(255, 255, 255, 0.005);
    border-top: 1px solid rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    white-space: nowrap;
    position: relative;
    width: 100vw;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}

/* Premium Gradient Fading Masks */
.logo-slider::before,
.logo-slider::after {
    content: "";
    position: absolute;
    top: 0;
    width: 250px;
    height: 100%;
    z-index: 5;
    pointer-events: none;
}

.logo-slider::before {
    left: 0;
    background: linear-gradient(to right, var(--bg-main) 10%, transparent 100%);
}

.logo-slider::after {
    right: 0;
    background: linear-gradient(to left, var(--bg-main) 10%, transparent 100%);
}

/* The moving row */
.tools-grid {
    display: flex;
    width: max-content;
    animation: scroll 25s linear infinite;
}

/* Individual card styling */
.tools-card {
    flex: 0 0 auto;
    width: 160px;
    margin: 0 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
}

.tools-card img {
    height: 40px;
    width: auto;
    max-width: 90px;
    object-fit: contain;
    filter: grayscale(100%) contrast(1.2);
    opacity: 0.4;
    transition: all var(--transition-normal);
}

.tools-card-name {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-dark);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0;
    transform: translateY(4px);
    transition: all var(--transition-normal);
}

.tools-card:hover img {
    filter: grayscale(0%) contrast(1);
    opacity: 1;
    transform: scale(1.1);
}

.tools-card:hover .tools-card-name {
    opacity: 0.8;
    color: var(--text-muted);
    transform: translateY(0);
}

/* The Animation */
@keyframes scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%); /* Moves exactly half the width to loop */
    }
}

/* Pause animation on hover */
.logo-slider:hover .tools-grid {
    animation-play-state: paused;
}

/* ==========================================================================
   PROJECTS SECTION
   ========================================================================== */
.projects-section {
    background-color: var(--bg-main);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
}

.project-card {
    position: relative;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2.2rem;
    transition: all var(--transition-normal);
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(800px circle at var(--x, 0px) var(--y, 0px), rgba(255, 51, 51, 0.06), transparent 40%);
    opacity: 0;
    transition: opacity var(--transition-normal);
    z-index: 1;
    pointer-events: none;
}

.project-card:hover::before {
    opacity: 1;
}

.project-header {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 2;
}

.project-icon-wrapper {
    width: 48px;
    height: 48px;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    transition: all var(--transition-normal);
}

.project-icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.project-meta {
    flex-grow: 1;
}

.project-title {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text-main);
    transition: color var(--transition-fast);
}

.project-category {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
    margin-top: 0.1rem;
}

.project-number {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-dark);
    font-weight: 700;
}

.project-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    flex-grow: 1;
    position: relative;
    z-index: 2;
}

.project-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border);
    padding-top: 1.25rem;
    position: relative;
    z-index: 2;
    margin-top: auto;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.project-tag {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    background-color: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--border);
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
}

.project-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    color: var(--text-muted);
    text-decoration: none;
    transition: all var(--transition-normal);
}

.project-link i {
    font-size: 1.15rem;
}

/* Card Hover States */
.project-card:hover {
    transform: translateY(-6px);
    border-color: rgba(255, 51, 51, 0.3);
    box-shadow: 0 20px 45px rgba(255, 51, 51, 0.05);
    background-color: var(--bg-card-hover);
}

.project-card:hover .project-icon-wrapper {
    border-color: rgba(255, 51, 51, 0.3);
    background-color: rgba(255, 51, 51, 0.03);
}

.project-card:hover .project-title {
    color: var(--primary);
}

.project-card:hover .project-link {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 4px 15px var(--primary-glow);
    transform: scale(1.05);
}

/* ==========================================================================
   CONTACT SECTION
   ========================================================================== */
.contact-section {
    background-color: var(--bg-main);
    padding-bottom: 3rem;
}

.contact-card {
    position: relative;
    background: linear-gradient(135deg, rgba(12, 12, 15, 0.9) 0%, rgba(5, 5, 7, 0.9) 100%);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 4.5rem;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

.contact-glow {
    position: absolute;
    bottom: -150px;
    left: 50%;
    transform: translateX(-50%);
    width: 400px;
    height: 300px;
    background: radial-gradient(circle, var(--primary-glow-strong) 0%, transparent 70%);
    filter: blur(50px);
    z-index: 1;
    pointer-events: none;
    opacity: 0.6;
}

.contact-content {
    position: relative;
    z-index: 2;
    max-width: 650px;
    margin: 0 auto;
}

.contact-lead {
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 3rem;
}

.contact-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.social-links-wrap {
    display: flex;
    gap: 1rem;
}

.social-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 1.25rem;
    text-decoration: none;
    transition: all var(--transition-normal);
}

.social-btn:hover {
    color: var(--primary);
    border-color: rgba(255, 51, 51, 0.4);
    background-color: rgba(255, 51, 51, 0.05);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px var(--primary-glow);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 3rem 0;
    background-color: #030305;
}

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

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-logo {
    height: 36px;
    width: auto;
    align-self: flex-start;
    opacity: 0.8;
}

.footer-brand p {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    color: var(--text-dark);
}

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

.footer-links a {
    color: var(--text-dark);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: color var(--transition-fast);
}

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

/* ==========================================================================
   CONTACT MODAL & FORM
   ========================================================================== */
.contact-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.contact-modal.active {
    display: flex;
    opacity: 1;
}

.contact-modal-content {
    position: relative;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2.5rem;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    animation: slideUp var(--transition-normal);
}

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

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--primary);
    transform: rotate(90deg);
}

.modal-header {
    margin-bottom: 2rem;
}

.modal-header h2 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.modal-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
    letter-spacing: 0.01em;
}

.form-group input,
.form-group textarea {
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    color: var(--text-main);
    transition: all var(--transition-fast);
    outline: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-dark);
}

.form-group input:focus,
.form-group textarea:focus {
    background-color: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 51, 51, 0.3);
    box-shadow: 0 0 12px rgba(255, 51, 51, 0.1);
}

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

.recaptcha-group {
    display: flex;
    justify-content: center;
    padding: 1rem 0;
}

.g-recaptcha {
    transform: scale(1);
    transform-origin: center;
}

.btn-submit {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 600;
    margin-top: 0.5rem;
    border: none;
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.form-message {
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    font-size: 0.95rem;
    margin-top: 1rem;
}

.form-message.success {
    background-color: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

.form-message.error {
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

/* ==========================================================================
   RESPONSIVE MEDIA QUERIES
   ========================================================================== */

/* --- Tablet Devices (Up to 1024px) --- */
@media (max-width: 1024px) {
    .hero-title {
        font-size: 3.2rem;
    }
    .about-grid {
        gap: 1.5rem;
    }

    .contact-modal-content {
        padding: 2rem;
    }

    .g-recaptcha {
        transform: scale(0.9);
    }
}

/* --- Medium Devices (Up to 768px) --- */
@media (max-width: 768px) {
    section {
        padding: 5rem 0;
    }

    .header-container {
        height: 70px;
    }

    .nav-links {
        display: none; /* Can be enhanced to compact burger drawer if required */
    }

    .hero-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }

    .hero-text-content {
        align-items: center;
    }

    .hero-title {
        font-size: 2.8rem;
    }

    .hero-tech-tags {
        justify-content: center;
    }

    .hero-image-wrapper {
        order: -1; /* Display profile picture above text on mobile */
    }

    .about-grid {
        grid-template-columns: 1fr;
        max-width: 450px;
        margin: 0 auto;
        gap: 2.5rem;
    }

    .about-card.highlighted-card {
        transform: none; /* Scale is handled smoothly by vertical layouts */
    }

    .projects-grid {
        grid-template-columns: 1fr;
        max-width: 550px;
        margin: 0 auto;
    }

    .contact-card {
        padding: 3rem 1.5rem;
    }

    .contact-modal-content {
        width: 85%;
        padding: 1.5rem;
        border-radius: 12px;
    }

    .modal-header h2 {
        font-size: 1.5rem;
    }

    .g-recaptcha {
        transform: scale(0.85);
        transform-origin: center;
    }

    .section-title-large {
        font-size: 2.2rem;
    }

    .footer-container {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
    }

    .footer-brand {
        align-items: center;
    }

    .footer-logo {
        align-self: center;
    }

    .footer-links {
        justify-content: center;
    }
}

/* --- Compact Mobile Devices (Up to 480px) --- */
@media (max-width: 480px) {
    .hero-title {
        font-size: 2.2rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .hero-actions {
        flex-direction: column;
        width: 100%;
    }

    .hero-actions .btn {
        width: 100%;
    }

    .project-card {
        padding: 1.5rem;
    }

    .project-header {
        align-items: flex-start;
    }

    .project-number {
        align-self: flex-start;
    }

    .contact-modal-content {
        width: 95%;
        padding: 1.25rem;
    }

    .modal-header h2 {
        font-size: 1.25rem;
    }

    .modal-close {
        top: 1rem;
        right: 1rem;
        font-size: 1.25rem;
    }

    .form-group input,
    .form-group textarea {
        font-size: 16px;
    }

    .g-recaptcha {
        transform: scale(0.75);
    }

    .footer-links {
        flex-wrap: wrap;
        gap: 1rem;
        justify-content: center;
    }
}

/* ==========================================================================
   FLOATING CHAT BUTTON
   ========================================================================== */
.floating-chat-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #ff5555);
    color: white;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 8px 24px var(--primary-glow-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
    z-index: 999;
}

.floating-chat-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 32px rgba(255, 51, 51, 0.5);
}

.floating-chat-btn:active {
    transform: scale(0.95);
}

@media (max-width: 768px) {
    .floating-chat-btn {
        width: 50px;
        height: 50px;
        bottom: 1.5rem;
        right: 1.5rem;
        font-size: 1.25rem;
    }
}