/* ============================================
   RESET AND BASE STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-black: #000000;
    --color-white: #ffffff;
    --color-gray: #666666;
    --font-primary: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    color: var(--color-white);
    background-color: #121211;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Improve touch interactions */
@media (hover: none) and (pointer: coarse) {
    /* Touch-friendly minimum sizes for buttons/links */
    .index-toggle,
    .close-menu,
    .k-logo,
    .contact-btn,
    .resume-btn,
    .index-link,
    .resource-btn {
        min-height: 44px; /* iOS recommended minimum touch target */
        min-width: 44px;
    }
    
    /* Remove hover effects on touch devices */
    .project-image:hover img {
        transform: scale(1);
    }
    
    /* Tap highlight color for better mobile experience */
    * {
        -webkit-tap-highlight-color: rgba(255, 255, 255, 0.1);
    }
}

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

/* K Logo - Top Left */
.k-logo {
    position: fixed;
    top: 40px;
    left: 50px;
    z-index: 2001;
    cursor: pointer;
    transition: opacity 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.k-logo:hover {
    opacity: 0.7;
}

.k-letter {
    display: inline-block;
    font-family: var(--font-primary);
    font-size: clamp(24px, 4vw, 32px); /* Responsive font size */
    font-weight: 700;
    color: var(--color-white);
    transition: transform 0.1s ease-out;
    transform-origin: center center;
}

/* Top Navigation - Index Menu Toggle */
.top-nav {
    position: fixed;
    top: 0;
    right: 0;
    padding: 40px 50px;
    z-index: 1000;
}

.index-toggle {
    background: transparent;
    border: none;
    color: var(--color-white);
    font-size: 16px;
    font-family: var(--font-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: opacity 0.3s ease;
}

.index-toggle:hover {
    opacity: 0.7;
}

/* Hamburger Menu Icon */
.menu-icon {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.menu-icon span {
    width: 25px;
    height: 2px;
    background-color: var(--color-white);
    transition: all 0.3s ease;
}

/* ============================================
   INDEX MENU OVERLAY
   ============================================ */

.index-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #121211;
    z-index: 2000;
    display: grid;
    grid-template-columns: 1fr 1fr;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    overflow: hidden;
}

.index-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Project Thumbnails Background - Shows on hover */
.project-thumbnails {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.project-thumb {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.project-thumb.active {
    opacity: 0.3;
}

.project-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Close Button */
.close-menu {
    position: absolute;
    top: 40px;
    right: 50px;
    background: transparent;
    border: none;
    color: var(--color-white);
    font-size: 50px;
    cursor: pointer;
    line-height: 1;
    transition: opacity 0.3s ease;
    z-index: 100;
}

.close-menu:hover {
    opacity: 0.7;
}

/* Left Side: Projects List */
.index-left {
    position: relative;
    z-index: 10;
    padding: 100px 60px 60px 60px;
    display: flex;
    flex-direction: column;
}

.index-section-title {
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.1em;
    margin-bottom: 50px;
    color: var(--color-white);
    text-transform: uppercase;
}

.projects-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 35px;
}

.project-link {
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.project-link a {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.project-name {
    font-size: 24px;
    font-weight: 500;
    color: var(--color-white);
    transition: opacity 0.3s ease;
}

.project-desc {
    font-size: 14px;
    font-style: italic;
    color: #999999;
    font-family: 'Playfair Display', serif;
    transition: opacity 0.3s ease;
}

.project-link:hover .project-name {
    opacity: 0.7;
}

.project-link:hover .project-desc {
    color: #cccccc;
}

/* Right Side: About Me */
.index-right {
    position: relative;
    z-index: 10;
    padding: 100px 60px 60px 60px;
    display: flex;
    flex-direction: column;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.index-right.hide {
    opacity: 0;
    visibility: hidden;
}

.about-content-index {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.about-content-index p {
    font-size: 18px;
    line-height: 1.7;
    color: #999999;
    margin: 0;
}

/* Index Menu Links (Resume, Contact) */
.about-links-index {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 30px;
}

.index-link {
    color: #666666;
    text-decoration: none;
    font-size: 18px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 25px 30px;
    background-color: transparent;
    border: 1px solid #333333;
    border-radius: 4px;
    transition: all 0.3s ease;
    position: relative;
}

.index-link .arrow {
    width: 40px;
    height: 40px;
    background-color: #333333;
    color: #666666;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.index-link:hover {
    background-color: var(--color-white);
    color: var(--color-black);
    border-color: var(--color-white);
    transform: scale(1.02);
}

.index-link:hover .arrow {
    background-color: var(--color-black);
    color: var(--color-white);
}

/* Dim other links when one is hovered */
.about-links-index:hover .index-link:not(:hover) {
    opacity: 0.3;
}

.about-links-index:hover .index-link:not(:hover) .arrow {
    opacity: 0.5;
}

/* ============================================
   HOME PAGE - HERO SECTION
   ============================================ */

.main-content {
    margin-left: 0;
    padding: 0;
}

.hero-section {
    min-height: 150vh;
    background-color: #121211;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 0 20px 50px 20px;
}

/* Floating Images Background - Parallax Effect */
.floating-images {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0;
    transition: opacity 2.5s ease-in-out, transform 2.5s ease-in-out, filter 2s ease-in-out;
}

.floating-images.animate-in {
    opacity: 1 !important;
}

.floating-images.hide-up {
    opacity: 0 !important;
    transform: translateY(-300px) scale(0.8) !important;
    filter: blur(20px);
    pointer-events: none;
}

.float-image {
    position: absolute;
    will-change: transform, filter;
    transition: transform 0.1s ease-out;
    width: 400px;
    height: 225px;
}

/* Position each floating image */
.float-image:nth-child(1) {
    top: 2%;
    left: 5%;
}

.float-image:nth-child(2) {
    top: 45%;
    left: 10%;
}

.float-image:nth-child(3) {
    top: 5%;
    right: 8%;
}

.float-image:nth-child(4) {
    bottom: 50%;
    right: 5%;
}

.float-image:nth-child(5) {
    top: 25%;
    left: 35%;
}

.float-image:nth-child(6) {
    top: 12%;
    right: 25%;
}

.float-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    opacity: 0.8;
    border-radius: 0;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

/* Hero Content - Name and Title */
.hero-content {
    position: fixed;
    top: 50%;
    top: 50lvh; /* Use large viewport height on supported browsers to avoid mobile UI jump */
    left: 50%;
    transform: translate(-50%, -50%) !important;
    z-index: 1000;
    text-align: center;
    color: var(--color-white);
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 1200px;
    padding: 20px;
}

.hero-name {
    font-size: clamp(40px, 10vw, 120px); /* Fluid responsive font size */
    font-weight: 900;
    letter-spacing: -0.01em;
    line-height: 1.1;
    margin-bottom: 5px;
    text-transform: uppercase;
    color: #ffffff;
    text-shadow: 0 4px 30px rgba(0, 0, 0, 0.8);
    opacity: 0;
    font-family: 'Space Grotesk', sans-serif;
    text-align: center;
    width: 100%;
}

.hero-title {
    font-size: clamp(20px, 4vw, 45px); /* Fluid responsive font size */
    font-weight: 400;
    font-style: italic;
    letter-spacing: 0.05em;
    margin-bottom: 40px;
    color: #ffffff;
    text-shadow: 0 4px 30px rgba(0, 0, 0, 0.8);
    opacity: 0;
    font-family: 'Playfair Display', serif;
    text-align: center;
    width: 100%;
    text-transform: capitalize;
}

/* Resume Button */
.resume-btn {
    position: absolute;
    top: calc(50% + 140px);
    left: 50%;
    transform: translate(-50%, 0);
    padding: 15px 45px;
    background-color: transparent;
    color: var(--color-white);
    text-decoration: none;
    border: 2px solid var(--color-white);
    border-radius: 50px;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.1em;
    opacity: 0;
    pointer-events: none;
}

.resume-btn.show {
    opacity: 1;
    pointer-events: auto;
}

.resume-btn.emerging {
    animation: emergeFromCenter 0.8s ease-out forwards;
}

.resume-btn:hover {
    background-color: var(--color-white);
    color: var(--color-black);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Hero Entry Animations */
.hero-name.animate-in {
    animation: fadeInCenter 1.2s ease-out forwards;
}

.hero-title.animate-in {
    animation: fadeInCenter 1.2s ease-out forwards;
}

/* ============================================
   HOME PAGE - FEATURED PROJECTS SECTION
   ============================================ */

/* Section Header */
.projects-header {
    padding: 10px 80px 40px;
    background-color: #121211;
    text-align: left;
    position: relative;
    z-index: 20;
    margin-top: -50vh;
}

.section-label {
    font-size: clamp(28px, 5vw, 48px); /* Fluid responsive font size */
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--color-white);
}

/* Projects Grid */
.projects-section {
    padding: 40px 0 100px 0;
    background-color: #121211;
    position: relative;
    z-index: 20;
}

.project-item {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 80px;
    margin-bottom: 0;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

/* Left-aligned projects */
.project-left {
    justify-content: flex-start;
}

.project-left .project-image {
    margin-right: auto;
}

/* Right-aligned projects */
.project-right {
    justify-content: flex-end;
}

.project-right .project-image {
    margin-left: auto;
}

/* Project Image Container - With zoom-in hover effect */
.project-image {
    width: 55%;
    max-width: 800px;
    height: auto;
    overflow: hidden;
    border-radius: 0;
    background-color: #f5f5f5;
    cursor: pointer;
}

.project-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    transform: scale(1);
    transition: transform 0.5s ease;
}

/* Zoom in on hover */
.project-image:hover img {
    transform: scale(1.15);
}

/* Project Details */
.project-details {
    position: absolute;
    bottom: 80px;
}

.project-left .project-details {
    left: 80px;
}

.project-right .project-details {
    right: 80px;
    text-align: right;
}

.project-title {
    font-size: clamp(20px, 4vw, 42px); /* Fluid responsive font size */
    font-weight: 600;
    margin-bottom: 10px;
    letter-spacing: 0.02em;
    color: var(--color-white);
}

.project-category {
    font-size: 16px;
    color: #999999;
    font-weight: 400;
    font-style: italic;
    letter-spacing: 0.05em;
}

/* ============================================
   HOME PAGE - ABOUT & CONTACT SECTIONS
   ============================================ */

/* About Section */
.about-section {
    padding: 80px 100px;
    margin-bottom: 120px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    background-color: #121211;
    position: relative;
    z-index: 20;
}

.about-section .section-label {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 40px;
    font-weight: 500;
    color: var(--color-white);
}

.about-content {
    margin-bottom: 40px;
}

.about-text {
    font-size: 20px;
    line-height: 1.8;
    color: #999999;
    margin-bottom: 24px;
}

.about-links {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.text-link {
    color: var(--color-white);
    text-decoration: underline;
    font-size: 16px;
    transition: opacity 0.3s ease;
    width: fit-content;
}

.text-link:hover {
    opacity: 0.6;
}

/* Contact Section */
.contact-section {
    text-align: center;
    padding: 200px 80px 200px 80px;
    margin: 0;
    background-color: #1a1a1a;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 20;
}

.contact-title {
    font-size: clamp(24px, 5vw, 48px); /* Fluid responsive font size */
    font-weight: 600;
    margin-bottom: 40px;
    line-height: 1.3;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    letter-spacing: -0.01em;
    color: var(--color-white);
}

.contact-btn {
    display: inline-block;
    background-color: var(--color-white);
    color: var(--color-black);
    padding: 18px 50px;
    font-size: 18px;
    font-weight: 500;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.contact-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(255, 255, 255, 0.3);
}

/* Footer */
.footer {
    border-top: none;
    padding: 80px;
    background-color: #1a1a1a;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    z-index: 20;
    margin-top: auto;
}

.footer-name {
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
}

.footer-links {
    display: flex;
    gap: 60px;
    align-items: center;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    font-size: 14px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: rgba(255, 255, 255, 1);
}

/* ============================================
   PROJECT DETAIL PAGES
   ============================================ */

/* Project Hero Section */
.project-hero {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    overflow: hidden;
    background: #000;
    z-index: 1;
}

.project-hero-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.project-hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-hero-title {
    position: relative;
    z-index: 2;
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(1.75rem, 5vw, 4rem); /* Fluid responsive font size */
    font-weight: 700;
    color: #fff;
    text-align: left;
    max-width: 1200px;
    padding: 0 clamp(2rem, 5vw, 4rem) clamp(4rem, 8vw, 8rem) clamp(2rem, 5vw, 4rem);
    line-height: 1.2;
    letter-spacing: -0.02em;
}

/* Project Content Section */
.project-content {
    background: #1a1a1a;
    color: #fff;
    padding: 8rem 2rem;
    min-height: 100vh;
    border-radius: 40px 40px 0 0;
    position: relative;
    margin-top: 100vh;
    z-index: 10;
}

.project-content-grid {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 8rem;
}

/* Right Column - Project Details */
.project-details-column {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    order: 2;
}

.detail-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.detail-label {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.85rem;
    font-weight: 400;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-style: italic;
}

.detail-value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.1rem;
    font-weight: 400;
    color: #fff;
    line-height: 1.6;
}

.process-list,
.tools-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.process-list li,
.tools-list li {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    font-weight: 400;
    color: #fff;
    padding-left: 1.5rem;
    position: relative;
}

.process-list li::before,
.tools-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: #fff;
}

/* Resource Buttons (Process Book, Whitepaper) */
.resource-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 10px;
}

.resource-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 25px;
    background-color: transparent;
    border: 1px solid #333333;
    border-radius: 4px;
    text-decoration: none;
    color: #999999;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.resource-btn:hover {
    background-color: var(--color-white);
    color: var(--color-black);
    border-color: var(--color-white);
    transform: translateX(5px);
}

.btn-arrow {
    width: 35px;
    height: 35px;
    background-color: #333333;
    color: #666666;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.resource-btn:hover .btn-arrow {
    background-color: var(--color-black);
    color: var(--color-white);
}

/* Left Column - Project Description */
.project-description-column {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    order: 1;
}

.description-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.project-intro {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.3rem;
    font-weight: 400;
    color: #fff;
    line-height: 1.8;
}

.section-heading {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.description-section p {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.1rem;
    font-weight: 400;
    color: #ddd;
    line-height: 1.8;
}

/* Project Images Section */
.project-images {
    background: #1a1a1a;
    padding: 0;
    position: relative;
    z-index: 10;
}

.project-image-full {
    width: 100%;
    margin-bottom: 0;
}

.project-image-full img {
    width: 100%;
    height: auto;
    display: block;
}

.project-image-full video {
    width: 100%;
    height: auto;
    display: block;
}

.project-image-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 0 2rem;
}

.project-image-grid.three-col {
    grid-template-columns: 1fr 1fr 1fr;
}

.project-image-half img,
.project-image-third img {
    width: 100%;
    height: auto;
    display: block;
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

@keyframes fadeInCenter {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

@keyframes emergeFromCenter {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

/* Apply fade-in animation to main sections */
.hero-section,
.project-item,
.about-section {
    animation: fadeIn 0.8s ease-out;
}

/* ============================================
   RESPONSIVE DESIGN - LARGE TABLET
   ============================================ */

@media (max-width: 1200px) {
    /* Navigation */
    .k-logo {
        top: 30px;
        left: 40px;
    }

    .top-nav {
        padding: 30px 40px;
    }

    /* Projects Section */
    .projects-header {
        padding: 10px 60px 40px;
    }

    .project-item {
        padding: 60px 40px;
    }

    .project-image {
        width: 60%;
    }

    /* About & Contact */
    .about-section {
        padding: 80px 60px;
    }

    .contact-section {
        padding: 180px 60px 150px 60px;
    }

    .footer {
        padding: 60px;
    }
}

/* ============================================
   RESPONSIVE DESIGN - TABLET
   ============================================ */

@media (max-width: 1024px) {
    /* Navigation */
    .k-logo {
        top: 25px;
        left: 30px;
    }

    .top-nav {
        padding: 25px 30px;
    }

    /* Hero Section */
    .float-image {
        width: 250px;
        height: 180px;
    }

    /* Hide some floating images on tablet */
    .float-image:nth-child(4),
    .float-image:nth-child(6) {
        display: none;
    }

    /* Projects Section */
    .projects-header {
        padding: 10px 40px 30px;
    }

    .project-item {
        padding: 50px 30px;
    }

    .project-image {
        width: 70%;
    }

    .project-details {
        bottom: 60px;
    }

    .project-left .project-details {
        left: 30px;
    }

    .project-right .project-details {
        right: 30px;
    }

    /* About & Contact */
    .about-section {
        padding: 60px 40px;
    }

    .contact-section {
        padding: 150px 40px 100px 40px;
    }

    .footer {
        padding: 50px 40px;
    }

    /* Index Menu Overlay */
    .index-overlay {
        grid-template-columns: 1fr;
    }
    
    .index-left,
    .index-right {
        padding: 80px 40px;
    }
    
    /* Hide about section on tablet */
    .index-right {
        display: none;
    }
    
    .project-name {
        font-size: 22px;
    }
    
    .index-link {
        font-size: 16px;
        padding: 20px 25px;
    }
    
    .index-link .arrow {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }

    /* Project Detail Pages */
    .project-content-grid {
        grid-template-columns: 1fr;
        gap: 4rem;
    }

    .project-description-column {
        order: 1;
    }

    .project-details-column {
        order: 2;
    }

    .project-content {
        padding: 5rem 2rem;
        border-radius: 30px 30px 0 0;
    }

    .project-image-grid.three-col {
        grid-template-columns: 1fr 1fr;
    }

    .project-image-grid {
        gap: 1.5rem;
        padding: 0 1.5rem;
    }

    .project-intro {
        font-size: 1.2rem;
    }

    .section-heading {
        font-size: 1.3rem;
    }

    .description-section p {
        font-size: 1rem;
    }
}

/* ============================================
   RESPONSIVE DESIGN - MOBILE
   ============================================ */

@media (max-width: 768px) {
    /* Navigation */
    .k-logo {
        top: 20px;
        left: 20px;
    }

    .top-nav {
        padding: 20px 20px;
    }

    .index-toggle {
        font-size: 14px;
    }
    
    .close-menu {
        top: 20px;
        right: 20px;
        font-size: 40px;
    }

    .index-left {
        padding: 80px 30px;
    }
    
    .index-section-title {
        font-size: 12px;
        margin-bottom: 30px;
    }
    
    .project-name {
        font-size: 20px;
    }
    
    .project-desc {
        font-size: 13px;
    }
    
    .index-link {
        font-size: 15px;
        padding: 18px 20px;
    }
    
    .index-link .arrow {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    
    .about-content-index p {
        font-size: 16px;
    }

    /* Hero Section */
    .hero-section {
        min-height: 100vh;
        padding: 0 15px 30px 15px;
    }

    .hero-content {
        padding: 15px;
    }

    /* Resume Button */
    .resume-btn {
        font-size: 12px;
        padding: 12px 35px;
        top: calc(50% + 100px);
    }

    /* Hide all floating images except first and third */
    .float-image {
        display: none;
    }

    .float-image:nth-child(1),
    .float-image:nth-child(3) {
        display: block;
        width: 180px;
        height: 130px;
    }

    /* Projects Section */
    .projects-header {
        padding: 10px 20px 20px;
        margin-top: -20vh;
    }

    .project-item {
        min-height: auto;
        padding: 40px 20px;
        flex-direction: column;
    }

    .project-left,
    .project-right {
        justify-content: center;
    }

    .project-image {
        width: 100%;
        margin: 0 !important;
    }

    .project-details {
        position: static;
        margin-top: 25px;
        text-align: left !important;
    }

    .project-left .project-details,
    .project-right .project-details {
        left: auto;
        right: auto;
    }

    .project-category {
        font-size: clamp(12px, 3vw, 14px);
    }

    /* About & Contact */
    .about-section {
        padding: 40px 20px;
    }

    .about-text {
        font-size: clamp(16px, 4vw, 18px);
    }

    .contact-section {
        padding: 100px 20px 80px 20px;
    }

    .contact-btn {
        padding: 14px 35px;
        font-size: 15px;
        width: 100%;
        max-width: 250px;
    }

    .footer {
        padding: 40px 20px;
    }

    .footer-name {
        font-size: 12px;
    }

    .footer-links {
        gap: 40px;
    }

    .footer-links a {
        font-size: 12px;
    }

    /* Project Detail Pages */
    .project-content {
        padding: 4rem 1.5rem;
        border-radius: 20px 20px 0 0;
    }

    .project-content-grid {
        gap: 3rem;
    }

    .project-intro {
        font-size: 1.1rem;
    }

    .section-heading {
        font-size: 1.2rem;
    }

    .description-section p {
        font-size: 0.95rem;
    }

    .detail-label {
        font-size: 0.75rem;
    }

    .detail-value {
        font-size: 1rem;
    }

    .process-list li,
    .tools-list li {
        font-size: 0.9rem;
    }

    .resource-btn {
        font-size: 14px;
        padding: 16px 20px;
    }

    .btn-arrow {
        width: 30px;
        height: 30px;
        font-size: 16px;
    }

    .project-image-grid,
    .project-image-grid.three-col {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0 1rem;
    }

    .project-image-full {
        margin-bottom: 1rem;
    }
}

/* ============================================
   RESPONSIVE DESIGN - SMALL MOBILE
   ============================================ */

@media (max-width: 480px) {
    /* Navigation */
    .k-logo {
        top: 15px;
        left: 15px;
    }

    .top-nav {
        padding: 15px 15px;
    }

    .index-toggle span:first-child {
        display: none; /* Hide "index" text on very small screens */
    }

    .close-menu {
        top: 15px;
        right: 15px;
        font-size: 35px;
    }

    .index-left {
        padding: 70px 20px;
    }

    .projects-list {
        gap: 25px;
    }

    .project-name {
        font-size: 18px;
    }

    .project-desc {
        font-size: 12px;
    }

    .index-link {
        font-size: 14px;
        padding: 15px 18px;
    }

    /* Hero Section */
    .hero-section {
        padding: 0 10px 20px 10px;
    }

    .hero-content {
        padding: 10px;
    }

    .resume-btn {
        font-size: 11px;
        padding: 10px 30px;
        top: calc(50% + 80px);
    }

    /* Floating images - smaller on tiny screens */
    .float-image:nth-child(1),
    .float-image:nth-child(3) {
        width: 140px;
        height: 100px;
    }

    /* Sections */
    .projects-header {
        padding: 10px 15px 15px;
    }

    .projects-section {
        padding: 20px 0 60px 0;
    }

    .project-item {
        padding: 30px 15px;
    }

    .project-details {
        margin-top: 20px;
    }

    .about-section {
        padding: 30px 15px;
    }

    .about-text {
        font-size: 16px;
        margin-bottom: 18px;
    }

    .contact-section {
        padding: 80px 15px 60px 15px;
    }

    .contact-title {
        margin-bottom: 30px;
        padding: 0 10px;
    }

    .contact-btn {
        padding: 12px 30px;
        font-size: 14px;
    }

    /* Footer - Stack vertically */
    .footer {
        flex-direction: column;
        gap: 25px;
        padding: 35px 20px;
        text-align: center;
    }
    
    .footer-name {
        font-size: 11px;
    }

    .footer-links {
        flex-direction: column;
        gap: 18px;
    }

    .footer-links a {
        font-size: 11px;
    }

    /* Project Detail Pages */
    .project-content {
        padding: 3rem 1rem;
        border-radius: 15px 15px 0 0;
    }

    .project-content-grid {
        gap: 2.5rem;
    }

    .project-intro {
        font-size: 1rem;
    }

    .section-heading {
        font-size: 1.1rem;
    }

    .description-section {
        gap: 1.2rem;
    }

    .description-section p {
        font-size: 0.9rem;
    }

    .detail-group {
        gap: 0.6rem;
    }

    .detail-label {
        font-size: 0.7rem;
    }

    .detail-value {
        font-size: 0.95rem;
    }

    .process-list,
    .tools-list {
        gap: 0.4rem;
    }

    .process-list li,
    .tools-list li {
        font-size: 0.85rem;
        padding-left: 1.2rem;
    }

    .resource-buttons {
        gap: 12px;
    }

    .resource-btn {
        font-size: 13px;
        padding: 14px 18px;
    }

    .btn-arrow {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }

    .project-image-grid {
        gap: 0.8rem;
        padding: 0 0.8rem;
        margin-bottom: 1.5rem;
    }
}

/* ============================================
   RESPONSIVE DESIGN - EXTRA SMALL DEVICES
   ============================================ */

@media (max-width: 360px) {
    /* Navigation */
    .k-logo {
        top: 12px;
        left: 12px;
    }

    .top-nav {
        padding: 12px 12px;
    }

    .menu-icon span {
        width: 20px;
    }

    /* Hero Section */
    .hero-content {
        padding: 8px;
    }

    .resume-btn {
        font-size: 10px;
        padding: 8px 25px;
    }

    /* Projects */
    .project-item {
        padding: 25px 12px;
    }

    /* Contact */
    .contact-section {
        padding: 70px 12px 50px 12px;
    }

    .contact-btn {
        padding: 10px 25px;
        font-size: 13px;
    }

    /* Footer */
    .footer {
        padding: 30px 15px;
    }
}

/* ============================================
   RESPONSIVE DESIGN - MOBILE LANDSCAPE
   ============================================ */

@media (max-width: 896px) and (max-height: 414px) and (orientation: landscape) {
    /* Hero Section - Adjust for landscape */
    .hero-section {
        min-height: 100vh;
        padding: 0 20px 20px 20px;
    }

    .hero-content {
        padding: 15px;
    }

    .hero-name {
        font-size: clamp(35px, 8vw, 80px);
        margin-bottom: 5px;
    }

    .hero-title {
        font-size: clamp(18px, 3vw, 32px);
        margin-bottom: 20px;
    }

    .resume-btn {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        margin-top: 20px;
    }

    /* Hide floating images in landscape */
    .float-image {
        display: none;
    }

    /* Projects Section */
    .project-item {
        min-height: 100vh;
        padding: 30px 20px;
    }

    /* Navigation */
    .k-logo {
        top: 15px;
        left: 15px;
    }

    .top-nav {
        padding: 15px 15px;
    }

    /* Contact Section */
    .contact-section {
        padding: 80px 20px 60px 20px;
        min-height: 100vh;
    }
}

/* ============================================
   RESPONSIVE DESIGN - IMAGE OPTIMIZATION
   ============================================ */

/* Ensure images are optimized for various screen sizes */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Prevent layout shift with aspect ratio boxes for images */
.project-image,
.float-image,
.project-hero-image,
.project-thumb {
    position: relative;
}

.project-image img,
.float-image img,
.project-hero-image img,
.project-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Smooth image loading */
img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* ============================================
   RESPONSIVE DESIGN - PRINT STYLES
   ============================================ */

@media print {
    /* Hide non-essential elements for printing */
    .k-logo,
    .top-nav,
    .index-overlay,
    .floating-images,
    .resume-btn {
        display: none !important;
    }

    /* Adjust colors for print */
    body {
        background-color: white;
        color: black;
    }

    /* Ensure proper page breaks */
    .project-item,
    .about-section,
    .contact-section {
        page-break-inside: avoid;
    }
}

/* ============================================
   RESPONSIVE DESIGN - ACCESSIBILITY
   ============================================ */

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    /* Disable parallax and floating animations */
    .float-image {
        transform: none !important;
    }

    .hero-section {
        transform: none !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --color-white: #ffffff;
        --color-black: #000000;
    }

    body {
        background-color: #000000;
        color: #ffffff;
    }

    .project-image,
    .float-image img {
        border: 2px solid #ffffff;
    }
}
