:root {
    /* Colors */
    --bg-color: #0a0a0a;
    --bg-secondary: #111111;
    --text-primary: #eeeeee;
    --text-secondary: #888888;
    --accent-color: #00f0ff;
    /* Electric Blue/Cyan */
    --accent-glow: rgba(0, 240, 255, 0.3);
    --grid-line: rgba(255, 255, 255, 0.03);
    --border-color: rgba(255, 255, 255, 0.1);
    --nav-bg: rgba(10, 10, 10, 0.8);
    --bot-msg-bg: rgba(255, 255, 255, 0.05);
    --user-msg-bg: rgba(0, 240, 255, 0.15);

    /* Typography */
    --font-main: 'Inter', sans-serif;

    /* Spacing */
    --container-width: 1200px;
    --section-padding: 120px 0;

    /* Safe areas for notch devices */
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
    --safe-area-left: env(safe-area-inset-left, 0px);
    --safe-area-right: env(safe-area-inset-right, 0px);
}

[data-theme="light"] {
    --bg-color: #fcfcfc;
    --bg-secondary: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #5a5a5a;
    --accent-color: #0070f3;
    --accent-glow: rgba(0, 112, 243, 0.2);
    --grid-line: rgba(0, 0, 0, 0.05);
    --border-color: rgba(0, 0, 0, 0.1);
    --nav-bg: rgba(252, 252, 252, 0.85);
    --bot-msg-bg: rgba(0, 0, 0, 0.05);
    --user-msg-bg: rgba(0, 112, 243, 0.1);
}

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

html {
    scroll-behavior: smooth;
}

/* Respect users who prefer reduced motion (accessibility) */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-text-size-adjust: 100%;
    text-rendering: optimizeLegibility;
    /* iOS Safari: prevent tap highlight flash */
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* ===== Custom Scrollbar — all platforms ===== */
/* WebKit (Chrome, Safari, Edge, Android, iOS) */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Firefox */
html {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) var(--bg-color);
}

/* ===== Selection highlight ===== */
::selection {
    background: rgba(0, 240, 255, 0.25);
    color: var(--text-primary);
}

::-moz-selection {
    background: rgba(0, 240, 255, 0.25);
    color: var(--text-primary);
}

/* Utilities */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
    padding-left: max(20px, var(--safe-area-left));
    padding-right: max(20px, var(--safe-area-right));
    position: relative;
    z-index: 2;
    width: 100%;
}

.section {
    padding: var(--section-padding);
    position: relative;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    /* Prevent iOS Safari callout on long-press links */
    -webkit-touch-callout: default;
}

/* ===== Focus-Visible accessibility (keyboard navigation) ===== */
/* Only show focus ring on keyboard nav, not mouse/touch */
:focus {
    outline: none;
}

:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 3px;
    border-radius: 2px;
}

/* ===== Touch-friendly active states ===== */
@media (hover: none) and (pointer: coarse) {
    /* Touch device: show active state on tap instead of hover */
    .btn:active,
    .btn-cv:active,
    .btn-block:active,
    .contact-card:active,
    .project-card:active,
    .nav-link:active {
        opacity: 0.8;
        transform: scale(0.97);
        transition: transform 0.1s ease, opacity 0.1s ease;
    }
}

/* Image rendering optimization for Retina / HiDPI screens */
img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

ul {
    list-style: none;
}

/* Background Effects */
.grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 0;
}

.vignette {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, transparent 0%, rgba(0, 0, 0, 0.4) 100%);
    pointer-events: none;
    z-index: 1;
}

#antigravity-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.5;
    pointer-events: none;
}

/* Navigation */
.fixed-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 0;
    padding-top: max(20px, var(--safe-area-top));
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.4s ease, border-color 0.4s ease;
}

.nav-list {
    display: flex;
    justify-content: center;
    gap: 40px;
}

.nav-link {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    position: relative;
    white-space: nowrap;
}

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

.nav-link.active::after,
.nav-link:hover::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background-color: var(--accent-color);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-glow);
}

/* Nav Actions Container */
.nav-actions {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 110;
}

/* Theme Toggle Button */
.theme-toggle-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    transition: all 0.3s ease;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

.theme-toggle-btn:hover {
    color: var(--accent-color);
    border-color: var(--accent-color);
    box-shadow: 0 0 10px var(--accent-glow);
    transform: translateY(-2px);
}

.theme-toggle-btn svg {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
}

/* Hide sun in light mode, moon in dark mode */
[data-theme="light"] .theme-toggle-btn .sun-icon {
    display: none;
}
[data-theme="light"] .theme-toggle-btn .moon-icon {
    display: block;
}
[data-theme="dark"] .theme-toggle-btn .sun-icon {
    display: block;
}
[data-theme="dark"] .theme-toggle-btn .moon-icon {
    display: none;
}
/* Default fallback if data-theme is not strictly set but dark is default */
:root:not([data-theme="light"]) .theme-toggle-btn .sun-icon {
    display: block;
}
:root:not([data-theme="light"]) .theme-toggle-btn .moon-icon {
    display: none;
}

/* Hamburger Menu Button */
.hamburger-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 110;
    position: relative;
    color: var(--text-primary);
}

.hamburger-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    margin: 5px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.hamburger-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}



/* Hero Section */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-top: 80px;
    /* Offset for nav */
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.profile-meta {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 40px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.profile-image-wrapper {
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    overflow: hidden;
    /* Clip the scaled-up image */
    margin-left: auto;
    margin-right: auto;
    border: 1px solid var(--border-color);
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.1);
}

.profile-image-placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.35);
    /* Zoom into the circular photo content */
    object-position: center center;
}

/* Removed pseudo-element overlay as we now have a real image */

.hero-title {
    font-size: clamp(2rem, 6vw, 4rem);
    font-weight: 700;
    margin-bottom: 40px;
    line-height: 1.1;
    letter-spacing: -1px;
    word-break: break-word;
    overflow-wrap: break-word;
}

.hero-title .highlight {
    color: transparent;
    -webkit-text-stroke: 1px var(--text-primary);
    opacity: 0.7;
    display: block;
    margin-top: 10px;
}

.hero-tagline {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 20px auto 40px;
    /* Added top margin */
}

/* Buttons */
.cta-group {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.btn {
    padding: 15px 30px;
    border-radius: 4px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    /* Apple HIG: minimum 44px touch target */
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background: transparent;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.1);
}

.btn-primary:hover {
    background: var(--accent-color);
    color: var(--bg-color);
    box-shadow: 0 0 20px var(--accent-glow);
}

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

.btn-secondary:hover {
    border-color: var(--text-primary);
    background: var(--bot-msg-bg);
}

.btn-block {
    display: block;
    width: 100%;
    text-align: center;
    border: 1px solid var(--border-color);
    padding: 20px;
    color: var(--text-primary);
    background: var(--bg-secondary);
    margin-top: 10px;
}

.btn-block:hover {
    border-color: var(--accent-color);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.1);
}

.cv-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 10px;
}

.btn-cv {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: transparent;
    border: 1px solid var(--border-color);
    padding: 20px;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.btn-cv:hover {
    background: var(--bot-msg-bg);
    border-color: var(--accent-color);
    transform: translateX(5px);
}

/* Core Technologies Section */
.technologies-section {
    padding: 80px 0;
}

.tech-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 40px;
}

.tech-category {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 28px;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(40px);
}

.tech-category.visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease, transform 0.6s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.tech-category:hover {
    border-color: var(--accent-color);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.08);
    transform: translateY(-3px);
}

.tech-category-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent-color);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.tech-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tech-list li {
    color: var(--text-secondary);
    font-size: 0.95rem;
    padding: 6px 0;
    position: relative;
    padding-left: 16px;
}

.tech-list li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent-color);
    font-size: 0.8rem;
    opacity: 0.6;
}

@media (max-width: 768px) {
    .tech-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .tech-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Work Section */
.section-title {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    margin-bottom: 60px;
    position: relative;
    display: inline-block;
    word-break: break-word;
    overflow-wrap: break-word;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 10px;
    right: -20px;
    width: 60px;
    height: 1px;
    background: var(--accent-color);
}

.timeline-grid {
    display: grid;
    gap: 40px;
    border-left: 1px solid var(--border-color);
    padding-left: 40px;
}

.timeline-item {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--grid-line);
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -45px;
    /* Adjust based on padding + border size */
    top: 5px;
    width: 9px;
    height: 9px;
    background: var(--bg-color);
    border: 2px solid var(--accent-color);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-glow);
}

.company-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.duration {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: block;
}

.role-title {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.role-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* About Section */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 60px;
    align-items: start;
}

.about-text p {
    margin-bottom: 25px;
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.about-text strong {
    color: var(--text-primary);
    font-weight: 600;
}

.about-actions .btn-block {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: transparent;
    border: 1px solid var(--border-color);
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.about-actions .btn-block:hover {
    background: var(--bot-msg-bg);
    border-color: var(--accent-color);
    transform: translateX(5px);
}

/* Contact Section */
.contact-wrapper {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.contact-headline {
    font-size: clamp(1.8rem, 5vw, 3rem);
    margin-bottom: 40px;
}

.contact-cards {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.contact-card {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    /* Apple HIG: min 44px touch target — 60px exceeds this */
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    transition: all 0.3s ease;
    /* Prevent accidental text selection on tap */
    -webkit-user-select: none;
    user-select: none;
}

.contact-card svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
    transition: all 0.3s ease;
}

.contact-card:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px -10px var(--accent-glow);
    background: var(--bot-msg-bg);
}

.contact-card:hover svg {
    transform: scale(1.1);
}






/* ===== RESPONSIVE: Tablet (max-width: 768px) ===== */
@media (max-width: 768px) {
    /* Mobile Navigation */
    .nav-actions {
        /* Actions are already absolute positioned right, we just keep it */
        right: 15px;
    }

    .hamburger-btn {
        display: block;
    }

    .fixed-nav {
        padding: 15px 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .fixed-nav nav {
        width: 100%;
        position: relative;
    }

    .nav-list {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        height: 100dvh;
        background: rgba(10, 10, 10, 0.97);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 30px;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        z-index: 105;
    }

    .nav-list.mobile-open {
        opacity: 1;
        visibility: visible;
    }

    .nav-list .nav-link {
        font-size: 1.2rem;
        letter-spacing: 3px;
    }

    /* Hero */
    .hero-section {
        min-height: auto;
        min-height: 100dvh;
        padding-top: 100px;
        padding-bottom: 60px;
    }

    .hero-title {
        font-size: clamp(1.8rem, 7vw, 2.5rem);
        margin-bottom: 20px;
    }

    .hero-title br {
        display: none;
    }

    .hero-tagline {
        font-size: 0.95rem;
        margin: 10px auto 30px;
        padding: 0 10px;
    }

    .profile-meta {
        flex-direction: column;
        align-items: center;
        gap: 8px;
        margin-bottom: 20px;
        font-size: 0.75rem;
    }

    .profile-image-wrapper {
        width: 120px;
        height: 120px;
        margin-bottom: 20px;
    }

    .cta-group {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    .btn {
        padding: 12px 24px;
        font-size: 0.8rem;
        width: 100%;
        max-width: 280px;
        text-align: center;
    }

    /* Sections */
    .section {
        padding: 60px 0;
    }

    .section-title {
        font-size: clamp(1.4rem, 5vw, 2rem);
        margin-bottom: 40px;
    }

    .section-title::after {
        display: none;
    }

    /* About */
    .about-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .about-text p {
        font-size: 1rem;
        line-height: 1.7;
    }

    .about-actions {
        width: 100%;
    }

    .btn-cv {
        padding: 16px;
    }

    .btn-block {
        padding: 16px;
    }

    /* Timeline / Work */
    .timeline-item {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .timeline-left {
        margin-bottom: 5px;
    }

    .timeline-grid {
        padding-left: 20px;
    }

    .timeline-item::before {
        left: -25px;
        width: 7px;
        height: 7px;
    }

    .role-title {
        font-size: 1.05rem;
    }

    .role-description {
        font-size: 0.9rem;
    }

    /* Contact */
    .contact-headline {
        font-size: clamp(1.6rem, 6vw, 2.5rem);
    }

    .contact-cards {
        gap: 15px;
    }

    .contact-card {
        width: 52px;
        height: 52px;
    }

    .contact-card svg {
        width: 20px;
        height: 20px;
    }
}

/* ===== RESPONSIVE: Small Mobile (max-width: 480px) ===== */
@media (max-width: 480px) {
    .container {
        padding-left: max(16px, var(--safe-area-left));
        padding-right: max(16px, var(--safe-area-right));
    }

    .hero-section {
        padding-top: 80px;
        padding-bottom: 40px;
    }

    .hero-title {
        font-size: clamp(1.5rem, 8vw, 2rem);
        margin-bottom: 16px;
    }

    .hero-tagline {
        font-size: 0.85rem;
        margin: 8px auto 24px;
    }

    .profile-image-wrapper {
        width: 100px;
        height: 100px;
        margin-bottom: 16px;
    }

    .section {
        padding: 40px 0;
    }

    .section-title {
        font-size: clamp(1.2rem, 5vw, 1.6rem);
        margin-bottom: 30px;
    }

    .about-text p {
        font-size: 0.9rem;
        margin-bottom: 18px;
    }

    .timeline-grid {
        padding-left: 16px;
        gap: 24px;
    }

    .timeline-item {
        padding-bottom: 24px;
        gap: 8px;
    }

    .timeline-item::before {
        left: -21px;
        width: 6px;
        height: 6px;
    }

    .company-name {
        font-size: 0.95rem;
    }

    .duration {
        font-size: 0.8rem;
    }

    .role-title {
        font-size: 0.95rem;
    }

    .role-description {
        font-size: 0.85rem;
    }

    .tech-category {
        padding: 20px;
    }

    .tech-category-title {
        font-size: 0.75rem;
    }

    .tech-list li {
        font-size: 0.85rem;
        padding: 4px 0;
        padding-left: 14px;
    }

    .contact-headline {
        font-size: clamp(1.4rem, 7vw, 2rem);
        margin-bottom: 30px;
    }

    .btn-cv,
    .btn-block {
        padding: 14px;
        font-size: 0.85rem;
    }

    .footer-text {
        font-size: 0.78rem;
    }

    .footer-links {
        font-size: 0.78rem;
    }
}

/* Footer */
footer {
    padding: 40px 0;
    /* iPhone home-indicator safe area */
    padding-bottom: max(40px, calc(40px + var(--safe-area-bottom)));
    border-top: 1px solid var(--border-color);
    text-align: center;
    position: relative;
    z-index: 2;
}

.footer-text {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.footer-links {
    font-size: 0.85rem;
}

.footer-links a {
    color: var(--text-secondary);
    transition: color 0.3s ease;
    /* Ensure touch targets are large enough */
    padding: 4px 2px;
}

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

.footer-separator {
    color: var(--text-secondary);
    margin: 0 8px;
    opacity: 0.5;
}

/* ==========================================================================
   UX Improvements: Progress Bar, Back to Top, Forms, etc.
   ========================================================================== */

/* Scroll Progress Bar */
#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: var(--accent-color);
    z-index: 9999;
    box-shadow: 0 0 10px var(--accent-glow);
    transition: width 0.1s ease-out;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 900;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background-color: var(--accent-color);
    color: var(--bg-color);
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 240, 255, 0.4);
}

/* About Feature Image */
.about-image {
    width: 100%;
    margin-top: 30px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.about-image:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 240, 255, 0.15);
    border-color: rgba(0, 240, 255, 0.3);
}

.about-feature-img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* Tech Icons */
.tech-icon {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    vertical-align: text-bottom;
}

/* Icons that need to be inverted in dark mode (like black logos) */
:root:not([data-theme="light"]) .invert-icon,
[data-theme="dark"] .invert-icon {
    filter: invert(1);
}

[data-theme="light"] .invert-icon {
    filter: none;
}


/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 90%;
    max-width: 900px;
    height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.modal-overlay.open .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--nav-bg);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.close-modal-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.3s ease, transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
}

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

.modal-body {
    flex-grow: 1;
    position: relative;
    background: #fff;
}

.modal-body iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Contact Form */

.contact-subtitle {
    color: var(--text-secondary);
    margin-bottom: 40px;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 40px;
    text-align: left;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 15px 20px;
    background-color: var(--bot-msg-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    background-color: rgba(0, 240, 255, 0.05);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.1);
}

.btn-submit {
    width: 100%;
    padding: 15px;
    font-size: 1.1rem;
    font-weight: 600;
}

.form-status {
    text-align: center;
    margin-top: -10px;
    font-size: 0.9rem;
    height: 20px;
}

.form-status.success {
    color: #4CAF50;
}

.form-status.error {
    color: #f44336;
}

/* Mobile Responsive Overrides */
@media (max-width: 480px) {
    .back-to-top {
        left: 20px;
        bottom: max(20px, var(--safe-area-bottom));
        width: 45px;
        height: 45px;
    }
}