/* --- ULTIMATE PROTOTYPE STYLES --- */

:root {
    --color-light: #fefefe;
    --color-dark: #121212;
    --color-text-light: #f0f0f0;
    --color-text-dark: #1c1c1c;
    --color-accent: #3b82f6;
    --color-muted: #aaa;
    --color-border: #e0e0e0;
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;
    --header-height: 5.5rem;

    /* Hero Graphic Colors */
    --hero-graphic-color-1: rgba(59, 130, 246, 0.15);
    /* Accent blue, slightly transparent */
    --hero-graphic-color-2: rgba(170, 170, 170, 0.1);
    /* Muted grey, slightly transparent */
    --hero-graphic-color-3: rgba(0, 0, 0, 0.1);
    /* Darker, subtle */
}

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

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

body {
    font-family: var(--font-body);
    color: var(--color-text-dark);
    background-color: var(--color-light);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    cursor: none;
}

body.no-scroll {
    overflow: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

main {
    visibility: hidden;
}

/* Hide Scrollbar */
body::-webkit-scrollbar {
    display: none;
}

body {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* --- 1. PRELOADER & ENTRANCE --- */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    overflow: hidden;
}

.preloader-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--color-light);
    z-index: 2;
}

.preloader-name {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.loading-bar-container {
    width: 200px;
    height: 3px;
    background-color: rgba(255, 255, 255, 0.2);
    margin: 0 auto 1rem auto;
}

.loading-bar {
    width: 0%;
    height: 100%;
    background-color: var(--color-light);
}

.loading-percent {
    font-family: var(--font-body);
    font-weight: 500;
}

.preloader-gate {
    position: absolute;
    width: 100%;
    background-color: var(--color-dark);
}

.top-gate {
    top: 0;
    height: 51%;
    /* Increased to create a slight overlap */
}

.bottom-gate {
    bottom: 0;
    height: 51%;
    /* Increased to create a slight overlap */
}

/* --- 2. INTERACTIVE ELEMENTS --- */
#ambient-light {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vmax;
    height: 100vmax;
    pointer-events: none;
    z-index: -1;
    background: radial-gradient(circle at center, rgba(59, 130, 246, 0.08), transparent 30%);
    transform: translate(-50%, -50%);
}

.cursor-outline,
.cursor-dot {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    border-radius: 50%;
    z-index: 9999;
}

.cursor-dot {
    width: 8px;
    height: 8px;
    background-color: var(--color-accent);
}

.cursor-outline {
    width: 40px;
    height: 40px;
    border: 1px solid var(--color-accent);
    background-color: rgba(59, 130, 246, 0.1);
    transition: transform 0.2s;
}

.project-hover-image {
    position: fixed;
    top: 0;
    left: 0;
    width: 300px;
    height: 400px;
    background-size: cover;
    background-position: center;
    pointer-events: none;
    z-index: 9998;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
    transition: opacity 0.4s, transform 0.4s;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.project-hover-image.visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* --- 3. HEADER & LIVE INVERT NAVIGATION --- */
#scroll-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--color-accent);
    width: 0%;
    z-index: 101;
}

.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5vw;
    z-index: 99;
    transition: color 0.4s ease;
}

.logo {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.8rem;
    transition: color 0.4s ease;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links-container {
    position: relative;
    display: flex;
    align-items: center;
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 2.5rem;
    padding: 0.5rem;
}

.main-nav ul a {
    font-weight: 500;
    font-size: 1rem;
    color: var(--color-text-dark);
    padding: 0.6rem 0.25rem;
    position: relative;
    transition: color 0.4s ease;
    background-color: transparent;
    border-radius: 0;
}

.main-nav ul a:hover {
    background-color: transparent;
    color: var(--color-text-dark);
}

.main-nav ul a::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background-color: var(--color-accent);
    bottom: 5px;
    left: 0;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.main-nav ul a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

header.main-header .nav-cta-button {
    font-weight: 600;
    font-size: 1rem;
    background-color: var(--color-dark);
    color: var(--color-light);
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

header.main-header .nav-cta-button:hover {
    background-color: var(--color-accent);
    color: var(--color-light);
}

header.main-header.header-is-inverted .logo,
header.main-header.header-is-inverted .main-nav ul a {
    color: var(--color-light);
}

header.main-header.header-is-inverted .main-nav ul a:hover {
    color: var(--color-light);
}

header.main-header.header-is-inverted .main-nav ul a::after {
    background-color: var(--color-light);
}

header.main-header.header-is-inverted .nav-cta-button {
    background-color: var(--color-light);
    color: var(--color-dark);
}

header.main-header.header-is-inverted .nav-cta-button:hover {
    background-color: var(--color-accent);
    color: var(--color-light);
}

/* --- MOBILE NAVIGATION --- */
.mobile-nav-toggle {
    display: none;
}

.mobile-nav {
    display: none;
}


/* --- 4. HERO SECTION --- */
.section-padding {
    padding: var(--header-height) 5vw;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.hero-section {
    justify-content: center;
}

.main-heading {
    font-family: var(--font-heading);
    font-size: clamp(3rem, 9vw, 8rem);
    line-height: 1.05;
    letter-spacing: -0.04em;
    max-width: 1400px;
    margin: 0 auto;
    text-align: center;
}

.main-heading .line {
    display: block;
    overflow: hidden;
}

.interactive-text .char {
    display: inline-block;
}

.hero-subtext {
    width: 100%;
    font-weight: 400;
    font-size: 0.9rem;
    color: var(--color-muted);
    padding-top: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

/* --- 5. ABOUT SECTION (REFINED) --- */
.bg-dark {
    background-color: var(--color-dark);
    color: var(--color-text-light);
    position: relative;
}

.about-section {
    padding-top: 12rem;
    padding-bottom: 12rem;
}

.about-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    padding-left: 10%;
    padding-right: 10%;
}

.about-text-content {
    max-width: 550px;
}

.about-intro {
    font-family: var(--font-heading);
    font-style: italic;
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    line-height: 1.5;
    margin-bottom: 3rem;
}

.about-intro .highlight {
    color: var(--color-accent);
    font-style: normal;
    font-weight: 600;
    position: relative;
    display: inline-block;
}

.about-intro .highlight::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background: var(--color-accent);
    left: 0;
    bottom: 0;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s cubic-bezier(0.8, 0, 0.2, 1);
}

.about-intro .highlight:hover::after {
    transform: scaleX(1);
}

.about-skills-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3rem;
    justify-content: center;
}

.floating-image-container {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    perspective: 1000px;
    transition: transform 0.4s ease-out;
}

.floating-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease-out;
}

.skills-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    width: 100%;
    max-width: 400px;
}

.skills-category h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-muted);
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    letter-spacing: 0.1em;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.skill-tag {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: transform 0.3s, background-color 0.3s;
}

.skill-tag:hover {
    transform: translateY(-3px);
    background-color: rgba(255, 255, 255, 0.1);
}

/* --- 6. WORKS SECTION (REFINED) --- */
.works-section {
    padding-top: 8rem;
    padding-bottom: 10rem;
}

.section-title {
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-muted);
    margin-bottom: 6rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-align: center;
}

/* --- PROJECTS GRID --- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 5vw;
}

.project-card {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    background: var(--color-light);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
    /* Soft shadow */
    transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    isolation: isolate;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.bg-dark .project-card {
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.15);
}

.bg-dark .project-card:hover {
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}

.card-image-wrapper {
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
    background-color: var(--color-muted);
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s ease;
}

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

.card-content {
    padding: 2rem;
    position: relative;
    z-index: 2;
}

.card-number {
    font-size: 0.85rem;
    color: var(--color-accent);
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: block;
    letter-spacing: 0.1em;
}

.card-title {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    margin-bottom: 1rem;
    line-height: 1.2;
    transition: color 0.3s;
}

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

.card-description {
    font-size: 0.95rem;
    color: var(--color-muted);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-links {
    display: flex;
    gap: 1.5rem;
    margin-top: auto;
}

.card-link {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text-dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.3s;
}

.bg-dark .card-link {
    color: var(--color-text-light);
}

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

.card-link i {
    font-size: 0.8rem;
    transition: transform 0.3s;
}

.card-link:hover i {
    transform: translate(2px, -2px);
}

.view-all-button {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text-dark);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 1rem 2rem;
    border: 1px solid var(--color-border);
    border-radius: 50px;
    transition: all 0.3s;
    background: transparent;
}

.bg-dark .view-all-button {
    color: var(--color-text-light);
    border-color: rgba(255, 255, 255, 0.2);
}

.view-all-button:hover {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: white;
}

/* --- 7. CONTACT SECTION --- */
.contact-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding-left: 5vw;
    padding-right: 5vw;
}

.contact-content-wrapper {
    flex-grow: 0;
    width: 100%;
    max-width: 1100px;
    text-align: center;
    position: relative;
    padding: 2rem;
}

.contact-text-block {
    margin-bottom: 4rem;
}

.contact-title {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 8vw, 6rem);
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin-bottom: 3.5rem;
}

.contact-title .line {
    display: block;
    overflow: hidden;
}

.contact-button {
    font-weight: 600;
    font-size: 1.2rem;
    display: inline-block;
    background-color: var(--color-accent);
    color: white;
    padding: 1.2rem 3.5rem;
    border-radius: 50px;
    transition: transform 0.3s, background-color 0.3s;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.contact-button:hover {
    transform: translateY(-5px) scale(1.02);
    background-color: #2563eb;
}

.site-footer {
    width: 100%;
    text-align: center;
    padding-top: 4rem;
    padding-bottom: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: transparent;
    border: 1px solid var(--color-muted);
    color: var(--color-muted);
    font-size: 1.1rem;
    transition: all 0.3s;
}

.social-icon:hover {
    background-color: var(--color-light);
    color: var(--color-dark);
    border-color: var(--color-light);
}

.footer-note {
    font-size: 0.85rem;
    color: var(--color-muted);
}

/* New Rotated Graph Paper Grid for Hero Section */
.hero-section::before {
    content: '';
    position: absolute;
    inset: -25%;
    /* Make it larger to cover edges when rotated */
    z-index: 0;
    background-image:
        linear-gradient(var(--hero-graphic-color-3) 1px, transparent 1px),
        linear-gradient(90deg, var(--hero-graphic-color-3) 1px, transparent 1px);
    background-size: 30px 30px;
    transform: rotate(-15deg);
    opacity: 0.5;
    pointer-events: none;
}

/* --- 8. UNIQUE BACKGROUND GRAPHICS --- */
.bg-dark::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 800"><filter id="noise"><feTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(%23noise)"/></svg>');
    opacity: 0.025;
    z-index: 0;
}

.bg-graphic {
    position: absolute;
    pointer-events: none;
    z-index: 0;
    opacity: 0;
}

.z-index-fix,
.about-layout,
.project-list,
#view-all-container,
.contact-content-wrapper,
.site-footer>*,
.hero-section>*:not(.hero-graphic):not(#hero-grid-container):not(.hero-blob):not(.symbol-container) {
    position: relative;
    z-index: 10;
}

.floating-symbol {
    position: absolute;
    font-family: 'Courier New', Courier, monospace;
    color: var(--hero-graphic-color-3);
    font-weight: 600;
    animation: float 10s ease-in-out infinite;
    will-change: transform;
}

.bg-dark .floating-symbol {
    color: rgba(255, 255, 255, 0.25);
}

.grid-point {
    background-color: var(--hero-graphic-color-3);
    border-radius: 50%;
    width: 3px;
    height: 3px;
    place-self: center;
}


.hero-blob.blob-1 {
    width: 70vw;
    max-width: 900px;
    top: -25%;
    left: -20%;
}

.hero-blob.blob-2 {
    width: 60vw;
    max-width: 800px;
    bottom: -30%;
    right: -20%;
}


.hero-graphic.large-circle-accent {
    width: 250px;
    height: 250px;
    border: 3px solid var(--color-accent);
    border-radius: 50%;
    top: 15%;
    left: 10%;
    animation: pulse-border 4s ease-in-out infinite alternate;
}

.hero-graphic.large-square-muted {
    width: 200px;
    height: 200px;
    background-color: var(--hero-graphic-color-2);
    top: 70%;
    right: 15%;
    transform: rotate(25deg);
    animation: simple-rotate 15s linear infinite reverse;
}

.hero-graphic.line-v-large {
    width: 4px;
    height: 300px;
    background-color: var(--hero-graphic-color-1);
    top: 50%;
    left: 5%;
    transform: translateY(-50%) rotate(15deg);
}

.hero-graphic.line-h-large {
    width: 300px;
    height: 4px;
    background-color: var(--hero-graphic-color-2);
    bottom: 10%;
    left: 30%;
    transform: rotate(-10deg);
}

.hero-graphic.small-circle-1 {
    width: 80px;
    height: 80px;
    background-color: var(--hero-graphic-color-1);
    border-radius: 50%;
    top: 40%;
    right: 10%;
    animation: float 8s ease-in-out infinite reverse;
}

.hero-graphic.small-square-1 {
    width: 60px;
    height: 60px;
    background-color: var(--hero-graphic-color-3);
    top: 20%;
    right: 25%;
    transform: rotate(45deg);
    animation: simple-rotate 10s linear infinite;
}

@keyframes simple-rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse-border {
    0% {
        border-color: var(--color-accent);
        transform: scale(1);
    }

    100% {
        border-color: rgba(59, 130, 246, 0.4);
        transform: scale(1.05);
    }
}

.about-graphic-grid {
    top: 50%;
    left: 50%;
    width: 120vw;
    height: 120vh;
    transform: translate(-50%, -50%);
    background-image: linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
    background-size: 80px 80px;
    animation: pan-grid 30s linear infinite;
}

.about-graphic-tag {
    position: absolute;
    font-family: 'Courier New', Courier, monospace;
    color: rgba(255, 255, 255, 0.1);
    z-index: 1;
    animation: float 10s ease-in-out infinite;
    will-change: transform;
}

.about-graphic-tag.tag-1 {
    top: 20%;
    left: 10%;
    font-size: 1.5rem;
}

.about-graphic-tag.tag-2 {
    top: 80%;
    left: 30%;
    font-size: 1.2rem;
    animation-delay: -5s;
}

.about-graphic-tag.tag-3 {
    top: 50%;
    right: 15%;
    font-size: 1.8rem;
    animation-delay: -2s;
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

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

    100% {
        transform: translateY(0px);
    }
}

@keyframes pan-grid {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 160px 160px;
    }
}

.works-graphic-pattern {
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background-image: radial-gradient(var(--color-border) 1px, transparent 1px);
    background-size: 25px 25px;
}

.works-graphic-line {
    position: absolute;
    background-color: var(--color-border);
    z-index: 3;
}

.works-graphic-line.line-v {
    top: 0;
    left: 5vw;
    width: 1px;
    height: 100%;
}

.works-graphic-line.line-h {
    top: var(--header-height);
    left: 0;
    width: 100%;
    height: 1px;
}

.contact-graphic-pulse {
    width: 50vmax;
    height: 50vmax;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    animation: pulse 6s ease-in-out infinite;
}

.contact-graphic-blob {
    position: absolute;
    width: 30vw;
    max-width: 400px;
    top: 10%;
    right: 5%;
    color: rgba(59, 130, 246, 0.1);
    z-index: 0;
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0.1;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 0.25;
    }

    100% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0.1;
    }
}

.contact-graphic-corner {
    position: absolute;
    width: 50px;
    height: 50px;
    border-color: var(--color-accent);
    border-style: solid;
    opacity: 0.5;
}

.contact-graphic-corner.top-left {
    top: 0;
    left: 0;
    border-width: 2px 0 0 2px;
}

.contact-graphic-corner.bottom-right {
    bottom: 0;
    right: 0;
    border-width: 0 2px 2px 0;
}

/* --- Make hero blobs and graphics visible and behind content */
.hero-blob,
.hero-graphic,
#hero-grid-container,
.symbol-container {
    opacity: 0.18;
    display: block;
    z-index: 1;
    position: absolute;
    pointer-events: none;
}

/* Ensure main heading and subtext are above graphics */
.hero-section .main-heading,
.hero-section .hero-subtext {
    position: relative;
    z-index: 10;
}

/* ==========================================================================
   8. RESPONSIVE ADJUSTMENTS (ENHANCED)
   ========================================================================== */

/* --- TABLETS & SMALLER (General Adjustments) --- */
@media (max-width: 900px) {
    .main-nav {
        display: none;
        /* Hide desktop nav */
    }

    .mobile-nav-toggle {
        display: block;
        /* Show hamburger menu icon */
        position: relative;
        z-index: 1000;
        width: 30px;
        height: 22px;
        background: transparent;
        border: none;
        cursor: pointer;
    }

    .mobile-nav-toggle span {
        display: block;
        width: 100%;
        height: 2px;
        background-color: var(--color-text-dark);
        position: absolute;
        left: 0;
        transition: transform 0.3s ease, top 0.3s ease, opacity 0.3s ease;
    }

    .main-header.header-is-inverted .mobile-nav-toggle span {
        background-color: var(--color-text-light);
    }

    .mobile-nav-toggle span:nth-child(1) {
        top: 0;
    }

    .mobile-nav-toggle span:nth-child(2) {
        top: 10px;
    }

    .mobile-nav-toggle.is-active span:nth-child(1) {
        top: 10px;
        transform: rotate(45deg);
    }

    .mobile-nav-toggle.is-active span:nth-child(2) {
        top: 10px;
        transform: rotate(-45deg);
    }

    .mobile-nav {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        /* Use vh for full viewport height */
        background-color: var(--color-dark);
        color: var(--color-light);
        z-index: 999;
        transform: translateY(-100%);
        transition: transform 0.5s cubic-bezier(0.8, 0, 0.2, 1);
    }

    .mobile-nav.is-active {
        transform: translateY(0);
    }

    .mobile-nav-link {
        font-family: var(--font-heading);
        font-size: clamp(2rem, 10vw, 3rem);
        opacity: 0;
        transform: translateY(20px);
        transition: opacity 0.4s ease, transform 0.4s ease;
    }

    .mobile-nav.is-active .mobile-nav-link {
        opacity: 1;
        transform: translateY(0);
        transition-delay: 0.3s;
    }

    .mobile-nav-cta {
        margin-top: 2rem;
        font-size: 1.1rem;
        font-weight: 600;
        padding: 0.8rem 2rem;
        border: 1px solid var(--color-light);
        border-radius: 50px;
        opacity: 0;
        transform: translateY(20px);
        transition: opacity 0.4s ease, transform 0.4s ease;
        transition-delay: 0.5s;
    }

    .mobile-nav.is-active .mobile-nav-cta {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- PHONES & SMALL TABLETS (Layout Stacking & Cleanup) --- */
@media (max-width: 768px) {

    /* Disable desktop-only interactive effects */
    body {
        cursor: default;
    }

    .cursor-outline,
    .cursor-dot {
        display: none;
    }

    /* Remove display: none from all other graphics! */

    .section-padding {
        padding: 6rem 5vw;
        /* Adjust padding for smaller screens */
    }

    /* Stack the About section */
    .about-layout {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 5rem;
    }

    .about-text-content {
        order: 2;
    }

    .about-skills-content {
        order: 1;
    }

    /* Simplify the Works section */
    .project-item {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 1rem;
        padding: 2.5rem 1rem;
    }

    .project-title {
        font-size: 2rem;
    }

    .project-number,
    .project-description,
    .project-arrow {
        display: none;
    }

    /* Add this inside your @media (max-width: 768px) block */

    .main-heading {
        /* Reduces font size on mobile to prevent ugly wrapping */
        font-size: clamp(2.2rem, 12vw, 4rem);
    }
}

/* ==========================================================================
   FINAL MOBILE TYPOGRAPHY & WRAPPING FIX
   ========================================================================== */

/* Targets phones and small tablets */
@media (max-width: 768px) {

    .main-heading,
    .contact-title {
        hyphens: auto;
        word-break: normal;
        /* Prevents words from breaking in the middle */
    }

    /* New rule to specifically resize the contact title on mobile/tablets */
    .contact-title {
        font-size: clamp(2.2rem, 9vw, 3.5rem);
    }
}

/* Targets very narrow phone screens */
@media (max-width: 400px) {

    /* Further reduces hero heading size to fit "Developer" on one line */
    .main-heading {
        font-size: clamp(2rem, 11vw, 2.5rem);
        letter-spacing: -0.05em;
        /* Tightens letter spacing slightly */
    }

    /* Reduces contact heading size to prevent words from being cut */
    .contact-title {
        font-size: clamp(2rem, 9vw, 3rem);
    }
}

/* ==========================================================================
   FINAL, PRECISION MOBILE TYPOGRAPHY FIX
   ========================================================================== */

/* This targets all narrow mobile screens (450px and smaller) */
@media (max-width: 450px) {

    /* Reduces hero heading size for the smallest phones */
    .main-heading {
        font-size: clamp(1.8rem, 9vw, 2.6rem);
        letter-spacing: -0.05em;
    }

    /* Reduces about section heading size */
    .about-intro {
        font-size: clamp(1.4rem, 5vw, 1.7rem);
    }

    /* Reduces contact heading size to prevent all wrapping issues */
    .contact-title {
        font-size: clamp(1.7rem, 7vw, 2.8rem);
    }
}

/* ==========================================================================
   ULTIMATE MOBILE TYPOGRAPHY OVERRIDE
   ========================================================================== */

/* This rule applies to all tablet and mobile screens */
@media (max-width: 768px) {

    /* This explicitly forbids the browser from cutting words in the middle */
    .contact-title {
        word-break: keep-all;
    }
}

/* This rule applies only to the absolute smallest phone screens */
@media (max-width: 320px) {
    .contact-title {
        /* A final, even smaller font size to ensure the longest word fits */
        font-size: 1.4rem;
    }
}

/* Add this to your style.css file */

#hero.section-padding {
    padding-top: var(--header-height);
    padding-bottom: 4rem;
}

/* ==========================================================================
   NEW HERO SECTION GRAPHICS & ANIMATIONS (CORRECTED)
   ========================================================================== */

/* THIS NEW RULE IS THE FIX */
.hero-graphic.floating-line-1,
.hero-graphic.floating-line-2,
.hero-graphic.sonar-ping {
    opacity: 1;
    /* This overrides the default invisibility of hero graphics */
}

/* --- New Shape Styles --- */
.hero-graphic.floating-line-1,
.hero-graphic.floating-line-2 {
    width: 200px;
    height: 1px;
    background-color: var(--color-muted);
    opacity: 0.3;
    /* Sets the final visible opacity for the lines */
}

.hero-graphic.floating-line-1 {
    top: 30%;
    left: 20%;
    animation: drift 15s ease-in-out infinite alternate;
}

.hero-graphic.floating-line-2 {
    bottom: 25%;
    right: 20%;
    animation: drift 20s ease-in-out infinite alternate-reverse;
}

.hero-graphic.sonar-ping {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.5);
    /* Accent blue */
    animation: sonar 3s infinite;
}


/* --- New Keyframe Animations --- */
@keyframes drift {
    from {
        transform: translateX(-50px) rotate(-10deg);
    }

    to {
        transform: translateX(50px) rotate(10deg);
    }
}

@keyframes sonar {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
    }

    100% {
        transform: translate(-50%, -50%) scale(10);
        opacity: 0;
        box-shadow: 0 0 0 30px rgba(59, 130, 246, 0);
    }
}

/* --- EXTRA HERO BLOBS & SHAPES --- */
.hero-blob.extra-1 {
    position: absolute;
    width: 40vw;
    max-width: 600px;
    height: 40vw;
    max-height: 600px;
    top: 10%;
    left: 60%;
    background: var(--hero-graphic-color-2);
    border-radius: 55% 45% 60% 40% / 50% 60% 40% 50%;
    opacity: 0.15;
    z-index: 1;
    animation: float-blob-1 18s ease-in-out infinite alternate;
    filter: blur(1px);
    pointer-events: none;
}

.hero-blob.extra-2 {
    position: absolute;
    width: 35vw;
    max-width: 500px;
    height: 35vw;
    max-height: 500px;
    top: 60%;
    left: 5%;
    background: var(--hero-graphic-color-1);
    border-radius: 60% 40% 55% 45% / 45% 55% 60% 40%;
    opacity: 0.18;
    z-index: 1;
    animation: float-blob-2 22s ease-in-out infinite alternate-reverse;
    filter: blur(1.5px);
    pointer-events: none;
}

.hero-blob.extra-3 {
    position: absolute;
    width: 30vw;
    max-width: 400px;
    height: 30vw;
    max-height: 400px;
    top: 35%;
    left: 75%;
    background: var(--hero-graphic-color-3);
    border-radius: 50% 60% 40% 50% / 60% 40% 50% 60%;
    opacity: 0.13;
    z-index: 1;
    animation: float-blob-3 25s ease-in-out infinite alternate;
    filter: blur(2px);
    pointer-events: none;
}

/* Keyframes for floating blobs */
@keyframes float-blob-1 {
    0% {
        transform: translateY(0) scale(1) rotate(0deg);
    }

    50% {
        transform: translateY(-30px) scale(1.05) rotate(8deg);
    }

    100% {
        transform: translateY(0) scale(1) rotate(0deg);
    }
}

@keyframes float-blob-2 {
    0% {
        transform: translateY(0) scale(1) rotate(0deg);
    }

    50% {
        transform: translateY(40px) scale(0.97) rotate(-10deg);
    }

    100% {
        transform: translateY(0) scale(1) rotate(0deg);
    }
}

@keyframes float-blob-3 {
    0% {
        transform: translateY(0) scale(1) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) scale(1.08) rotate(12deg);
    }

    100% {
        transform: translateY(0) scale(1) rotate(0deg);
    }
}

/* Make sure blobs are visible in hero section */
.hero-section {
    position: relative;
    overflow: hidden;
}

/* Responsive: Hide extra blobs on mobile */
@media (max-width: 768px) {

    .hero-blob.extra-1,
    .hero-blob.extra-2,
    .hero-blob.extra-3 {
        display: none;
    }
}

/* --- EXTRA ABSTRACT SHAPES FOR HERO --- */
.hero-graphic.sketch-1 {
    position: absolute;
    top: 25%;
    left: 35%;
    width: 180px;
    height: 180px;
    border: 2px dashed var(--color-accent);
    border-radius: 60% 40% 70% 30% / 50% 60% 40% 50%;
    opacity: 0.13;
    z-index: 1;
    transform: rotate(-12deg);
    pointer-events: none;
}

.hero-graphic.sketch-2 {
    position: absolute;
    top: 65%;
    left: 55%;
    width: 120px;
    height: 120px;
    border: 2px dotted var(--color-muted);
    border-radius: 50% 50% 40% 60% / 60% 40% 50% 50%;
    opacity: 0.15;
    z-index: 1;
    transform: rotate(18deg);
    pointer-events: none;
}

.hero-graphic.sketch-3 {
    position: absolute;
    top: 40%;
    left: 80%;
    width: 90px;
    height: 90px;
    background: repeating-linear-gradient(135deg,
            var(--color-accent) 0 2px,
            transparent 2px 8px);
    border-radius: 40% 60% 50% 50% / 60% 40% 50% 50%;
    opacity: 0.10;
    z-index: 1;
    pointer-events: none;
}

.hero-graphic.sketch-4 {
    position: absolute;
    top: 75%;
    left: 25%;
    width: 140px;
    height: 140px;
    border: 2px solid var(--color-muted);
    border-radius: 50%;
    opacity: 0.12;
    z-index: 1;
    transform: rotate(30deg);
    pointer-events: none;
}

/* ==========================================================================
   9. FINAL TOUCHES & BUG FIXES
   ========================================================================== */

/* --- PREVENT BODY SCROLL ON PRELOADER --- */
#preloader body {
    overflow: hidden;
}

/* --- REMOVE FOCUS OUTLINE FOR AESTHETICS --- */
*:focus {
    outline: none;
}

/* --- SMOOTH SCROLLING FOR SAFARI --- */
html {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* --- FIXED POSITIONING FOR MOBILE SAFETY --- */
@media (max-width: 768px) {
    .main-header {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 999;
    }

    .mobile-nav {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        z-index: 998;
    }

    #preloader {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 10000;
    }
}

/* --- TEMPORARY DEBUGGING STYLES --- */
/* Remove these in the final version */
/* body {
    background-color: rgba(255, 0, 0, 0.1);
} */

/* ==========================================================================
   10. MOBILE & TABLET OPTIMIZATIONS (PROJECTS)
   ========================================================================== */

@media (max-width: 1024px) {
    .projects-grid {
        gap: 2rem;
        padding: 0 3vw;
    }

    .card-title {
        font-size: 1.6rem;
    }
}

@media (max-width: 768px) {
    .projects-grid {
        display: flex;
        flex-direction: column;
        width: 100%;
        padding: 0 1.5rem;
        gap: 2rem;
        box-sizing: border-box;
    }

    .project-card {
        width: 100%;
        max-width: 100%;
        border-radius: 16px;
        /* Slightly easier on eyes than 12 */
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.06);
    }

    .card-image-wrapper {
        height: auto;
        padding-top: 56.25%;
        /* 16:9 Aspect Ratio */
        width: 100%;
    }

    .card-image {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }

    .card-content {
        padding: 1.5rem;
    }

    .card-title {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }

    .card-description {
        font-size: 0.95rem;
        margin-bottom: 1rem;
        -webkit-line-clamp: 4;
        line-clamp: 4;
        /* Standard property */
    }

    /* Disable hover effects that stick on mobile */
    .project-card:hover {
        transform: none;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.06);
    }
}

/* ==========================================================================
   END OF STYLES
   ========================================================================== */