/*
|--------------------------------------------------------------------------
| CSS Variables (Root Settings)
|--------------------------------------------------------------------------
*/
:root {
    --primary-color: #0f9ff8;
    --dark-bg: #091723;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    --container-max-width: 1280px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background-color: var(--dark-bg);
    color: white;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/*
|--------------------------------------------------------------------------
| Header Styles (portfolio-header)
|--------------------------------------------------------------------------
*/
.portfolio-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 999;
    background: rgba(9, 23, 35, 0.9);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex;
    justify-content: space-between;
    /* CORRECT: Puts space between Logo and Right side */
    align-items: center;
    /* Ensure padding is wide enough for desktop: */
    padding: 1rem 2rem;
}

/* --- NEW CSS ADDITION --- */
.header-right-actions {
    /* Set the profile/login action container to be a flex item */
    display: flex;
    align-items: center;
    /* Add space between the Blog link and the Login/Profile button */
    gap: 1.5rem;
}

.header-logo {
    display: flex;
    align-items: center;
    color: white;
    font-size: 1.25rem;
    font-weight: 700;
    text-decoration: none;
}

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

.header-nav {
    display: flex;
    gap: 2rem;
}

.header-nav .nav-link {
    color: white;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s;
    display: inline-block;
}

.header-nav .nav-link:hover {
    color: var(--primary-color);
}

.login-button {
    padding: 0.5rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 0.25rem;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    transition: background-color 0.2s;
}

.login-button:hover {
    background-color: #096198;
}

.nav-toggle-button {
    display: none;
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1000;
}

/*
|--------------------------------------------------------------------------
| Profile Dropdown Styles (for Logged-in Public Header)
|--------------------------------------------------------------------------
*/

.user-profile {
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar-container {
    position: relative;
    display: inline-block;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    /* Add a subtle ring for aesthetics */
    border: 2px solid var(--primary-color);
}

.profile-dropdown {
    position: absolute;
    top: 120%;
    right: 0;
    width: 200px;
    /* Adjusted size */
    background-color: var(--dark-bg);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    padding: 10px 0;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.profile-dropdown h4 {
    text-align: center;
}

.profile-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.dropdown-menu-list li {
    padding: 0;
}

.dropdown-menu-list a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    text-decoration: none;
    color: white;
    font-weight: 500;
    transition: background-color 0.2s;
}

.dropdown-menu-list a:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--primary-color);
}

.dropdown-menu-list i {
    font-size: 20px;
}

/* Ensure the profile shows correctly in the header nav container */
.header-nav-container .user-profile {
    order: 3;
    /* Ensure it stays on the right */
}

/*
|--------------------------------------------------------------------------
| Main Layout Structure
|--------------------------------------------------------------------------
*/
main {
    flex: 1;
}

.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
}

/*
|--------------------------------------------------------------------------
| Components (Hero, Buttons, Cards)
|--------------------------------------------------------------------------
*/

/* --- Back Button (Feature Page) --- */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 2rem;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    transition: color 0.3s;
}

.back-btn:hover {
    color: #096198;
}

/* --- Hero (Feature Page) --- */
.hero {
    text-align: center;
    margin-bottom: 4rem;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.75rem);
    font-weight: 800;
    margin-bottom: 1rem;
}

.hero .highlight {
    color: var(--primary-color);
}

.hero p {
    font-size: 1.125rem;
    color: #d1d5db;
    max-width: 48rem;
    margin: 0 auto;
}

/* --- Services Grid (Feature Page) --- */
.services-grid {
    /* MASONRY DEFAULT: 3 Columns */
    column-count: 3;
    column-gap: 2rem;
    margin-bottom: 5rem;
}

.service-card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(5px);
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s;

    /* MASONRY FLOW + INTERNAL FLEX */
    display: block;
    width: 100%;
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.service-card:hover {
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.02);
}

.service-image {
    position: relative;
    height: 12rem;
    overflow: hidden;
}

.service-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.service-card:hover .service-image img {
    transform: scale(1.1);
}

.image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, var(--dark-bg), transparent);
}

.service-icon {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.service-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.service-content h3 {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.service-short-desc {
    color: #d1d5db;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.service-details {
    overflow: hidden;
    transition: all 0.3s;
    max-height: 0;
    opacity: 0;
}

.service-details.expanded {
    max-height: 1000px;
    opacity: 1;
}

.service-full-desc {
    color: #d1d5db;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.features-list {
    margin-bottom: 1rem;
}

.features-list h4 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

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

.features-list li {
    display: flex;
    align-items: start;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #d1d5db;
}

.checkmark {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.expand-btn {
    margin-top: auto;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: 0.5rem;
    border: 2px solid;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1rem;
}

/* --- CTA Section --- */
.cta-section {
    background: linear-gradient(to right, rgba(15, 159, 248, 0.2), rgba(9, 97, 152, 0.2));
    border-radius: 1rem;
    padding: 3rem 2rem;
    text-align: center;
    border: 1px solid rgba(15, 159, 248, 0.3);
}

.cta-section h2 {
    font-size: clamp(1.875rem, 4vw, 2.25rem);
    font-weight: bold;
    margin-bottom: 1rem;
}

.cta-section p {
    font-size: 1.125rem;
    color: #d1d5db;
    margin-bottom: 2rem;
    max-width: 42rem;
    margin-left: auto;
    margin-right: auto;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.cta-btn-primary {
    padding: 1rem 2rem;
    font-weight: 600;
    border-radius: 0.5rem;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    transition: background 0.3s;
}

.cta-btn-primary:hover {
    background: #096198;
}

.cta-btn-secondary {
    padding: 1rem 2rem;
    font-weight: 600;
    border-radius: 0.5rem;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    text-decoration: none;
    transition: all 0.3s;
}

.cta-btn-secondary:hover {
    background: var(--primary-color);
    color: white;
}

/* --- Portfolio/Home Section Wrapper --- */
.hero-section-wrapper {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8rem 1rem 4rem 1rem;
}

.hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    /* background-image: url("/assets/images/hero.png"); */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.7;
    z-index: 0;
}

.hero-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: var(--container-max-width);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 3rem;
}

.hero-content-left {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 36rem;
    text-align: center;
}

.hero-heading {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
}

.hero-lead {
    font-size: 1.0rem;
    color: #d1d5db;
}

.hero-button-group {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: 0.5rem;
    transition: all 0.2s;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    color: white;
    background-color: var(--primary-color);
}

.btn-secondary {
    color: var(--primary-color);
    border: 2px solid #024974ff;
    background-color: transparent;
}

/* --- Glass Cards (Portfolio) --- */
.hero-image-container {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 400px;
    max-height: 600px;
}



/* --- Feature Sections --- */
.feature-section {
    padding: 4rem 1rem;
    max-width: var(--container-max-width);
    margin: 0 auto;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.background-text-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    text-align: center;
    pointer-events: none;
    font-family: var(--font-family);
    font-size: clamp(4rem, 15vw, 12rem);
    font-weight: 800;
    line-height: 1;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.1);
    letter-spacing: 0.5em;
    white-space: nowrap;
    z-index: 0;
}

.feature-heading-group {
    max-width: 48rem;
    text-align: center;
    margin: 0 auto 3rem;
}

.feature-heading {
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 0.5rem;
}

.feature-lead {
    font-size: 1.125rem;
    color: #d1d5db;
}

.feature-content-grid {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.feature-list-column {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    width: 100%;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    border-radius: 0.5rem;
    transition: background-color 0.3s;
}

.feature-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.feature-icon {
    width: 2.5rem;
    height: 2.5rem;
    color: var(--primary-color);
    flex-shrink: 0;
    margin-top: 0.25rem;
}

.feature-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.feature-description {
    font-size: 0.95rem;
    color: #d1d5db;
}

.feature-cards-column {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    width: 100%;
}

.feature-card {
    background-color: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(5px);
    padding: 1.5rem;
    border-radius: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.feature-card-title {
    font-size: 1.5rem;
    font-weight: 700;
}

.feature-card-image img {
    width: 100%;
    max-height: 250px;
    object-fit: cover;
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* --- Shared Footer --- */
.main-footer {
    padding: 1.36rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.05);
    /* flex-shrink: 0; is redundant here */
}

.footer-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.footer-link {
    color: #72e1ee;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: #58a6ff;
    text-decoration: underline;
}

/*
|--------------------------------------------------------------------------
| New Floating Cube Animation (Replaces Glassy Cards)
|--------------------------------------------------------------------------
*/

/* --- Keyframes for Box Entry --- */
@keyframes slide-in-from-top {
    0% {
        opacity: 0;
        transform: translateY(-200%) scale(0.5);
    }

    70% {
        opacity: 1;
        transform: translateY(0) scale(1.05);
    }

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

@keyframes slide-in-from-left {
    0% {
        opacity: 0;
        transform: translateX(-200%) scale(0.5);
    }

    70% {
        opacity: 1;
        transform: translateX(0) scale(1.05);
    }

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

@keyframes slide-in-from-right {
    0% {
        opacity: 0;
        transform: translateX(200%) scale(0.5);
    }

    70% {
        opacity: 1;
        transform: translateX(0) scale(1.05);
    }

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

/* --- Keyframes for Sphere Entry --- */
@keyframes spin-in-from-top {
    0% {
        opacity: 0;
        transform: translateY(-200%) scale(0) rotate(0deg);
    }

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

@keyframes spin-in-from-left {
    0% {
        opacity: 0;
        transform: translateX(-200%) scale(0) rotate(0deg);
    }

    100% {
        opacity: 1;
        transform: translateX(0) scale(1) rotate(720deg);
    }
}

@keyframes spin-in-from-right {
    0% {
        opacity: 0;
        transform: translateX(200%) scale(0) rotate(0deg);
    }

    100% {
        opacity: 1;
        transform: translateX(0) scale(1) rotate(720deg);
    }
}

/* --- Keyframes for Continuous Floating --- */
@keyframes float-loop {
    0% {
        transform: translateY(0);
    }

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

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

@keyframes float-loop-slow {
    0% {
        transform: translateY(0);
    }

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

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

/* --- Tweak the hero container --- */
.hero-image-container {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 450px;
    /* Give it space */
}

/* --- Main animation wrapper --- */
.floating-tech-wrapper {
    position: relative;
    width: 100%;
    max-width: 500px;
    /* Max width of the animation area */
    height: 400px;
    /* Fixed height */
    margin: 0 auto;
}

/* --- Background Circles --- */
.bg-circle-lg,
.bg-circle-md {
    position: absolute;
    border-radius: 50%;
    background: rgba(15, 159, 248, 0.05);
    /* Faint primary color */
    z-index: 1;
}

.bg-circle-lg {
    width: 400px;
    height: 400px;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

.bg-circle-md {
    width: 300px;
    height: 300px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(15, 159, 248, 0.05);
}

/* --- Base Floating Elements (ONE clean definition) --- */
.floating-box,
.floating-sphere {
    position: absolute;
    z-index: 10;
    border-radius: 16px;
    /* Rounded cubes */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0;
    /* Start hidden */
    animation-fill-mode: forwards;
    /* Keep end state of intro animation */
}

.floating-sphere {
    border-radius: 50%;
}

/* --- Individual Elements (Corrected and Restored) --- */

/* ✅ RESTORED BOX 1: Pinkish/Orange - Comes from Top */
.floating-box.box-1 {
    width: 130px;
    height: 130px;
    background-color: #fab387;
    top: 20px;
    right: 80px;
    animation:
        slide-in-from-top 1s ease-out 0.2s forwards,
        float-loop 3.5s ease-in-out 1.2s infinite;
}

/* ✅ RESTORED BOX 2: Main white/light - Comes from Left */
.floating-box.box-2 {
    width: 150px;
    height: 150px;
    background-color: #cdd6f4;
    top: 100px;
    left: 20px;
    animation:
        slide-in-from-left 1s ease-out 0.4s forwards,
        float-loop 5s ease-in-out 1.4s infinite;
}

/* ✅ RESTORED BOX 3: Blue - Comes from Right */
.floating-box.box-3 {
    width: 100px;
    height: 100px;
    background-color: var(--primary-color);
    bottom: 40px;
    left: 140px;
    animation:
        slide-in-from-right 1s ease-out 0.6s forwards,
        float-loop 4.2s ease-in-out 1.6s infinite;
}

/* Box 4: Small white/light - Comes from Top */
.floating-box.box-4 {
    width: 90px;
    height: 90px;
    background-color: #cdd6f4;
    bottom: 60px;
    right: 30px;
    animation:
        slide-in-from-top 1s ease-out 0.8s forwards,
        float-loop 6s ease-in-out 1.8s infinite;
}

/* --- Spheres (Corrected "spin-in" versions) --- */
/* Sphere 1: White - SPINS from Left */
.floating-sphere.sphere-1 {
    width: 40px;
    height: 40px;
    background-color: #cdd6f4;
    top: 50px;
    left: 180px;
    animation:
        spin-in-from-left 1.2s cubic-bezier(0.25, 1, 0.5, 1) 0.3s forwards,
        float-loop-slow 3s ease-in-out 1.5s infinite;
}

/* Sphere 2: Yellowish - SPINS from Right */
.floating-sphere.sphere-2 {
    width: 30px;
    height: 30px;
    background-color: #f9e2af;
    top: 180px;
    left: 240px;
    animation:
        spin-in-from-right 1.2s cubic-bezier(0.25, 1, 0.5, 1) 0.5s forwards,
        float-loop-slow 2.5s ease-in-out 1.7s infinite;
}

/* Sphere 3: White - SPINS from Top */
.floating-sphere.sphere-3 {
    width: 20px;
    height: 20px;
    background-color: #cdd6f4;
    bottom: 120px;
    right: 140px;
    animation:
        spin-in-from-top 1.2s cubic-bezier(0.25, 1, 0.5, 1) 0.7s forwards,
        float-loop-slow 3.8s ease-in-out 1.9s infinite;
}

/* --- Responsive Media Queries --- */
@media (max-width: 1024px) {
    .floating-tech-wrapper {
        transform: scale(0.8);
    }
}

@media (max-width: 768px) {
    .hero-image-container {
        min-height: 350px;
        margin-top: -2rem;
    }

    .floating-tech-wrapper {
        transform: scale(0.7);
    }
}

/*
|--------------------------------------------------------------------------
| New Floating Image Animations (Computer & Person)
|--------------------------------------------------------------------------
*/

/* --- Base style for new images --- */
.floating-image {
    position: absolute;
    z-index: 10;
    opacity: 0;
    /* Start hidden */
    animation-fill-mode: forwards;
    /* Keep end state of intro animation */
}

.floating-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Ensures your image aspect ratio is kept */
    /* Add a nice shadow to make it pop */
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.4));
}

/* --- Individual Image Styles --- */

/* 1. The Computer Image */
.computer-image {
    width: 120px;
    height: 120px;
    top: 200px;
    /* Position in the middle-right */
    right: 40px;
    animation:
        slide-in-from-right 1s ease-out 0.9s forwards,
        /* Slides in from the right */
        float-loop 5.5s ease-in-out 1.9s infinite;
    /* Floats at a slow speed */
}

/* 2. The Person Image */
.person-image {
    width: 100px;
    height: 100px;
    bottom: 50px;
    /* Position in the bottom-left */
    left: 50px;
    animation:
        slide-in-from-left 1s ease-out 1.1s forwards,
        /* Slides in from the left */
        float-loop-slow 4.8s ease-in-out 2.1s infinite;
    /* Floats at a different speed */
}

/*
|--------------------------------------------------------------------------
| Media Queries (Unified)
|--------------------------------------------------------------------------
*/

/* Mobile Styles (Max 767px / 768px used for layout/header) */
@media (max-width: 768px) {

    /* Header/Navigation */
    .nav-toggle-button {
        display: block;
    }

    .header-nav-container {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 4rem;
        right: 0;
        width: 100%;
        max-width: 300px;
        background: var(--dark-bg);
        padding: 1.5rem;
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
        align-items: flex-start;
        border-radius: 0 0 0.5rem 0.5rem;
        transition: opacity 0.3s, transform 0.3s;
        opacity: 0;
        transform: translateY(-20px);
    }

    .header-nav-container.open {
        display: flex;
        opacity: 1;
        transform: translateY(0);
    }

    .header-nav {
        flex-direction: column;
        gap: 0.75rem;
        width: 100%;
        padding-bottom: 1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        margin-bottom: 1rem;
    }

    .header-nav .nav-link {
        font-size: 1.1rem;
        padding: 0.25rem 0;
    }

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

    /* Footer */
    .main-footer {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    /* Feature Page Specific */
    .services-grid {
        column-count: 1;
        column-gap: 0;
        /* Ensures gap is zero on mobile */
    }

    .service-card {
        margin-bottom: 2rem;
    }

    /* FIX: Ensure main content uses reduced padding on small screens */
    main {
        padding: 2rem 1rem 4rem;
    }

    .portfolio-header {
        padding: 1rem 1rem;
    }
}

/* Very Small Mobile fix (Max 480px, inherited from previous steps) */
@media (max-width: 480px) {
    .portfolio-header {
        padding: 1rem 0.5rem;
    }

    main {
        padding: 2rem 0.7rem 4rem;
    }
}

@media (max-width: 820px) {
    .portfolio-header {
        padding: 1rem 0.5rem;
    }

    main {
        padding: 2rem 0.7rem 4rem;
    }
}

@media (max-width: 1024px) {
    .portfolio-header {
        padding: 1rem 0.5rem;
    }

    main {
        padding: 2rem 0.7rem 4rem;
    }
}

@media (max-width: 1280px) {
    .portfolio-header {
        padding: 1rem 0.5rem;
    }

    main {
        padding: 2rem 0.7rem 4rem;
    }
}

@media (max-width: 1430px) {
    .portfolio-header {
        padding: 1rem 0.5rem;
    }

    main {
        padding: 2rem 0.7rem 4rem;
    }
}

@media (max-width: 1447px) {
    .portfolio-header {
        padding: 1rem;
    }

    main {
        padding: 2rem 0.7rem 4rem;
    }
}

@media (max-width: 1470px) {
    .portfolio-header {
        padding: 1rem 0.5rem;
    }

    main {
        padding: 2rem 0.7rem 4rem;
    }
}

/* Tablet/Desktop Styles (Min 768px / 1024px used for component structure) */

@media (min-width: 768px) {

    /* Header/Navigation */
    .header-nav-container {
        display: flex !important;
        position: static;
        width: auto;
        max-width: none;
        background: transparent;
        padding: 0;
        box-shadow: none;
        opacity: 1;
        transform: none;
    }
}

@media (min-width: 640px) {

    /* Hero Section (Portfolio) */
    .hero-button-group {
        flex-direction: row;
    }

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

@media (min-width: 1024px) {

    /* Hero Section (Portfolio) */
    .hero-container {
        flex-direction: row;
    }

    .hero-content-left {
        gap: 2rem;
        text-align: left;
    }

    .hero-button-group {
        justify-content: flex-start;
    }

    .hero-image-container {
        width: 50%;
    }

    .hero-heading {
        font-size: 3.5rem;
    }

    /* Feature Sections */
    .feature-content-grid {
        flex-direction: row;
        align-items: flex-start;
        gap: 5rem;
    }

    .feature-list-column {
        width: 40%;
        order: 1;
    }

    .feature-cards-column {
        width: 60%;
        order: 2;
    }

    .feature-content-grid:nth-child(3) .feature-list-column {
        order: 2;
    }

    .feature-content-grid:nth-child(3) .feature-cards-column {
        order: 1;
    }
}




/*
|--------------------------------------------------------------------------
| Infinite Scroll Ticker Section
|--------------------------------------------------------------------------
*/

.ticker-section {
    padding: 4rem 0;
    /* Full width, vertical padding only */
    position: relative;
    overflow: hidden;
    background: transparent;
}

/* Gradient mask to fade edges */
.ticker-container {
    width: 100%;
    position: relative;
    overflow: hidden;
    mask-image: linear-gradient(to right,
            transparent,
            black 10%,
            black 90%,
            transparent);
    -webkit-mask-image: linear-gradient(to right,
            transparent,
            black 10%,
            black 90%,
            transparent);
}

.ticker-track {
    display: flex;
    gap: 2rem;
    /* Space between cards */
    width: max-content;
    /* The animation duration controls the speed */
    animation: scroll-horizontal 30s linear infinite;
}

/* Pause animation on hover for readability */
.ticker-track:hover {
    animation-play-state: paused;
}

@keyframes scroll-horizontal {
    0% {
        transform: translateX(0);
    }

    100% {
        /* Move left by 50% assuming we duplicated the content exactly once */
        transform: translateX(-50%);
    }
}

/* --- Card Styling --- */
.ticker-card {
    flex: 0 0 400px;
    /* Fixed width for cards */
    background: rgba(20, 30, 45, 0.6);
    /* Slightly lighter than dark-bg */
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.ticker-card:hover {
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.05);
}

/* Card Internal Typography */
.card-icon {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.card-icon i {
    font-size: 1.5rem;
}

.card-icon h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    margin: 0;
}

.ticker-card h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: white;
    line-height: 1.4;
}

.ticker-card p {
    font-size: 0.95rem;
    color: #94a3b8;
    /* Slate grey text */
    line-height: 1.6;
    margin-bottom: 2rem;
}

.card-stats {
    display: flex;
    gap: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat-val {
    font-size: 1.5rem;
    font-weight: 700;
}

.stat-label {
    font-size: 0.8rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-img-avatar {
    width: 50px;
    /* Size of the image */
    height: 50px;
    border-radius: 50%;
    /* Makes it circular */
    object-fit: cover;
    /* Prevents stretching */
    margin-left: auto;
    /* ✨ This pushes the image to the far right */
    border: 2px solid rgba(255, 255, 255, 0.2);
    /* Optional: nice border */
}

/* --- Bottom Row Container --- */
.card-action-row {
    display: flex;
    justify-content: space-between;
    /* Stats Left, Socials Right */
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    /* Move border here */
    padding-top: 1rem;
    margin-top: auto;
    /* Pushes to bottom if card height varies */
}

/* Update Existing Stats to fit */
.card-stats {
    display: flex;
    gap: 1.5rem;
    border-top: none;
    align-items: center;
    /* Remove old border */
    padding-top: 0;
    /* Remove old padding */
}

/* --- Social Buttons --- */
.card-socials {
    display: flex;
    gap: 0.5rem;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    color: #94a3b8;
    font-size: 1.2rem;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.social-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(15, 159, 248, 0.3);
    /* Glow effect */
}

/* Mobile Adjustment */
@media (max-width: 768px) {
    .ticker-card {
        flex: 0 0 300px;
        /* Smaller cards on mobile */
        padding: 1.5rem;
    }

    .ticker-track {
        animation-duration: 20s;
        /* Faster on mobile or keep same */
    }
}