/* =================================
   FUTURIST PORTFOLIO - MAIN STYLES
   Kyle Dallafior UI/UX Portfolio
   ================================= */

/* CSS Variables - Color Scheme */
:root {
    /* Primary Colors */
    --white: #FFFFFF;
    --light-gray: #F9F9F9;
    --section-gray: #e6e6e6;
    --dark-gray: #000000;
    --medium-gray: #A9A3A1;
    --accent-red: #FF0000;
    --accent-red-light: #FF0000;
    
    /* Typography */
    --font-family: 'Overpass', sans-serif;
    
    /* Spacing */
    --section-padding: 120px 0;
    --container-padding: 0 20px;
    --grid-gap: 2rem;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.4s ease;
    --transition-slow: 0.6s ease;
    --transition-cubic: 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    
    /* Shadows */
    --shadow-subtle: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-medium: 0 8px 40px rgba(0, 0, 0, 0.12);
    --shadow-strong: 0 20px 60px rgba(0, 0, 0, 0.18);
    
    /* Z-index layers */
    --z-mobile-nav: 1000;
    --z-header: 100;
    --z-dropdown: 50;
    --z-overlay: 10;
}

/* =================================
   RESET & BASE STYLES
   ================================= */

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-family);
    color: var(--dark-gray);
    background-color: var(--white);
    line-height: 1.6;
    overflow-x: hidden;
}

/* =================================
   TYPOGRAPHY
   ================================= */

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }
h4 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); }

p {
    margin-bottom: 1rem;
    font-size: clamp(1rem, 1.2vw, 1.125rem);
    line-height: 1.7;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all var(--transition-fast);
}

/* =================================
   UTILITY CLASSES
   ================================= */

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--container-padding);
}

.accent-text {
    color: var(--accent-red);
    background: var(--accent-red);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* =================================
   BUTTONS
   ================================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    border: 2px solid transparent;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all var(--transition-cubic);
    position: relative;
    overflow: hidden;
    min-width: 0; /* allow responsive grid buttons to size evenly */
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left var(--transition-slow);
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: transparent;
    color: var(--dark-gray);
    border-color: var(--dark-gray);
    transform: translateY(0);
}

.btn-primary:hover {
    background: var(--dark-gray);
    color: var(--white);
    transform: translateY(-3px);
}

.btn-secondary {
    background: var(--accent-red);
    color: var(--white);
    border-color: var(--accent-red);
}

.btn-secondary:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-strong);
}

.btn-outline {
    background: transparent;
    color: var(--accent-red);
    border-color: var(--accent-red);
}

.btn-outline:hover {
    background: var(--accent-red);
    color: var(--white);
    transform: translateY(-3px);
}

/* =================================
   HEADER & NAVIGATION
   ================================= */

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    /* Transparent on load */
    background: transparent;
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    border-bottom: 1px solid transparent;
    z-index: var(--z-header);
    transition: all var(--transition-normal);
}

.header.scrolled {
    /* Glass (frosted) effect */
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
}

.logo {
    display: flex;
    flex-direction: column;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: #FF0000;
}

.logo-subtitle {
    font-size: 0.875rem;
    color: var(--medium-gray);
    font-weight: 400;
    margin-top: -0.25rem;
}

.logo-link, .mobile-logo-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    transition: opacity 0.3s ease;
}

.logo-link:hover, .mobile-logo-link:hover {
    opacity: 0.8;
}

/* Desktop Navigation */
.desktop-nav {
    display: none;
}

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

.nav-link {
    position: relative;
    font-weight: 500;
    color: var(--dark-gray);
    transition: color var(--transition-fast);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-red);
    transition: width var(--transition-cubic);
}

.nav-link:hover {
    color: var(--accent-red);
}

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

.nav-link.active {
    color: var(--accent-red);
}

/* Dropdown Menu */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow-medium);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-cubic);
    list-style: none;
    min-width: 200px;
    z-index: var(--z-dropdown);
    padding: 1rem 0;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li {
    padding: 0;
}

.dropdown-menu a {
    display: block;
    padding: 0.75rem 1.5rem;
    color: var(--dark-gray);
    transition: all var(--transition-fast);
}

.dropdown-menu a:hover {
    background: var(--light-gray);
    color: var(--accent-red);
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: calc(var(--z-mobile-nav) + 1);
}

.mobile-menu-btn span {
    width: 25px;
    height: 2px;
    background: var(--dark-gray);
    transition: all var(--transition-cubic);
    transform-origin: center;
}

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

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

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

/* =================================
   MOBILE NAVIGATION
   ================================= */

.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100vh;
    background: rgba(255, 255, 255, 0);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    opacity: 0;
    visibility: hidden;
    z-index: var(--z-mobile-nav);
    transition: 
        opacity 0.15s ease-out,
        visibility 0.15s ease-out,
        background 0.15s ease-out,
        backdrop-filter 0.15s ease-out,
        -webkit-backdrop-filter 0.15s ease-out;
}

.mobile-nav-overlay.active {
    opacity: 1;
    visibility: visible;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    transition: 
        opacity 0.3s ease-in,
        visibility 0.3s ease-in,
        background 0.3s ease-in,
        backdrop-filter 0.3s ease-in,
        -webkit-backdrop-filter 0.3s ease-in;
}

.mobile-nav {
    position: absolute;
    right: 0;
    top: 0;
    width: min(400px, 80vw);
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 
        -20px 0 40px rgba(0, 0, 0, 0.1),
        inset 1px 0 0 rgba(255, 255, 255, 0.3);
    padding: 2rem;
    transform: translateX(100%);
    transition: transform var(--transition-slow);
}

.mobile-nav-overlay.active .mobile-nav {
    transform: translateX(0);
}

.mobile-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--light-gray);
}

.mobile-nav-header h2 {
    margin: 0;
    color: var(--dark-gray);
}

.close-mobile-nav {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    position: relative;
    width: 30px;
    height: 30px;
}

.close-mobile-nav span {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 2px;
    background: var(--dark-gray);
    transform-origin: center;
}

.close-mobile-nav span:nth-child(1) {
    transform: translate(-50%, -50%) rotate(45deg);
}

.close-mobile-nav span:nth-child(2) {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.mobile-nav-links {
    list-style: none;
}

.mobile-nav-links li {
    margin-bottom: 1rem;
}

.mobile-nav-links .nav-link {
    display: block;
    padding: 1rem 0;
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--dark-gray);
    border-bottom: 1px solid transparent;
    transition: all var(--transition-fast);
}

.mobile-nav-links .nav-link:hover,
.mobile-nav-links .nav-link.active {
    color: var(--accent-red);
    border-bottom-color: var(--accent-red);
}

.mobile-nav-links .project-sublink {
    padding-left: 2rem;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--medium-gray);
    border-bottom: none;
}

.mobile-nav-links .project-sublink:hover {
    color: var(--accent-red);
    border-bottom: none;
}

/* Mobile navigation responsive adjustments */
.mobile-nav-links .nav-link,
.mobile-nav-links .project-sublink {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    line-height: 1.4;
}

@media (max-width: 480px) {
    .mobile-nav-links .nav-link {
        font-size: 1.1rem;
        padding: 0.8rem 0;
    }
    
    .mobile-nav-links .project-sublink {
        font-size: 1rem;
        padding-left: 1.5rem;
        padding-top: 0.6rem;
        padding-bottom: 0.6rem;
    }
}

@media (max-width: 360px) {
    .mobile-nav-links .nav-link {
        font-size: 1rem;
        padding: 0.7rem 0;
    }
    
    .mobile-nav-links .project-sublink {
        font-size: 0.95rem;
        padding-left: 1.2rem;
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }
}

@media (max-width: 320px) {
    .mobile-nav-links .nav-link {
        font-size: 0.95rem;
        padding: 0.6rem 0;
    }
    
    .mobile-nav-links .project-sublink {
        font-size: 0.9rem;
        padding-left: 1rem;
        padding-top: 0.4rem;
        padding-bottom: 0.4rem;
    }
}

/* =================================
   ICONOIR CUSTOM STYLING
   ================================= */

/* Default Iconoir icons to theme colors */
[class^="iconoir-"], [class*=" iconoir-"] {
    color: var(--dark-gray);
    font-size: 1.5rem;
    display: inline-block;
}

/* Red accent icons */
.icon-red {
    color: #FF0000 !important;
}

/* Dark gray icons */
.icon-dark {
    color: var(--dark-gray) !important;
}

/* White icons */
.icon-white {
    color: var(--white) !important;
}

/* Icon sizing utilities */
.icon-sm {
    font-size: 1rem;
}

.icon-md {
    font-size: 1.5rem;
}

.icon-lg {
    font-size: 2rem;
}

.icon-xl {
    font-size: 3rem;
}

/* =================================
   HERO SECTION
   ================================= */

.hero {
    position: relative;
    min-height: 100vh;
    height: 100vh; /* Fit within viewport on mobile */
    display: flex;
    align-items: center;
    background: var(--white);
    overflow: hidden;
    padding: 100px 0 60px; /* Reduced padding for mobile viewport fitting */
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--white);
}

/* .hero-3d-container removed - no longer needed for clean hero background */

.hero-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem; /* Reduced gap for mobile fitting */
    align-items: center;
    position: relative;
    z-index: 1;
    padding: 0;
    width: 100%;
    max-width: 100%;
    height: 100%; /* Use full available height */
}

.hero-text {
    text-align: center;
    order: 2; /* Below hero-visual on mobile */
}

.hero-title {
    font-size: 2.5rem; /* Default mobile-first font size */
    margin-bottom: 1rem; /* Reduced margin for mobile fitting */
    line-height: 1.1;
}

.title-line {
    display: block;
    opacity: 0;
    transform: translateY(50px);
    animation: heroTextReveal 1s ease forwards;
}

.title-line:nth-child(2) {
    animation-delay: 0.2s;
}

.title-line:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes heroTextReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-description {
    font-size: 1.1rem; /* Smaller font for mobile fitting */
    color: var(--medium-gray);
    margin-bottom: 1.5rem; /* Reduced margin for mobile fitting */
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    opacity: 0;
    animation: heroTextReveal 1s ease 0.6s forwards;
    line-height: 1.4; /* Better line spacing for readability */
}

.hero-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    opacity: 0;
    animation: heroTextReveal 1s ease 0.8s forwards;
}

.hero-visual {
    display: flex;
    justify-content: center;
    order: 1; /* Above hero-text on mobile */
}

.profile-container {
    position: relative;
    width: 260px; /* Smaller for mobile viewport fitting */
    height: 260px;
    max-width: 80vw; /* More conservative max width */
    max-height: 30vh; /* Limit height to percentage of viewport */
}

.profile-image-placeholder {
    width: 180px; /* Smaller for mobile viewport fitting */
    height: 180px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--light-gray), var(--white));
    border: 3px solid var(--accent-red);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 40px auto; /* Reduced margin */
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-strong);
}

.profile-icon {
    font-size: 3rem; /* Smaller for mobile viewport fitting */
    font-weight: 700;
    color: var(--accent-red);
}

/* Responsive Profile Container for Desktop */
@media (min-width: 768px) {
    .profile-container {
        width: 400px;
        height: 400px;
        max-width: 40vw;
        max-height: 60vh;
    }
    
    .profile-image-placeholder {
        width: 280px;
        height: 280px;
        margin: 60px auto;
        border-width: 4px;
    }
    
    .profile-icon {
        font-size: 4.5rem;
    }
}

@media (min-width: 1200px) {
    .profile-container {
        width: 500px;
        height: 500px;
        max-width: 35vw;
        max-height: 55vh;
    }
    
    .profile-image-placeholder {
        width: 350px;
        height: 350px;
        margin: 75px auto;
        border-width: 5px;
    }
    
    .profile-icon {
        font-size: 5.5rem;
    }
}

@media (min-width: 1600px) {
    .profile-container {
        width: 600px;
        height: 600px;
        max-width: 30vw;
        max-height: 50vh;
    }
    
    .profile-image-placeholder {
        width: 420px;
        height: 420px;
        margin: 90px auto;
        border-width: 6px;
    }
    
    .profile-icon {
        font-size: 6.5rem;
    }
}

/* .profile-particles removed - no background elements */

.scroll-indicator {
    position: absolute;
    bottom: 1.5rem;
    left: 0;
    right: 0;
    margin: 0 auto;
    z-index: 10;
    animation: chevronBounce 2s infinite;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    border: 1px solid rgba(255, 0, 0, 0.2);
    cursor: pointer;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scroll-arrow {
    width: 24px;
    height: 24px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto; /* Ensure centering within parent */
}

.scroll-arrow::after {
    content: '';
    display: block;
    width: 12px;
    height: 12px;
    border-right: 2px solid var(--accent-red);
    border-bottom: 2px solid var(--accent-red);
    transform: rotate(45deg);
    margin-top: -3px;
}

@keyframes chevronBounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Back to Top Chevron */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    border: 1px solid rgba(255, 0, 0, 0.2);
    cursor: pointer;
    /* Debug styling */
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top.visible {
    opacity: 1 !important;
    visibility: visible !important;
}

.back-to-top:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 0, 0, 0.4);
    transform: translateY(-2px);
}

.up-arrow::after {
    content: '';
    display: block;
    width: 12px;
    height: 12px;
    border-right: 2px solid var(--accent-red);
    border-bottom: 2px solid var(--accent-red);
    transform: rotate(-135deg);
    margin-top: 3px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .back-to-top {
        bottom: 1rem;
        right: 1rem;
        padding: 0.4rem;
    }
    
    .up-arrow::after {
        width: 10px;
        height: 10px;
    }
}

/* =================================
   SECTIONS
   ================================= */

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

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: 1.25rem;
    color: var(--medium-gray);
    font-weight: 400;
}

/* =================================
   ABOUT SECTION
   ================================= */

.about {
    background: var(--section-gray);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    align-items: start;
}

.about-block {
    margin-bottom: 2rem;
    padding: 2rem;
    background: var(--white);
    border-radius: 20px;
    box-shadow: var(--shadow-subtle);
    transition: transform var(--transition-cubic);
}

.about-block:hover {
    transform: translateY(-5px);
}

.about-block h3 {
    color: var(--accent-red);
    margin-bottom: 1rem;
}

.resume-section {
    text-align: center;
    margin-top: 3rem;
}

/* Enhanced spacing for resume section at different breakpoints */
@media (max-width: 1024px) {
    .resume-section {
        margin-top: 4rem;
    }
}

@media (max-width: 768px) {
    .resume-section {
        margin-top: 4.5rem;
    }
    
    .resume-section .btn-outline {
        white-space: nowrap;
        padding: 1rem 1.5rem;
        min-width: 180px;
    }
}

@media (max-width: 480px) {
    .resume-section {
        margin-top: 5rem;
    }
    
    .resume-section .btn-outline {
        white-space: nowrap;
        padding: 1rem 1.5rem;
        min-width: 180px;
    }
}

.tech-stack {
    display: grid;
    gap: 2rem;
}

.tech-category {
    background: var(--white);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: var(--shadow-subtle);
}

.tech-category h4 {
    color: var(--dark-gray);
    margin-bottom: 1rem;
    font-size: 1.125rem;
}

.tech-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tech-item {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--light-gray);
    border-radius: 25px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--dark-gray);
    transition: all var(--transition-fast);
}

.tech-item:hover {
    background: var(--accent-red);
    color: var(--white);
    transform: translateY(-2px);
}

/* =================================
   PROJECTS SECTION
   ================================= */

.projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--grid-gap);
    align-items: stretch;
}

.project-card {
    background: var(--white);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4);
    transition: all var(--transition-cubic);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-strong);
}

.project-image {
    position: relative;
    width: 100%;
    height: 300px;
    overflow: hidden;
    flex-shrink: 0;
}

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

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

.project-overlay {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 0.5rem 1rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--dark-gray);
}

.project-content {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.project-title {
    margin-bottom: 1rem;
    color: var(--dark-gray);
}

.project-description {
    color: var(--medium-gray);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    margin-top: auto;
}

.tag {
    padding: 0.25rem 0.75rem;
    background: var(--light-gray);
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--dark-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.project-link {
    color: var(--accent-red);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: gap var(--transition-fast);
}

.project-link:hover {
    gap: 1rem;
}

.project-link::after {
    content: '→';
    transition: transform var(--transition-fast);
}

.project-link:hover::after {
    transform: translateX(5px);
}

/* =================================
   RESEARCH SECTION
   ================================= */

.research-section {
    padding: 120px 0;
    background: var(--section-gray);
    position: relative;
}

.research-content {
    margin-top: 3rem;
}

.research-project {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    align-items: center;
}

.research-visual {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-strong);
}

.research-visual {
    transition: transform var(--transition-slow);
}

.research-visual a {
    display: block;
    text-decoration: none;
}

.research-visual img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform var(--transition-slow);
}

.research-project:hover .research-visual {
    transform: translateY(-10px);
}

.research-project:hover .research-visual img {
    transform: scale(1.05);
}

.research-overlay {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
}

.research-badge {
    background: linear-gradient(135deg, var(--accent-red), #ff4444);
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow-soft);
}

.research-details {
    background: var(--white);
    padding: 3rem;
    border-radius: 20px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(255, 0, 0, 0.1);
}

.research-title {
    color: var(--dark-gray);
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.research-description {
    color: var(--medium-gray);
    font-size: 1.125rem;
    line-height: 1.7;
    margin-bottom: 2.5rem;
}

.research-methodology {
    margin-bottom: 2.5rem;
}

.research-methodology h4 {
    color: var(--dark-gray);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.methodology-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.method-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--light-gray);
    border-radius: 12px;
    transition: all var(--transition-fast);
}

.method-item:hover {
    background: rgba(255, 0, 0, 0.05);
    transform: translateY(-2px);
}

.method-item span {
    color: var(--dark-gray);
    font-weight: 500;
}

.research-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.research-tag {
    background: var(--light-gray);
    color: var(--dark-gray);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.research-tag:hover {
    background: var(--accent-red);
    color: var(--white);
    transform: translateY(-1px);
}

.research-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.research-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

.research-actions .research-link {
    flex: 1;
    min-width: 200px;
    justify-content: center;
}

/* Desktop layout for research section */
@media (min-width: 768px) {
    .research-project {
        grid-template-columns: 1fr 1fr;
        gap: 4rem;
    }
    
    .research-visual {
        order: 1;
    }
    
    .research-details {
        order: 2;
    }
}

/* Large desktop enhancements */
@media (min-width: 1200px) {
    .research-section {
        padding: 140px 0;
    }
    
    .research-details {
        padding: 4rem;
    }
    
    .research-title {
        font-size: 2.5rem;
    }
    
    .research-description {
        font-size: 1.25rem;
    }
}

/* Mobile responsive adjustments */
@media (max-width: 767px) {
    .research-section {
        padding: 80px 0;
    }
    
    .research-details {
        padding: 2rem;
        text-align: center;
    }
    
    .research-title {
        font-size: 1.75rem;
    }
    
    .research-description {
        font-size: 1rem;
    }
    
    .methodology-grid {
        grid-template-columns: 1fr;
    }
    
    .research-overlay {
        top: 1rem;
        right: 1rem;
    }
    
    .research-badge {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }
    
    .research-link {
        justify-content: center;
        width: 100%;
    }
    
    .research-actions {
        flex-direction: column;
        gap: 0.75rem;
        align-items: center;
    }
    
    .research-actions .research-link {
        flex: none;
        min-width: auto;
        width: 100%;
        max-width: 280px;
        text-align: center;
        white-space: nowrap;
        padding: 1rem 1.5rem;
    }
}

/* =================================
   CONTACT SECTION
   ================================= */

.contact {
    background: var(--section-gray);
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    align-items: center;
}

.contact-block {
    margin-bottom: 2rem;
}

.contact-block h3 {
    color: var(--dark-gray);
    margin-bottom: 1rem;
}

.contact-methods {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-method {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--white);
    border-radius: 15px;
    transition: all var(--transition-cubic);
    text-decoration: none;
}

.contact-method:hover {
    transform: translateX(10px);
    box-shadow: var(--shadow-medium);
}

.method-icon {
    font-size: 1.5rem;
}

.method-text {
    font-weight: 500;
    color: var(--dark-gray);
}

.contact-3d-element {
    width: 100%;
    height: 300px;
    background: linear-gradient(135deg, var(--light-gray), var(--white));
    border-radius: 20px;
    position: relative;
    overflow: hidden;
}

/* =================================
   FOOTER
   ================================= */

.footer {
    background: var(--dark-gray);
    color: var(--white);
    padding: 2rem 0;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-text p {
    margin: 0;
    color: var(--medium-gray);
}

.footer-links a {
    color: var(--accent-red);
    font-weight: 500;
    transition: color var(--transition-fast);
}

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

/* =================================
   RESPONSIVE DESIGN
   ================================= */

@media (min-width: 768px) {
    /* Show desktop navigation */
    .desktop-nav {
        display: block;
    }
    
    .mobile-menu-btn {
        display: none;
    }
    
    /* Hero adjustments */
    .hero-content {
        grid-template-columns: 1fr 1fr;
        text-align: left;
    }
    
    .hero-text {
        text-align: left;
        order: 1; /* Reset order for desktop side-by-side */
    }
    
    .hero-visual {
        order: 2; /* Reset order for desktop side-by-side */
    }
    
    .hero-description {
        margin-left: 0;
        margin-right: 0;
    }
    
    .hero-cta {
        justify-content: flex-start;
    }
    
    /* About section */
    .about-content {
        grid-template-columns: 2fr 1fr;
    }
    
    /* Projects grid */
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Contact section */
    .contact-content {
        grid-template-columns: 1fr 1fr;
    }
}

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

/* Mobile and short screen adjustments */
@media (max-height: 600px) {
    .hero {
        min-height: 100vh;
        height: auto;
        padding: 120px 0 80px; /* Increased to account for header + profile animation movement */
        align-items: flex-start;
        justify-content: center;
    }
    
    .hero-content {
        gap: 1.5rem;
        padding-top: 20px;
    }
    
    .hero-title {
        margin-bottom: 1rem;
    }
    
    .hero-description {
        margin-bottom: 1.5rem;
    }
    
    .scroll-indicator {
        bottom: 0.5rem;
        padding: 0.25rem;
    }
}

@media (max-height: 500px) {
    .hero {
        padding: 100px 0 60px; /* Increased to account for header + profile animation movement */
    }
    
    .hero-content {
        gap: 1rem;
    }
    
    .hero-title {
        font-size: 2rem;
        margin-bottom: 0.75rem;
    }
    
    .hero-description {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }
    
    .hero-cta {
        gap: 0.75rem;
    }
    
    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .profile-container {
        width: 250px;
        height: 250px;
    }
    
    .profile-image-placeholder {
        width: 180px;
        height: 180px;
        margin: 35px auto;
    }
}

@media (max-height: 400px) {
    .hero {
        padding: 20px 0 40px;
        min-height: auto;
        height: auto;
    }
    
    .hero-content {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .hero-title {
        font-size: 1.75rem;
        margin-bottom: 0.5rem;
    }
    
    .hero-description {
        font-size: 0.85rem;
        margin-bottom: 0.75rem;
    }
    
    .hero-cta {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
        margin-top: 1rem;
    }
    
    .btn {
        width: 100%;
        max-width: 200px;
    }
    
    .profile-container {
        width: 200px;
        height: 200px;
    }
    
    .profile-image-placeholder {
        width: 150px;
        height: 150px;
        margin: 25px auto;
    }
    
    .profile-icon {
        font-size: 2.5rem;
    }
    
    .scroll-indicator {
        display: none;
    }
}

/* Mobile responsiveness for medium phones */
@media (max-width: 480px) {
    .hero {
        padding: 80px 0 60px; /* Optimized for mobile viewport fitting */
        height: 100vh; /* Fit within viewport */
    }
    
    .hero-content {
        gap: 1rem; /* Tighter spacing */
    }
    
    .hero-title {
        font-size: 2.2rem; /* Slightly smaller for medium phones */
        margin-bottom: 0.75rem;
    }
    
    .hero-description {
        font-size: 1rem;
        margin-bottom: 1rem;
    }
    
    .hero-cta {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
        margin-top: 0.5rem;
    }
    
    .btn {
        width: 100%;
        max-width: 280px;
        min-width: 200px;
        padding: 0.8rem 1.5rem; /* Slightly smaller buttons */
        font-size: 0.9rem;
    }
    
    .profile-container {
        width: 220px; /* Smaller for medium phones */
        height: 220px;
        max-height: 25vh;
    }
    
    .profile-image-placeholder {
        width: 160px;
        height: 160px;
        margin: 30px auto;
    }
    
    .profile-icon {
        font-size: 2.5rem;
    }
}

/* Small phones - 320px and below */
@media (max-width: 320px) {
    .hero {
        padding: 70px 0 50px; /* Minimal padding for small screens */
        height: 100vh; /* Fit within viewport */
    }
    
    .hero-content {
        gap: 0.75rem; /* Minimal spacing */
    }
    
    .hero-title {
        font-size: 1.8rem; /* Compact for small screens */
        margin-bottom: 0.5rem;
    }
    
    .hero-description {
        font-size: 0.9rem;
        margin-bottom: 0.75rem;
        line-height: 1.3;
    }
    
    .hero-cta {
        margin-top: 0.5rem;
        gap: 0.5rem;
    }
    
    .btn {
        padding: 0.7rem 1.2rem; /* Compact buttons */
        font-size: 0.85rem;
        max-width: 250px;
    }
    
    .profile-container {
        width: 180px; /* Much smaller for small phones */
        height: 180px;
        max-height: 20vh;
    }
    
    .profile-image-placeholder {
        width: 140px;
        height: 140px;
        margin: 20px auto;
    }
    
    .profile-icon {
        font-size: 2rem;
    }
}

/* Specific fix for mobile devices with short viewports */
@media (max-width: 480px) and (max-height: 700px) {
    .hero {
        padding: 60px 0 40px; /* Minimal padding for short screens */
        align-items: flex-start;
        justify-content: center;
    }
    
    .hero-content {
        padding-top: 1rem;
        gap: 0.75rem;
    }
    
    .hero-title {
        font-size: 1.8rem;
        margin-bottom: 0.5rem;
    }
    
    .hero-description {
        font-size: 0.9rem;
        margin-bottom: 0.75rem;
    }
    
    .profile-container {
        width: 160px;
        height: 160px;
        max-height: 18vh;
    }
    
    .profile-image-placeholder {
        width: 120px;
        height: 120px;
        margin: 20px auto;
    }
    
    .profile-icon {
        font-size: 1.8rem;
    }
}

/* Large mobile/small tablet devices */
@media (min-width: 481px) and (max-width: 767px) {
    .hero {
        padding: 90px 0 70px;
    }
    
    .hero-title {
        font-size: 2.8rem;
        margin-bottom: 1.25rem;
    }
    
    .hero-description {
        font-size: 1.15rem;
        margin-bottom: 1.75rem;
    }
    
    .hero-cta {
        gap: 1rem;
        flex-direction: row;
        justify-content: center;
    }
    
    .btn {
        padding: 0.9rem 1.75rem;
        font-size: 0.95rem;
        width: auto;
        min-width: 160px;
        max-width: 200px;
    }
    
    .profile-container {
        width: 300px;
        height: 300px;
        max-height: 35vh;
    }
    
    .profile-image-placeholder {
        width: 220px;
        height: 220px;
        margin: 40px auto;
    }
    
    .profile-icon {
        font-size: 3.2rem;
    }
}

/* Hero background animations removed for cleaner look */

@media (min-width: 768px) {
    .hero {
        padding: 80px 0 120px;
        height: 100vh; /* Fixed height on desktop */
    }
    
    .hero-content {
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
        align-items: center;
        height: auto; /* Let content determine height on desktop */
    }
    
    .hero-text {
        text-align: left;
        order: 1;
    }
    
    .hero-visual {
        order: 2;
    }
    
    .hero-title {
        font-size: 3.5rem; /* Larger for desktop */
        margin-bottom: 2rem;
    }
    
    .hero-description {
        font-size: 1.25rem; /* Larger for desktop */
        margin-bottom: 3rem;
    }
}

@media (min-width: 768px) and (max-height: 700px) {
    .hero {
        padding: 60px 0 100px;
    }
    
    .hero-content {
        gap: 2rem;
    }
}

@media (min-width: 1200px) {
    .hero {
        padding: 100px 0 140px;
    }
    
    .hero-content {
        gap: 4rem;
    }
    
    .about-content {
        gap: 4rem;
    }
    
    .tech-stack {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 1200px) and (max-height: 800px) {
    .hero {
        padding: 80px 0 120px;
    }
    
    .hero-content {
        gap: 3rem;
    }
}

/* =================================
   ACCESSIBILITY
   ================================= */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .scroll-indicator {
        animation: none;
    }
}

/* Responsive scroll indicator positioning */
@media (max-width: 768px) {
    .scroll-indicator {
        bottom: 0.5rem;
        left: 0;
        right: 0;
        margin: 0 auto;
        background: rgba(255, 255, 255, 0.15);
        backdrop-filter: blur(15px);
    }
}

@media (min-width: 769px) {
    .scroll-indicator {
        bottom: 1.5rem;
        left: 0;
        right: 0;
        margin: 0 auto;
    }
    
    .scroll-indicator:hover {
        background: rgba(255, 255, 255, 0.2);
        border-color: rgba(255, 0, 0, 0.4);
        transform: scale(1.1); /* Remove translateX since we're using margin centering */
        cursor: pointer;
    }
}

/* Focus styles for keyboard navigation */
.btn:focus,
.contact-method:focus {
    outline: 2px solid var(--accent-red);
    outline-offset: 2px;
}

.nav-link:focus {
    outline: none;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --shadow-subtle: 0 2px 20px rgba(0, 0, 0, 0.3);
        --shadow-medium: 0 8px 40px rgba(0, 0, 0, 0.4);
        --shadow-strong: 0 20px 60px rgba(0, 0, 0, 0.5);
    }
}