﻿/* 
 * Portfolio Website - Core Styles
 * Theme: Dark / Neon Gradient (Purple/Blue)
 * Author: Priyam
 */

:root {
    --bg-color: #0a0a0a;
    --card-bg: rgba(255, 255, 255, 0.05);
    --text-color: #e0e0e0;
    --text-muted: #a0a0a0;
    --primary-color: #b026ff;
    /* Neon Purple */
    --secondary-color: #00d4ff;
    /* Neon Blue */
    --accent-glow: rgba(176, 38, 255, 0.5);
    --font-main: 'Inter', sans-serif;
    --font-heading: 'Outfit', sans-serif;
    --transition-speed: 0.3s;
    --nav-height: 80px;
    --toast-success: #0bbf66;
    --toast-error: #e05353;
    --toast-text: #ffffff;
    --toast-pad: 12px 16px;
    --toast-radius: 10px;
    --toast-z: 2147483647;
    --form-bg: rgba(255, 255, 255, 0.02);
    --input-bg: #0b0b0b;
    --input-border: rgba(255, 255, 255, 0.06);
    --accent-1: #7b2cff;
    --accent-2: #00c6ff;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    background-image:
        radial-gradient(circle at 10% 20%, rgba(176, 38, 255, 0.1) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(0, 212, 255, 0.1) 0%, transparent 20%);
    background-attachment: fixed;
}

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

ul {
    list-style: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: #fff;
    margin-bottom: 1rem;
}

section {
    padding: 100px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Utility Classes */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    display: block;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    border: 2px solid transparent;
}

.btn-primary {
    transition: 0.4s !important;
    background: linear-gradient(135deg, #00eaff, #8a2be2, #3b82f6);
    background-clip: padding-box;
    background-size: 200%;
    background-repeat: no-repeat;
    color: #fff;
    box-shadow: 0 0 15px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 25px var(--accent-glow);
}

.btn-outline {
    transition: 0.4s !important;
    background: transparent;
    border-color: var(--secondary-color);
    color: var(--secondary-color);
}

.btn-outline:hover {
    background: var(--secondary-color);
    color: #000;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.5);
}

/* Navbar */
.navbar {
    position: sticky;
    top: 0;
    height: var(--nav-height);
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-link {
    font-size: 1rem;
    font-weight: 500;
    position: relative;
    color: var(--text-muted);
}

.nav-link:hover,
.nav-link.active {
    color: #fff;
}

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

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

.hamburger {
    display: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
}

.bar {
    width: 25px;
    height: 3px;
    background-color: #fff;
    transition: all 0.3s ease;
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    /* Align left on desktop */
    text-align: left;
    /* Align text left on desktop */
    position: relative;
    overflow: hidden;
    padding-top: var(--nav-height);
    margin-top: calc(-1 * var(--nav-height));
    padding-left: 5%;
    /* Add spacing from left edge */
}

.hero-content {
    z-index: 2;
    animation: fadeInUp 1s ease-out;
    max-width: 800px;
    margin-right: auto;
    margin-left: 0;
}

.hero h1 {
    font-size: 4rem;
    margin-bottom: 1rem;
    line-height: 1.1;
}

/* Background Animation Particles */
.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
}

.particle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    animation: float 20s infinite linear;
}

.particle:nth-child(1) {
    width: 100px;
    height: 100px;
    top: 10%;
    left: 10%;
    animation-duration: 25s;
}

.particle:nth-child(2) {
    width: 150px;
    height: 150px;
    top: 60%;
    left: 80%;
    animation-duration: 30s;
}

.particle:nth-child(3) {
    width: 50px;
    height: 50px;
    top: 40%;
    left: 40%;
    animation-duration: 15s;
}

.particle:nth-child(4) {
    width: 80px;
    height: 80px;
    top: 80%;
    left: 20%;
    animation-duration: 20s;
}

/* About Page Styles */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: start;
}

.about-text p {
    margin-bottom: 1.5rem;
    color: var(--text-muted);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px;
    margin-top: 2rem;
}

.skill-tag {
    background: var(--card-bg);
    padding: 10px;
    text-align: center;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition-speed);
}

.skill-tag:hover {
    background: rgba(176, 38, 255, 0.2);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.timeline {
    margin-top: 3rem;
    position: relative;
    border-left: 2px solid rgba(255, 255, 255, 0.1);
    padding-left: 30px;
}

.timeline-item {
    margin-bottom: 2rem;
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -36px;
    top: 5px;
    width: 10px;
    height: 10px;
    background: var(--secondary-color);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--secondary-color);
}

.timeline-date {
    font-size: 0.9rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

/* Projects Page Styles */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.project-card {
    background: var(--card-bg);
    border-radius: 15px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition-speed);
    position: relative;
}

.project-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.project-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.project-info {
    padding: 20px;
}

.project-tags {
    display: flex;
    gap: 10px;
    margin: 10px 0;
    flex-wrap: wrap;
}

.tag {
    font-size: 0.8rem;
    padding: 4px 10px;
    background: rgba(0, 212, 255, 0.1);
    color: var(--secondary-color);
    border-radius: 20px;
}

.project-link {
    display: inline-block;
    margin-top: 15px;
    color: var(--primary-color);
    font-weight: 600;
}

.project-link:hover {
    text-decoration: underline;
}

/* Blog Page Styles */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.blog-card {
    background: var(--card-bg);
    border-radius: 15px;
    overflow: hidden;
    transition: var(--transition-speed);
}

.blog-card:hover {
    transform: scale(1.02);
    background: rgba(255, 255, 255, 0.08);
}

.blog-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.blog-content {
    padding: 20px;
}

.blog-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.read-more {
    color: var(--secondary-color);
    margin-top: 10px;
    display: inline-block;
    font-size: 0.9rem;
}

/* Contact Page Styles */
.contact-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.contact-form {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-family: var(--font-main);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(176, 38, 255, 0.2);
}

.social-links {
    display: flex;
    gap: 20px;
    margin-top: 30px;
}

.social-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--card-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: var(--transition-speed);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.social-icon:hover {
    background: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: 0 0 20px var(--accent-glow);
}

/* Footer */
footer {
    text-align: center;
    padding: 40px 0;
    color: var(--text-muted);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 50px;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

@keyframes float {
    0% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(20px, -20px);
    }

    100% {
        transform: translate(0, 0);
    }
}

.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Typewriter Effect */
.txt-type>.txt {
    border-right: 0.2rem solid var(--secondary-color);
    padding-right: 5px;
    animation: blink 0.7s infinite;
}

@keyframes blink {
    0% {
        border-color: transparent
    }

    50% {
        border-color: var(--secondary-color)
    }

    100% {
        border-color: transparent
    }
}

/* Mobile Responsiveness */
@media (max-width: 1024px) {
    .section-title {
        font-size: 2rem;
    }

    .hero h1 {
        font-size: 3rem;
    }
}

@media (max-width: 768px) {
    .hamburger {
        display: flex;
        z-index: 1001;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 75%;
        height: 100vh;
        background: rgba(10, 10, 10, 0.98);
        backdrop-filter: blur(15px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: right 0.4s cubic-bezier(0.77, 0.2, 0.05, 1.0);
        box-shadow: -5px 0 25px rgba(0, 0, 0, 0.7);
    }

    .nav-links.active {
        right: 0;
    }

    .nav-link {
        font-size: 1.2rem;
        margin: 15px 0;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero h2 {
        font-size: 1.5rem !important;
    }

    .hero p {
        font-size: 1rem;
    }

    /* Center Hero on Mobile */
    .hero {
        justify-content: center;
        text-align: center;
        padding-left: 20px;
        padding-right: 20px;
    }

    .hero-content {
        margin: 0 auto;
        text-align: center;
        width: 100%;
    }

    .hero-buttons {
        display: flex;
        flex-direction: column;
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
        gap: 20px;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    .projects-grid,
    .blog-grid {
        grid-template-columns: 1fr;
    }

    .about-grid,
    .contact-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2rem;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .container {
        padding: 0 15px;
    }

    .project-img,
    .blog-img {
        height: 180px;
    }
}

#toast.toast {
    position: fixed;
    top: calc(18px + env(safe-area-inset-top));
    left: 50%;
    transform: translateX(-50%) translateY(-14px);
    z-index: var(--toast-z);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: var(--toast-pad);
    background: var(--toast-success);
    color: var(--toast-text);
    font-size: 15px;
    border-radius: var(--toast-radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
    pointer-events: none;
    /* disable clicks while hidden */
    opacity: 0;
    visibility: hidden;
    transition: opacity .32s cubic-bezier(.2, .9, .3, 1),
        transform .32s cubic-bezier(.2, .9, .3, 1),
        visibility .32s;
    max-width: calc(100% - 36px);
    box-sizing: border-box;
    white-space: nowrap;
}

/* Visible state */
#toast.toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

/* Error variant */
#toast.toast.error {
    background: var(--toast-error);
    box-shadow: 0 10px 30px rgba(224, 83, 83, 0.18);
}

/* Icon */
#toast .toast-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    font-weight: 700;
    font-size: 16px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
}

/* Text: ellipsize on tiny screens but allow wrapping if forced */
#toast #toast-text {
    display: inline-block;
    max-width: calc(100% - 56px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Small screens: allow wrapping, smaller paddings */
@media (max-width: 420px) {
    #toast.toast {
        padding: 9px 12px;
        font-size: 14px;
        top: calc(12px + env(safe-area-inset-top));
        white-space: normal;
    }

    #toast .toast-icon {
        width: 22px;
        height: 22px;
        font-size: 14px;
    }

    #toast #toast-text {
        max-width: calc(100% - 44px);
        white-space: normal;
        line-height: 1.15;
    }
}

/* Very narrow landscape safety */
@media (max-width: 360px) and (orientation: landscape) {
    #toast.toast {
        max-width: 92%;
        left: 50%;
        transform: translateX(-50%) translateY(0);
    }
}

/* -------------------------
   Minimal scoped contact form styles
   (Scoped under .contact-section to avoid global impact)
   ------------------------- */

.contact-section .contact-form-inner {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    box-sizing: border-box;
}

/* Inputs & textarea (dark-friendly defaults) */
.contact-section .form-control,
.contact-section textarea.form-control {
    width: 100%;
    box-sizing: border-box;
    padding: .85rem 1rem;
    font-size: 1rem;
    border-radius: 10px;
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    color: #fff;
    resize: vertical;
}

/* labels */
.contact-section label {
    display: block;
    margin-bottom: .45rem;
    color: #dcdcdc;
    font-weight: 600;
}

/* focus */
.contact-section .form-control:focus,
.contact-section textarea.form-control:focus {
    outline: none;
    box-shadow: 0 10px 24px rgba(11, 198, 255, 0.06);
    border-color: rgba(11, 198, 255, 0.28);
}

/* submit button (safe styling) */
.contact-section .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    padding: .85rem 1.2rem;
    border-radius: 999px;
    border: 0;
    background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease;
    box-shadow: 0 8px 28px rgba(123, 44, 255, 0.12), inset 0 -6px 18px rgba(0, 0, 0, 0.18);
}

.contact-section .btn:disabled {
    opacity: .65;
    cursor: default;
    transform: none;
}

/* spacing for groups */
.contact-section .form-group {
    margin-bottom: 1rem;
}

/* responsive tweaks for form layout (safe & minimal) */
@media (max-width: 900px) {
    .contact-section .contact-container {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .contact-section .btn {
        width: 100%;
        padding: .95rem;
    }
}

/* final safety: ensure toast sits above any fixed headers (extra) */
header,
.navbar,
.site-header {
    z-index: 10;
}

/* typical site header - won't affect toast since toast z-index is huge */

/* ===================================================================
   ADDITIONAL MEDIA QUERIES FOR COMPREHENSIVE DEVICE SUPPORT
   =================================================================== */

/* Tablet Portrait (iPad, iPad Air, iPad Mini) - 768px to 1024px */
@media (min-width: 769px) and (max-width: 1024px) {
    section {
        padding: 80px 25px;
    }

    .hero h1 {
        font-size: 3.2rem;
    }

    .hero h2 {
        font-size: 1.8rem;
    }

    .projects-grid,
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .skills-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
}

/* iPad Pro (Portrait) - 1024px */
@media (min-width: 1024px) and (max-width: 1366px) and (orientation: portrait) {
    .hero h1 {
        font-size: 3.5rem;
    }

    .section-title {
        font-size: 2.3rem;
    }

    .projects-grid,
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 35px;
    }
}

/* iPad Pro (Landscape) - 1366px */
@media (min-width: 1024px) and (max-width: 1366px) and (orientation: landscape) {
    .hero {
        padding-left: 8%;
    }

    .about-grid {
        gap: 60px;
    }
}

/* Large Phones / Small Tablets (600px - 768px) */
@media (min-width: 601px) and (max-width: 768px) {
    .hero h1 {
        font-size: 2.8rem;
    }

    .hero h2 {
        font-size: 1.6rem;
    }

    section {
        padding: 70px 20px;
    }

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

    .projects-grid,
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }

    .project-card,
    .blog-card {
        min-height: 350px;
    }
}

/* Standard Mobile Phones (480px - 600px) */
@media (min-width: 481px) and (max-width: 600px) {
    .hero h1 {
        font-size: 2.3rem;
    }

    .hero h2 {
        font-size: 1.4rem;
    }

    .section-title {
        font-size: 1.9rem;
    }

    section {
        padding: 60px 18px;
    }

    .btn {
        padding: 11px 25px;
        font-size: 0.95rem;
    }

    .contact-form {
        padding: 30px 25px;
    }
}

/* iPhone 14 Pro Max, iPhone 13 Pro Max, iPhone 12 Pro Max - 428px */
@media (max-width: 428px) {
    .hero h1 {
        font-size: 2.1rem;
        line-height: 1.2;
    }

    .hero h2 {
        font-size: 1.3rem;
    }

    .logo {
        font-size: 1.6rem;
    }

    .nav-links {
        width: 80%;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .project-img,
    .blog-img {
        height: 190px;
    }
}

/* iPhone 14 Pro, iPhone 13 Pro, iPhone 12 Pro - 390px */
@media (max-width: 390px) {
    .hero h1 {
        font-size: 2rem;
        margin-bottom: 0.8rem;
    }

    .hero h2 {
        font-size: 1.25rem;
    }

    .hero p {
        font-size: 0.95rem;
    }

    .section-title {
        font-size: 1.7rem;
        margin-bottom: 2.5rem;
    }

    .btn {
        padding: 10px 22px;
        font-size: 0.9rem;
    }

    .project-info,
    .blog-content {
        padding: 18px;
    }

    .skills-grid {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
        gap: 12px;
    }

    .skill-tag {
        padding: 8px;
        font-size: 0.85rem;
    }
}

/* iPhone 14, iPhone 13, iPhone 12 - 375px */
@media (max-width: 375px) {
    .hero h1 {
        font-size: 1.9rem;
    }

    .hero h2 {
        font-size: 1.2rem;
    }

    .logo {
        font-size: 1.5rem;
    }

    section {
        padding: 50px 15px;
    }

    .section-title {
        font-size: 1.65rem;
    }

    .container {
        padding: 0 12px;
    }

    .project-card,
    .blog-card {
        border-radius: 12px;
    }

    .contact-form {
        padding: 25px 20px;
    }

    .form-control {
        padding: 10px;
        font-size: 0.95rem;
    }

    .social-icon {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }
}

/* iPhone SE, Small Android Phones - 360px */
@media (max-width: 360px) {
    .hero h1 {
        font-size: 1.8rem;
    }

    .hero h2 {
        font-size: 1.15rem;
    }

    .hero p {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    .section-title {
        font-size: 1.6rem;
        margin-bottom: 2rem;
    }

    .btn {
        padding: 9px 20px;
        font-size: 0.85rem;
    }

    .hero-buttons {
        gap: 15px;
    }

    .project-img,
    .blog-img {
        height: 170px;
    }

    .tag {
        font-size: 0.75rem;
        padding: 3px 8px;
    }

    .timeline {
        padding-left: 20px;
    }

    .timeline-item::before {
        left: -26px;
    }
}

/* Extra Small Phones - 320px (iPhone 5/SE older models) */
@media (max-width: 320px) {
    .hero h1 {
        font-size: 1.6rem;
        line-height: 1.25;
    }

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

    .hero p {
        font-size: 0.85rem;
    }

    .logo {
        font-size: 1.4rem;
    }

    section {
        padding: 45px 12px;
    }

    .section-title {
        font-size: 1.5rem;
        margin-bottom: 1.8rem;
    }

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

    .project-info,
    .blog-content {
        padding: 15px;
    }

    .project-info h3,
    .blog-content h3 {
        font-size: 1.1rem;
    }

    .contact-form {
        padding: 20px 15px;
    }

    .social-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .social-links {
        gap: 15px;
    }
}

/* Landscape Mode Optimizations for Mobile Devices */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        height: auto;
        min-height: 100vh;
        padding-top: calc(var(--nav-height) + 40px);
        padding-bottom: 40px;
    }

    .hero h1 {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }

    .hero h2 {
        font-size: 1.2rem;
    }

    .hero p {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }

    section {
        padding: 60px 20px;
    }

    .navbar {
        height: 60px;
    }

    .nav-links {
        width: 50%;
    }
}

/* Tablet Landscape (General) */
@media (min-width: 769px) and (max-width: 1024px) and (orientation: landscape) {
    .hero {
        padding-top: calc(var(--nav-height) + 20px);
    }

    .about-grid,
    .contact-container {
        gap: 40px;
    }

    .projects-grid,
    .blog-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 25px;
    }
}

/* Large Desktop Screens (1440px+) */
@media (min-width: 1440px) {
    .container {
        max-width: 1400px;
    }

    section {
        max-width: 1400px;
        padding: 120px 40px;
    }

    .hero h1 {
        font-size: 4.5rem;
    }

    .hero h2 {
        font-size: 2rem;
    }

    .section-title {
        font-size: 3rem;
    }

    .projects-grid,
    .blog-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 40px;
    }

    .project-img,
    .blog-img {
        height: 220px;
    }
}

/* Ultra-Wide Screens (1920px+) */
@media (min-width: 1920px) {
    .container {
        max-width: 1600px;
    }

    section {
        max-width: 1600px;
    }

    .hero h1 {
        font-size: 5rem;
    }

    .projects-grid,
    .blog-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* High DPI / Retina Display Optimization */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {

    .hero h1,
    .section-title {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }

    .btn {
        -webkit-font-smoothing: antialiased;
    }
}

/* Reduced Motion Preference */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .particle {
        animation: none !important;
    }
}

/* =================================================================
   MOBILE NAVBAR AND HERO FIXES (Override previous media queries)
   ================================================================= */

/* Fix navbar swipe issue - completely hide navbar when closed */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
        z-index: 1001;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: 0;
        width: 75%;
        height: 100vh;
        background: rgba(10, 10, 10, 0.98);
        backdrop-filter: blur(15px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transform: translateX(100%);
        transition: transform 0.4s cubic-bezier(0.77, 0.2, 0.05, 1.0),
            opacity 0.4s ease,
            visibility 0.4s ease;
        box-shadow: -5px 0 25px rgba(0, 0, 0, 0.7);
        pointer-events: none;
        visibility: hidden;
        opacity: 0;
    }

    .nav-links.active {
        transform: translateX(0);
        pointer-events: auto;
        visibility: visible;
        opacity: 1;
    }

    .nav-link {
        font-size: 1.2rem;
        margin: 15px 0;
    }

    /* Fix empty space on scroll - use min-height instead of fixed height */
    .hero {
        min-height: 100vh;
        height: auto;
    }
}

/* Additional fix to prevent black space on swipe */
@media (max-width: 768px) {
    body {
        overflow-x: hidden;
        position: relative;
    }

    /* Ensure no horizontal scroll at all */
    html {
        overflow-x: hidden;
    }

    /* Update hero section to fit perfectly */
    .hero {
        min-height: calc(100vh - var(--nav-height)) !important;
        height: auto !important;
        max-height: 100vh;
        padding-bottom: 0 !important;
        margin-bottom: 0 !important;
    }

    /* Ensure footer comes right after hero */
    footer {
        margin-top: 0 !important;
    }
}
/* Hamburger Animation Fix */
.hamburger .bar {
    transition: all 0.3s ease !important;
}

.hamburger.active .bar:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px) !important;
}

.hamburger.active .bar:nth-child(2) {
    opacity: 0 !important;
}

.hamburger.active .bar:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px) !important;
}

/* Navbar Animation Fix */
@media (max-width: 768px) {
    .nav-links {
        right: 0 !important;
        transform: translateX(100%) !important;
        transition: transform 0.4s cubic-bezier(0.77, 0.2, 0.05, 1.0) !important;
    }

    .nav-links.active {
        transform: translateX(0) !important;
    }
}
