html {
    scroll-behavior: smooth;
}

/* Hide default scrollbar for desktop to allow for custom side-nav indicator */
@media (min-width: 769px) {
    html::-webkit-scrollbar {
        display: none;
    }

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

    body::-webkit-scrollbar {
        display: none;
    }

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

body.is-scrolling {
    user-select: none;
    -webkit-user-select: none;
    cursor: ns-resize;
}

:root {
    --bg-black: #000000;
    --accent-red: #8b0000;
    --text-white: #FFFFFF;
    --text-gray: #888888;
    --border-color: rgba(255, 255, 255, 0.12);
    --font-heading: 'Anton', sans-serif;
    --font-body: 'Inter', sans-serif;
}

body.light-mode {
    --bg-black: #f4f4f4;
    --text-white: #111111;
    --text-gray: #555555;
    --border-color: rgba(0, 0, 0, 0.12);
}

/* Split Loader Styles */
.split-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-black);
    display: flex;
    z-index: 10000;
    padding: 0 8vw;
    align-items: center;
    justify-content: space-between;

    /* 3D Vault Door Transition */
    transform-origin: left center;
    transform: perspective(2500px) rotateY(0deg);
    transition: transform 1.8s cubic-bezier(0.77, 0, 0.175, 1), opacity 1.2s ease-in 0.4s;
    pointer-events: all;
    backface-visibility: hidden;
}

body.light-mode .split-loader {
    background-color: #f4f4f4;
}

body.loaded .split-loader {
    transform: perspective(2500px) rotateY(-100deg) scale(0.8);
    opacity: 0;
    pointer-events: none;
}

/* 3D Main Page Entrance - Matches Loader Theme */
.top-bar,
.hero-section,
.floating-nav-container {
    opacity: 0;
    transform: perspective(2500px) rotateY(10deg) translateZ(-100px) scale(0.95);
    transition: transform 1.8s cubic-bezier(0.77, 0, 0.175, 1) 0.4s, opacity 1.5s ease 0.4s;
    transform-origin: right center;
}

body.loaded .top-bar,
body.loaded .hero-section,
body.loaded .floating-nav-container {
    opacity: 1;
    transform: perspective(2500px) rotateY(0deg) translateZ(0) scale(1);
}

.top-bar-left,
.top-bar-right>* {
    opacity: 0;
    transform: translateY(-20px);
    transition: transform 0.8s cubic-bezier(0.77, 0, 0.175, 1), opacity 0.8s ease;
}

body.loaded .top-bar-left,
body.loaded .top-bar-right>* {
    opacity: 1;
    transform: translateY(0);
}

body.loaded .top-bar-left {
    transition-delay: 0.8s;
}

body.loaded .top-bar-right>*:nth-child(1) {
    transition-delay: 0.9s;
}

body.loaded .top-bar-right>*:nth-child(2) {
    transition-delay: 1.0s;
}

body.loaded .top-bar-right>*:nth-child(3) {
    transition-delay: 1.1s;
}

.hero-name {
    opacity: 0;
    clip-path: polygon(0 100%, 100% 100%, 100% 100%, 0% 100%);
    transform: translateY(40px);
    letter-spacing: -2px;
    transition:
        transform 1.2s cubic-bezier(0.77, 0, 0.175, 1),
        opacity 1.2s ease,
        clip-path 1.2s cubic-bezier(0.77, 0, 0.175, 1),
        letter-spacing 1.5s cubic-bezier(0.25, 1, 0.5, 1);
}

body.loaded .hero-name {
    opacity: 1;
    clip-path: polygon(0 0%, 100% 0%, 100% 100%, 0% 100%);
    transform: translateY(0);
    letter-spacing: 0px;
    transition-delay: 0.8s;
}

.hero-sub {
    opacity: 0;
    transform: translateX(-30px);
    transition: transform 1.2s cubic-bezier(0.77, 0, 0.175, 1) 1s, opacity 1.2s ease 1s;
}

body.loaded .hero-sub {
    opacity: 1;
    transform: translateX(0);
}

/* Subtitle Kinetic Word Animation - Multiline Layout */
.hero-sub {
    font-family: 'Jockey One', sans-serif;
    font-size: clamp(0.7rem, 1.2vw, 0.9rem);
    color: rgba(255, 255, 255, 0.45);
    letter-spacing: 2px;
    line-height: 1.4;
    text-transform: uppercase;
    font-weight: 400;
    margin-top: 25px;
    display: flex;
    flex-direction: column;
}

body.light-mode .hero-sub {
    color: rgba(0, 0, 0, 0.5);
}

.sub-item {
    display: inline-block;
    opacity: 0;
    transform: translateY(10px);
    transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.8s ease;
}

body.loaded .sub-item {
    opacity: 1;
    transform: translateY(0);
}

.sub-bullet {
    color: #ffffff;
    margin-right: 12px;
}

body.light-mode .sub-bullet {
    color: var(--accent-red);
}

body.loaded .sub-item:nth-child(1) {
    transition-delay: 1.0s;
}

body.loaded .sub-item:nth-child(2) {
    transition-delay: 1.1s;
}

body.loaded .sub-item:nth-child(3) {
    transition-delay: 1.2s;
}

body.loaded .sub-item:nth-child(4) {
    transition-delay: 1.3s;
}

/* Hero Socials Section */
.hero-socials {
    display: flex;
    gap: 15px;
    margin-top: 25px;
    padding: 10px 10px 30px 0;
    /* Padding to prevent the shadow from being cropped by clip-path */
    pointer-events: auto;
    /* ensure it stays clickable */
    position: relative;
    z-index: 10;
    /* stay above hero image wrapper */
    opacity: 0;
    transform: translateY(10px);
    transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1) 1.5s, opacity 0.8s ease 1.5s;
}

body.loaded .hero-socials {
    opacity: 1;
    transform: translateY(0);
}

.social-circle {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-white);
    font-size: 1.2rem;
    transition: all 0.4s ease;
    text-decoration: none;
    position: relative;
}

body.light-mode .social-circle {
    color: var(--text-white);
    background: var(--bg-black);
}

.social-circle svg {
    width: 20px;
    height: 20px;
}

.social-circle:hover {
    color: var(--text-white);
    border-color: var(--text-white);
    box-shadow: 0 0 28px rgba(255, 255, 255, 0.9);
}

body.light-mode .social-circle:hover {
    color: var(--accent-red);
    border-color: var(--accent-red);
    box-shadow: 0 0 28px rgba(139, 0, 0, 1);
    background: transparent;
}

/* Removed duplicate hero-image-wrapper definition */

.moody-portrait {
    transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.hero-image-wrapper:hover .moody-portrait {
    transform: scale(1.05);
}

.red-period {
    opacity: 0;
    transform: scale(0);
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) 1.2s, opacity 0.6s ease;
}

body.loaded .red-period {
    opacity: 1;
    transform: scale(1);
}

.split-loader-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4rem;
    z-index: 2;
}

.split-text-wrap {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.split-name {
    font-family: 'Aubrey', cursive;
    font-size: clamp(4rem, 8vw, 7.5rem);
    color: var(--text-white);
    letter-spacing: 4px;
    margin: 0;
    line-height: 0.9;
    clip-path: polygon(0 100%, 100% 100%, 100% 100%, 0% 100%);
    animation:
        splitTextReveal 1.2s cubic-bezier(0.22, 1, 0.36, 1) 0.2s forwards,
        nameBreathe 4s ease-in-out infinite alternate 1.4s;
}

.split-role {
    font-family: var(--font-body);
    font-size: clamp(0.75rem, 1.5vw, 0.95rem);
    color: var(--text-gray);
    letter-spacing: 5px;
    text-transform: uppercase;
    font-weight: 600;
    margin: 0;
    opacity: 0;
    transform: translateX(-20px);
    animation:
        splitFadeRight 1s cubic-bezier(0.22, 1, 0.36, 1) 0.6s forwards,
        roleGlitch 3s steps(1) infinite 1.6s;
}

@keyframes nameBreathe {
    0% {
        letter-spacing: 4px;
        text-shadow: 0 0 0 transparent;
    }

    50% {
        letter-spacing: 12px;
        text-shadow: 0 0 20px rgba(139, 0, 0, 0.5);
    }

    100% {
        letter-spacing: 4px;
        text-shadow: 0 0 0 transparent;
    }
}

@keyframes roleGlitch {

    0%,
    92%,
    96%,
    100% {
        opacity: 1;
        transform: translateX(0);
        filter: blur(0);
        text-shadow: none;
    }

    94% {
        opacity: 0.8;
        transform: translateX(2px);
        filter: blur(1px);
        text-shadow: 3px 0 var(--accent-red), -3px 0 rgba(255, 255, 255, 0.5);
    }
}

.split-status-area {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
    max-width: 500px;
    opacity: 0;
    animation: splitFadeUp 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.8s forwards;
}

.split-percent-wrap {
    font-family: var(--font-heading);
    color: var(--accent-red);
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.loading-percent {
    font-size: 5rem;
    line-height: 1;
}

.percent-symbol {
    font-size: 2.5rem;
    color: var(--text-gray);
    opacity: 0.5;
}

/* Voice Assistant Wave Loader */
.voice-wave-loader {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    height: 50px;
    margin-top: 0.5rem;
}

.wave-bar {
    width: 6px;
    height: 12px;
    background-color: var(--accent-red);
    border-radius: 6px;
    animation: googleWave 1.8s ease-in-out infinite;
}

.wave-bar:nth-child(1) {
    animation-delay: 0.0s;
    opacity: 0.1;
}

.wave-bar:nth-child(2) {
    animation-delay: 0.1s;
    opacity: 0.2;
}

.wave-bar:nth-child(3) {
    animation-delay: 0.2s;
    opacity: 0.3;
}

.wave-bar:nth-child(4) {
    animation-delay: 0.3s;
    opacity: 0.4;
}

.wave-bar:nth-child(5) {
    animation-delay: 0.4s;
    opacity: 0.5;
}

.wave-bar:nth-child(6) {
    animation-delay: 0.5s;
    opacity: 0.7;
}

.wave-bar:nth-child(7) {
    animation-delay: 0.6s;
    opacity: 0.8;
}

.wave-bar:nth-child(8) {
    animation-delay: 0.7s;
    opacity: 0.9;
}

.wave-bar:nth-child(9) {
    animation-delay: 0.8s;
    opacity: 1;
}

.wave-bar:nth-child(10) {
    animation-delay: 0.9s;
    opacity: 0.9;
}

.wave-bar:nth-child(11) {
    animation-delay: 1.0s;
    opacity: 0.8;
}

.wave-bar:nth-child(12) {
    animation-delay: 1.1s;
    opacity: 0.7;
}

.wave-bar:nth-child(13) {
    animation-delay: 1.2s;
    opacity: 0.6;
}

.wave-bar:nth-child(14) {
    animation-delay: 1.3s;
    opacity: 0.5;
}

.wave-bar:nth-child(15) {
    animation-delay: 1.4s;
    opacity: 0.6;
}

.wave-bar:nth-child(16) {
    animation-delay: 1.5s;
    opacity: 0.7;
}

.wave-bar:nth-child(17) {
    animation-delay: 1.6s;
    opacity: 0.6;
}

.wave-bar:nth-child(18) {
    animation-delay: 1.7s;
    opacity: 0.5;
}

.wave-bar:nth-child(19) {
    animation-delay: 1.8s;
    opacity: 0.4;
}

.wave-bar:nth-child(20) {
    animation-delay: 1.9s;
    opacity: 0.3;
}

.wave-bar:nth-child(21) {
    animation-delay: 2.0s;
    opacity: 0.2;
}

body.light-mode .wave-bar {
    animation-name: googleWaveLight;
}

.split-loader-right {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    height: 100%;
    position: relative;
}

.split-cutout-wrap {
    position: relative;
    width: clamp(300px, 45vw, 550px);
    /* Balanced size */
    aspect-ratio: 1;
    border-radius: 70% 30% 30% 70% / 60% 40% 60% 40%;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transform: translateY(60px) scale(0.95);
    animation:
        slideUpReveal 1.5s cubic-bezier(0.22, 1, 0.36, 1) 0.4s forwards,
        blobMorph 4s ease-in-out infinite;
    border: 2px solid rgba(255, 255, 255, 0.05);
}

@keyframes blobMorph {
    0% {
        border-radius: 70% 30% 30% 70% / 60% 40% 60% 40%;
    }

    25% {
        border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    }

    50% {
        border-radius: 50% 50% 20% 80% / 25% 80% 20% 75%;
    }

    75% {
        border-radius: 20% 80% 60% 40% / 70% 40% 60% 30%;
    }

    100% {
        border-radius: 70% 30% 30% 70% / 60% 40% 60% 40%;
    }
}

body.light-mode .split-cutout-wrap {
    border: 1.5px solid rgba(0, 0, 0, 0.8);
}

.cutout-backdrop {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 80%;
    background: var(--accent-red);
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.3;
    z-index: -1;
}

body.light-mode .cutout-backdrop {
    opacity: 0.15;
}

.split-cutout {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    filter: grayscale(100%) contrast(1.1);
    transform: scale(1.3);
    animation: panImageUp 3s ease-out forwards;
}

@keyframes splitTextReveal {
    0% {
        opacity: 0;
        clip-path: polygon(0 100%, 100% 100%, 100% 100%, 0% 100%);
        transform: translateY(40px);
    }

    100% {
        opacity: 1;
        clip-path: polygon(0 0%, 100% 0%, 100% 100%, 0% 100%);
        transform: translateY(0);
    }
}

@keyframes splitFadeRight {
    0% {
        opacity: 0;
        transform: translateX(-20px);
    }

    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes splitFadeUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUpReveal {
    0% {
        opacity: 0;
        transform: translateY(60px) scale(0.95);
        filter: blur(10px);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

@keyframes panImageUp {
    0% {
        object-position: center 60%;
    }

    100% {
        object-position: center 10%;
    }
}

@keyframes googleWave {

    0%,
    100% {
        height: 12px;
    }

    50% {
        height: 45px;
        background-color: var(--text-white);
    }
}

@keyframes googleWaveLight {

    0%,
    100% {
        height: 12px;
    }

    50% {
        height: 45px;
        background-color: var(--bg-black);
    }
}

/* Fallback for smaller screens */
@media (max-width: 900px) {
    .split-loader {
        flex-direction: column;
        justify-content: center;
        padding: 6vw;
        padding-top: 15vh;
        text-align: center;
    }

    .split-loader-left {
        align-items: center;
        height: max-content;
        gap: 3rem;
    }

    .split-status-area {
        align-items: center;
    }

    .split-role {
        transform: translateY(10px);
        animation-name: splitFadeUp;
    }

    .cad-loader-track {
        max-width: 300px;
    }

    .split-loader-right {
        display: none;
    }
}

/* Page Reveal Scale Effect */
#about,
.top-bar {
    transition: transform 1.2s cubic-bezier(0.19, 1, 0.22, 1), opacity 1.2s ease;
    transform: scale(0.95);
    opacity: 0;
}

.floating-nav {
    transition: transform 1.2s cubic-bezier(0.19, 1, 0.22, 1), opacity 1.2s ease;
    transform: scale(0.95);
    opacity: 0;
}

body.loaded #about,
body.loaded .top-bar {
    transform: scale(1);
    opacity: 1;
}

body.loaded .floating-nav {
    transform: scale(1);
    opacity: 1;
}

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

html,
body {
    overflow-x: hidden;
}

/* ===================================================
   UNSEEN METAMORPHIC VIEW TRANSITIONS API
   =================================================== */
::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: 1.1s;
    animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
    mix-blend-mode: normal;
}

::view-transition-new(root) {
    z-index: 100;
    animation-name: custom-spatial-burst;
}

::view-transition-old(root) {
    z-index: 1;
    animation: none;
}

@keyframes custom-spatial-burst {
    0% {
        clip-path: circle(0px at var(--vt-x, 50%) var(--vt-y, 50%));
        filter: blur(20px) contrast(2);
    }

    70% {
        filter: blur(0px) contrast(1);
    }

    100% {
        clip-path: circle(var(--vt-radius, 150vw) at var(--vt-x, 50%) var(--vt-y, 50%));
        filter: blur(0px) contrast(1);
    }
}

/* Theme Toggle Global Transition Tool */
.theme-transition,
.theme-transition *,
.theme-transition *::before,
.theme-transition *::after {
    transition: background-color 0.6s ease, color 0.6s ease, border-color 0.6s ease, background 0.6s ease, box-shadow 0.6s ease, fill 0.6s ease, stroke 0.6s ease, filter 0.6s ease !important;
}

body.editorial-noir {
    background-color: var(--bg-black);
    color: var(--text-white);
    font-family: var(--font-body);
    overflow-x: hidden;
    line-height: 1.5;
    /* transition: background-color 0.5s ease, color 0.5s ease; removed in favor of global theme-transition handler */
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

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

/* Typography Base */
h1,
h2,
h3,
h4,
.massive-quote,
.footer-headline {
    font-family: var(--font-heading);
    text-transform: uppercase;
    line-height: 1;
}

.label-text {
    font-size: 0.8rem;
    color: var(--text-gray);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1px;
}

.top-red-square {
    display: inline-block;
    width: 6px;
    height: 6px;
    background-color: var(--accent-red);
    margin-left: 6px;
}

.section-title {
    font-family: 'Original Surfer', cursive;
    font-size: clamp(2rem, 5vw, 4rem);
    margin-bottom: 3rem;
    color: var(--text-white);
}

/* Header / Top Nav */
.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 4vw;
    z-index: 100;
    mix-blend-mode: difference;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.status-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: #00FF00;
    border-radius: 50%;
    animation: pulse 1.5s infinite alternate;
}

@keyframes pulse {
    from {
        opacity: 0.3;
    }

    to {
        opacity: 1;
        box-shadow: 0 0 8px #00ff00;
    }
}

.time-tracker {
    font-family: monospace;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-white);
}

/* Theme Toggle Button */
.theme-toggle {
    background: transparent;
    border: none;
    color: var(--text-white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    opacity: 0.6;
    position: relative;
    z-index: 10;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.theme-toggle:hover {
    opacity: 1;
    transform: scale(1.1);
}

.theme-toggle svg {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    /* Let the button catch the click */
    transition: transform 0.5s ease, opacity 0.5s ease;
}

.theme-toggle .sun-icon {
    opacity: 0;
    transform: rotate(-90deg) scale(0);
}

body.light-mode .theme-toggle .sun-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

body.light-mode .theme-toggle .moon-icon {
    opacity: 0;
    transform: rotate(90deg) scale(0);
}

/* Refined Double-Border Geometric Structure (Right Concentrated) */
.hero-bg-shapes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    opacity: 0;
    transition: opacity 2.5s cubic-bezier(0.19, 1, 0.22, 1) 0.5s;
}

body.loaded .hero-bg-shapes {
    opacity: 1;
}

.shape {
    position: absolute;
    aspect-ratio: 1;
    transform: rotate(45deg);
    background: linear-gradient(135deg, rgba(35, 35, 35, 0.5) 0%, rgba(8, 8, 8, 0.2) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: -25px 25px 70px rgba(0, 0, 0, 0.95);
    transition: transform 1.5s cubic-bezier(0.19, 1, 0.22, 1);
}

.shape::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    bottom: 8px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    pointer-events: none;
}

.shape-1 {
    width: 30%;
    height: 110%;
    top: -40%;
    right: -8%;
    opacity: 0.9;
    z-index: 0;
}

.shape-2 {
    width: 47%;
    height: 120%;
    top: 40%;
    right: -3%;
    opacity: 0.85;
    z-index: 2;
}

.shape-3 {
    width: 30%;
    bottom: 35%;
    right: 32%;
    opacity: 0.7;
    z-index: 1;
}

.shape-4 {
    width: 40%;
    height: 130%;
    top: 41%;
    right: 32%;
    opacity: 0.55;
    z-index: 0;
}

.shape-5 {
    width: 20%;
    height: 40%;
    top: 54%;
    left: 23%;
    opacity: 0.25;
    z-index: 1;
}

.shape-6 {
    width: 30%;
    bottom: -30%;
    right: -12%;
    opacity: 0.85;
    z-index: 1;
}

.hero-section {
    min-height: 105vh;
    padding: 0 4vw 10vh;
    position: relative;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero-image-wrapper {
    position: absolute;
    right: -8vw;
    /* Moved further to the right */
    top: 12vh;
    width: 65vw;
    max-width: 1100px;
    z-index: 1;
    overflow: hidden;
    /* For bottom crop */
    max-height: 92vh;
    /* Controlled height for crop feel */
    display: flex;
    align-items: flex-start;
    /* Ensure top stays flush */
    opacity: 0;
    clip-path: polygon(50% 0%, 50% 0%, 50% 100%, 50% 100%);
    transform: perspective(2500px) scale(1.3);
    filter: brightness(5) blur(30px) contrast(3);
}

body.loaded .hero-image-wrapper {
    animation: phantomMaterialize 3s cubic-bezier(0.22, 1, 0.36, 1) 1s forwards;
}

/* Phantom Materialization — Dimensional slit → light leak → ghost flash → settle */
@keyframes phantomMaterialize {
    0% {
        opacity: 0;
        clip-path: polygon(50% 0%, 50% 0%, 50% 100%, 50% 100%);
        transform: perspective(2500px) scale(1.3);
        filter: brightness(5) blur(30px) contrast(3);
    }

    /* Slit widens into a skewed parallelogram with 3D rotation */
    15% {
        clip-path: polygon(35% 0%, 65% 0%, 68% 100%, 32% 100%);
        transform: perspective(2500px) rotateY(8deg) rotateZ(-0.5deg) scale(1.2) translateX(-20px);
        filter: brightness(2) blur(8px) contrast(1.8);
    }

    /* Full reveal */
    30% {
        clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%);
        transform: perspective(2500px) rotateY(2deg) scale(1.04);
        filter: brightness(1.3) blur(0px) contrast(1.3);
    }

    /* Micro-wobble overshoot */
    70% {
        transform: perspective(2500px) rotateY(1deg) scale(0.995);
        filter: brightness(1) blur(0px) contrast(1);
    }

    /* Final settle */
    100% {
        opacity: 1;
        clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%);
        transform: perspective(2500px) rotateY(0deg) translateX(0) scale(1);
        filter: blur(0) grayscale(0);
    }
}

.moody-portrait {
    width: 100%;
    height: auto;
    max-height: 95vh;
    object-fit: contain;
    filter: grayscale(100%) contrast(1.1) brightness(0.7);
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.6s ease;
}

body.light-mode .moody-portrait {
    filter: grayscale(100%) contrast(1.1) brightness(1.0);
}

.hero-image-wrapper:hover .moody-portrait {
    transform: scale(1.08);
}

.hero-text-wrapper {
    position: relative;
    z-index: 2;
    margin-top: 15vh;
    padding-left: 4vw;
}

.hero-name {
    font-family: 'Tac One', sans-serif;
    font-size: clamp(7rem, 20vw, 15rem);
    color: var(--text-white);
    display: flex;
    align-items: baseline;
    margin-left: 0;
    line-height: 1.10;
    overflow: visible;
}

.red-period {
    display: inline-block;
    width: clamp(0.8rem, 2.5vw, 2.2rem);
    height: clamp(0.8rem, 2.5vw, 2.2rem);
    background-color: var(--accent-red);
    margin-left: 0.5vw;
}

.hero-sub {
    font-size: clamp(1rem, 2vw, 1.5rem);
    font-weight: 600;
    letter-spacing: 2px;
    max-width: 400px;
    margin-top: 0.25rem;
}

/* Expertise Section */
.expertise-section {
    padding: 8rem 4vw;
    position: relative;
    padding-bottom: 4rem;
}

.expertise-section .section-title {
    text-align: right;
}

.line-under-text {
    display: inline-block;
    border-bottom: 2px solid var(--text-white);
    padding-bottom: 0.5rem;
}

.expertise-list {
    display: flex;
    flex-direction: column;
}

/* Each expertise row */
.exp-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    cursor: default;
    transition: padding-left 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.expertise-list .exp-row:first-child {
    border-top: 1px solid var(--border-color);
}

/* Red gradient fill from left */
.exp-row::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #000000 0%, #8b0000 20%, #8b0000 40%, #000000 100%);
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 0;
}

.exp-row:hover::before,
.exp-row.active-scroll::before {
    transform: translateX(100%);
}

/* Left side: index + title */
.exp-left {
    display: flex;
    align-items: baseline;
    gap: 1.5rem;
    width: 45%;
    position: relative;
    z-index: 1;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.exp-row:hover .exp-left,
.exp-row.active-scroll .exp-left {
    transform: translateY(-4px);
}

.exp-index {
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.25);
    letter-spacing: 1px;
    transition: color 0.4s ease;
    min-width: 2ch;
}

.exp-row:hover .exp-index,
.exp-row.active-scroll .exp-index {
    color: rgba(255, 255, 255, 0.6);
}

.exp-title {
    font-family: var(--font-heading);
    font-size: clamp(1.8rem, 3.5vw, 3.2rem);
    color: rgba(255, 255, 255, 0.35);
    text-transform: uppercase;
    line-height: 1.1;
    transition: color 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.exp-row:hover .exp-title,
.exp-row.active-scroll .exp-title {
    color: #ffffff;
}

/* Right side: description */
.exp-right {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 50%;
    position: relative;
    z-index: 1;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.exp-row:hover .exp-right,
.exp-row.active-scroll .exp-right {
    transform: translateY(-4px);
}

.exp-desc {
    font-size: 1.1rem;
    color: var(--text-gray);
    font-weight: 400;
    line-height: 1.6;
    text-align: left;
    transition: color 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.exp-row:hover .exp-desc,
.exp-row.active-scroll .exp-desc {
    color: #ffffff;
}

/* Responsive */
@media (max-width: 768px) {
    .exp-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding: 2.5rem 1rem;
    }

    .exp-left,
    .exp-right {
        width: 100%;
    }
}



/* Project Grid */
.projects-section {
    padding: 5rem 4vw 4rem;
}

.projects-section .section-title {
    text-align: left;
    text-decoration: underline;
    text-underline-offset: 0.5rem;
    text-decoration-thickness: 3px;
    margin-bottom: 4rem;
}

.forge-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    align-items: start;
}

@media (min-width: 769px) {
    .forge-grid {
        padding-bottom: 6rem;
    }

    .forge-item:nth-child(even) {
        transform: translateY(6rem);
    }
}

.forge-item {
    position: relative;
    cursor: pointer;
}

.forge-item.text-card {
    background-color: #161616;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem;
    min-height: 350px;
}

.forge-text-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    height: 100%;
}

.forge-title-large {
    font-size: clamp(1.8rem, 3vw, 2.8rem);
    font-family: var(--font-body);
    font-weight: 800;
    color: var(--text-white);
    line-height: 1.2;
    margin-top: auto;
    margin-bottom: auto;
}

.view-pill-static {
    background: var(--text-white);
    color: var(--bg-black);
    padding: 0.8rem 2.5rem;
    border-radius: 50px;
    font-weight: 800;
    font-size: 0.9rem;
    align-self: flex-end;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.forge-item.text-card:hover .view-pill-static {
    transform: scale(1.05);
}

.forge-item.img-card {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.forge-img-wrap {
    width: 100%;
    background: #b5b5b5;
    aspect-ratio: 4/3;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Pattern: light, dark, dark, light (1-2-2-1) */
.forge-item:nth-child(4n+1) .forge-img-wrap {
    background: #b5b5b5;
}

.forge-item:nth-child(4n+2) .forge-img-wrap {
    background: #3a3a3a;
}

.forge-item:nth-child(4n+3) .forge-img-wrap {
    background: #3a3a3a;
}

.forge-item:nth-child(4n) .forge-img-wrap {
    background: #b5b5b5;
}

.clean-img {
    width: 90%;
    height: 90%;
    object-fit: contain;
    filter: grayscale(100%);
    transition: transform 0.6s ease;
}

.forge-item.img-card:hover .clean-img,
.forge-item.img-card.active-scroll .clean-img {
    transform: scale(1.05);
}

.forge-caption {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.forge-title-row {
    display: flex;
    align-items: baseline;
    gap: 1rem;
}

.forge-name {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: var(--text-white);
    text-transform: uppercase;
}

.forge-meta-year {
    font-size: 1rem;
    color: var(--text-gray);
    font-weight: 600;
}

.forge-cat {
    font-size: 0.9rem;
    color: var(--text-gray);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Scatter effect */
.scatter-gallery {
    position: fixed;
    top: 0;
    left: 0;
    width: 2px;
    height: 2px;
    pointer-events: none;
    z-index: 9999;
}

.scatter-img {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 280px;
    height: 160px;
    margin-left: -140px;
    margin-top: -80px;
    object-fit: cover;
    background: #111;
    border-radius: 6px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.9);
    opacity: 0;
    /* Slower exiting transition */
    transition: all 1s cubic-bezier(0.25, 1, 0.5, 1);
    transform: scale(0.2) translate(0, 0) rotate(0deg);
}

/* Snappy entering transition */
.scatter-gallery.active .scatter-img {
    transition: all 0.6s cubic-bezier(0.25, 0.9, 0.4, 1.15);
}

.scatter-gallery.active .s-img-1 {
    opacity: 1;
    transform: scale(1) translate(var(--tx-1, -150px), var(--ty-1, -100px)) rotate(var(--r-1, -16deg));
    z-index: 1;
}

.scatter-gallery.active .s-img-2 {
    opacity: 1;
    transform: scale(1) translate(var(--tx-2, 160px), var(--ty-2, -40px)) rotate(var(--r-2, 14deg));
    z-index: 2;
}

.scatter-gallery.active .s-img-3 {
    opacity: 1;
    transform: scale(1) translate(var(--tx-3, -40px), var(--ty-3, 130px)) rotate(var(--r-3, -8deg));
    z-index: 3;
}

/* Achievements Section */
.achievements-section {
    padding: 6rem 4vw;
}

.achievements-section .section-title {
    text-align: right;
    text-decoration: underline;
    text-underline-offset: 0.5rem;
    text-decoration-thickness: 3px;
    margin-bottom: 4rem;
}

.achievements-list {
    display: flex;
    flex-direction: column;
}

/* Each achievement row */
.achv-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2.8rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    cursor: default;
    transition: padding-left 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.achievements-list .achv-row:first-child {
    border-top: 1px solid var(--border-color);
}

/* Red gradient fill from left */
.achv-row::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #000000 0%, #8b0000 20%, #8b0000 40%, #000000 100%);
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 0;
}

.achv-row:hover::before,
.achv-row.active-scroll::before {
    transform: translateX(100%);
}

/* Left side: index + title */
.achv-left {
    display: flex;
    align-items: baseline;
    gap: 1.5rem;
    width: 55%;
    position: relative;
    z-index: 1;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.achv-row:hover .achv-left,
.achv-row.active-scroll .achv-left {
    transform: translateY(-4px);
}

.achv-index {
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.25);
    letter-spacing: 1px;
    transition: color 0.4s ease;
    min-width: 2ch;
}

.achv-row:hover .achv-index,
.achv-row.active-scroll .achv-index {
    color: rgba(255, 255, 255, 0.6);
}

.achv-title {
    font-family: var(--font-heading);
    font-size: clamp(1.8rem, 3.5vw, 3.2rem);
    color: rgba(255, 255, 255, 0.35);
    text-transform: uppercase;
    line-height: 1;
    transition: color 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.achv-row:hover .achv-title,
.achv-row.active-scroll .achv-title {
    color: #ffffff;
}

/* Right side: award + year */
.achv-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.4rem;
    width: 40%;
    position: relative;
    z-index: 1;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.achv-row:hover .achv-right,
.achv-row.active-scroll .achv-right {
    transform: translateY(-4px);
}

.achv-award {
    font-family: var(--font-body);
    font-size: clamp(0.85rem, 1.2vw, 1.05rem);
    font-weight: 600;
    color: rgba(255, 255, 255, 0.3);
    text-align: right;
    letter-spacing: 0.5px;
    transition: color 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.achv-row:hover .achv-award,
.achv-row.active-scroll .achv-award {
    color: #ffffff;
}

.achv-year {
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.18);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    transition: color 0.4s ease;
}

.achv-row:hover .achv-year,
.achv-row.active-scroll .achv-year {
    color: rgba(255, 255, 255, 0.7);
}

/* Responsive */
@media (max-width: 768px) {
    .achv-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding: 2rem 1rem;
    }

    .achv-left,
    .achv-right {
        width: 100%;
    }

    .achv-right {
        align-items: flex-start;
    }
}

/* Tech Stack Banner */
.tech-stack-bar {
    width: 100%;
    overflow: hidden;
    padding: 3rem 0;
    background: var(--bg-black);
    border-top: 1px solid var(--text-white);
    border-bottom: 1px solid var(--text-white);
}

.marquee-content {
    display: flex;
    gap: 5rem;
    width: max-content;
    animation: scrollStack 40s linear infinite;
}

.tech-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-family: var(--font-heading);
    font-size: 4rem;
    color: var(--text-gray);
    /* Monochrome */
}

@keyframes scrollStack {
    to {
        transform: translateX(calc(-50% - 2.5rem));
    }
}

/* Testimonials */
.testimonials-section {
    padding: 8rem 4vw;
    background-color: var(--bg-black);
}

.slider-container {
    display: flex;
    gap: 2rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    padding-bottom: 2rem;
}

.slider-container::-webkit-scrollbar {
    display: none;
}

.testimonial-card {
    min-width: 80vw;
    max-width: 800px;
    background-color: var(--accent-red);
    padding: 4rem;
    scroll-snap-align: center;
    position: relative;
    border: 2px solid transparent;
}

.massive-quote {
    position: absolute;
    top: 2rem;
    left: 2rem;
    font-size: 8rem;
    color: var(--text-white);
    line-height: 0.5;
}

.t-text {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 4vw, 3rem);
    color: var(--text-white);
    margin: 4rem 0 3rem;
    position: relative;
    z-index: 2;
}

.t-author {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.t-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--text-white);
    background-image: url('assets/avatar2.png');
    background-size: cover;
    background-position: center;
    filter: grayscale(100%);
}

.t-name {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-white);
    text-transform: uppercase;
}

/* About Me Section */
.about-me-section {
    padding: 8rem 4vw;
    background-color: var(--bg-black);
    position: relative;
    perspective: 1000px;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.8s ease;
}

/* Base state for scroll animation */
.about-grid.hidden-3d {
    opacity: 0;
    transform: translateY(80px) rotateX(25deg) scale(0.9);
}

.about-grid.visible-3d {
    opacity: 1;
    transform: translateY(0) rotateX(0deg) scale(1);
}

.about-img-wrap {
    width: 75%;
    /* Increased image size */
    margin: 0 auto;
    aspect-ratio: 4/5;
    background-color: transparent;
    /* Removed gray background */
    overflow: hidden;
    position: relative;
    /* Removed border-radius and box-shadow */
}

.about-portrait {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%) contrast(1.2);
    transition: transform 0.6s ease, filter 0.6s ease;
}

.about-img-wrap:hover .about-portrait {
    transform: scale(1.05);
    filter: grayscale(0%) contrast(1.1);
}

.about-headline {
    font-family: var(--font-heading);
    font-size: clamp(3rem, 6vw, 5.5rem);
    color: var(--text-white);
    line-height: 0.9;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    transition: color 0.4s ease;
    cursor: default;
    text-align: left;
}

.about-headline:last-of-type {
    margin-bottom: 2.5rem;
}

.about-headline:hover {
    color: #8b0000;
}

.about-desc {
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--text-gray);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.about-desc p {
    max-width: 90%;
}

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

@media (max-width: 768px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .about-desc p {
        max-width: 100%;
    }
}

/* Footer Section */
.massive-footer {
    padding: 8rem 4vw 4rem;
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
}

.footer-headline {
    font-size: clamp(4rem, 12vw, 15rem);
    color: var(--text-white);
    max-width: 90%;
    word-break: break-word;
    margin-bottom: 4rem;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 2rem;
    align-items: flex-end;
    border-top: 1px solid var(--text-gray);
    padding-top: 2rem;
}

.footer-col {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-self: flex-start;
    /* Forces the columns to align to the top instead of the bottom */
}

.footer-col-title {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--text-gray);
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0.6;
}

.social-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.social-list a {
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.45);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    transition: color 0.3s ease, transform 0.3s ease;
    display: inline-block;
}

.social-list a:hover {
    color: var(--text-white);
    transform: translateX(5px);
}

.footer-nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-nav-list a {
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.45);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    transition: color 0.3s ease, transform 0.3s ease;
    display: inline-block;
}

.footer-nav-list a:hover {
    color: var(--text-white);
    transform: translateX(5px);
}

.big-email {
    font-family: var(--font-heading);
    font-size: clamp(1.5rem, 5vw, 5rem);
    color: var(--text-white);
    letter-spacing: 2px;
    text-transform: none;
    text-decoration: none;
    transition: color 0.3s ease;
    display: inline-block;
}

.big-email:hover {
    color: var(--accent-red);
}

/* Spinning Badge Container */
.spinning-badge {
    position: absolute;
    bottom: 18%;
    right: 5%;
    width: clamp(294px, 44vw, 525px);
    height: clamp(294px, 44vw, 525px);
    max-width: 90vw;
}

/* SVG Text Paths - Outer and Inner */
.rotating-text-outer,
.rotating-text-inner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    fill: var(--accent-red);
    font-family: 'Caesar Dressing', cursive;
    font-weight: 400;
    letter-spacing: 2px;
    pointer-events: none;
    overflow: visible;
    /* Allows mouse to pass through the dual canvas boxes */
}

/* Outer Ring - Clockwise Rotation */
.rotating-text-outer {
    animation: spin 20s linear infinite;
    font-size: 13px;
}

/* Inner Ring - Counter-Clockwise Rotation */
.rotating-text-inner {
    animation: spin-reverse 15s linear infinite;
    font-size: 10px;
}

/* Center Badge Text */
.badge-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--accent-red);
    font-family: var(--font-heading);
    font-size: 5.2rem;
    transition: color 0.3s ease;
    pointer-events: auto;
    cursor: default;
}

.badge-center:hover {
    color: var(--text-white);
    text-shadow: 0 0 20px var(--accent-red);
}

/* Animations */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes spin-reverse {
    to {
        transform: rotate(-360deg);
    }
}

/* Letter Hover Effects */
.hover-char {
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), font-size 0.2s ease, fill 0.1s ease, stroke 0.1s ease, stroke-width 0.1s ease, text-shadow 0.1s ease, baseline-shift 0.1s ease;
    pointer-events: auto;
    cursor: default;
    transform-origin: center;
    transform-box: fill-box;
}

.hover-char:hover {
    fill: var(--text-white);
    transform: scale(1.5) translateY(-2px);
    text-shadow: 0 0 10px var(--accent-red);
}

/* Floating Nav Bar */
.floating-nav {
    position: fixed;
    bottom: 2rem;
    right: 4vw;
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 0.15rem 0.4rem 0.15rem 1.8rem;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    z-index: 100;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    transition: transform 1.2s cubic-bezier(0.19, 1, 0.22, 1), opacity 1.2s ease;
    transform: scale(0.95);
    opacity: 0;
}

.floating-nav .nav-links {
    display: flex;
    gap: 1rem;
}

.floating-nav .nav-links a {
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--text-white);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    transition: color 0.3s;
}

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

.lets-talk-btn {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background-color: var(--bg-black);
    color: var(--text-white);
    padding: 0.4rem 1.5rem 0.4rem 0.4rem;
    border-radius: 50px;
    text-transform: uppercase;
    font-weight: 800;
    font-family: var(--font-body);
    font-size: 0.85rem;
    letter-spacing: 1px;
    transition: background-color 0.3s, transform 0.2s;
}

.lets-talk-btn:hover {
    background-color: var(--accent-red);
    color: var(--text-white);
    transform: scale(1.02);
}

.nav-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    filter: grayscale(100%);
}

@media (max-width: 768px) {
    .floating-nav {
        bottom: 1.5rem;
        padding: 0.4rem 0.4rem 0.4rem 1.5rem;
        gap: 1.5rem;
        width: 90%;
        max-width: 400px;
        justify-content: space-between;
    }

    .floating-nav .nav-links {
        gap: 1rem;
    }

    .floating-nav .nav-links a {
        font-size: 0.75rem;
        letter-spacing: 1px;
    }

    .lets-talk-btn {
        padding: 0.3rem 1rem 0.3rem 0.3rem;
        font-size: 0.75rem;
        gap: 0.5rem;
    }

    .nav-avatar {
        width: 30px;
        height: 30px;
    }

    .hero-section {
        flex-direction: column;
        justify-content: center;
        text-align: left;
    }

    .hero-image-wrapper {
        position: static;
        width: 100%;
        max-width: 300px;
        margin-bottom: 2rem;
    }

    .hero-text-wrapper {
        margin-top: 0;
    }

    .projects-section {
        padding: 4rem 4vw;
    }

    .forge-grid {
        grid-template-columns: 1fr;
    }

    .exp-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
        padding: 3rem 1rem;
    }

    .exp-title {
        width: 100%;
        font-size: 2.5rem;
    }

    .exp-desc {
        width: 100%;
    }



    .spinning-badge {
        bottom: 50%;
        right: 5%;
    }
}

/* ===================================================
   SCROLL-DRIVEN ANIMATION SYSTEM
   =================================================== */

/* --- Generic Scroll Reveal --- */
[data-scroll] {
    opacity: 0;
    transition:
        opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.8s cubic-bezier(0.22, 1, 0.36, 1),
        filter 0.8s cubic-bezier(0.22, 1, 0.36, 1),
        clip-path 0.8s cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: calc(var(--stagger, 0) * 0.12s);
    will-change: opacity, transform, filter;
}

/* Base Skew for all scrollable elements */
.exp-row,
.forge-item,
.achv-row,
.about-grid,
.massive-footer {
    will-change: transform;
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* Direction: UP (slide up from below) */
[data-scroll="up"] {
    --entrance-transform: translateY(60px);
    transform: var(--entrance-transform) skewY(var(--scroll-skew, 0deg));
}

/* Direction: LEFT (slide in from the left) */
[data-scroll="left"] {
    --entrance-transform: translateX(-60px);
    transform: var(--entrance-transform) skewY(var(--scroll-skew, 0deg));
}

/* Direction: RIGHT (slide in from the right) */
[data-scroll="right"] {
    --entrance-transform: translateX(60px);
    transform: var(--entrance-transform) skewY(var(--scroll-skew, 0deg));
}

/* Direction: SCALE (zoom up from small) */
[data-scroll="scale"] {
    --entrance-transform: scale(0.88) translateY(40px);
    transform: var(--entrance-transform) skewY(var(--scroll-skew, 0deg));
}

/* Direction: CLIP (clip-path curtain wipe for hero text) */
[data-scroll="clip"] {
    opacity: 1;
    clip-path: inset(0 100% 0 0);
    --entrance-transform: none;
    transform: var(--entrance-transform) skewY(var(--scroll-skew, 0deg));
}

[data-scroll="clip"].revealed {
    clip-path: inset(0 0 0 0);
}

/* Direction: TILT (3D perspective tilt-in for expertise rows) */
[data-scroll="tilt"] {
    --entrance-transform: perspective(800px) rotateY(-12deg) translateX(-60px);
    transform: var(--entrance-transform) skewY(var(--scroll-skew, 0deg));
    transform-origin: left center;
}

/* Direction: FLIP (3D card flip for forge items) */
[data-scroll="flip"] {
    --entrance-transform: perspective(1200px) rotateY(35deg) translateX(-40px);
    transform: var(--entrance-transform) skewY(var(--scroll-skew, 0deg));
    transform-origin: left center;
    transition-duration: 1s;
}

/* Direction: BLINDS (alternate left/right slide-in for achievements) */
[data-scroll="blinds"] {
    --entrance-transform: translateX(-80px) scaleX(0.88);
    transform: var(--entrance-transform) skewY(var(--scroll-skew, 0deg));
    transform-origin: left center;
}

[data-scroll="blinds"][style*="--stagger: 1"],
[data-scroll="blinds"][style*="--stagger: 3"] {
    --entrance-transform: translateX(80px) scaleX(0.88);
    transform: var(--entrance-transform) skewY(var(--scroll-skew, 0deg));
    transform-origin: right center;
}

/* Direction: BLUR (blur-to-sharp focus-in for footer) */
[data-scroll="blur"] {
    filter: blur(12px);
    --entrance-transform: translateY(30px) scale(0.97);
    transform: var(--entrance-transform) skewY(var(--scroll-skew, 0deg));
    transition-duration: 1.1s;
}

[data-scroll="blur"].revealed {
    filter: blur(0px);
}

/* Revealed state — reset entrance transform but keep skew */
[data-scroll].revealed {
    opacity: 1;
    --entrance-transform: translate(0, 0) scale(1) rotate(0);
    transform: var(--entrance-transform) skewY(var(--scroll-skew, 0deg));
}

/* Specific overrides for revealed states that have other transforms (like staggered grid) */
@media (min-width: 769px) {
    .forge-item:nth-child(even)[data-scroll].revealed {
        --entrance-transform: translateY(6rem);
    }
}

/* Hide phase (scrolling up) - remove delay for snappier feedback */
[data-scroll]:not(.revealed) {
    transition-delay: 0s !important;
}

/* --- Section Title: Slide in from left with opacity --- */
.section-title[data-scroll] {
    opacity: 0;
    transform: translateX(-80px);
}

.section-title[data-scroll].revealed {
    opacity: 1;
    transform: none;
}

/* --- Forge cards: preserve staggered grid offset on even items --- */
@media (min-width: 769px) {
    .forge-item:nth-child(even)[data-scroll].revealed {
        transform: translateY(6rem);
    }
}

/* --- Forge flip: longer transition for dramatic effect --- */
.forge-item[data-scroll="flip"] {
    transition-duration: 1s;
}

/* --- Hero Parallax --- */
.hero-image-wrapper {
    will-change: transform;
}

.hero-image-wrapper.parallax-ready {
    transition: transform 0.05s linear;
}

/* Footer headline uses data-scroll="blur" reveal */


/* --- Floating Nav Auto-Hide --- */
.floating-nav {
    transition:
        transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.4s ease;
}

body.loaded .floating-nav.nav-faded {
    opacity: 0.4;
    pointer-events: auto;
    /* Keep it clickable but faded */
}

body.loaded .floating-nav.nav-at-footer {
    transform: translateY(200%);
    opacity: 0 !important;
    pointer-events: none;
}

/* --- About Me: Override old 3D system with scroll system --- */
.about-grid.hidden-3d {
    opacity: 0;
    transform: scale(0.88) translateY(40px);
}

.about-grid.visible-3d {
    opacity: 1;
    transform: none;
}

/* --- Forge Card Extra Polish --- */
.forge-item[data-scroll] {
    transition-duration: 0.9s;
}

/* --- Desktop Side Nav (Progress + Ascend) --- */
.desktop-nav-side {
    position: fixed;
    bottom: 3.5rem;
    right: 3vw;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    z-index: 1000;
    opacity: 0;
    transform: translateY(40px);
    transition: transform 1.2s cubic-bezier(0.22, 1, 0.36, 1), opacity 1s ease;
}

.desktop-nav-side.visible {
    opacity: 1;
    transform: translateY(0);
}

.custom-scrollbar-container {
    height: 25vh;
    /* Perfect mid-ground length */
    width: 24px;
    /* Large invisible hit area for easy clicking/dragging */
    display: flex;
    justify-content: center;
    position: relative;
    cursor: ns-resize;
    margin-bottom: 0.5rem;
    margin-right: -11px;
    /* Center the thin track horizontally relative to Ascend button */
}

.custom-scrollbar-track {
    width: 2px;
    /* Keep it elegantly thin */
    height: 100%;
    background-color: rgba(255, 255, 255, 0.08);
    position: relative;
    overflow: hidden;
    border-radius: 10px;
}

.custom-scrollbar-thumb {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--accent-red);
    transform-origin: top;
    transform: scaleY(0);
    transition: transform 0.1s linear;
}

.btt-unique {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
}

.btt-unique.visible {
    opacity: 1;
    transform: translateY(0);
}

.btt-line-wrapper {
    width: 2px;
    height: 50px;
    background-color: rgba(255, 255, 255, 0.15);
    overflow: hidden;
    position: relative;
}

.btt-arrow {
    width: 20px;
    height: 20px;
    color: var(--text-gray);
    margin-bottom: -12px;
    /* Pulls the track line right up to the arrow */
    transition: color 0.4s ease, transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.btt-red-line {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background-color: var(--accent-red);
    transition: height 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.btt-text {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-family: var(--font-body);
    font-weight: 800;
    font-size: 0.75rem;
    letter-spacing: 4px;
    color: var(--text-gray);
    margin-bottom: 3rem;
    transition: color 0.4s ease, transform 0.4s ease;
}

.btt-unique:hover .btt-red-line {
    height: 100%;
}

.btt-unique:hover .btt-arrow {
    color: var(--accent-red);
    transform: translateY(-6px);
}

.btt-unique:hover .btt-text {
    color: var(--text-white);
    transform: rotate(180deg) translateY(10px);
}

/* --- Reduced Motion Accessibility --- */
@media (prefers-reduced-motion: reduce) {
    [data-scroll] {
        opacity: 1 !important;
        transform: none !important;
        filter: none !important;
        clip-path: none !important;
        transition: none !important;
    }

    .floating-nav.nav-hidden {
        transform: translateX(-50%) !important;
        opacity: 1 !important;
    }
}

/* ===================================================
   LIGHT THEME OVERRIDES
   =================================================== */

/* Top bar adjustment for light theme */
body.light-mode .top-bar {
    mix-blend-mode: normal;
    background-color: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

/* Gradients */
body.light-mode .exp-row::before,
body.light-mode .achv-row::before {
    background: linear-gradient(90deg, #600000 0%, var(--accent-red) 50%, #600000 100%);
}

/* Hardcoded Text Opacities (Expertise & Achievements) */
body.light-mode .exp-index,
body.light-mode .achv-index {
    color: rgba(0, 0, 0, 0.3);
}

body.light-mode .exp-row:hover .exp-index,
body.light-mode .achv-row:hover .achv-index,
body.light-mode .achv-row:hover .achv-year {
    color: rgba(255, 255, 255, 0.7);
}

body.light-mode .exp-title,
body.light-mode .achv-title {
    color: rgba(0, 0, 0, 0.4);
}

body.light-mode .exp-row:hover .exp-title,
body.light-mode .achv-row:hover .achv-title,
body.light-mode .achv-row:hover .achv-award,
body.light-mode .exp-row:hover .exp-desc {
    color: #ffffff;
}

body.light-mode .achv-award {
    color: rgba(0, 0, 0, 0.4);
}

body.light-mode .achv-year {
    color: rgba(0, 0, 0, 0.3);
}

body.light-mode .exp-desc {
    color: var(--text-gray);
}

/* The Forge Cards */
body.light-mode .forge-item.text-card {
    background-color: #e0e0e0;
}

body.light-mode .forge-item:nth-child(4n+2) .forge-img-wrap,
body.light-mode .forge-item:nth-child(4n+3) .forge-img-wrap {
    background: #e0e0e0;
}

/* Scatter Gallery */
body.light-mode .scatter-img {
    background: #f4f4f4;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

/* Footer & Nav List Links */
body.light-mode .social-list a,
body.light-mode .footer-nav-list a {
    color: rgba(0, 0, 0, 0.5);
}

body.light-mode .social-list a:hover,
body.light-mode .footer-nav-list a:hover {
    color: var(--text-white);
}

/* Floating Nav Below */
body.light-mode .floating-nav {
    background-color: rgba(255, 255, 255, 0.7);
    border-color: rgba(0, 0, 0, 0.15);
}

body.light-mode .floating-nav a {
    color: rgba(0, 0, 0, 0.7);
}

body.light-mode .floating-nav a:hover {
    color: var(--accent-red);
}

body.light-mode .floating-nav .lets-talk-btn {
    color: #fff !important;
    background-color: #111;
}

body.light-mode .floating-nav .lets-talk-btn:hover {
    color: #fff !important;
    background-color: var(--accent-red);
}

/* Back to Top Track */
body.light-mode .btt-line-wrapper {
    background-color: rgba(0, 0, 0, 0.15);
}

/* =========================================================
   GLOBAL RESPONSIVE REFINEMENTS (Tablet to 350px Mobile)
   ========================================================= */

/* Table / Small Laptop (1024px) */
@media (max-width: 1024px) {
    .architectural-j {
        font-size: 10rem;
    }

    .hero-text-wrapper h1 {
        font-size: 18vw;
    }

    .hero-image-wrapper {
        width: 58vw;
        right: -2vw;
    }

    /* Moved further right from 2vw */

    .about-grid {
        grid-template-columns: 1fr;
        gap: 4rem;
        text-align: center;
    }

    .about-desc,
    .about-para {
        max-width: 100%;
        text-align: left;
    }

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

/* Mobile / Small Tablet (768px) */
@media (max-width: 768px) {
    .metadata-corner {
        font-size: 0.6rem;
        padding: 1.5rem;
    }

    .top-bar-left .label-text {
        font-size: 0.7rem;
        white-space: nowrap;
    }

    /* Top Bar Mobile Optimization */
    .top-bar {
        padding: 1rem 4vw;
        background-color: transparent !important;
        backdrop-filter: none;
    }

    body.light-mode .top-bar {
        background-color: transparent !important;
    }

    .top-bar-right {
        gap: 1rem;
    }

    .status-wrap .label-text {
        display: none;
        /* Hide location text on mobile to save space */
    }

    .time-tracker {
        font-size: 0.75rem;
    }

    /* Stack Hero Content */
    .hero-section {
        flex-direction: column;
        justify-content: center;
        align-items: flex-start;
        padding-top: 15vh;
        overflow: visible;
    }

    /* Overlap requires visible overflow */
    .hero-text-wrapper {
        width: 100%;
        margin-top: -10vh;
        z-index: 5;
        position: relative;
    }

    /* Negative margin to pull text over image */
    .hero-text-wrapper h1 {
        font-size: 30vw;
        line-height: 0.85;
        margin-left: -5px;
    }

    /* Move portrait under text gracefully */
    .hero-image-wrapper {
        position: relative;
        right: auto;
        top: auto;
        width: 92%;
        max-width: 480px;
        margin: 2vh 0 0 auto;
        /* Removed horizontal centering (auto/auto) and pushed to right with 'auto' on left */
        z-index: 1;
    }

    /* Floating Navigation Constraints */
    .floating-nav {
        width: 95%;
        padding: 0.5rem;
        gap: 0.5rem;
        justify-content: space-between;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
    }

    .floating-nav .nav-links {
        gap: 0.8rem;
    }

    .floating-nav .nav-links a {
        font-size: 0.65rem;
        letter-spacing: 0.5px;
    }

    .lets-talk-btn {
        padding: 0.3rem 0.8rem 0.3rem 0.3rem;
        font-size: 0.65rem;
        gap: 0.4rem;
    }

    .nav-avatar {
        width: 24px;
        height: 24px;
    }

    /* Achievements Grid cleanup */
    .achv-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .achv-right {
        text-align: left;
        align-items: flex-start;
    }

    /* Footer Stack */
    .footer-bottom {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }

    .footer-col-title {
        margin-bottom: 1rem;
    }

    .social-list,
    .footer-nav-list {
        align-items: center;
    }

    .big-email {
        font-size: 7vw;
        text-align: right;
        word-break: break-all;
        margin-left: auto;
    }

    .spinning-badge {
        width: 120px;
        height: 120px;
        bottom: -20px;
        right: 20px;
    }

    .badge-center {
        font-size: 2.3rem;
    }
}

/* Standard Mobile (480px) */
@media (max-width: 480px) {
    .architectural-j {
        font-size: 4rem;
    }

    .loader-progress-bar {
        width: 80%;
    }

    .hero-text-wrapper h1 {
        font-size: 32vw;
    }

    .hero-sub {
        font-size: 0.8rem;
        letter-spacing: 2px;
    }

    .hero-image-wrapper {
        width: 100%;
    }

    .section-title {
        font-size: 11vw;
    }

    .tech-stack-bar {
        padding: 1.5rem 0;
    }

    .tech-item {
        font-size: 1.5rem;
    }

    .marquee-content {
        gap: 2rem;
    }

    .forge-name {
        font-size: 1.8rem;
    }
}

/* Extra Small Devices (350px) */
@media (max-width: 350px) {
    .hero-text-wrapper h1 {
        font-size: 34vw;
    }

    .hero-sub {
        font-size: 0.7rem;
        letter-spacing: 1px;
    }

    .floating-nav {
        padding: 0.4rem;
        gap: 0.5rem;
        justify-content: space-between;
        width: 100%;
        top: auto;
        bottom: 0.5rem;
        border-radius: 20px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
    }

    .floating-nav .nav-links {
        gap: 0.4rem;
    }

    .floating-nav .nav-links a {
        font-size: 0.55rem;
        letter-spacing: 0;
    }

    .lets-talk-text {
        display: none;
    }

    /* Show only avatar and + icon to save space */
    .lets-talk-btn {
        padding: 0.3rem;
        justify-content: center;
    }

    .nav-avatar {
        width: 18px;
        height: 18px;
    }

    .spinning-badge {
        display: none;
    }

    /* Hide complex badge on tiny screens to avoid squishing */
}

/* =========================================================
   MOBILE FAB NAVIGATION (CIRCLE & MENU)
   ========================================================= */

.mobile-nav-container {
    display: none;
    /* Hidden by default */
    position: fixed;
    bottom: 2rem;
    right: 5vw;
    z-index: 1000;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.4rem;

    /* Reveal Animation Base (matches desktop system) */
    opacity: 0;
    transform: perspective(2500px) rotateY(10deg) translateZ(-100px) scale(0.95);
    transition:
        transform 1.4s cubic-bezier(0.77, 0, 0.175, 1),
        opacity 1.2s ease;
    transform-origin: right bottom;
}

/* Page Reveal State */
body.loaded .mobile-nav-container {
    opacity: 1;
    transform: perspective(2500px) rotateY(0deg) translateZ(0) scale(1);
}

/* Footer Exit Animation (Refined) */
body.loaded .mobile-nav-container.nav-at-footer,
body.loaded .mobile-scroll-container.nav-at-footer {
    transform: translateY(120%) scale(0.8) rotate(10deg);
    opacity: 0 !important;
    pointer-events: none;
    filter: blur(10px);
}


.mobile-nav-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--accent-red);
    border: none;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(139, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1002;
    padding: 0;
}

.mobile-nav-toggle:active {
    transform: scale(0.9);
}

.symbol-plus {
    width: 20px;
    height: 20px;
    position: relative;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.symbol-plus::before,
.symbol-plus::after {
    content: '';
    position: absolute;
    background-color: white;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.symbol-plus::before {
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    transform: translateY(-50%);
}

.symbol-plus::after {
    top: 0;
    left: 50%;
    width: 2px;
    height: 100%;
    transform: translateX(-50%);
}

.mobile-nav-container.menu-active .symbol-plus {
    transform: rotate(135deg);
}

/* Ascend Column for Mobile */
.mobile-nav-btt {
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Straight vertical line for mobile */
    gap: 0.3rem;
    /* Tighter gap */
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.6s ease;
    pointer-events: none;
    margin-bottom: -12px;
    /* Pull it down to sit almost touching the toggle circle */
    padding-right: 20px;
    /* Aligns the vertical axis with the toggle circle */
}

/* Hide Ascend when menu is active - Use display: none to remove its space */
.mobile-nav-container.menu-active .mobile-nav-btt {
    display: none;
    pointer-events: none;
}

.mobile-nav-btt.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.mobile-nav-btt .btt-arrow {
    width: 20px;
    height: 20px;
    color: var(--text-gray);
    margin-bottom: -15px;
    /* Pull arrow down to sit squarely on the line */
    transition: color 0.3s;
}

.mobile-nav-btt .btt-line-wrapper {
    width: 2px;
    height: 35px;
    /* Slightly shorter for cleaner mobile look */
    background-color: rgba(255, 255, 255, 0.1);
    overflow: hidden;
    position: relative;
}

.mobile-nav-btt .btt-red-line {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background-color: var(--accent-red);
    transition: height 0.4s ease;
}

.mobile-nav-btt .btt-text {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-family: var(--font-body);
    font-weight: 800;
    font-size: 0.65rem;
    letter-spacing: 3px;
    color: var(--text-gray);
    transition: color 0.3s;
    margin-top: 0.2rem;
}

/* Hover/Active states */
.mobile-nav-btt:active .btt-red-line {
    height: 100%;
}

.mobile-nav-btt:active .btt-text {
    color: white;
}

.mobile-nav-btt:active .btt-arrow {
    color: var(--accent-red);
}

/* Menu items with reduced transparency */
.mobile-nav-menu {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    /* Align menu items to the right */
    gap: 0.6rem;
    margin-bottom: 0.4rem;
    /* Reduced space below menu items to bring them closer to the circle */
    pointer-events: none;
}

.mobile-menu-item {
    background: rgba(255, 255, 255, 0.05);
    /* Reduced transparency (more see-through) */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.8);
    padding: 0.7rem 1.4rem;
    border-radius: 100px;
    font-family: var(--font-body);
    font-weight: 800;
    font-size: 0.8rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    text-decoration: none;
    opacity: 0;
    transform: translateY(15px) scale(0.9);
    transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    width: max-content;
}

/* --- Mobile Scroll Tracker (Left Side) --- */
.mobile-scroll-container {
    display: none;
    /* Hidden on desktop */
    position: fixed;
    top: 50%;
    left: 2.5vw;
    /* Moved further to the left */
    transform: translateY(-50%);
    width: 2px;
    height: 22vh;
    /* Increased length */
    z-index: 999;
    opacity: 0;
    transition: transform 1s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.8s ease;
}

body.loaded .mobile-scroll-container {
    opacity: 0.6;
    /* Slight transparency to keep it subtle */
}

@media (max-width: 768px) {
    .mobile-scroll-container {
        display: block;
    }
}

.mobile-scroll-track {
    width: 2px;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.15);
    position: relative;
    overflow: hidden;
    border-radius: 10px;
}

.mobile-scroll-thumb {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--text-white);
    /* White color for dark theme */
    transform-origin: top;
    transform: scaleY(0);
    transition: transform 0.1s linear;
}

/* Hide in footer */
body.loaded .mobile-scroll-container.nav-at-footer {
    opacity: 0 !important;
    transform: translateY(-50%) translateX(-20px);
}




.mobile-nav-container.menu-active .mobile-menu-item {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.mobile-menu-item:nth-child(9) {
    transition-delay: 0.05s;
}

.mobile-menu-item:nth-child(8) {
    transition-delay: 0.1s;
}

.mobile-menu-item:nth-child(7) {
    transition-delay: 0.15s;
}

.mobile-menu-item:nth-child(6) {
    transition-delay: 0.2s;
}

.mobile-menu-item:nth-child(5) {
    transition-delay: 0.25s;
}

.mobile-menu-item:nth-child(4) {
    transition-delay: 0.3s;
}

.mobile-menu-item:nth-child(3) {
    transition-delay: 0.35s;
}

.mobile-menu-item:nth-child(2) {
    transition-delay: 0.4s;
}

.mobile-menu-item:nth-child(1) {
    transition-delay: 0.45s;
}

@media (max-width: 768px) {

    .floating-nav,
    .desktop-nav-side {
        display: none !important;
    }

    .mobile-nav-container {
        display: flex;
    }
}

/* Light Mode Overrides */
body.light-mode .mobile-menu-item {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.05);
    color: rgba(0, 0, 0, 0.7);
}

body.light-mode .mobile-nav-btt .btt-line-wrapper {
    background-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .mobile-nav-btt .btt-text,
body.light-mode .mobile-nav-btt .btt-arrow {
    color: rgba(0, 0, 0, 0.5);
}

body.light-mode .mobile-scroll-track {
    background-color: rgba(0, 0, 0, 0.08);
}

body.light-mode .mobile-scroll-thumb {
    background-color: rgba(0, 0, 0, 0.6);
}

/* Light Mode Hero Shapes - Lighter to the left, Medium to the right */
body.light-mode .shape {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.03) 0%, rgba(0, 0, 0, 0.01) 100%);
}

/* Left - Lighter */
body.light-mode .shape-5 {
    box-shadow: -25px 25px 70px rgba(0, 0, 0, 0.28);
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .shape-5::after {
    border-color: rgba(0, 0, 0, 0.05);
}

/* Center-Left - Transitioning */
body.light-mode .shape-3,
body.light-mode .shape-4 {
    box-shadow: -25px 25px 70px rgba(0, 0, 0, 0.48);
    border-color: rgba(0, 0, 0, 0.18);
}

body.light-mode .shape-3::after,
body.light-mode .shape-4::after {
    border-color: rgba(0, 0, 0, 0.09);
}

/* Right - Medium */
body.light-mode .shape-1,
body.light-mode .shape-2,
body.light-mode .shape-6 {
    box-shadow: -25px 25px 70px rgba(0, 0, 0, 0.68);
    border-color: rgba(0, 0, 0, 0.25);
}

body.light-mode .shape-1::after,
body.light-mode .shape-2::after,
body.light-mode .shape-6::after {
    border-color: rgba(0, 0, 0, 0.15);
}

/* ===================================================
   MOBILE SCROLL PERFORMANCE OPTIMIZATIONS
   =================================================== */
@media (max-width: 768px) {

    /* Enable smooth momentum scrolling on iOS */
    html,
    body {
        -webkit-overflow-scrolling: touch;
    }

    /* Reduce heavy box-shadows on mobile */
    .shape {
        box-shadow: -10px 10px 30px rgba(0, 0, 0, 0.6);
    }

    /* Simplify transitions for smoother scroll */
    .exp-row,
    .forge-item,
    .achv-row {
        transition-duration: 0.4s !important;
    }

    /* Hardware accelerate key scroll containers */
    .hero-section,
    .expertise-section,
    .projects-section,
    .achievements-section,
    .about-me-section,
    .massive-footer {
        will-change: auto;
        transform: translateZ(0);
        backface-visibility: hidden;
    }

    /* Disable heavy filters on mobile for performance */
    .moody-portrait {
        filter: grayscale(100%) contrast(1.2) brightness(0.7);
    }

    .section-title,
    .expertise-section .section-title,
    .projects-section .section-title,
    .achievements-section .section-title,
    .certifications-section .section-title {
        font-size: clamp(1.8rem, 10vw, 3.0rem) !important;
    }
}

/* ===================================================
   PUBLICATIONS SECTION - MONUMENTAL EDITORIAL
   =================================================== */
.publications-section {
    position: relative;
    padding: 10vh 4vw;
}

.editorial-pub-block {
    margin-top: 3rem;
    padding: 4vw 2vw;
    border-top: 2px solid var(--border-color);
    border-bottom: 2px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 2rem;
    position: relative;
    transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    opacity: 0;
    transform: translateY(30px) skewY(var(--scroll-skew, 0deg));
    will-change: transform, opacity;
}

.editorial-pub-block.revealed {
    opacity: 1;
    transform: translateY(0) skewY(var(--scroll-skew, 0deg));
}

body.light-mode .editorial-pub-block {
    border-color: rgba(0, 0, 0, 0.2);
}

.editorial-pub-block:hover {
    background-color: var(--text-white);
    color: var(--bg-black);
    padding-left: 3vw;
    padding-right: 3vw;
    border-color: transparent;
    cursor: crosshair;
    transform: scale(1.02) skewY(var(--scroll-skew, 0deg));
}

body.light-mode .editorial-pub-block:hover {
    background-color: #000000;
    color: #ffffff;
    border-color: transparent;
}

.pub-meta {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 2px;
    color: var(--text-gray);
    transition: color 0.5s ease;
}

.editorial-pub-block:hover .pub-meta {
    color: var(--bg-black);
}

body.light-mode .editorial-pub-block:hover .pub-meta {
    color: rgba(255, 255, 255, 0.7);
}

.pub-category {
    color: var(--accent-red);
}

.pub-headline {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 5vw, 4.5rem);
    line-height: 1;
    text-transform: uppercase;
    margin: 0;
    color: var(--text-white);
    transition: color 0.5s ease;
}

body.light-mode .pub-headline {
    color: #000000;
}

.editorial-pub-block:hover .pub-headline {
    color: var(--bg-black);
}

body.light-mode .editorial-pub-block:hover .pub-headline {
    color: #ffffff;
}

.pub-subheadline {
    color: var(--accent-red);
    font-size: 0.7em;
}

.pub-footer-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    font-family: var(--font-body);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
    margin-top: 1rem;
}

.pub-conference {
    display: flex;
    align-items: center;
    gap: 15px;
    max-width: 65%;
    line-height: 1.5;
}

.dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    background-color: var(--accent-red);
    border-radius: 50%;
    flex-shrink: 0;
}

.pub-action {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
}

.pulse-ring {
    width: 12px;
    height: 12px;
    background-color: transparent;
    border: 2px solid var(--accent-red);
    border-radius: 50%;
    animation: pub-pulse 2s cubic-bezier(0.25, 1, 0.5, 1) infinite;
}

@keyframes pub-pulse {
    0% {
        transform: scale(0.8);
        box-shadow: 0 0 0 0 rgba(139, 0, 0, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(139, 0, 0, 0);
    }

    100% {
        transform: scale(0.8);
        box-shadow: 0 0 0 0 rgba(139, 0, 0, 0);
    }
}

@media (max-width: 900px) {
    .pub-footer-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .pub-conference {
        max-width: 100%;
        align-items: flex-start;
    }

    .dot {
        margin-top: 5px;
    }
}

/* ===================================================
   CERTIFICATIONS SECTION
   =================================================== */
.certifications-section {
    position: relative;
    padding: 10vh 4vw;
}

.certifications-section .section-title {
    text-align: right;
    margin-bottom: 1rem;
}

.cert-instructions {
    text-align: right;
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: var(--text-gray);
    letter-spacing: 1px;
    margin-bottom: 3rem;
    text-transform: uppercase;
}

.dot-separator {
    color: var(--accent-red);
    margin: 0 10px;
    font-weight: 900;
}

.cert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
}

.cert-card {
    position: relative;
    padding: 35px 30px;
    border: 1px solid var(--border-color);
    background: transparent;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 220px;
    transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    cursor: none;
    z-index: 1;
    overflow: hidden;
}

.cert-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 4px;
    background: var(--accent-red);
    transition: width 0.4s ease;
    z-index: 5;
}

.cert-card:hover::before {
    width: 100%;
}

.cert-card:hover {
    background: rgba(255, 255, 255, 0.02);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.1);
    z-index: 10;
}

body.light-mode .cert-card:hover {
    background: rgba(0, 0, 0, 0.02);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
}

.cert-top {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
    margin-bottom: 25px;
    font-family: var(--font-body);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.cert-year {
    color: var(--accent-red);
    font-weight: 700;
}

.cert-provider {
    color: var(--text-gray);
    font-weight: 600;
}

.cert-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-white);
    margin: 0;
    line-height: 1.4;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    z-index: 2;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

body.light-mode .cert-title {
    color: #000000;
}

.cert-hover-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    z-index: 10;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.cert-card:hover .cert-hover-layer {
    opacity: 1;
}

.cert-card:hover .cert-title {
    transform: translateY(-25px);
}

.cert-verify {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 0.7rem;
    letter-spacing: 3px;
    color: #ffffff;
    background: var(--accent-red);
    padding: 6px 12px;
    font-weight: 700;
}

/* ===================================================
   CERTIFICATE POP-OUT PREVIEW BOX
   =================================================== */
.cert-preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20;
    opacity: 0;
    pointer-events: none;
    transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    background: var(--bg-black);
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Internal Reveal (Triggered by JS on Single Click) */
.cert-card.active .cert-preview {
    opacity: 1;
    pointer-events: auto;
}

body.light-mode .cert-preview {
    background: #ffffff;
}

/* Hover "VIEW" Circle */
.view-circle {
    position: absolute;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%) scale(0.5);
    /* Centered now that cursors hidden */
    width: 60px;
    height: 60px;
    background: var(--accent-red);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: var(--font-body);
    font-weight: 800;
    font-size: 0.7rem;
    letter-spacing: 1px;
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease;
    z-index: 15;
    pointer-events: none;
}

body.is-touch-device .view-circle {
    display: none !important;
}

.cert-card:hover .view-circle {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Internal Reveal (Triggered by JS on Single Click) */
.cert-card.active .cert-preview {
    opacity: 1;
    pointer-events: auto;
}

.cert-card.active {
    cursor: auto;
    /* Re-enable cursor when image is open so you can click to close */
}

/* Hide interaction elements when viewing internally */
.cert-card.active .view-circle,
.cert-card.active .cert-verify {
    opacity: 0 !important;
}

.cert-card:hover .cert-verify {
    opacity: 0;
    /* Hide verify tag when circle appears */
}

/* DIRECTIONAL LOGIC REMOVED - NOW USING INTERNAL CLICK SYSTEM */

/* Prevent layout shifts */
.cert-card:hover {
    transform: none !important;
    z-index: 50 !important;
}

/* Ensure boxes are visible during directional pop out */
.cert-grid {
    overflow: visible !important;
}

.cert-card {
    overflow: visible !important;
}


.cert-preview-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    color: var(--text-white);
}

body.light-mode .cert-preview-inner {
    color: #111111;
}

.pdf-icon {
    width: 60px;
    height: 60px;
    color: var(--accent-red);
}

.cert-preview-inner span {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 2px;
}

.cert-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0.8;
    transition: opacity 0.4s ease;
}

.cert-card:hover .cert-image {
    opacity: 1;
}

/* ===================================================
   WORKFLOW / HOW I WORK SECTION (LOGIC ENGINE)
   =================================================== */
.workflow-section {
    padding: 120px 4vw;
    background-color: var(--bg-black);
    position: relative;
    overflow: hidden;
}

.workflow-section .section-title {
    text-align: left;
    margin-bottom: 4rem;
}

.logic-engine-container {
    max-width: 1400px;
    margin: 60px auto 0;
    position: relative;
}

/* Vertical track connecting items */
.logic-track {
    position: absolute;
    left: 45px;
    top: 0;
    width: 1.5px;
    height: 100%;
    background: var(--border-color);
    z-index: 1;
}

.logic-progress {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0;
    background: var(--accent-red);
    transition: height 0.3s ease;
    box-shadow: 0 0 15px var(--accent-red);
}

.workflow-grid {
    display: flex;
    flex-direction: column;
    gap: 80px;
    position: relative;
    z-index: 2;
}

.workflow-item {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 60px;
    align-items: center;
    position: relative;
}

.workflow-info {
    padding-left: 100px;
}

.workflow-num {
    font-family: var(--font-heading);
    font-size: 5.5rem;
    color: transparent;
    -webkit-text-stroke: 1.5px var(--border-color);
    line-height: 1;
    position: absolute;
    left: 0;
    top: -10px;
    opacity: 0.35;
    transition: all 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.workflow-item:hover .workflow-num {
    color: var(--accent-red);
    -webkit-text-stroke: 1.5px var(--accent-red);
    opacity: 0.8;
}

.workflow-title {
    font-family: 'Jockey One', sans-serif;
    font-size: clamp(2rem, 3.5vw, 3rem);
    color: var(--text-white);
    letter-spacing: 2px;
    margin-bottom: 20px;
    text-transform: uppercase;
}

.workflow-desc {
    font-family: var(--font-body);
    font-size: 1.1rem;
    color: var(--text-gray);
    line-height: 1.8;
    max-width: 500px;
    margin-bottom: 30px;
}

.workflow-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.workflow-tags span {
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 1px;
    padding: 8px 18px;
    border: 1px solid var(--border-color);
    border-radius: 25px;
    color: var(--text-gray);
    text-transform: uppercase;
    transition: all 0.4s ease;
}

.workflow-item:hover .workflow-tags span {
    border-color: var(--accent-red);
    color: var(--text-white);
    background: rgba(139, 0, 0, 0.1);
}

/* THE BLUEPRINT VISUAL */
.workflow-visual {
    position: relative;
    width: 100%;
    aspect-ratio: 16/10;
}

.blueprint-box {
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.6s ease;
}

.workflow-item:hover .blueprint-box {
    border-color: rgba(139, 0, 0, 0.4);
}

.grid-lines {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--border-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--border-color) 1px, transparent 1px);
    background-size: 35px 35px;
    opacity: 0.35;
}

/* Phase 1: DECONSTRUCTION visual */
.circuit-path {
    width: 240px;
    height: 3px;
    background: var(--accent-red);
    position: relative;
    box-shadow: 0 0 15px var(--accent-red);
    clip-path: inset(0 0 0 100%);
    animation: drawLine 2.5s infinite ease-in-out;
}

@keyframes drawLine {
    0% {
        clip-path: inset(0 100% 0 0);
    }

    50% {
        clip-path: inset(0 0 0 0);
    }

    100% {
        clip-path: inset(0 0 0 100%);
    }
}

.pulse-node {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--text-white);
    border-radius: 50%;
    box-shadow: 0 0 25px var(--text-white);
    animation: nodePulse 2s infinite;
}

@keyframes nodePulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.8;
    }

    50% {
        transform: scale(2);
        opacity: 1;
    }
}

/* Phase 2: SYNTHESIS visual */
.code-stream {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 70%;
}

.stream-line {
    height: 5px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    position: relative;
    overflow: hidden;
}

.stream-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 40%;
    height: 100%;
    background: var(--accent-red);
    box-shadow: 0 0 10px var(--accent-red);
    animation: streamFlow 2.5s infinite cubic-bezier(0.4, 0, 0.2, 1);
}

.stream-line:nth-child(2)::after {
    animation-delay: 0.8s;
}

.stream-line:nth-child(3)::after {
    animation-delay: 1.6s;
}

@keyframes streamFlow {
    to {
        left: 140%;
    }
}

/* Phase 3: CALIBRATION visual */
.gauge-wrap {
    width: 150px;
    height: 150px;
    border: 3px solid var(--border-color);
    border-radius: 50%;
    position: relative;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.5);
}

.gauge-needle {
    position: absolute;
    bottom: 50%;
    left: 50%;
    width: 5px;
    height: 65px;
    background: var(--accent-red);
    transform-origin: bottom center;
    transform: translateX(-50%) rotate(-60deg);
    animation: calibrationSweep 3.5s infinite alternate ease-in-out;
    box-shadow: 0 0 10px var(--accent-red);
}

.gauge-needle::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    background: var(--text-white);
    border-radius: 50%;
    border: 3px solid var(--accent-red);
}

@keyframes calibrationSweep {
    from {
        transform: translateX(-50%) rotate(-80deg);
    }

    to {
        transform: translateX(-50%) rotate(80deg);
    }
}

/* Responsive Fixes */
@media (max-width: 1024px) {
    .workflow-item {
        grid-template-columns: 1fr;
        gap: 50px;
        max-width: 650px;
        margin: 0 auto;
    }

    .workflow-info {
        padding-left: 80px;
    }

    .logic-track {
        left: 40px;
    }
}

@media (max-width: 600px) {
    .workflow-section {
        padding: 80px 6vw;
    }

    .workflow-num {
        font-size: 3.5rem;
        color: var(--accent-red);
        -webkit-text-stroke: 1.5px var(--accent-red);
        opacity: 0.8;
    }

    .workflow-info {
        padding-left: 0;
        margin-top: 50px;
    }

    .logic-track {
        display: none;
    }

    .workflow-item {
        gap: 30px;
    }
}

/* Scroll Reveal Animations for Workflow */
[data-scroll="fade-up"] {
    opacity: 0;
    transform: translateY(50px);
    transition: all 1s cubic-bezier(0.22, 1, 0.36, 1);
}

[data-scroll="fade-up"].revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Delay reveals slightly */
.workflow-item:nth-child(2) {
    transition-delay: 0.1s;
}

.workflow-item:nth-child(3) {
    transition-delay: 0.2s;
}

/* ===================================================
   MOBILE SOCIAL ROW (INSIDE MENU)
   =================================================== */
.mobile-menu-socials {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 5px;
    opacity: 0;
    transform: translateY(15px) scale(0.9);
    transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: 0.3s;
    /* Revealed after 'LET'S TALK' */
    width: 100%;
}

.mobile-nav-container.menu-active .mobile-menu-socials {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.mobile-social-bubble {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: auto;
}

.mobile-social-bubble i,
.mobile-social-bubble svg {
    font-size: 1.1rem;
    width: 20px;
    height: 20px;
    color: inherit;
}

.mobile-social-bubble:active {
    background: var(--accent-red);
    color: white;
    transform: scale(0.95);
}

body.light-mode .mobile-social-bubble {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.05);
    color: rgba(0, 0, 0, 0.7);
}

/* ===================================================
   SPINNING BADGE COMPONENT
   =================================================== */

/* Spinning Badge Container */
.spinning-badge {
    position: absolute;
    bottom: 18%;
    right: 5%;
    width: clamp(294px, 44vw, 525px);
    height: clamp(294px, 44vw, 525px);
    max-width: 90vw;
}

/* SVG Text Paths - Outer and Inner */
.rotating-text-outer,
.rotating-text-inner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    fill: var(--accent-red);
    font-family: 'Caesar Dressing', cursive;
    font-weight: 400;
    letter-spacing: 2px;
    pointer-events: none;
    overflow: visible;
    /* Allows mouse to pass through the dual canvas boxes */
}

/* Outer Ring - Clockwise Rotation */
.rotating-text-outer {
    animation: spin 20s linear infinite;
    font-size: 11.3px;
}

/* Inner Ring - Counter-Clockwise Rotation */
.rotating-text-inner {
    animation: spin-reverse 15s linear infinite;
    font-size: 8.7px;
}

/* Center Badge Text */
.badge-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--accent-red);
    font-family: var(--font-heading);
    font-size: 5.2rem;
    transition: color 0.3s ease;
    pointer-events: auto;
    cursor: default;
}

.badge-center:hover {
    color: var(--text-white);
}

/* Animations */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes spin-reverse {
    to {
        transform: rotate(-360deg);
    }
}

/* Letter Hover Effects */
.hover-char {
    transition: font-size 0.2s ease, fill 0.1s ease, stroke 0.1s ease, stroke-width 0.1s ease, text-shadow 0.1s ease, baseline-shift 0.1s ease;
    pointer-events: auto;
    cursor: default;
}

.hover-char:hover {
    fill: #ffffff !important;
    stroke: #ffffff;
    stroke-width: 0.4px;
    baseline-shift: 2.5px;
    font-size: 1.35em;
    transform: perspective(600px) rotateX(20deg) rotateY(15deg);
    text-shadow:
        0.5px 0.5px 0px #aa0000,
        1.5px 1.5px 0px #550000,
        3px 4px 8px rgba(0, 0, 0, 0.5);
}

body.light-mode .hover-char:hover {
    fill: #ffffff !important;
    stroke: #8b0000;
    stroke-width: 0.4px;
    font-size: 1.35em;
    transform: perspective(600px) rotateX(20deg) rotateY(15deg);
    text-shadow:
        1px 1px 0px rgba(0, 0, 0, 0.1),
        2px 2px 8px rgba(0, 0, 0, 0.1);
}

/* Mobile Adjustments for Spinning Badge */
@media (max-width: 768px) {
    .spinning-badge {
        width: clamp(140px, 35vw, 200px);
        height: clamp(140px, 35vw, 200px);
        bottom: 45%;
        right: 5%;
    }

    .badge-center {
        font-size: 1.4rem;
    }
}