/* Global Styles */

:root {
    --primary-color: #F2F4F3;
    --secondary-color: #a29bfe;
    --dark-bg: #1e1e2e;
    --light-text: #ffffff;
    --accent-color: #00cec9;
}

html {
    font-size: 16px;
    position: relative;
    min-height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-weight: 400;
    line-height: 1.55;
    background: #060b13; /* Solid deep cyber dark background */
    color: var(--light-text);
    margin: 0;
    overflow-x: hidden; /* Prevent horizontal scrollbars from floating background */
}

.site-main-shell {
    flex: 1 0 auto;
    width: 100%;
    padding-top: 2.75rem;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 650;
    letter-spacing: -0.015em;
}

.display-1 {
    font-size: 5rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.home-hero .display-1 {
    font-size: clamp(3.2rem, 6.25vw, 5rem);
}

.home-hero-row {
    min-height: clamp(620px, 82vh, 860px);
    margin-right: 0;
    margin-left: 0;
}

.home-hero-content {
    width: min(100%, 920px);
    padding-right: clamp(0rem, 4vw, 3rem);
}

.home-hero-content > p {
    max-width: 720px;
}

.home-capabilities {
    margin-top: 0;
    padding-top: clamp(1rem, 3vw, 2.5rem);
}

/* Navbar */
.navbar {
    background-color: rgba(30, 30, 46, 0.7) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar-brand {
    font-weight: 700;
    color: var(--primary-color) !important;
    font-size: 1.5rem;
}

.nav-link {
    font-weight: 500;
    transition: color 0.3s ease;
}

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

/* Footer */
.footer {
    flex: 0 0 auto;
    background-color: rgba(30, 30, 46, 0.25) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: #ccd0d4;
    padding: 2.5rem 0 6rem;
    margin-top: 6rem;
    width: 100%;
}

/* Top Floating Identity Watermark */
.top-identity-wrapper {
    position: fixed;
    top: 30px;
    left: 40px;
    z-index: 1000;
    pointer-events: auto;
}

.top-identity {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    transition: color 0.3s ease, opacity 0.3s ease;
    opacity: 0.75;
}

.brand-logo {
    display: block;
    width: auto;
    object-fit: contain;
}

.brand-logo-header {
    height: 54px;
    max-width: min(230px, 42vw);
}

.brand-logo-footer {
    height: 64px;
    max-width: min(260px, 72vw);
}

.footer-brand {
    border-radius: 10px;
}

.top-identity:hover {
    color: var(--light-text);
    opacity: 1;
}

@media (max-width: 768px) {
    .top-identity-wrapper {
        position: absolute;
        top: 25px;
        left: 20px;
    }

    .site-main-shell {
        padding-top: 3.25rem;
    }

    .brand-logo-header {
        height: 48px;
        max-width: 150px;
    }
}

/* Buttons */
.btn-primary {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--light-text);
    border-radius: 50px;
    padding: 0.8rem 2rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.1);
}

.btn-outline-light {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    padding: 0.8rem 2rem;
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
}

/* Cards */
.card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(25px) saturate(200%);
    -webkit-backdrop-filter: blur(25px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    color: var(--light-text);
    border-radius: 24px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Profile Frame */
.profile-frame {
    position: relative;
    isolation: isolate;
    width: min(72%, 360px);
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.17);
    border-radius: 38px 38px 64px 38px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(0, 206, 201, 0.035));
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.48), 0 0 42px rgba(0, 206, 201, 0.08);
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease, box-shadow 0.3s ease;
}

.profile-frame::before {
    content: "";
    position: absolute;
    inset: -15px;
    z-index: -2;
    border: 1px solid rgba(0, 206, 201, 0.24);
    border-radius: 48px 48px 76px 48px;
    clip-path: polygon(0 0, 38% 0, 38% 2px, 100% 2px, 100% 64%, calc(100% - 2px) 64%, calc(100% - 2px) 100%, 62% 100%, 62% calc(100% - 2px), 0 calc(100% - 2px));
    transform: rotate(-3deg);
}

.profile-frame::after {
    content: "";
    position: absolute;
    right: -8px;
    bottom: 28px;
    z-index: 2;
    width: 42px;
    height: 42px;
    border-right: 3px solid var(--accent-color);
    border-bottom: 3px solid var(--accent-color);
    border-radius: 0 0 20px 0;
    filter: drop-shadow(0 0 8px rgba(0, 206, 201, 0.46));
    pointer-events: none;
}

.profile-frame:hover {
    transform: translateY(-6px) rotate(-1deg);
    box-shadow: 0 30px 78px rgba(0, 0, 0, 0.52), 0 0 54px rgba(0, 206, 201, 0.16);
    border-color: rgba(0, 206, 201, 0.44);
}

.profile-frame img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 30px 30px 56px 30px;
    clip-path: polygon(9% 0, 100% 0, 100% 88%, 88% 100%, 0 100%, 0 9%);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), filter 0.4s ease;
}

.profile-frame:hover img {
    transform: scale(1.035);
    filter: saturate(1.04) contrast(1.02);
}

/* Responsive project media */
.project-image {
    display: block;
    max-width: 100%;
    height: auto;
}

.project-image-cover {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.project-image-contain {
    width: auto;
    max-height: 400px;
    object-fit: contain;
}

.project-visual {
    width: 100%;
    aspect-ratio: 5 / 2;
    overflow: hidden;
}

.project-visual .project-image {
    max-height: 100%;
}

.project-priority-1 { order: 1; }
.project-priority-3 { order: 2; }
.project-priority-2 { order: 3; }
.project-priority-4 { order: 4; }
.project-priority-5 { order: 5; }

.project-summary {
    display: grid;
    gap: 1rem;
}

.project-summary section {
    padding-left: 1rem;
    border-left: 2px solid rgba(0, 206, 201, 0.45);
}

.project-summary h6 {
    margin-bottom: 0.35rem;
    color: #ffffff;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.project-summary p,
.project-summary ul {
    margin-bottom: 0;
    color: #ccd0d4;
    font-size: 0.9rem;
    line-height: 1.55;
}

.project-summary ul {
    padding-left: 1.1rem;
}

.project-details {
    color: #ffffff;
}

.project-details summary {
    color: var(--accent-color);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

.project-details summary:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 4px;
}

/* Premium neutral badges */
.badge {
    padding: 0.38rem 0.65rem;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.065) !important;
    color: rgba(255, 255, 255, 0.82) !important;
    font-size: 0.72rem;
    font-weight: 550;
    line-height: 1;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.badge:hover {
    background: rgba(255, 255, 255, 0.095) !important;
    border-color: rgba(255, 255, 255, 0.17);
    color: #ffffff !important;
}

/* Projects page */
.projects-page {
    max-width: 1120px;
    padding-bottom: 8rem !important;
}

.projects-header {
    max-width: 720px;
}

.projects-header h1 {
    font-size: clamp(2.75rem, 5vw, 4.75rem);
    font-weight: 650;
    line-height: 0.98;
    letter-spacing: -0.045em;
}

.projects-header p {
    max-width: 62ch;
    font-size: 1rem;
    line-height: 1.6;
}

.projects-eyebrow {
    display: inline-block;
    margin-bottom: 0.85rem;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.projects-grid {
    --bs-gutter-x: 1.5rem;
    --bs-gutter-y: 1.5rem;
    align-items: stretch;
}

.projects-grid > [class*="col-"] {
    margin-bottom: 0 !important;
}

.project-card {
    height: 100% !important;
    overflow: hidden;
    border-color: rgba(255, 255, 255, 0.11);
    border-radius: 20px;
    background: rgba(17, 24, 34, 0.78);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
}

.project-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.17);
    background: rgba(20, 28, 39, 0.88);
    box-shadow: 0 22px 58px rgba(0, 0, 0, 0.28);
}

.project-card .card-body,
.project-card .card-body.p-4,
.project-card .card-body.p-5 {
    padding: 1.4rem !important;
}

.project-card-featured .card-body,
.project-card-featured .card-body.p-5 {
    padding: clamp(1.4rem, 2.4vw, 2rem) !important;
}

.project-featured-layout {
    align-items: stretch;
}

.project-media-column {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: rgba(5, 10, 17, 0.52);
}

.project-media-column .carousel {
    width: 100%;
    height: auto !important;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
}

.project-card .card-title {
    font-size: clamp(1.25rem, 2vw, 1.65rem);
    font-weight: 620 !important;
    letter-spacing: -0.025em;
}

.project-card .lead,
.project-card .project-description {
    font-size: 0.94rem;
    font-weight: 400;
    line-height: 1.55;
}

.project-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem 1rem;
    margin-top: 1rem;
    margin-bottom: 1.1rem;
}

.project-summary section {
    padding-left: 0.75rem;
    border-left-width: 1px;
    border-left-color: rgba(0, 206, 201, 0.32);
}

.project-summary h6 {
    margin-bottom: 0.25rem;
    font-size: 0.66rem;
    font-weight: 650;
    letter-spacing: 0.095em;
}

.project-summary p,
.project-summary ul {
    font-size: 0.8rem;
    font-weight: 400;
    line-height: 1.45;
}

.project-card .mb-4 {
    margin-bottom: 1rem !important;
}

.project-card .d-flex.gap-3 {
    gap: 0.65rem !important;
    flex-wrap: wrap;
}

.project-card .btn {
    min-height: 38px;
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 560;
}

.project-details {
    margin-top: 1rem !important;
    padding-top: 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.project-details summary {
    font-size: 0.78rem;
    font-weight: 560;
}

.project-carousel {
    background: rgba(4, 8, 14, 0.88);
}

.project-carousel .carousel-indicators {
    bottom: 0.45rem;
    gap: 0.3rem;
    margin-bottom: 0;
}

.project-carousel .carousel-indicators [data-bs-target] {
    width: 5px;
    height: 5px;
    margin: 0;
    border: 0;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.38);
}

.project-carousel .carousel-indicators .active {
    background-color: rgba(255, 255, 255, 0.92);
}

.project-carousel .carousel-control-prev,
.project-carousel .carousel-control-next {
    top: 50%;
    bottom: auto;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    background: rgba(8, 13, 21, 0.72);
    transform: translateY(-50%);
    opacity: 0.82;
}

.project-carousel .carousel-control-prev-icon,
.project-carousel .carousel-control-next-icon {
    width: 0.9rem;
    height: 0.9rem;
}

.browser-carousel .carousel-inner {
    padding: 2rem 0.7rem 1.8rem;
    background: rgba(6, 10, 17, 0.9);
}

.browser-carousel .carousel-inner::before,
.browser-mockup::before {
    content: "•••";
    position: absolute;
    top: 0.38rem;
    left: 0.7rem;
    z-index: 3;
    color: rgba(255, 255, 255, 0.32);
    font-size: 0.78rem;
    letter-spacing: 0.18em;
}

.browser-carousel .project-image {
    width: 100%;
    max-height: none;
    aspect-ratio: 16 / 10;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: #0b1018;
    object-fit: contain;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
}

.browser-carousel .carousel-control-prev {
    left: 1rem;
}

.browser-carousel .carousel-control-next {
    right: 1rem;
}

.phone-carousel .carousel-inner {
    padding: 1.2rem 3.5rem 2.2rem;
    background: radial-gradient(circle at 50% 42%, rgba(35, 48, 64, 0.75), rgba(6, 10, 17, 0.95) 64%);
}

.phone-carousel .project-image {
    width: min(250px, 100%);
    max-height: none;
    border: 7px solid #171c24;
    border-radius: 30px;
    background: #05070a;
    object-fit: contain;
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.42), inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.phone-carousel .carousel-control-prev {
    left: max(0.65rem, calc(50% - 165px));
}

.phone-carousel .carousel-control-next {
    right: max(0.65rem, calc(50% - 165px));
}

@media (min-width: 768px) {
    .rider-project-card {
        display: flex;
        flex-direction: column;
    }

    .rider-project-content {
        min-width: 0;
    }
}

.browser-mockup {
    position: relative;
    padding: 1.8rem 0.7rem 0.7rem;
    aspect-ratio: 16 / 10;
    background: rgba(6, 10, 17, 0.9) !important;
}

.browser-mockup .project-image {
    width: 100%;
    max-height: 100%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 9px;
    background: #0b1018;
    object-fit: contain;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
}

/* Contact */
.contact-message {
    max-width: 62ch;
    line-height: 1.7;
}

.contact-actions .btn {
    min-height: 56px;
}

/* Utility */
.text-primary {
    color: var(--primary-color) !important;
}

.section-title {
    font-weight: 700;
    margin-bottom: 2rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    display: block;
    width: 20%;
    height: 4px;
    background: var(--primary-color);
    margin-top: 0.5rem;
    border-radius: 2px;
}

/* Overrides */
.text-muted {
    color: #ccd0d4 !important;
}

/* Floating Navigation Dock */
.floating-dock {
    position: fixed;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(30, 30, 46, 0.55);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 
                inset 0 1px 1px rgba(255, 255, 255, 0.1),
                0 0 20px rgba(0, 206, 201, 0.08);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.floating-dock:hover {
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.6), 
                inset 0 1px 1px rgba(255, 255, 255, 0.2),
                0 0 30px rgba(0, 206, 201, 0.2);
}

.dock-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 1.2rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
}

.dock-item:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-8px) scale(1.15);
    box-shadow: 0 5px 15px rgba(0, 206, 201, 0.3);
}

.dock-item.active {
    color: var(--accent-color);
    background: rgba(0, 206, 201, 0.12);
    border-color: rgba(0, 206, 201, 0.45);
    box-shadow: 0 0 15px rgba(0, 206, 201, 0.35);
}

/* Tooltip labels for dock */
.dock-item::before {
    content: attr(data-label);
    position: absolute;
    bottom: 60px;
    background: rgba(20, 20, 31, 0.95);
    backdrop-filter: blur(5px);
    color: #fff;
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}

.dock-item:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Skill Card & Chips */
.skill-card {
    background: rgba(30, 30, 46, 0.4) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 20px !important;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.skill-card:hover {
    transform: translateY(-5px);
    border-color: rgba(0, 206, 201, 0.35) !important;
    box-shadow: 0 10px 30px rgba(0, 206, 201, 0.15) !important;
}

.skill-chip {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #ccd0d4;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: default;
}

.skill-card:hover .skill-chip {
    border-color: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

.skill-chip:hover {
    color: #ffffff !important;
    background: rgba(0, 206, 201, 0.18) !important;
    border-color: var(--accent-color) !important;
    box-shadow: 0 0 12px rgba(0, 206, 201, 0.45);
    transform: scale(1.06) translateY(-1px);
}

/* Experience Timeline */
.timeline {
    position: relative;
    padding-left: 20px;
    border-left: 2px solid rgba(255, 255, 255, 0.1);
    margin-left: 10px;
}

.timeline-item {
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -27px;
    top: 6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #1e1e2e;
    border: 2px solid var(--accent-color);
    box-shadow: 0 0 8px var(--accent-color);
    z-index: 2;
}

/* Custom colors for timeline items */
.timeline-item:nth-child(3)::before {
    border-color: var(--secondary-color);
    box-shadow: 0 0 8px var(--secondary-color);
}

.timeline-item:nth-child(5)::before {
    border-color: #00cec9;
    box-shadow: 0 0 8px #00cec9;
}

/* Fade In On Scroll Animation */
.fade-in-on-scroll {
    opacity: 0;
    transform: translateY(25px);
    transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 1s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

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

/* Responsiveness for floating dock */
@media (max-width: 576px) {
    .floating-dock {
        bottom: 15px;
        gap: 6px;
        padding: 8px 12px;
        border-radius: 30px;
    }
    .dock-item {
        width: 38px;
        height: 38px;
        font-size: 1.1rem;
    }
    .dock-item::before {
        bottom: 50px;
        font-size: 0.7rem;
        padding: 3px 8px;
    }
    body {
        margin-bottom: 0;
    }
}

/* Tech Background Styling */
.tech-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -9999;
    overflow: hidden;
    background: #060b13;
    pointer-events: none;
}

.tech-globe {
    position: absolute;
    top: -10%;
    right: -10%;
    width: 950px;
    height: 950px;
    background-image: url('../images/tech-globe.svg');
    background-repeat: no-repeat;
    background-size: contain;
    opacity: 0.26;
    pointer-events: none;
    transform-origin: center center;
    animation: techGlobeAnim 140s linear infinite;
    filter: drop-shadow(0 0 25px rgba(0, 206, 201, 0.15));
}

.tech-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 80% 20%, rgba(10, 25, 47, 0.25) 0%, rgba(6, 11, 19, 0.95) 70%);
    pointer-events: none;
}

@keyframes techGlobeAnim {
    0% {
        transform: rotate(0deg) translate(0, 0) scale(1);
    }
    50% {
        transform: rotate(180deg) translate(-25px, 20px) scale(1.02);
    }
    100% {
        transform: rotate(360deg) translate(0, 0) scale(1);
    }
}

/* Reduced Motion preferences */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto !important;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }

    .tech-globe {
        animation: none !important;
    }
    .fade-in-on-scroll {
        transition: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}

/* Responsive adjustment for the globe background */
@media (max-width: 992px) {
    .tech-globe {
        width: 750px;
        height: 750px;
        top: -5%;
        right: -15%;
        opacity: 0.2;
    }
}

@media (max-width: 576px) {
    .tech-globe {
        width: 480px;
        height: 480px;
        top: 5%;
        right: -20%;
        opacity: 0.16;
    }
}

/* Mobile layout refinements. Desktop presentation remains unchanged. */
@media (max-width: 767.98px) {
    html,
    body {
        max-width: 100%;
        overflow-x: hidden;
    }

    .container,
    .container-fluid,
    main {
        max-width: 100%;
    }

    main.pb-3 {
        padding-bottom: 0 !important;
    }

    .home-hero {
        margin-bottom: 1.5rem !important;
    }

    .home-hero .row {
        min-height: auto !important;
        padding-top: 4.5rem;
        padding-bottom: 2.5rem;
    }

    .home-hero-content {
        width: 100%;
        padding-right: 0;
    }

    .home-hero .display-1 {
        font-size: clamp(2.35rem, 10.5vw, 3.25rem);
        line-height: 1.08;
        margin-bottom: 1.25rem !important;
    }

    .display-1,
    .display-4 {
        font-size: clamp(2.25rem, 9vw, 3rem);
        line-height: 1.1;
    }

    .home-hero .lead {
        font-size: 1.05rem;
    }

    .home-hero-content > p.mb-5 {
        margin-bottom: 1.75rem !important;
    }

    .home-hero .profile-frame,
    .profile-frame {
        width: min(66vw, 240px);
        margin-top: 0.75rem;
        transform: none;
    }

    .home-capabilities {
        margin-top: 0 !important;
        padding-top: 1rem !important;
    }

    .container.py-5 {
        padding-top: 5rem !important;
        padding-bottom: 1.5rem !important;
    }

    .container.py-5 > .mb-5,
    .container.py-5 > h1.mb-5,
    .section-title.mb-5 {
        margin-bottom: 1.75rem !important;
    }

    .projects-grid {
        --bs-gutter-x: 1.25rem;
        --bs-gutter-y: 1.25rem;
    }

    .projects-grid > [class*="col-"] {
        width: 100%;
        margin-bottom: 0 !important;
    }

    .card {
        width: 100%;
        border-radius: 18px;
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
    }

    .card .card-body,
    .card .card-body.p-5,
    .card.p-4 {
        padding: 1.25rem !important;
    }

    .project-image-cover {
        aspect-ratio: 16 / 10;
    }

    .project-image-contain {
        width: auto;
        max-width: 100%;
        max-height: min(70vh, 360px);
    }

    .project-visual {
        aspect-ratio: 16 / 9;
    }

    .project-description {
        display: -webkit-box;
        overflow: hidden;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 7;
        line-clamp: 7;
    }

    .project-summary {
        gap: 0.85rem;
    }

    .project-summary section {
        padding-left: 0.75rem;
    }

    .project-summary p,
    .project-summary ul {
        font-size: 0.86rem;
    }

    .footer {
        width: 100%;
        margin-top: 3rem !important;
        padding: 1.5rem 0 5.5rem !important;
        text-align: center;
    }

    .footer .row {
        row-gap: 1rem;
    }

    .footer-social {
        gap: 0.75rem 1rem !important;
    }

    .footer-social a {
        white-space: nowrap;
    }

    .contact-card {
        text-align: center;
    }

    .contact-message {
        margin-right: auto;
        margin-left: auto;
        line-height: 1.6;
    }

    .contact-actions .btn {
        width: 100%;
        min-height: 52px;
        padding-right: 1rem;
        padding-left: 1rem;
    }

    .tech-globe {
        animation: none;
        filter: none;
    }

    .card,
    .floating-dock,
    .footer,
    .btn-primary,
    .btn-outline-light {
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }

    .card:hover,
    .profile-frame:hover,
    .profile-frame:hover img,
    .dock-item:hover,
    .btn-primary:hover {
        transform: none;
    }

    .fade-in-on-scroll {
        transition-duration: 0.35s;
        will-change: auto;
    }
}

@media (max-width: 575.98px) {
    .home-hero .d-flex.gap-3 {
        flex-direction: column;
    }

    .home-hero .btn {
        justify-content: center;
        width: 100%;
    }
}

@media (max-width: 991.98px) {
    .projects-page {
        max-width: 760px;
    }

    .project-card-featured .project-featured-layout > [class*="col-"] {
        width: 100%;
    }

    .project-card-featured .browser-carousel .project-image {
        aspect-ratio: 16 / 9;
    }
}

@media (max-width: 767.98px) {
    .container.py-5.projects-page {
        padding-bottom: 5.5rem !important;
    }

    .projects-header {
        margin-bottom: 1.75rem !important;
    }

    .projects-header h1 {
        font-size: clamp(2.3rem, 11vw, 3.35rem);
        letter-spacing: -0.04em;
    }

    .projects-header p {
        font-size: 0.92rem;
    }

    .projects-grid {
        --bs-gutter-x: 1rem;
        --bs-gutter-y: 1rem;
    }

    .project-card {
        border-radius: 17px;
    }

    .rider-project-card {
        display: block;
    }

    .project-card .card-body,
    .project-card .card-body.p-4,
    .project-card .card-body.p-5,
    .project-card-featured .card-body,
    .project-card-featured .card-body.p-5 {
        padding: 1.15rem !important;
    }

    .project-card .card-title {
        font-size: 1.25rem;
    }

    .project-summary {
        grid-template-columns: 1fr;
        gap: 0.7rem;
        margin-top: 0.85rem;
        margin-bottom: 0.9rem;
    }

    .project-summary p,
    .project-summary ul {
        font-size: 0.82rem;
        line-height: 1.45;
    }

    .project-card .badge {
        font-size: 0.68rem;
    }

    .browser-carousel .carousel-inner {
        padding: 1.8rem 0.55rem 1.65rem;
    }

    .phone-carousel .carousel-inner {
        padding: 1rem 3rem 2rem;
    }

    .phone-carousel .project-image {
        width: min(250px, 100%);
        border-width: 6px;
        border-radius: 27px;
    }

    .phone-carousel .carousel-control-prev {
        left: 0.55rem;
    }

    .phone-carousel .carousel-control-next {
        right: 0.55rem;
    }

    .project-carousel .carousel-control-prev,
    .project-carousel .carousel-control-next {
        width: 32px;
        height: 32px;
    }

    .browser-mockup {
        padding: 1.7rem 0.55rem 0.55rem;
        aspect-ratio: 16 / 10;
    }

    .project-card .d-flex.justify-content-between {
        align-items: flex-start !important;
        gap: 0.65rem;
    }
}
