/* Enable buttery smooth scrolling for all anchor links site-wide */
html {
    scroll-behavior: smooth;
}

/* Reset and Base Styles */
body, html {
    margin: 0;
    padding: 0;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: #111111; /* Deep, cinematic dark mode */
    color: #ffffff;
    overflow-x: hidden;
}

a, button {
    text-decoration: none !important;
}

/* --- CUSTOM CURSOR --- */
/* Hide the default system pointer on the body and clickable items */
body, a, button, .project-card, .build-card, .service-card {
    cursor: none !important;
}

/* If JS detects a touch device, restore the native pointer */
body.touch-device,
.touch-device a,
.touch-device button,
.touch-device .project-card,
.touch-device .build-card,
.touch-device .service-card {
    cursor: auto !important;
}

/* --- LK ADDS 20260723 --- */
/*
  * Ensure the parent container of the image and text
  * has position: relative so the absolute positioning works.
  * Replace '.process-container' with your actual parent class.
*/
.proc-img-head-container {
}

/* Style the icon */
.process-icon {
}

/*
 * Target the element immediately following the process-icon.
 * You can replace the '*' with your specific class (e.g., '.process-title')
*/
.process-icon + * {
}

.process-icon {
    width: 33%;
    height: auto;
}

/* --- END LK ADDS 20260723 --- */
.custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 20px;
    height: 20px;
    background-color: rgba(255, 51, 51, 0.5); /* Translucent Lucid Red */
    border: 2px solid #ff3333;
    border-radius: 50%;
    pointer-events: none; /* CRUCIAL: Lets the user actually click through the dot */
    z-index: 9999; /* Keeps it on top of everything */
    transform: translate(-50%, -50%); /* Centers the dot exactly on the mouse coordinates */
    /* Removed the backdrop-filter blur here */
    transition: width 0.3s ease, height 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

/* The "Target Lock" state when hovering over projects or buttons */
.custom-cursor.cursor-grow {
    /* Triggers the rapid twitch animation below */
    animation: cursor-target-lock 0.3s forwards ease-out;
}

@keyframes cursor-target-lock {
    0% {
        width: 20px;
        height: 20px;
        border-color: #ff3333;
        background-color: rgba(255, 51, 51, 0.5);
    }
    30% {
        width: 60px;
        height: 4px; /* Horizontal squish/glitch */
        border-color: #ffffff;
        background-color: transparent;
    }
    60% {
        width: 4px;
        height: 60px; /* Vertical squish/glitch */
        border-color: #ffffff;
        background-color: transparent;
    }
    100% {
        width: 12px;
        height: 12px; /* Locks into a tiny precision dot */
        border-color: #ffffff;
        background-color: #ffffff;
    }
}

/* ************************CHROMATIC GLITCH BORDERS************************ */
/* --- The Chromatic Borders --- */
.chromatic-border {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Prevents borders from blocking clicks */
    mix-blend-mode: screen;
    z-index: 2;
    filter: blur(0px); /* Rests perfectly crisp */
    transition: all 0.2s ease;
    border-radius: 12px; /* Matches the card's rounded corners perfectly */
    box-sizing: border-box;
}

/* Base Colors */
.chromatic-border.red {
    border: 2px solid #ff0000;
}

.chromatic-border.green {
    border: 2px solid #00ff00;
}

.chromatic-border.blue {
    border: 2px solid #0000ff;
}

/*
  Hover State:
  When you hover over ANY glitch container (or the service card),
  stop the animation and lock it into a crisp white box.
*/
[class*="glitch-"]:hover .chromatic-border,
.service-card:hover .chromatic-border {
    transform: translate(0, 0) !important;
    filter: blur(0px) !important;
    border-color: #ffffff;
    animation: none !important;
}

/* --- ASSIGNING THE VARIANTS --- */
/* Different irregular durations so they never sync up on the page */

.glitch-v1 .chromatic-border.red {
    animation: twitch-v1-red 18.2s infinite;
}

.glitch-v1 .chromatic-border.green {
    animation: twitch-v1-green 18.2s infinite;
}

.glitch-v1 .chromatic-border.blue {
    animation: twitch-v1-blue 18.2s infinite;
}

.glitch-v2 .chromatic-border.red {
    animation: twitch-v2-red 29.1s infinite;
}

.glitch-v2 .chromatic-border.green {
    animation: twitch-v2-green 29.1s infinite;
}

.glitch-v2 .chromatic-border.blue {
    animation: twitch-v2-blue 29.1s infinite;
}

.glitch-v3 .chromatic-border.red {
    animation: twitch-v3-red 17.9s infinite;
}

.glitch-v3 .chromatic-border.green {
    animation: twitch-v3-green 17.9s infinite;
}

.glitch-v3 .chromatic-border.blue {
    animation: twitch-v3-blue 17.9s infinite;
}

.glitch-v4 .chromatic-border.red {
    animation: twitch-v4-red 20.3s infinite;
}

.glitch-v4 .chromatic-border.green {
    animation: twitch-v4-green 20.3s infinite;
}

.glitch-v4 .chromatic-border.blue {
    animation: twitch-v4-blue 20.3s infinite;
}

.glitch-v5 .chromatic-border.red {
    animation: twitch-v5-red 18.7s infinite;
}

.glitch-v5 .chromatic-border.green {
    animation: twitch-v5-green 18.7s infinite;
}

.glitch-v5 .chromatic-border.blue {
    animation: twitch-v5-blue 18.7s infinite;
}

/* ==========================================
   THE GLITCH KEYFRAMES (ULTRA-TIGHT DISTANCES)
========================================== */

/* VARIANT 1: Mid-cycle glitch */
@keyframes twitch-v1-red {
    0%, 49%, 52%, 100% {
        transform: translate(0, 0);
        filter: blur(0px);
    }
    49.5% {
        transform: translate(-2px, -1px);
        filter: blur(2px);
    }
    50.5% {
        transform: translate(2px, 1px);
        filter: blur(1px);
    }
    51.5% {
        transform: translate(-3px, -2px);
        filter: blur(2px);
    }
}

@keyframes twitch-v1-green {
    0%, 49%, 52%, 100% {
        transform: translate(0, 0);
        filter: blur(0px);
    }
    49.5% {
        transform: translate(2px, -1px);
        filter: blur(1px);
    }
    50.5% {
        transform: translate(-1px, 2px);
        filter: blur(2px);
    }
    51.5% {
        transform: translate(3px, -1px);
        filter: blur(1px);
    }
}

@keyframes twitch-v1-blue {
    0%, 49%, 52%, 100% {
        transform: translate(0, 0);
        filter: blur(0px);
    }
    49.5% {
        transform: translate(-1px, 2px);
        filter: blur(1px);
    }
    50.5% {
        transform: translate(2px, -2px);
        filter: blur(2px);
    }
    51.5% {
        transform: translate(-1px, 3px);
        filter: blur(1px);
    }
}

/* VARIANT 2: Early glitch */
@keyframes twitch-v2-red {
    0%, 14%, 17%, 100% {
        transform: translate(0, 0);
        filter: blur(0px);
    }
    14.5% {
        transform: translate(2px, 1px);
        filter: blur(2px);
    }
    15.5% {
        transform: translate(-1px, -2px);
        filter: blur(2px);
    }
    16.5% {
        transform: translate(1px, 2px);
        filter: blur(1px);
    }
}

@keyframes twitch-v2-green {
    0%, 14%, 17%, 100% {
        transform: translate(0, 0);
        filter: blur(0px);
    }
    14.5% {
        transform: translate(-2px, -2px);
        filter: blur(2px);
    }
    15.5% {
        transform: translate(2px, 1px);
        filter: blur(1px);
    }
    16.5% {
        transform: translate(-2px, -1px);
        filter: blur(2px);
    }
}

@keyframes twitch-v2-blue {
    0%, 14%, 17%, 100% {
        transform: translate(0, 0);
        filter: blur(0px);
    }
    14.5% {
        transform: translate(1px, -1px);
        filter: blur(1px);
    }
    15.5% {
        transform: translate(-2px, 3px);
        filter: blur(2px);
    }
    16.5% {
        transform: translate(2px, -2px);
        filter: blur(2px);
    }
}

/* VARIANT 3: Late glitch */
@keyframes twitch-v3-red {
    0%, 83%, 86%, 100% {
        transform: translate(0, 0);
        filter: blur(0px);
    }
    83.5% {
        transform: translate(-2px, 2px);
        filter: blur(2px);
    }
    84.5% {
        transform: translate(3px, -1px);
        filter: blur(1px);
    }
    85.5% {
        transform: translate(-1px, -3px);
        filter: blur(2px);
    }
}

@keyframes twitch-v3-green {
    0%, 83%, 86%, 100% {
        transform: translate(0, 0);
        filter: blur(0px);
    }
    83.5% {
        transform: translate(1px, -2px);
        filter: blur(1px);
    }
    84.5% {
        transform: translate(-2px, 2px);
        filter: blur(2px);
    }
    85.5% {
        transform: translate(2px, 1px);
        filter: blur(2px);
    }
}

@keyframes twitch-v3-blue {
    0%, 83%, 86%, 100% {
        transform: translate(0, 0);
        filter: blur(0px);
    }
    83.5% {
        transform: translate(2px, 1px);
        filter: blur(2px);
    }
    84.5% {
        transform: translate(-1px, -2px);
        filter: blur(2px);
    }
    85.5% {
        transform: translate(3px, 2px);
        filter: blur(1px);
    }
}

/* VARIANT 4: The Double Stutter (Two glitches per cycle) */
@keyframes twitch-v4-red {
    0%, 32%, 35%, 72%, 75%, 100% {
        transform: translate(0, 0);
        filter: blur(0px);
    }
    33% {
        transform: translate(2px, -1px);
        filter: blur(2px);
    }
    34% {
        transform: translate(-2px, 2px);
        filter: blur(1px);
    }
    73% {
        transform: translate(-3px, -1px);
        filter: blur(2px);
    }
    74% {
        transform: translate(1px, 2px);
        filter: blur(2px);
    }
}

@keyframes twitch-v4-green {
    0%, 32%, 35%, 72%, 75%, 100% {
        transform: translate(0, 0);
        filter: blur(0px);
    }
    33% {
        transform: translate(-1px, 2px);
        filter: blur(1px);
    }
    34% {
        transform: translate(3px, -1px);
        filter: blur(2px);
    }
    73% {
        transform: translate(2px, 1px);
        filter: blur(2px);
    }
    74% {
        transform: translate(-2px, -2px);
        filter: blur(2px);
    }
}

@keyframes twitch-v4-blue {
    0%, 32%, 35%, 72%, 75%, 100% {
        transform: translate(0, 0);
        filter: blur(0px);
    }
    33% {
        transform: translate(-2px, -2px);
        filter: blur(2px);
    }
    34% {
        transform: translate(1px, 1px);
        filter: blur(2px);
    }
    73% {
        transform: translate(2px, -2px);
        filter: blur(1px);
    }
    74% {
        transform: translate(-1px, 2px);
        filter: blur(2px);
    }
}

/* VARIANT 5: Rapid micro-glitch */
@keyframes twitch-v5-red {
    0%, 62%, 64%, 100% {
        transform: translate(0, 0);
        filter: blur(0px);
    }
    62.5% {
        transform: translate(-1px, 1px);
        filter: blur(2px);
    }
    63.5% {
        transform: translate(1px, -1px);
        filter: blur(1px);
    }
}

@keyframes twitch-v5-green {
    0%, 62%, 64%, 100% {
        transform: translate(0, 0);
        filter: blur(0px);
    }
    62.5% {
        transform: translate(1px, -1px);
        filter: blur(1px);
    }
    63.5% {
        transform: translate(-1px, 1px);
        filter: blur(2px);
    }
}

@keyframes twitch-v5-blue {
    0%, 62%, 64%, 100% {
        transform: translate(0, 0);
        filter: blur(0px);
    }
    62.5% {
        transform: translate(1px, 1px);
        filter: blur(2px);
    }
    63.5% {
        transform: translate(-1px, -1px);
        filter: blur(1px);
    }
}

/* ************************END CHROMATIC GLITCH BORDERS************************ */


main {
    margin-top: 0;
    padding-top: 0;
}

/* Hero Section */
.hero-section {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-top: 0;
    padding-top: 0;
}

.hero-section > *:first-child {
    margin-top: 0;
}

/* Positioning the SVG behind the text */
.svg-container.logo-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 55vw; /* Increased from 40vw */
    max-width: 550px; /* Increased from 400px */
    z-index: 0;
    opacity: 0.6;
}

/* Making the SVG glow slightly */
#hero-svg {
    width: 100%;
    height: auto;
    filter: drop-shadow(0px 0px 15px rgba(255, 51, 51, 0.4));
}

/* Allow the GSAP spring animation to expand past the SVG canvas */
.svg-logo {
    overflow: visible !important;
}

/* Foreground Content */
.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.hero-title {
    font-size: clamp(3rem, 8vw, 7rem);
    font-weight: 900;
    letter-spacing: 2px;
    margin: 0;
    text-transform: uppercase;
    word-break: keep-all;
    overflow-wrap: break-word;
    hyphens: none;
    white-space: normal;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25em;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.5rem);
    color: #aaaaaa;
    margin-top: 10px;
}

/* Section Titles */
.section-title {
    text-align: center;
    font-size: clamp(2rem, 4vw, 3.5rem);
    margin: 6rem 0 3rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* ==========================================
   SERVICES GRID (What We Build)
========================================== */
.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 1fr;
    gap: 30px;
    padding: 0 10%;
    margin-bottom: 6rem;
}

@media (max-width: 1200px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .services-grid {
        grid-template-columns: 1fr;
    }
}

.service-card {
    position: relative;
    width: 100%;
    padding: 2.5rem 2rem;
    margin: 0 auto;
    background-size: cover;
    background-position: center;
    cursor: pointer;
    box-sizing: border-box;
    z-index: 1;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    overflow: visible;
    height: 100%;
}

.service-card h3 {
    margin: 0 0 10px 0;
    font-size: 1.5rem;
    text-transform: uppercase;
}

.service-card p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.4;
}

@media (max-width: 768px) {
    .service-card h3 {
        font-size: 1.2rem;
    }

    .service-card p {
        font-size: 0.9rem;
    }
}

.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: -1;
    border-radius: inherit; /* Keeps the dark tint perfectly rounded */
    pointer-events: none;
}

/* Make sure text sits above the overlay and borders */
.card-content {
    position: relative;
    z-index: 10;
}

/* ==========================================
   PORTFOLIO GRID
========================================== */
.project-meta {
    display: flex;
    gap: 40px;
    margin-bottom: 40px;
    flex-wrap: wrap;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 30px;
}

.meta-item h4 {
    color: #ff3333;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.meta-item p {
    color: #fff;
    font-size: 1.1rem;
    margin: 0;
}

.small-btn {
    padding: 10px 20px;
    font-size: 0.9rem;
}

.back-link {
    margin-top: 40px;
}

.project-description h2 {
    color: #ff3333;
    font-size: 1.8rem;
    margin-bottom: 20px;
    line-height: 1.2;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 30px;
    padding: 0 5%;
    margin-bottom: 5rem;
}

@media (max-width: 1200px) {
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .portfolio-grid {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }
}

/* Additional Work Grid */
.additional-work-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 20px;
    padding: 0 5%;
    margin-bottom: 5rem;
}

@media (max-width: 1400px) {
    .additional-work-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

@media (max-width: 1100px) {
    .additional-work-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 850px) {
    .additional-work-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 550px) {
    .additional-work-grid {
        grid-template-columns: 1fr !important;
    }
}

.project-card.small {
    min-height: 150px;
}

.project-card.small .project-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px 10px 10px;
    background: rgba(26, 26, 26, 0.9);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    transform: translateY(100%); /* Hidden initially */
    z-index: 4;
}

.project-card.small:hover .project-info {
    transform: translateY(0); /* Slides up on hover */
    background: rgba(0, 0, 0, 0.95);
    padding-top: 20px;
}

.project-card.small .project-info h3 {
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.project-card.small .project-info p {
    font-size: 0.75rem;
}

/* Small Project Modal */
.small-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: all 0.4s ease;
}

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

.small-modal-content {
    background: #1a1a1a;
    width: 90%;
    max-width: 500px;
    padding: 40px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    transform: translateY(20px);
    transition: transform 0.4s ease;
}

.small-modal-overlay.active .small-modal-content {
    transform: translateY(0);
}

.close-small-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s ease;
}

.close-small-modal:hover {
    color: #ff3333;
}

.small-modal-body h3 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    text-transform: uppercase;
    color: #fff;
}

.small-modal-categories {
    color: #ff3333;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.small-modal-description {
    color: #ccc;
    line-height: 1.6;
    font-size: 1rem;
    text-transform: none !important; /* Ensure NOT all caps */
}

.small-modal-description p {
    margin-bottom: 15px;
    text-transform: none !important;
}


.project-card {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    background: #222;
    cursor: pointer;
}

.project-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

/* Slide-up Info Overlay */
.project-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    padding: 30px 20px 20px;
    transform: translateY(100%);
    transition: transform 0.4s ease;
}

.project-card:hover .project-info {
    transform: translateY(0);
}

.project-info h3 {
    margin: 0 0 5px;
    font-size: 1.5rem;
}

.project-info p {
    margin: 0;
    color: #ff3333;
    font-size: 0.9rem;
    font-weight: bold;
    text-transform: uppercase;
}

/* Position the video exactly over the thumbnail */
.project-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0; /* Hidden by default */
    transition: opacity 0.4s ease;
    z-index: 1; /* Sits above the image, but below the text info */
}

/* Ensure the text info stays on top of the video */
.project-info {
    z-index: 2;
}

/* Fade out the image and fade in the video on hover */
.project-card:not(.small):hover .project-image {
    opacity: 0;
}

.project-card:not(.small):hover .project-video {
    opacity: 1;
}

/* Contact Section */
.contact-section {
    padding: 0 5%;
    margin-bottom: 8rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.contact-container {
    background: #1a1a1a;
    padding: 40px;
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-row input {
    flex: 1;
}

input, textarea {
    width: 100%;
    background: #222;
    border: 1px solid #333;
    color: #fff;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

input:focus, textarea:focus {
    outline: none;
    border-color: #ff3333;
}

.primary-btn {
    width: 100%;
    background: #ff3333;
    color: #fff;
    border: none;
    padding: 15px;
    font-size: 1.1rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.primary-btn:hover {
    background: #ff4d4d;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 51, 51, 0.4);
}

.primary-btn:disabled {
    background: #555;
    cursor: not-allowed;
}

/* Success SVG Styles */
.checkmark-svg {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    display: block;
}

.checkmark-circle {
    stroke: #ff3333;
    stroke-width: 2;
}

.checkmark-check {
    stroke: #ff3333;
    stroke-width: 4;
    stroke-linecap: round;
}

/* Project Detail Hero */
.project-hero {
    height: 70vh;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: flex-end;
    padding: 5%;
    margin-top: 0;
}

.project-hero > *:first-child {
    margin-top: 0;
}

/* Project Details Layout */
.project-details-section {
    display: flex;
    flex-wrap: wrap;
    gap: 50px;
    padding: 5% 10%;
    margin-bottom: 5rem;
}

.project-meta {
    flex: 1;
    min-width: 250px;
    background: rgba(255, 255, 255, 0.05);
    padding: 40px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    height: fit-content;
}

.meta-item {
    margin-bottom: 30px;
}

.meta-item h4 {
    color: #ff3333;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 5px 0;
    font-size: 0.9rem;
}

.meta-item p {
    margin: 0;
    font-size: 1.2rem;
    font-weight: bold;
}

.project-description {
    flex: 2;
    min-width: 300px;
    font-size: 1.1rem;
    line-height: 1.8;
    color: #cccccc;
}

.project-description h2 {
    color: #ffffff;
    margin-top: 0;
}

.small-btn {
    display: inline-block;
    padding: 10px 20px;
    font-size: 0.9rem;
    text-decoration: none;
    text-align: center;
    margin-top: 10px;
}

.secondary-btn {
    display: inline-block;
    margin-top: 40px;
    color: #ffffff;
    text-decoration: none;
    padding-bottom: 5px;
    transition: all 0.3s ease;
}

.secondary-btn:hover {
    color: #ff3333;
    transform: translateX(10px);
    letter-spacing: 1px;
}

/* ==========================================
   SERVICE DETAIL OVERLAY
========================================== */
.service-detail-overlay {
    position: fixed;
    top: 2vh;
    left: 1vw;
    width: 98vw;
    height: 96vh;
    background-color: rgba(17, 17, 17, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 2000;
    visibility: hidden;
    opacity: 0;
    overflow-y: auto;
    padding: 0;
    border-radius: 14px;
    border: 1px white solid;
}
.service-detail-overlay .close-overlay {
    position: sticky !important;
    bottom: 88vh;
    left: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255, 51, 51, 0.1);
    border: 1px solid rgba(255, 51, 51, 0.3);
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.service-detail-overlay .close-overlay:hover {
    background: rgba(255, 51, 51, 0.3);
    transform: rotate(90deg);
}

.service-detail-overlay .close-overlay span {
    position: absolute;
    width: 20px;
    height: 2px;
    background: #fff;
}

.service-detail-overlay .close-overlay span:nth-child(1) {
    transform: rotate(45deg);
}

.service-detail-overlay .close-overlay span:nth-child(2) {
    transform: rotate(-45deg);
}

.overlay-content-wrapper {
    max-width: 100%;
    width: 100%;
    margin-top: 0;
    margin-bottom: 0;
    margin-left: 0;
    margin-right: 0;
    background: #1a1a1a;
    border-radius: 0;
    border: none;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden; /* Ensures hero image stays within border radius */
}

.overlay-hero-image {
    width: 100%;
    height: 450px;
    background-size: cover;
    background-position: center;
    position: relative;
    border-bottom: 1px solid rgba(255, 51, 51, 0.2);
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    filter: brightness(0.7);
}

.overlay-title-wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    text-align: center;
}

.overlay-title-wrapper h2 {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    color: #ff3333;
    margin: 0;
    z-index: 2;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.9), 0 0 30px rgba(0, 0, 0, 0.7);
    padding: 0 40px;
}
.overlay-body {
    padding: 30px 60px 60px;
    font-size: 1.2rem;
    line-height: 1.8;
    color: #ccc;
}

.overlay-description {
    font-size: 1.4rem;
    color: #fff;
    font-weight: 500;
    margin-bottom: 2rem;
    border-left: 3px solid #ff3333;
    padding-left: 20px;
}

.overlay-rich-content {
    margin-top: 2rem;
}

.overlay-body p {
    margin-bottom: 1.5rem;
}

.overlay-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 2rem 0;
    display: block;
}

/* Image alignment helpers for rich text */
.overlay-body img.align-left {
    float: left;
    margin: 0 2rem 1.5rem 0;
    max-width: 50%;
    display: inline;
}

.overlay-body img.align-right {
    float: right;
    margin: 0 0 1.5rem 2rem;
    max-width: 50%;
    display: inline;
}

.overlay-body img.align-center {
    margin: 2rem auto;
    display: block;
    float: none;
}

/* Clearfix for the container to handle floated images */
.overlay-rich-content::after {
    content: "";
    clear: both;
    display: table;
}

/* Mobile adjustments for aligned images */
@media (max-width: 768px) {
    .overlay-body img.align-left,
    .overlay-body img.align-right {
        float: none;
        margin: 2rem auto;
        max-width: 100%;
        display: block;
    }
}

.overlay-body video {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 2rem 0;
}

.rich-text-content iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    border: none;
    border-radius: 8px;
    margin: 2rem 0;
}

/* Detailed Content Stack for Services */
.detailed-content-stack {
    display: flex;
    flex-direction: column;
    gap: .1vh;
    padding: 2rem 0;
    max-width: 1200px;
    margin: 0 auto;
}

.detailed-content-item {
    display: flex;
    gap: 4rem;
    align-items: center;
    width: 100%;
}

.detailed-content-item.no-icon {
    display: block;
}

.detailed-content-item.no-icon .detailed-content-icon {
    display: none;
}

.detailed-content-icon {
    flex: 0 0 20%;
    position: relative;
    border-radius: 8px;
}

.detailed-content-icon img {
    width: 100%;
    height: auto;
    display: block;
}

.detailed-content-text {
    flex: 1;
}

/* Rich Text Specifics */
.detailed-content-text .rich-text p {
    margin-bottom: 1.5rem;
    line-height: 1.6;
    color: #e0e0e0;
}

.detailed-content-text .rich-text ul,
.detailed-content-text .rich-text ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.detailed-content-text .rich-text li {
    margin-bottom: 0.5rem;
    color: #e0e0e0;
}

.desktop-only-title {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    color: #ff3333;
}

.mobile-only-title {
    display: none;
}

@media (max-width: 768px) {

    .service-detail-overlay {
        padding: 0 !important;
        background-color: #1a1a1a !important;
    }

    .overlay-content-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        border-radius: 0 !important;
        border: none !important;
        background: transparent !important;
    }

    .service-detail-overlay .close-overlay {
        position: sticky !important;
        top: 60px !important;
        left: 20px !important;
        right: auto !important;
        z-index: 9999 !important;
    }

    .detailed-content-item {
        flex-direction: column;
        gap: 2rem;
    }

    .detailed-content-item.no-icon {
        display: block;
        gap: 0;
    }

    .detailed-content-icon {
        width: 100%;
        flex: none;
        position: relative;
    }

    .detailed-content-text {
        width: 100%;
        flex: none;
        padding: 0;
    }

    .desktop-only-title {
        display: none;
    }

    .mobile-only-title {
        display: block;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        z-index: 2;
        width: 90%;
        text-align: center;
        font-size: 2rem;
        color: #ff3333;
        line-height: 1.1;
        margin: 0;
        pointer-events: none;
    }
}

/* ==========================================
   FULL-SCREEN NAVIGATION
========================================== */

/* The Hamburger Button */
.menu-toggle {
    position: fixed;
    top: 40px;
    right: 5%;
    z-index: 9001; /* Keeps it above the overlay, but below the custom cursor (9999) */
    background: transparent;
    border: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    cursor: pointer;
}

.hamburger-line {
    width: 40px;
    height: 2px;
    background-color: #ffffff;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.3s ease, background-color 0.3s ease;
    transform-origin: left center;
}

/* Morph hamburger to 'X' when the '.active' class is added */
.menu-toggle.active .hamburger-line {
    background-color: #ff3333; /* Shifts to Lucid Red */
}

.menu-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(0px, -2px);
}

.menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(0px, 2px);
}

/* The Dark Overlay */
.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(17, 17, 17, 0.98);
    backdrop-filter: blur(10px);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden; /* Hidden by GSAP initially */
    opacity: 0;
}

.nav-links {
    display: flex;
    flex-direction: column;
    text-align: center;
    gap: 2rem;
}

.nav-link {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    color: #ffffff;
    text-decoration: none;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 2px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: #ff3333;
    letter-spacing: 5px;
    transform: scale(1.1);
}

/* Stacked Items Section (Products/Playground) */
.stacked-items-section {
    padding: 100px 5%;
    max-width: 1200px;
    margin: 0 auto;
}

.stacked-container {
    display: flex;
    flex-direction: column;
    gap: 80px;
}

.stacked-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 20px;
    padding: 40px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.stacked-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 51, 51, 0.3);
}

.card-image-wrapper {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 12px;
}

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

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

.card-title {
    font-size: 2.5rem;
    margin: 0;
    text-transform: uppercase;
    font-weight: 800;
}

.card-description {
    color: #cccccc;
    line-height: 1.8;
    font-size: 1.1rem;
}

.card-description p {
    margin-bottom: 15px;
}

.card-actions {
    margin-top: 10px;
}

.empty-state {
    text-align: center;
    padding: 100px 20px;
    color: #666666;
    font-style: italic;
    font-size: 1.2rem;
}

@media (max-width: 992px) {
    .stacked-card {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 30px;
    }

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

/* ==========================================
   MOBILE RESPONSIVENESS
========================================== */
@media screen and (max-width: 768px) {
    /* --- LK ADDS 20260723 --- */
    /*
     * Ensure the parent container of the image and text
     * has position: relative so the absolute positioning works.
     * Replace '.process-container' with your actual parent class.
     */
    .proc-img-head-container {
        position: relative;
        display: flex;
        justify-content: center;
    }

    /* Style the icon */
    .process-icon {
        width: 100%;
        display: block;
        margin: 0 auto; /* Centers the image */
        filter: brightness(0.4); /* Darkens the image (0 is black, 1 is normal) */
    }

    /*
     * Target the element immediately following the process-icon.
     * You can replace the '*' with your specific class (e.g., '.process-title')
     */
    .process-icon + * {
        position: absolute;
        top: 50%; /* Center vertically */
        left: 50%; /* Center horizontally */
        transform: translate(-50%, -50%); /* Perfect centering offset */
        font-weight: 700; /* Make it bolder */
        color: #ffffff; /* Make text white to contrast with darkened image */
        text-align: center;
        z-index: 10;
        width: 90%; /* Prevents text from hitting the very edge of the screen */
    }

    .detailed-content-icon img {
        filter: brightness(0.4);
    }
    .overlay-title-wrapper {
        top: 18vh;
    }

    .detailed-content-stack {
        padding: 0;
    }

    .overlay-body {
        padding: 0 7vw;
    }



    /* --- END LK ADDS 20260723 --- */
    .overlay-content-wrapper {
        margin: 20px auto;
    }

    .overlay-hero-image {
        height: 250px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }

    .overlay-content-wrapper h2 {
        font-size: 2.5rem;
        padding: 0 20px;
    }


    /* 1. Scale up the logo so it commands the phone screen */
    .svg-container.logo-container {
        width: 85vw;
    }


    /* 3. Stack the contact form inputs vertically */
    .form-row {
        flex-direction: column;
        gap: 0;
    }

    /* 4. Adjust the project detail page layout */
    .project-details-section {
        flex-direction: column;
        gap: 30px;
    }

    .project-meta {
        width: 0;
    }
    .meta-item {
        margin-bottom: 0;
    }

    .overlay-body p {
        margin-bottom: 0;
    }

    .overlay-hero-image {
    border-bottom: none;
}
}

