/* ========================================
   pibiCo Design System - Bold Modern Edition
   Inspired by fio.ai aesthetic
   ======================================== */

/* CSS Variables */
:root {
    /* Brand Colors */
    --steel-blue: #4682B4;
    --steel-blue-dark: #3a6d96;
    --steel-blue-light: #5a9fd4;
    --black: #0a0a0a;
    --white: #ffffff;
    --accent-red: #8F1402;
    --accent-red-light: #b01a03;
    --gray: #768089;
    --gray-light: #a0a8b0;
    --gray-dark: #404850;

    /* Gradients */
    --gradient-hero: linear-gradient(135deg, var(--steel-blue) 0%, var(--steel-blue-dark) 40%, var(--accent-red) 100%);
    --gradient-hero-alt: linear-gradient(160deg, #3a6d96 0%, #4682B4 30%, #6a3040 70%, #8F1402 100%);

    /* Typography */
    --font-display: 'Poppins', sans-serif;
    --font-body: 'Nunito Sans', sans-serif;
    --font-accent: 'Raleway', sans-serif;

    /* Spacing - Compact */
    --space-xs: 0.35rem;
    --space-sm: 0.75rem;
    --space-md: 1.25rem;
    --space-lg: 2.5rem;
    --space-xl: 4rem;
    --space-xxl: 6rem;

    /* Left Sidebar */
    --sidebar-width: 60px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.15);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.2);

    /* Border Radius */
    --radius-sm: 12px;
    --radius-md: 20px;
    --radius-lg: 28px;
    --radius-xl: 40px;
    --radius-full: 50px;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 18px;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: var(--font-body);
    line-height: 1.5;
    color: var(--black);
    background: var(--white);
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Dark Mode */
body.dark-mode {
    --black: #ffffff;
    --white: #0a0a0a;
    --gray: #a0a8b0;
    --gray-light: #606870;
    --gray-dark: #c0c8d0;
    background: #0a0a0a;
    color: #ffffff;
}

body.dark-mode .section--light {
    background: #111111;
}

body.dark-mode .navbar--scrolled {
    background: rgba(10, 10, 10, 0.95);
}

body.dark-mode .service-block,
body.dark-mode .product-card,
body.dark-mode .project-card,
body.dark-mode .contact-form,
body.dark-mode .apihub-card {
    background: #1a1a1a;
    border-color: rgba(255,255,255,0.10);
    box-shadow: 0 0 12px rgba(255,255,255,0.03), 0 0 1px rgba(255,255,255,0.08);
}

body.dark-mode .form-input,
body.dark-mode .form-textarea {
    background: #1a1a1a;
    border-color: rgba(255,255,255,0.2);
    color: #ffffff;
}

/* navbar__logo-img handled via filter property */

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    bottom: var(--space-md);
    right: var(--space-md);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--steel-blue);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    box-shadow: var(--shadow-md);
    transition: var(--transition-normal);
}

.theme-toggle:hover {
    transform: scale(1.1);
    background: var(--steel-blue-dark);
}

.theme-toggle svg {
    width: 24px;
    height: 24px;
    fill: white;
    transition: var(--transition-normal);
}

.theme-toggle .sun-icon {
    display: none;
}

.theme-toggle .moon-icon {
    display: block;
}

body.dark-mode .theme-toggle .sun-icon {
    display: block;
}

body.dark-mode .theme-toggle .moon-icon {
    display: none;
}

/* Typography - Bold & Large */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

h1 {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 700;
}

h2 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 600;
}

h3 {
    font-size: clamp(1.5rem, 3vw, 2rem);
}

p {
    font-size: 1.1rem;
    line-height: 1.45;
    max-width: 600px;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition-fast);
}

/* ========================================
   Minimal Navbar (fio.ai style)
   ======================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: var(--space-md) var(--space-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition-normal);
}

.navbar--scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shadow-sm);
    padding: var(--space-sm) var(--space-md);
}

/* navbar__logo-img filter handled in main .navbar__logo-img rules */

.navbar--scrolled .navbar__toggle span {
    background: var(--black);
}

.navbar__logo {
    z-index: 1001;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.navbar__logo-img {
    height: 32px;
    width: auto;
    transition: var(--transition-fast);
    /* Invert for light logo on dark hero */
    filter: brightness(0) invert(1);
}

.navbar--scrolled .navbar__logo-img {
    /* Normal colors when scrolled (white bg) */
    filter: none;
}

body.dark-mode .navbar__logo-img {
    filter: brightness(0) invert(1);
}

body.dark-mode .navbar--scrolled .navbar__logo-img {
    filter: brightness(0) invert(1);
}

/* Hidden desktop menu - we use overlay now */
.navbar__menu {
    display: none;
}

/* Hamburger Menu - Always visible */
.navbar__toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 48px;
    height: 48px;
    background: transparent;
    border: none;
    cursor: pointer;
    gap: 6px;
    z-index: 1001;
    padding: 0;
}

.navbar__toggle span {
    display: block;
    width: 28px;
    height: 2px;
    background: var(--white);
    transition: var(--transition-normal);
    border-radius: 2px;
}

.navbar__toggle:hover span {
    opacity: 0.7;
}

.navbar__toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.navbar__toggle.active span:nth-child(2) {
    opacity: 0;
}

.navbar__toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Full Screen Menu Overlay */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-hero);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-slow);
}

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

.menu-overlay__content {
    text-align: center;
}

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

.menu-overlay__nav li {
    margin: var(--space-md) 0;
    transform: translateY(30px);
    opacity: 0;
    transition: var(--transition-normal);
}

.menu-overlay.active .menu-overlay__nav li {
    transform: translateY(0);
    opacity: 1;
}

.menu-overlay.active .menu-overlay__nav li:nth-child(1) { transition-delay: 0.1s; }
.menu-overlay.active .menu-overlay__nav li:nth-child(2) { transition-delay: 0.15s; }
.menu-overlay.active .menu-overlay__nav li:nth-child(3) { transition-delay: 0.2s; }
.menu-overlay.active .menu-overlay__nav li:nth-child(4) { transition-delay: 0.25s; }
.menu-overlay.active .menu-overlay__nav li:nth-child(5) { transition-delay: 0.3s; }

.menu-overlay__link {
    font-family: var(--font-accent);
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 600;
    color: var(--white);
    opacity: 0.9;
    transition: var(--transition-fast);
}

.menu-overlay__link:hover {
    opacity: 1;
    text-shadow: 0 0 30px rgba(255,255,255,0.5);
}

/* ========================================
   Hero Section - Bold Gradient
   ======================================== */
.hero {
    position: relative;
    min-height: 100vh;
    background: var(--gradient-hero-alt);
    display: flex;
    align-items: center;
    overflow: hidden;
    padding: var(--space-lg) var(--space-md);
    padding-top: calc(var(--space-lg) + 60px);
}

.hero__canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.hero__content {
    position: relative;
    z-index: 10;
    max-width: 800px;
    width: 100%;
    color: #ffffff;
    box-sizing: border-box;
}

.hero__tag {
    display: inline-block;
    font-family: var(--font-accent);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    background: rgba(255,255,255,0.15);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-md);
    backdrop-filter: blur(10px);
}

.hero__title {
    font-size: clamp(2.5rem, 8vw, 7rem);
    font-weight: 700;
    line-height: 1.05;
    margin-bottom: var(--space-md);
    text-shadow: 0 4px 30px rgba(0,0,0,0.3);
    word-break: normal;
    overflow-wrap: normal;
    hyphens: none;
    -webkit-hyphens: none;
    -moz-hyphens: none;
    -ms-hyphens: none;
}

.hero__title span {
    opacity: 0.7;
}

.hero__description {
    font-size: 1.15rem;
    line-height: 1.8;
    opacity: 0.9;
    margin-top: calc(var(--space-xl) * 3);
    margin-bottom: var(--space-lg);
    max-width: 550px;
}

.hero__cta {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.hero__btn {
    min-width: 160px;
    text-align: center;
    box-sizing: border-box;
}

/* Scroll Indicator */
.hero__scroll {
    position: absolute;
    right: var(--space-md);
    bottom: var(--space-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    color: rgba(255,255,255,0.5);
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    font-family: var(--font-accent);
}

.hero__scroll-line {
    width: 1px;
    height: 50px;
    background: linear-gradient(to bottom, rgba(255,255,255,0.5), transparent);
    animation: scrollLine 2s ease-in-out infinite;
}

@keyframes scrollLine {
    0%, 100% { transform: scaleY(1); opacity: 1; }
    50% { transform: scaleY(0.5); opacity: 0.5; }
}

/* ========================================
   Buttons - Modern Style
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    padding: 1rem 2rem;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: var(--transition-normal);
    text-decoration: none;
    gap: 0.5rem;
}

.btn--primary {
    background: #ffffff;
    color: #0a0a0a;
}

.btn--primary:hover {
    background: rgba(255,255,255,0.9);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.btn--outline {
    background: transparent;
    color: #ffffff;
    border: 2px solid rgba(255,255,255,0.4);
}

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

.btn--dark {
    background: #0a0a0a;
    color: #ffffff;
}

.btn--dark:hover {
    background: var(--gray-dark);
    transform: translateY(-2px);
}

.btn--secondary {
    background: var(--steel-blue);
    color: var(--white);
}

.btn--secondary:hover {
    background: var(--steel-blue-dark);
    transform: translateY(-2px);
}

.btn--large {
    padding: 1.2rem 2.5rem;
    font-size: 1rem;
}

/* ========================================
   Sections - Clean & Compact
   ======================================== */
.section {
    padding: var(--space-md) var(--space-md);
    position: relative;
    overflow-x: hidden;
    max-width: 100vw;
}

.section--light {
    background: #f8fafc;
}

#servicios {
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, #f8fafc 0%, #EFF4F9 100%);
}

body.dark-mode #servicios {
    background: linear-gradient(180deg, #111111 0%, #0a0a0a 100%);
}

#productos {
    background: linear-gradient(180deg, #d0dfe8 0%, #EFF4F9 8%, #EFF4F9 100%);
}

body.dark-mode #productos {
    background: linear-gradient(180deg, #101820 0%, #0a0a0a 8%, #0a0a0a 100%);
}

.section--dark {
    background: #0a0a0a;
    color: #ffffff;
}

.section--gradient {
    background: var(--gradient-hero);
    color: #ffffff;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    padding: 0 var(--space-sm);
    box-sizing: border-box;
}

.section__header {
    margin-bottom: var(--space-md);
}

.section__tag {
    display: inline-block;
    font-family: var(--font-accent);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--steel-blue);
    margin-bottom: var(--space-xs);
}

.section__title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: var(--space-xs);
}

.section__subtitle {
    font-family: var(--font-accent);
    font-size: 1.1rem;
    color: var(--gray);
    max-width: 600px;
}

.subtitle {
    font-family: var(--font-accent);
    font-size: 1.1rem;
    color: var(--gray);
}

/* ========================================
   Services - Asymmetric Layout
   ======================================== */
.services {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
}

.service-block {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.service-block__number {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 700;
    color: var(--steel-blue);
    opacity: 0.15;
    line-height: 1;
}

.service-block__title {
    font-size: 1.5rem;
    margin-bottom: var(--space-xs);
}

.service-block__list {
    list-style: none;
}

.service-block__list li {
    padding: 6px 0;
    display: flex;
    align-items: flex-start;
    gap: var(--space-xs);
}

.service-block__list li::before {
    content: '';
    width: 5px;
    height: 5px;
    background: var(--steel-blue);
    border-radius: 50%;
    margin-top: 0.4rem;
    flex-shrink: 0;
}

.service-block__list strong {
    display: block;
    font-size: 0.95rem;
    line-height: 1.2;
    margin-bottom: 2px;
}

.service-block__list p {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.2;
    color: var(--gray);
}

/* Light Bulb Card - Hidden on mobile/tablet, shown on big screens */
.service-bulb-card {
    display: none !important;
}

.service-bulb-card canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
}

.service-bulb-card__label {
    position: absolute;
    bottom: var(--space-md);
    left: 0;
    right: 0;
    text-align: center;
    font-family: var(--font-accent);
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--gray);
    z-index: 5;
}

/* Globe Bulb Tooltip */
.globe-tooltip {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    --tooltip-bg: rgba(26, 95, 95, 0.95);
    background: var(--tooltip-bg);
    backdrop-filter: blur(10px);
    padding: 12px 18px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 100;
    text-align: center;
    min-width: 150px;
}

.globe-tooltip.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.globe-tooltip__tag {
    display: block;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 4px;
}

.globe-tooltip__title {
    display: block;
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
    color: #ffffff;
}

.globe-tooltip::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 8px 8px 0 8px;
    border-style: solid;
    border-color: var(--tooltip-bg) transparent transparent transparent;
}

/* Two-column services layout */
.services.services--two-cols {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
}

@media (min-width: 768px) {
    .services.services--two-cols {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-xl);
    }
}

/* ========================================
   Globe Bulb Interactive Section - Full Width
   ======================================== */
.globe-section {
    position: relative;
    width: 100%;
    min-height: 500px;
    background: linear-gradient(180deg, #EFF4F9 0%, #e0eaf4 50%, #d0dfe8 100%);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.dark-mode .globe-section {
    background: linear-gradient(180deg, #0a0a0a 0%, #0d1518 50%, #101820 100%);
}

.globe-section__canvas-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.globe-section__canvas-wrapper canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
    cursor: grab;
}

.globe-section__canvas-wrapper canvas:active {
    cursor: grabbing;
}

.globe-section__content {
    position: absolute;
    bottom: var(--space-md);
    right: var(--space-md);
    z-index: 10;
    text-align: right;
    pointer-events: none;
}

.globe-section__text {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    display: inline-block;
    pointer-events: auto;
    box-shadow: var(--shadow-sm);
    max-width: 280px;
}

body.dark-mode .globe-section__text {
    background: rgba(20, 30, 35, 0.92);
}

.globe-section__tag {
    display: block;
    font-family: var(--font-accent);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--steel-blue);
    margin-bottom: 2px;
}

.globe-section__title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--black);
    margin-bottom: 4px;
    line-height: 1.2;
}

.globe-section__desc {
    font-size: 0.75rem;
    color: var(--gray);
    line-height: 1.4;
    margin: 0;
}

/* Globe tooltip repositioned for mouse-follow */
.globe-section .globe-tooltip {
    bottom: auto;
    top: 20px;
    left: 20px;
    right: auto;
    transform: none;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.globe-section .globe-tooltip.active {
    transform: none;
}

.globe-section .globe-tooltip::after {
    display: none;
}

/* Responsive heights */
@media (min-width: 768px) {
    .globe-section {
        min-height: 550px;
    }
}

@media (min-width: 1024px) {
    .globe-section {
        min-height: 600px;
    }

    .globe-section__content {
        bottom: var(--space-lg);
        right: var(--space-lg);
    }

    .globe-section__text {
        max-width: 320px;
    }
}

@media (min-width: 1400px) {
    .globe-section {
        min-height: 650px;
    }
}

/* Legacy 3-column layout (deprecated, kept for compatibility) */
@media (min-width: 1200px) {
    .services.services--with-bulb {
        grid-template-columns: 1fr minmax(280px, 320px) 1fr;
        gap: var(--space-md);
    }

    .service-bulb-card {
        display: block !important;
        position: relative;
        background: transparent;
        border-radius: var(--radius-lg);
        overflow: hidden;
        min-height: 400px;
        align-self: stretch;
    }
}

/* Legacy service category styles */
.service-category {
    padding: var(--space-lg);
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.service-category__title {
    font-size: 1.5rem;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 3px solid var(--steel-blue);
}

.service-category__list {
    list-style: none;
}

.service-category__item {
    padding: var(--space-sm) 0;
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.service-category__item:last-child {
    border-bottom: none;
}

.service-category__item::before {
    content: '';
    width: 8px;
    height: 8px;
    margin-top: 0.6rem;
    background-color: var(--steel-blue);
    border-radius: 50%;
    flex-shrink: 0;
}

.service-category__item strong {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.service-category__item p {
    margin: 0;
    font-size: 0.95rem;
}

/* ========================================
   Products - Card Grid
   ======================================== */
.products-grid,
.grid--3 {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
}

.products-grid--two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
    align-items: stretch;
}

/* Equal-width columns at all breakpoints */
@media (min-width: 768px) {
    .products-grid.products-grid--two {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-lg);
    }
}

@media (min-width: 1024px) {
    .products-grid.products-grid--two {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-xl);
    }
}

@media (min-width: 1200px) {
    .products-grid.products-grid--two {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-xl);
    }
}

@media (min-width: 1600px) {
    .products-grid.products-grid--two {
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
        max-width: 1400px;
        margin: 0 auto;
    }
}

/* Combined PILoT card: info left, 3D canvas right */
.product-card.product-card--pilot-combined {
    display: flex;
    flex-direction: row;
    aspect-ratio: auto;
    text-align: left;
    align-items: stretch;
    padding: 0;
    max-width: 900px;
    margin: 0 auto;
    min-height: 380px;
}

.product-card.product-card--pilot-combined .product-card__info {
    flex: 0 0 40%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: var(--space-lg);
}

.product-card.product-card--pilot-combined .product-card__icon {
    margin: 0 0 var(--space-sm);
}

.product-card.product-card--pilot-combined .product-card__canvas-wrap {
    flex: 1 1 60%;
    position: relative;
    min-height: 380px;
}

.product-card.product-card--pilot-combined .product-card__canvas-wrap canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.product-card.product-card--pilot-combined .product-card__desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: var(--space-sm);
}

.product-card__pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: var(--space-sm);
}

.product-card__pill {
    font-size: 0.7rem;
    font-weight: 500;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: rgba(70, 130, 180, 0.1);
    color: var(--steel-blue);
    white-space: nowrap;
}

.product-card__stats-line {
    font-size: 0.75rem;
    color: var(--gray);
    font-weight: 500;
    letter-spacing: 0.02em;
    margin-bottom: var(--space-xs);
}

@media (max-width: 767px) {
    .product-card.product-card--pilot-combined {
        flex-direction: column;
        max-width: 100%;
    }

    .product-card.product-card--pilot-combined .product-card__info {
        flex: none;
        padding: var(--space-md);
        text-align: center;
        align-items: center;
    }

    .product-card__pills {
        justify-content: center;
    }

    .product-card__stats-line {
        text-align: center;
    }

    .product-card.product-card--pilot-combined .product-card__canvas-wrap {
        flex: none;
        min-height: 280px;
        height: 280px;
    }
}

.product-card.product-card--3d {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 420px;
    background: transparent !important;
    padding: 0;
    border: none !important;
    border-radius: 0;
    box-shadow: none !important;
    overflow: visible;
    position: relative;
    aspect-ratio: auto;
}

.product-card.product-card--3d:hover {
    transform: none;
    box-shadow: none !important;
}

body.dark-mode .product-card.product-card--3d {
    background: transparent !important;
    border-color: transparent !important;
}

.product-card--3d::after {
    display: none;
}

.product-card--3d canvas {
    width: 100%;
    height: 100%;
    min-height: 420px;
}

/* Large screens: taller canvas */
@media (min-width: 1200px) {
    .product-card--3d {
        min-height: 480px;
    }

    .product-card--3d canvas {
        min-height: 480px;
    }
}

@media (min-width: 1600px) {
    .product-card--3d {
        min-height: 520px;
    }

    .product-card--3d canvas {
        min-height: 520px;
    }
}

@media (max-width: 991px) {
    .products-grid--two {
        grid-template-columns: 1fr 1fr;
    }

    .product-card--3d {
        min-height: 380px;
    }

    .product-card--3d canvas {
        min-height: 380px;
    }
}

@media (max-width: 767px) {
    .products-grid--two {
        grid-template-columns: 1fr;
    }

    .product-card--3d {
        min-height: 320px;
    }

    .product-card--3d canvas {
        min-height: 320px;
    }

    /* Wider cards with less horizontal padding on mobile */
    .container {
        padding: 0 var(--space-xs);
    }

    .section {
        padding: var(--space-md) var(--space-xs);
    }

    .product-card {
        padding: var(--space-sm);
        border-radius: var(--radius-md);
    }

    .service-block {
        padding: var(--space-sm);
    }

    .card {
        padding: var(--space-md);
    }

    .hero {
        padding: var(--space-md) var(--space-xs);
        padding-top: calc(var(--space-md) + 60px);
    }

    .footer {
        padding: var(--space-lg) var(--space-xs);
    }
}

.product-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    transition: var(--transition-normal);
    border: 1px solid rgba(0,0,0,0.06);
    position: relative;
    overflow: hidden;
    text-align: center;
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.product-card:hover {
    transform: translateY(-8px);
    /* Steel blue to red brick gradient shadow on all borders */
    box-shadow:
        -4px -4px 15px -3px rgba(70, 130, 180, 0.5),   /* Top-left: steel blue */
        4px -4px 15px -3px rgba(100, 100, 150, 0.4),   /* Top-right: blend */
        -4px 4px 15px -3px rgba(120, 80, 100, 0.4),    /* Bottom-left: blend */
        4px 4px 15px -3px rgba(143, 20, 2, 0.5),       /* Bottom-right: red brick */
        0 0 20px -5px rgba(70, 130, 180, 0.3),         /* Outer glow blue */
        0 0 20px -5px rgba(143, 20, 2, 0.3);           /* Outer glow red */
}

.product-card__icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-sm);
    background: linear-gradient(135deg, rgba(70,130,180,0.1) 0%, rgba(70,130,180,0.05) 100%);
}

.product-card--consumia .product-card__icon {
    background: linear-gradient(135deg, rgba(46,125,50,0.1) 0%, rgba(46,125,50,0.05) 100%);
}

.product-card--talk2doc .product-card__icon {
    background: linear-gradient(135deg, rgba(123,31,162,0.1) 0%, rgba(123,31,162,0.05) 100%);
}

.product-card__name {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.product-card__tagline {
    font-family: var(--font-accent);
    font-size: 0.9rem;
    color: var(--steel-blue);
    margin-bottom: var(--space-sm);
}

.product-card--consumia .product-card__tagline { color: #2E7D32; }
.product-card--talk2doc .product-card__tagline { color: #7B1FA2; }

.product-card__image {
    width: 100%;
    height: auto;
    margin: var(--space-sm) 0;
    display: block;
    border-radius: var(--radius-sm);
}

.product-card__description {
    color: var(--gray);
    font-size: 1rem;
}

.product-card__highlight {
    font-size: 0.9rem;
    font-style: italic;
    color: var(--steel-blue);
    margin-top: var(--space-xs);
    padding-top: var(--space-xs);
    border-top: 1px solid rgba(70, 130, 180, 0.2);
}

.product-card--clickable {
    cursor: pointer;
    transition: var(--transition-normal);
}

.product-card--clickable:hover {
    transform: translateY(-8px);
    /* Steel blue to red brick gradient shadow on all borders */
    box-shadow:
        -4px -4px 15px -3px rgba(70, 130, 180, 0.5),
        4px -4px 15px -3px rgba(100, 100, 150, 0.4),
        -4px 4px 15px -3px rgba(120, 80, 100, 0.4),
        4px 4px 15px -3px rgba(143, 20, 2, 0.5),
        0 0 20px -5px rgba(70, 130, 180, 0.3),
        0 0 20px -5px rgba(143, 20, 2, 0.3);
}

.product-card__cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: var(--space-sm);
    color: var(--steel-blue);
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

.product-card--clickable:hover .product-card__cta {
    gap: 0.75rem;
}

/* ========================================
   Product Slide Panel (like legal panel)
   ======================================== */
.product-panel {
    --panel-gap: 0.75rem;
    position: fixed;
    inset: 0;
    z-index: 2000;
    visibility: hidden;
    pointer-events: none;
}

.product-panel.active {
    visibility: visible;
    pointer-events: auto;
}

.product-panel__overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0);
    -webkit-backdrop-filter: blur(0);
    transition: all 0.4s ease;
}

.product-panel.active .product-panel__overlay {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.product-panel__content {
    position: fixed;
    top: var(--panel-gap);
    left: var(--panel-gap);
    bottom: var(--panel-gap);
    width: 69%;
    max-width: 900px;
    background: #0d1117;
    color: #ffffff;
    transform: translateX(calc(-100% - var(--panel-gap) * 2));
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    /* Diagonal corners: top-right and bottom-left rounded */
    border-radius: 0 var(--radius-lg) 0 var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 10px 0 40px rgba(0, 0, 0, 0.4);
    line-height: 1;
}

.product-panel.active .product-panel__content {
    transform: translateX(0);
}

[data-theme="dark"] .product-panel__content {
    background: #f5f5f5;
    color: #1a1a1a;
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 10px 0 40px rgba(0, 0, 0, 0.2);
}

.product-panel__close {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition-fast);
    z-index: 10;
    color: rgba(255, 255, 255, 0.7);
}

.product-panel__close:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] .product-panel__close {
    border-color: rgba(0, 0, 0, 0.2);
    color: rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] .product-panel__close:hover {
    background: rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.3);
}

.product-panel__header {
    padding: 3px var(--space-sm);
    padding-top: calc(var(--space-md) + 36px);
    background: linear-gradient(135deg, rgba(70, 130, 180, 0.2) 0%, transparent 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .product-panel__header {
    background: linear-gradient(135deg, rgba(70, 130, 180, 0.15) 0%, transparent 100%);
    border-bottom-color: rgba(0, 0, 0, 0.1);
}

.product-panel__tag {
    display: inline-block;
    padding: 3px 8px;
    background: rgba(70, 130, 180, 0.3);
    color: #7eb8e8;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 4px;
    margin-bottom: 3px;
    line-height: 1;
}

[data-theme="dark"] .product-panel__tag {
    background: rgba(70, 130, 180, 0.2);
    color: var(--steel-blue);
}

.product-panel__title {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 3px;
    color: inherit;
    line-height: 1;
}

.product-panel__subtitle {
    font-family: var(--font-accent);
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1;
    padding: 3px 0;
}

[data-theme="dark"] .product-panel__subtitle {
    color: rgba(0, 0, 0, 0.6);
}

.product-panel__hero {
    width: 100%;
    padding: 0 var(--space-sm);
    margin-bottom: var(--space-xs);
}

.product-panel__image {
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: cover;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
    .product-panel__image {
        max-height: 150px;
    }
}

.product-panel__diagram {
    margin-top: var(--space-sm);
    text-align: center;
}

.product-panel__diagram-img {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
}

.product-panel__body {
    flex: 1;
    padding: 3px var(--space-sm);
}

.product-panel__section {
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .product-panel__section {
    border-bottom-color: rgba(0, 0, 0, 0.1);
}

.product-panel__section:last-child {
    border-bottom: none;
}

.product-panel__section h3 {
    font-family: var(--font-accent);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--steel-blue-light);
    margin-bottom: 3px;
    padding: 3px 0;
    line-height: 1;
    border-bottom: none;
    display: block;
}

[data-theme="dark"] .product-panel__section h3 {
    color: var(--steel-blue);
}

.product-panel__section p {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.3;
    margin-bottom: 3px;
    padding: 3px 0;
}

[data-theme="dark"] .product-panel__section p {
    color: rgba(0, 0, 0, 0.7);
}

.product-panel__features {
    list-style: none;
    padding: 0;
    margin: 0;
}

.product-panel__features li {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 3px 0;
    border-bottom: none;
    line-height: 1;
}

.product-panel__features svg {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    margin-top: 1px;
}

.product-panel__features span {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.75rem;
    line-height: 1.2;
}

[data-theme="dark"] .product-panel__features span {
    color: rgba(0, 0, 0, 0.8);
}

.product-panel__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 3px 0;
}

.product-panel__sector-tag {
    padding: 3px 8px;
    background: rgba(70, 130, 180, 0.2);
    color: #7eb8e8;
    font-size: 0.7rem;
    font-weight: 500;
    border-radius: 4px;
    line-height: 1;
}

[data-theme="dark"] .product-panel__sector-tag {
    background: rgba(70, 130, 180, 0.15);
    color: var(--steel-blue);
}

.product-panel__validations {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 3px 0;
}

.product-panel__validation {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
}

[data-theme="dark"] .product-panel__validation {
    background: rgba(0, 0, 0, 0.05);
}

.product-panel__validation-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(70, 130, 180, 0.2);
    border-radius: 50%;
    flex-shrink: 0;
}

.product-panel__validation-icon svg {
    width: 16px;
    height: 16px;
}

.product-panel__validation strong {
    display: block;
    font-size: 0.8rem;
    color: inherit;
    margin-bottom: 2px;
    line-height: 1;
}

.product-panel__validation p {
    margin: 0;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
    padding: 0;
    line-height: 1.2;
}

[data-theme="dark"] .product-panel__validation p {
    color: rgba(0, 0, 0, 0.6);
}

/* Stock ticker style clients box */
.product-panel__clients-wrapper {
    background: linear-gradient(180deg, #0a0f14 0%, #121a24 100%);
    border: 1px solid rgba(70, 130, 180, 0.3);
    border-radius: var(--radius-sm);
    padding: 8px 0;
    overflow: hidden;
    position: relative;
}

.product-panel__clients-wrapper::before,
.product-panel__clients-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 30px;
    z-index: 2;
    pointer-events: none;
}

.product-panel__clients-wrapper::before {
    left: 0;
    background: linear-gradient(90deg, #0a0f14 0%, transparent 100%);
}

.product-panel__clients-wrapper::after {
    right: 0;
    background: linear-gradient(-90deg, #121a24 0%, transparent 100%);
}

[data-theme="dark"] .product-panel__clients-wrapper {
    background: linear-gradient(180deg, #f0f4f8 0%, #e8ecf0 100%);
    border-color: rgba(70, 130, 180, 0.4);
}

[data-theme="dark"] .product-panel__clients-wrapper::before {
    background: linear-gradient(90deg, #f0f4f8 0%, transparent 100%);
}

[data-theme="dark"] .product-panel__clients-wrapper::after {
    background: linear-gradient(-90deg, #e8ecf0 0%, transparent 100%);
}

.product-panel__clients {
    display: flex;
    gap: 12px;
    padding: 0 10px;
    animation: ticker-scroll 20s linear infinite;
    width: max-content;
}

.product-panel__clients:hover {
    animation-play-state: paused;
}

@keyframes ticker-scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.product-panel__clients span {
    padding: 4px 12px;
    background: rgba(70, 130, 180, 0.15);
    color: #4682B4;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 3px;
    line-height: 1;
    white-space: nowrap;
    border: 1px solid rgba(70, 130, 180, 0.25);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

[data-theme="dark"] .product-panel__clients span {
    background: rgba(70, 130, 180, 0.12);
    color: #3a6a94;
    border-color: rgba(70, 130, 180, 0.3);
}

/* Stats bar */
.product-panel__stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    padding: 0 var(--space-sm);
    margin-bottom: var(--space-sm);
}

.product-panel__stat {
    text-align: center;
    padding: 12px 4px;
    background: rgba(70, 130, 180, 0.08);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(70, 130, 180, 0.15);
}

.product-panel__stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: #4682B4;
    line-height: 1.1;
}

.product-panel__stat-label {
    display: block;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 4px;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

[data-theme="dark"] .product-panel__stat-label {
    color: rgba(0, 0, 0, 0.5);
}

/* Section hint text */
.product-panel__section-hint {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.5);
    margin: -4px 0 8px;
    font-style: italic;
}

[data-theme="dark"] .product-panel__section-hint {
    color: rgba(0, 0, 0, 0.5);
}

/* Three pillars grid */
.product-panel__pillars {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.product-panel__pillar {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    padding: 14px 12px;
}

[data-theme="dark"] .product-panel__pillar {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.08);
}

.product-panel__pillar-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(70, 130, 180, 0.15);
    border-radius: 8px;
    margin-bottom: 8px;
}

.product-panel__pillar h4 {
    font-size: 0.85rem;
    font-weight: 700;
    margin: 0 0 8px;
    color: #4682B4;
}

.product-panel__pillar ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.product-panel__pillar li {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.75);
    padding-left: 12px;
    position: relative;
    line-height: 1.35;
}

.product-panel__pillar li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    width: 4px;
    height: 4px;
    background: #4682B4;
    border-radius: 50%;
}

[data-theme="dark"] .product-panel__pillar li {
    color: rgba(0, 0, 0, 0.65);
}

/* Tech stack tags */
.product-panel__tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.product-panel__tech-tag {
    padding: 4px 10px;
    background: rgba(70, 130, 180, 0.10);
    color: #4682B4;
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: 4px;
    border: 1px solid rgba(70, 130, 180, 0.20);
    line-height: 1;
}

/* Sectors grid */
.product-panel__sectors-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}

.product-panel__sector {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .product-panel__sector {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.06);
}

.product-panel__sector svg {
    flex-shrink: 0;
    margin-top: 2px;
}

.product-panel__sector strong {
    display: block;
    font-size: 0.78rem;
    line-height: 1.2;
}

.product-panel__sector span {
    display: block;
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.3;
    margin-top: 2px;
}

[data-theme="dark"] .product-panel__sector span {
    color: rgba(0, 0, 0, 0.5);
}

/* Implementations grid */
.product-panel__implementations {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}

.product-panel__impl {
    padding: 10px 12px;
    background: rgba(70, 130, 180, 0.06);
    border: 1px solid rgba(70, 130, 180, 0.12);
    border-radius: var(--radius-sm);
}

.product-panel__impl strong {
    display: block;
    font-size: 0.8rem;
    color: inherit;
    line-height: 1.2;
}

.product-panel__impl span {
    display: block;
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 2px;
    line-height: 1.2;
}

[data-theme="dark"] .product-panel__impl span {
    color: rgba(0, 0, 0, 0.5);
}

/* Differentiators list */
.product-panel__diffs {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.product-panel__diff {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.78rem;
    line-height: 1.4;
}

.product-panel__diff svg {
    flex-shrink: 0;
    margin-top: 1px;
}

/* Mobile responsive for panel new elements */
@media (max-width: 767px) {
    .product-panel__stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .product-panel__pillars {
        grid-template-columns: 1fr;
    }

    .product-panel__sectors-grid {
        grid-template-columns: 1fr;
    }

    .product-panel__implementations {
        grid-template-columns: 1fr;
    }
}

.product-panel__footer {
    padding: 6px var(--space-sm);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 8px;
}

[data-theme="dark"] .product-panel__footer {
    border-top-color: rgba(0, 0, 0, 0.1);
}

.product-panel__btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 4px;
    transition: var(--transition-fast);
    cursor: pointer;
    border: none;
    line-height: 1;
}

.product-panel__btn svg {
    width: 14px;
    height: 14px;
}

.product-panel__btn--primary {
    background: var(--steel-blue);
    color: var(--white);
}

.product-panel__btn--primary:hover {
    background: #3a6d96;
}

.product-panel__btn--outline {
    background: transparent;
    color: var(--steel-blue-light);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] .product-panel__btn--outline {
    color: var(--steel-blue);
    border-color: rgba(0, 0, 0, 0.2);
}

.product-panel__btn--outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

[data-theme="dark"] .product-panel__btn--outline:hover {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.4);
}

@media (max-width: 991px) {
    .product-panel__content {
        width: 70%;
    }
}

@media (max-width: 767px) {
    .product-panel {
        --panel-gap: 0;
    }

    .product-panel__content {
        width: 100%;
        max-width: none;
        border-radius: 0;
        top: 0;
        left: 0;
        bottom: 0;
    }

    .product-panel__footer {
        flex-direction: column;
    }
}

/* ========================================
   Grants/Ayudas Section
   ======================================== */
.grants-section {
    background: var(--bg-light);
    padding: var(--space-lg) 0;
}

[data-theme="dark"] .grants-section {
    background: var(--bg-dark);
}

.grants-grid {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.grants-grid .grant-card {
    flex: 1 1 0;
    min-width: 0;
}

@media (max-width: 576px) {
    .grants-grid {
        gap: var(--space-xs);
    }
}

.grant-card {
    background: #fff;
    border-radius: 0;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: var(--transition-normal);
    cursor: pointer;
}

[data-theme="dark"] .grant-card {
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.grant-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.grant-card__image {
    width: 100%;
    height: auto;
    display: block;
    vertical-align: bottom;
}

/* Grant Modal */
.grant-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.grant-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.grant-modal__content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.grant-modal.active .grant-modal__content {
    transform: scale(1);
}

.grant-modal__image {
    width: 100%;
    height: auto;
    display: block;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

.grant-modal__close {
    position: absolute;
    top: -40px;
    right: 0;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.grant-modal__close:hover {
    color: var(--steel-blue);
    transform: rotate(90deg);
}

@media (max-width: 576px) {
    .grant-modal__content {
        width: 95%;
    }

    .grant-modal__close {
        top: -35px;
        right: 0;
    }
}

/* ========================================
   Stats Section
   ======================================== */
.stats-grid,
.grid--4 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
}

.stat-item,
.card {
    text-align: center;
    padding: var(--space-sm);
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--radius-md);
}

.stat-item__number,
.text-steel[data-count] {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    color: var(--steel-blue);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.section--dark .stat-item__number,
.section--dark .text-steel {
    color: var(--white);
}

.stat-item__label {
    font-size: 0.95rem;
    color: rgba(255,255,255,0.7);
}

/* ========================================
   Projects - Minimal Cards
   ======================================== */
.projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
}

.project-card,
.card {
    padding: var(--space-lg);
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(0,0,0,0.06);
    transition: var(--transition-normal);
}

.project-card:hover,
.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.card__title {
    font-size: 1.3rem;
    margin-bottom: var(--space-sm);
}

.card__description {
    color: var(--gray);
    font-size: 1rem;
    margin-bottom: var(--space-sm);
}

/* ========================================
   Contact Section - Get In Touch Style
   ======================================== */
.contact-section {
    background: linear-gradient(180deg, #0a0a0a 0%, var(--steel-blue-dark) 50%, var(--accent-red) 100%);
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: var(--space-xl) var(--space-md);
    position: relative;
}

.contact-section__tag {
    font-family: var(--font-accent);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: rgba(255,255,255,0.6);
    margin-bottom: var(--space-md);
}

.contact-section__title {
    font-family: var(--font-display);
    font-size: clamp(3rem, 12vw, 8rem);
    font-weight: 700;
    color: #ffffff;
    line-height: 1;
    margin-bottom: var(--space-lg);
    text-transform: uppercase;
    letter-spacing: -0.02em;
}

.contact-section__subtitle {
    font-size: 1.2rem;
    color: rgba(255,255,255,0.8);
    max-width: 500px;
    margin-bottom: var(--space-xl);
}

.contact-section__email {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    font-family: var(--font-accent);
    font-size: 1.2rem;
    font-weight: 600;
    color: #ffffff;
    padding: 1rem 2rem;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50px;
    transition: var(--transition-normal);
    margin-bottom: var(--space-lg);
}

.contact-section__email:hover {
    background: rgba(255,255,255,0.1);
    border-color: #ffffff;
    transform: scale(1.05);
}

.contact-section__email svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
}

.contact-section__social {
    display: flex;
    gap: var(--space-lg);
    margin-top: var(--space-md);
}

.contact-section__social-link {
    font-family: var(--font-accent);
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255,255,255,0.7);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: var(--transition-fast);
}

.contact-section__social-link:hover {
    color: #ffffff;
}

.contact-section__location {
    position: absolute;
    bottom: var(--space-lg);
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.85rem;
    color: rgba(255,255,255,0.5);
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
    font-family: inherit;
}

.contact-section__location:hover {
    color: #ffffff;
}

/* Map Modal */
.map-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.map-modal.active {
    display: flex;
}

.map-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
}

.map-modal__content {
    position: relative;
    width: 90vw;
    max-width: 700px;
    height: 70vh;
    max-height: 500px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.map-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 1000;
    background: var(--white);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    color: var(--black);
}

.map-modal__close:hover {
    background: #f0f0f0;
}

#map-container {
    width: 100%;
    height: 100%;
}

/* Legacy contact form (hidden by default, shown if needed) */
.contact-form {
    max-width: 800px;
    margin: 0 auto;
    background: var(--white);
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    display: none;
}

.contact-form.show-form {
    display: block;
}

.grid--2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: var(--space-md);
}

.form-label {
    font-family: var(--font-accent);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--gray-dark);
}

.form-input,
.form-textarea {
    font-family: var(--font-body);
    font-size: 1rem;
    padding: 1rem 1.25rem;
    border: 2px solid rgba(0,0,0,0.08);
    border-radius: var(--radius-sm);
    background: #f8fafc;
    transition: var(--transition-fast);
    width: 100%;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--steel-blue);
    background: var(--white);
}

.form-textarea {
    min-height: 150px;
    resize: vertical;
}

/* ========================================
   Footer - Minimal
   ======================================== */
.footer {
    background: #0a0a0a;
    color: #ffffff;
    padding: var(--space-xl) var(--space-md);
}

.footer__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
    text-align: center;
}

.footer__brand {
    font-family: var(--font-accent);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
}

.footer__brand span {
    opacity: 0.6;
}

.footer__title {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-sm);
    color: rgba(255,255,255,0.5);
}

.footer__links {
    list-style: none;
}

.footer__links li {
    margin-bottom: 0.75rem;
}

.footer__links a {
    color: rgba(255,255,255,0.7);
    transition: var(--transition-fast);
}

.footer__links a:hover {
    color: #ffffff;
}

.footer__social {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-sm);
}

.footer__social-link {
    color: rgba(255,255,255,0.5);
    transition: color 0.2s;
}

.footer__social-link:hover {
    color: #ffffff;
}

.footer__bottom {
    padding-top: var(--space-lg);
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    color: rgba(255,255,255,0.5);
    font-size: 0.75rem;
}

.footer__bottom p {
    margin: 0;
    white-space: nowrap;
    font-size: inherit;
    line-height: 1;
}

.footer__bottom .footer__legal-link {
    font-size: inherit;
    line-height: 1;
}

@media (max-width: 767px) {
    .footer__bottom {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
}

/* ========================================
   Animations
   ======================================== */
.fade-in,
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible,
.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
    animation: fadeIn 1s ease forwards;
}

.animate-slide-up {
    animation: slideUp 1s ease forwards;
}

.animate-slide-up:nth-child(2) { animation-delay: 0.2s; }
.animate-slide-up:nth-child(3) { animation-delay: 0.4s; }

/* ========================================
   Responsive - Mobile First
   ======================================== */

/* Tablet */
@media (min-width: 768px) {
    html {
        font-size: 18px;
    }

    .navbar {
        padding: var(--space-md) var(--space-lg);
    }

    .section {
        padding: var(--space-lg) var(--space-md);
    }

    .hero {
        padding: var(--space-lg) var(--space-md);
    }

    .services {
        grid-template-columns: repeat(2, 1fr);
    }

    .products-grid,
    .grid--3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-grid,
    .grid--4 {
        grid-template-columns: repeat(4, 1fr);
    }

    .grid--2 {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer__grid {
        grid-template-columns: 2fr 1fr 1fr 1fr;
        text-align: left;
    }
}

/* Desktop */
@media (min-width: 1024px) {
    html {
        font-size: 19px;
    }

    .navbar {
        padding: var(--space-sm) var(--space-lg);
    }

    .section {
        padding: var(--space-xl) var(--space-lg);
    }

    .hero {
        padding: var(--space-xl) var(--space-lg);
    }

    .hero__content {
        max-width: 900px;
    }

    .products-grid,
    .grid--3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Large Desktop */
@media (min-width: 1400px) {
    html {
        font-size: 20px;
    }

    .container {
        max-width: 1600px;
    }
}

/* ========================================
   Utilities
   ======================================== */
.text-center { text-align: center; }
.text-steel { color: var(--steel-blue); }
.text-gray { color: var(--gray); }
.mt-2 { margin-top: var(--space-md); }
.mt-4 { margin-top: var(--space-lg); }
.mb-2 { margin-bottom: var(--space-md); }
.mb-4 { margin-bottom: var(--space-lg); }

/* ========================================
   Infinite Horizontal Carousel
   ======================================== */
.carousel-section {
    position: relative;
    padding: var(--space-lg) 0;
    overflow: hidden;
    background: #0a0a0a;
    max-width: 100vw;
}

.carousel-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(to bottom, #0a1628, #0a0a0a);
    pointer-events: none;
    z-index: 0;
}

.carousel-section .section__header {
    padding: 0 var(--space-md);
    margin-bottom: var(--space-lg);
}

.carousel-section .section__tag {
    color: rgba(255,255,255,0.5);
}

.carousel-section .section__title {
    color: #ffffff;
}

.carousel-wrapper {
    position: relative;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.carousel-wrapper::-webkit-scrollbar {
    display: none;
}

.carousel-track {
    display: flex;
    gap: var(--space-md);
    width: max-content;
    cursor: grab;
    user-select: none;
    padding: var(--space-md) var(--space-lg);
    transition: transform 0.1s ease-out;
    touch-action: pan-y;
    -webkit-user-select: none;
}

.carousel-track:active {
    cursor: grabbing;
}

.carousel-track.dragging {
    cursor: grabbing;
    transition: none;
}

.carousel-track.auto-scroll {
    animation: scroll 60s linear infinite;
}

.carousel-track.auto-scroll:hover {
    animation-play-state: paused;
}

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

@keyframes scroll-reverse {
    0% {
        transform: translateX(-50%);
    }
    100% {
        transform: translateX(0);
    }
}

/* Clients Logo Carousel */
.clients-carousel-section {
    padding: var(--space-md) 0;
    overflow: hidden;
    background: #0a1628;
    max-width: 100vw;
}

.clients-carousel-section .section__header {
    padding: 0 var(--space-md);
    margin-bottom: var(--space-md);
}

.clients-carousel-section .section__tag {
    color: rgba(255,255,255,0.5);
}

.clients-carousel-section .section__title {
    color: #ffffff;
}

.clients-carousel-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    padding-top: 52px;
    padding-bottom: 28px;
}

.clients-carousel-track {
    display: flex;
    gap: var(--space-lg);
    width: max-content;
    animation: scroll-reverse 40s linear infinite;
}

.clients-carousel-track:hover {
    animation-play-state: paused;
}

.client-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 60px;
    padding: 0 var(--space-md);
    flex-shrink: 0;
    opacity: 0.6;
    transition: opacity var(--transition-fast);
    filter: grayscale(100%) brightness(1.5);
}

.client-logo:hover {
    opacity: 1;
    filter: grayscale(0%) brightness(1);
}

.client-logo img {
    max-height: 40px;
    max-width: 120px;
    object-fit: contain;
}

.client-logo svg {
    height: 40px;
    width: auto;
}

.client-logo__text {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff !important;
    white-space: nowrap;
    letter-spacing: 0.05em;
}

/* Client logo active/selected state */
.client-logo--active {
    opacity: 1 !important;
    filter: none !important;
    position: relative;
}

.client-logo--active .client-logo__text {
    color: #fff !important;
    text-shadow: 0 0 8px rgba(70, 130, 180, 0.6);
}

/* Selected client logo display (above clicked item) */
.client-selected {
    position: absolute;
    top: 0;
    pointer-events: none;
    opacity: 0;
    transform: translateX(-50%) translateY(-4px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 2;
    background: #FFFFFF;
    border-radius: 8px;
    padding: 8px 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.client-selected.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.client-selected__logo {
    max-height: 40px;
    max-width: 180px;
    object-fit: contain;
    display: block;
}

/* Client website link (below clicked item) */
.client-selected__link {
    position: absolute;
    bottom: 0;
    pointer-events: auto;
    opacity: 0;
    transform: translateX(-50%) translateY(4px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 2;
    white-space: nowrap;
}

.client-selected__link.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.client-selected__link a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-decoration: none;
    padding: 4px 12px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    transition: background var(--transition-fast), color var(--transition-fast);
}

.client-selected__link a:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.client-selected__link svg {
    opacity: 0.7;
    flex-shrink: 0;
}

@media (max-width: 767px) {
    .clients-carousel-track {
        gap: var(--space-md);
        animation-duration: 25s;
    }

    .client-logo {
        height: 50px;
        padding: 0 var(--space-sm);
    }

    .client-logo__text {
        font-size: 0.9rem;
    }

    .client-selected__logo {
        max-height: 32px;
        max-width: 140px;
    }
}

/* Project Carousel Card */
.carousel-card {
    position: relative;
    width: 420px;
    height: 180px;
    flex-shrink: 0;
    perspective: 1000px;
    cursor: pointer;
}

.carousel-card__inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.carousel-card:hover .carousel-card__inner {
    transform: rotateY(15deg) scale(1.02);
}

.carousel-card.flipped .carousel-card__inner {
    transform: rotateY(180deg);
}

.carousel-card__front,
.carousel-card__back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.carousel-card__front {
    background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.25) 100%);
}

.carousel-card__image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
}

.carousel-card__content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 128px;
    top: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: var(--space-lg);
    color: #ffffff;
    z-index: 1;
}

.carousel-card__tag {
    display: inline-block;
    width: auto;
    font-family: var(--font-accent);
    font-size: 0.55rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    background: rgba(255,255,255,0.2);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    margin-bottom: 0.4rem;
    backdrop-filter: blur(10px);
    white-space: nowrap;
}

.carousel-card__title {
    font-family: var(--font-display);
    font-size: clamp(0.95rem, 2vw, 1.25rem);
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
}

.carousel-card__back {
    background: var(--gradient-hero);
    transform: rotateY(180deg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
}

.carousel-card__back-content {
    text-align: center;
    color: var(--white);
}

.carousel-card__back-title {
    font-size: 1.5rem;
    margin-bottom: var(--space-sm);
}

.carousel-card__back-text {
    font-size: 0.95rem;
    opacity: 0.9;
    margin-bottom: var(--space-md);
}

.carousel-card__back-btn {
    background: var(--white);
    color: var(--black);
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition-fast);
}

.carousel-card__back-btn:hover {
    transform: scale(1.05);
}

.carousel-card__3d {
    position: absolute;
    top: 8px;
    bottom: 8px;
    right: 8px;
    width: 120px;
    z-index: 2;
    pointer-events: auto;
    cursor: pointer;
    overflow: hidden;
    border-radius: 8px;
}

.carousel-card__3d canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

/* ========================================
   Project Modal - Full Screen
   ======================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-normal);
}

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

.modal {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    overflow: hidden;
    transform: scale(0.95);
    transition: var(--transition-normal);
    position: relative;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal__close {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    color: var(--white);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    z-index: 10;
    transition: var(--transition-fast);
    backdrop-filter: blur(10px);
}

.modal__close:hover {
    background: var(--accent-red);
    transform: rotate(90deg);
}

.modal__image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.modal__content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    padding: var(--space-xl);
    padding-left: 10%;
    padding-top: calc(var(--space-xl) + 20px);
    color: var(--white);
    max-width: 700px;
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal__tag {
    display: inline-block;
    font-family: var(--font-accent);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--white);
    background: rgba(255,255,255,0.2);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    margin-bottom: var(--space-sm);
    backdrop-filter: blur(10px);
}

.modal__title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: var(--space-md);
    color: var(--white);
    line-height: 1.1;
}

.modal__client {
    font-family: var(--font-accent);
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255,255,255,0.7);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: var(--space-xs);
}

.modal__description {
    color: rgba(255,255,255,0.85);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: var(--space-md);
    max-width: 500px;
}

.modal__details {
    margin-bottom: var(--space-md);
    width: 100%;
    max-width: 500px;
}

.modal__detail-section {
    margin-bottom: var(--space-sm);
    background: rgba(255,255,255,0.08);
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-md);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.1);
}

.modal__detail-heading {
    font-family: var(--font-accent);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: rgba(255,255,255,0.95);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.modal__detail-heading::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 14px;
    background: var(--steel-blue);
    border-radius: 2px;
}

.modal__detail-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.modal__detail-list li {
    position: relative;
    padding-left: 22px;
    font-size: 0.82rem;
    line-height: 1.2;
    color: rgba(255,255,255,0.8);
}

.modal__detail-list li::before {
    content: '▸';
    position: absolute;
    left: 4px;
    top: 0;
    color: var(--steel-blue-light, #87CEEB);
    font-size: 0.9rem;
}

.modal__detail-list li b {
    color: rgba(255,255,255,0.95);
    font-weight: 600;
}

/* Outcomes section - negative/inverted style */
.modal__detail--outcomes {
    background: rgba(255,255,255,0.85);
    border-color: rgba(255,255,255,0.9);
}

.modal__detail--outcomes .modal__detail-heading {
    color: rgba(0,0,0,0.85);
}

.modal__detail--outcomes .modal__detail-heading::before {
    background: var(--accent-red, #8F1402);
}

.modal__detail--outcomes .modal__detail-list li {
    color: rgba(0,0,0,0.65);
}

.modal__detail--outcomes .modal__detail-list li::before {
    color: var(--accent-red, #8F1402);
}

.modal__detail--outcomes .modal__detail-list li b {
    color: rgba(0,0,0,0.9);
}

.modal__stats {
    display: flex;
    gap: var(--space-lg);
    margin-bottom: var(--space-md);
}

.modal__stat {
    text-align: left;
}

.modal__stat-value {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--white);
    line-height: 1;
}

.modal__stat-label {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.6);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.modal__technologies {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

.modal__tech-tag {
    background: rgba(255,255,255,0.15);
    color: var(--white);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

/* Mobile modal adjustments */
@media (max-width: 767px) {
    .modal__content {
        padding: var(--space-md);
        padding-top: calc(var(--space-xl) + 40px);
        padding-bottom: 80px;
        justify-content: flex-start;
        max-width: 100%;
    }

    .modal__title {
        font-size: 1.75rem;
    }

    .modal__description {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    .modal__stats {
        flex-wrap: wrap;
        gap: var(--space-sm) var(--space-md);
    }

    .modal__stat-value {
        font-size: 1.5rem;
    }

    .modal__details {
        max-width: 100%;
    }

    .modal__detail-section {
        padding: var(--space-sm);
    }

    .modal__tech-tag {
        font-size: 0.7rem;
        padding: 0.3rem 0.6rem;
    }
}

/* Mobile carousel adjustments */
@media (max-width: 767px) {
    .carousel-card {
        width: 300px;
        height: 220px;
    }

    .carousel-card__3d {
        width: 100px;
    }

    .carousel-card__content {
        right: 108px;
    }

    .modal__image {
        height: 200px;
    }
}

/* ========================================
   Cookie Consent Banner
   ======================================== */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--black);
    color: var(--white);
    padding: var(--space-md) var(--space-lg);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9999;
    border-top: 1px solid rgba(255,255,255,0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

body.dark-mode .cookie-banner {
    background: rgba(20, 20, 20, 0.98);
    border-top-color: rgba(255,255,255,0.05);
}

.cookie-banner.active {
    transform: translateY(0);
}

.cookie-banner__container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

@media (min-width: 768px) {
    .cookie-banner__container {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.cookie-banner__content {
    flex: 1;
}

.cookie-banner__title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.cookie-banner__text {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.7);
    line-height: 1.5;
}

.cookie-banner__text a {
    color: var(--steel-blue-light);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cookie-banner__text a:hover {
    color: var(--white);
}

.cookie-banner__actions {
    display: flex;
    gap: var(--space-sm);
    flex-shrink: 0;
    flex-wrap: wrap;
}

@media (max-width: 767px) {
    .cookie-banner__actions {
        width: 100%;
    }

    .cookie-banner__btn {
        flex: 1 1 auto;
        min-width: 0;
        padding: 0.65rem 0.75rem;
        font-size: 0.8rem;
        text-align: center;
    }
}

.cookie-banner__btn {
    font-family: var(--font-accent);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-fast);
    border: none;
    white-space: nowrap;
}

.cookie-banner__btn--accept {
    background: var(--steel-blue);
    color: var(--white);
}

.cookie-banner__btn--accept:hover {
    background: var(--steel-blue-light);
    transform: translateY(-2px);
}

.cookie-banner__btn--decline {
    background: transparent;
    color: rgba(255,255,255,0.7);
    border: 1px solid rgba(255,255,255,0.2);
}

.cookie-banner__btn--decline:hover {
    background: rgba(255,255,255,0.05);
    color: var(--white);
    border-color: rgba(255,255,255,0.4);
}

.cookie-banner__btn--settings {
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.9);
    border: 1px solid rgba(255,255,255,0.2);
}

.cookie-banner__btn--settings:hover {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.4);
}

/* Cookie Options */
.cookie-banner__options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    padding: 8px 0;
}

.cookie-option {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.8rem;
}

.cookie-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--steel-blue);
    cursor: pointer;
}

.cookie-option input[type="checkbox"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.cookie-option__label {
    color: rgba(255,255,255,0.8);
    font-size: 0.75rem;
    user-select: none;
}

@media (min-width: 768px) {
    .cookie-banner__container {
        flex-wrap: wrap;
    }

    .cookie-banner__options {
        width: 100%;
        order: 2;
        padding: 4px 0;
    }

    .cookie-banner__actions {
        order: 3;
    }
}

/* Adjust theme toggle position when cookie banner is shown */
.cookie-banner.active ~ .theme-toggle,
body:has(.cookie-banner.active) .theme-toggle {
    bottom: calc(var(--space-md) + 100px);
}

/* ========================================
   Legal Info Slide Panel
   ======================================== */
.legal-panel {
    --panel-gap: 0.5rem;
    position: fixed;
    top: var(--panel-gap);
    left: var(--panel-gap);
    bottom: var(--panel-gap);
    width: 100%;
    max-width: calc(420px - var(--panel-gap) * 2);
    height: auto;
    /* Dark theme by default (pibico.org style) */
    background: #1a1a1a;
    color: #ffffff;
    z-index: 10000;
    transform: translateX(calc(-100% - var(--panel-gap) * 2));
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    /* Rounded corners: top-right and bottom-left */
    border-radius: 0 var(--radius-lg) 0 var(--radius-lg);
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 10px 0 40px rgba(0,0,0,0.4);
}

/* Inverse for light mode body - dark panel stays dark */
body:not(.dark-mode) .legal-panel {
    background: #0a0a0a;
    color: #f0f0f0;
    border-color: rgba(255,255,255,0.08);
}

/* When body is dark mode, panel is light (inverse) */
body.dark-mode .legal-panel {
    background: #f5f5f5;
    color: #1a1a1a;
    border-color: rgba(0,0,0,0.1);
    box-shadow: 10px 0 40px rgba(0,0,0,0.2);
}

.legal-panel.active {
    transform: translateX(0);
}

.legal-panel__overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.legal-panel__overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.legal-panel__close {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255,255,255,0.2);
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    border-radius: 50%;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition-fast);
}

.legal-panel__close:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.3);
}

body.dark-mode .legal-panel__close {
    border-color: rgba(0,0,0,0.2);
}

body.dark-mode .legal-panel__close:hover {
    background: rgba(0,0,0,0.1);
    border-color: rgba(0,0,0,0.3);
}

.legal-panel__close svg {
    width: 18px;
    height: 18px;
    color: rgba(255,255,255,0.7);
}

body.dark-mode .legal-panel__close svg {
    color: rgba(0,0,0,0.6);
}

.legal-panel__content {
    padding: 3px var(--space-sm);
    padding-top: calc(var(--space-md) + 36px);
    line-height: 1;
}

.legal-panel__title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 6px;
    padding-bottom: 3px;
    color: inherit;
    line-height: 1;
}

.legal-panel__section {
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

body.dark-mode .legal-panel__section {
    border-bottom-color: rgba(0,0,0,0.1);
}

.legal-panel__section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.legal-panel__section h3 {
    font-family: var(--font-accent);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--steel-blue-light);
    margin-bottom: 3px;
    padding: 3px 0;
    line-height: 1;
}

body.dark-mode .legal-panel__section h3 {
    color: var(--steel-blue);
}

.legal-panel__section p {
    font-size: 0.75rem;
    line-height: 1;
    color: rgba(255,255,255,0.7);
    margin-bottom: 3px;
    padding: 3px 0;
}

body.dark-mode .legal-panel__section p {
    color: rgba(0,0,0,0.7);
}

.legal-panel__section ul {
    list-style: none;
    margin-top: 3px;
}

.legal-panel__section li {
    font-size: 0.7rem;
    line-height: 1;
    color: rgba(255,255,255,0.6);
    margin-bottom: 2px;
    padding: 2px 0 2px 0.75rem;
    position: relative;
}

body.dark-mode .legal-panel__section li {
    color: rgba(0,0,0,0.6);
}

.legal-panel__section li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.4em;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--steel-blue-light);
}

body.dark-mode .legal-panel__section li::before {
    background: var(--steel-blue);
}

.legal-panel__section a {
    color: var(--steel-blue-light);
    text-decoration: underline;
    text-underline-offset: 2px;
}

body.dark-mode .legal-panel__section a {
    color: var(--steel-blue);
}

.legal-panel__section a:hover {
    color: var(--white);
}

body.dark-mode .legal-panel__section a:hover {
    color: var(--steel-blue-dark);
}

.legal-panel__btn {
    font-family: var(--font-accent);
    font-size: 0.65rem;
    font-weight: 600;
    padding: 3px 8px;
    background: transparent;
    color: rgba(255,255,255,0.8);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition-fast);
    margin-top: 3px;
    line-height: 1;
}

.legal-panel__btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.5);
    color: var(--white);
}

body.dark-mode .legal-panel__btn {
    color: rgba(0,0,0,0.7);
    border-color: rgba(0,0,0,0.2);
}

body.dark-mode .legal-panel__btn:hover {
    background: rgba(0,0,0,0.05);
    border-color: rgba(0,0,0,0.4);
    color: var(--black);
}

/* Footer legal link */
.footer__legal-link {
    display: inline-block;
    margin-top: var(--space-sm);
    font-size: 0.85rem;
    color: rgba(255,255,255,0.5);
    background: none;
    border: none;
    cursor: pointer;
    transition: var(--transition-fast);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.footer__legal-link:hover {
    color: rgba(255,255,255,0.8);
}

/* ========================================
   Contact Modal (missioncontrol.co style)
   ======================================== */
.contact-section__cta {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    font-family: var(--font-accent);
    font-size: 1rem;
    font-weight: 600;
    color: #0a0a0a;
    background: #ffffff;
    padding: 1rem 2rem;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
    margin-bottom: var(--space-lg);
}

.contact-section__cta:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.contact-section__cta svg {
    transition: transform 0.3s ease;
}

.contact-section__cta:hover svg {
    transform: translateX(4px);
}

.contact-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    padding: var(--space-md);
}

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

.contact-modal__content {
    background: var(--white);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 480px;
    max-height: 95vh;
    overflow: hidden;
    position: relative;
    transform: translateY(30px);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.1, 0.67, 0.23, 1), opacity 0.4s ease;
}

body.dark-mode .contact-modal__content {
    background: #1a1a1a;
}

.contact-modal.active .contact-modal__content {
    transform: translateY(0);
    opacity: 1;
}

.contact-modal__close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(0,0,0,0.05);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    z-index: 10;
}

body.dark-mode .contact-modal__close {
    background: rgba(255,255,255,0.1);
}

.contact-modal__close:hover {
    background: rgba(0,0,0,0.1);
    transform: rotate(90deg);
}

body.dark-mode .contact-modal__close:hover {
    background: rgba(255,255,255,0.2);
}

.contact-modal__close svg {
    color: var(--gray);
}

.contact-modal__body {
    padding: 16px 20px 20px;
}

.contact-modal__title {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--black);
    margin-bottom: 4px;
    line-height: 1.2;
}

.contact-modal__subtitle {
    margin-bottom: 12px;
}

.contact-modal__subtitle p {
    font-size: 0.8rem;
    color: var(--gray);
    line-height: 1.4;
    margin-bottom: 2px;
}

.contact-modal__subtitle a {
    color: var(--steel-blue);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.contact-modal__form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.contact-modal__hp {
    position: absolute;
    left: -9999px;
    opacity: 0;
    height: 0;
    overflow: hidden;
}

.contact-modal__field {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.contact-modal__field label {
    font-family: var(--font-accent);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--gray);
}

.contact-modal__field input,
.contact-modal__field textarea {
    font-family: var(--font-body);
    font-size: 0.9rem;
    padding: 8px 10px;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 6px;
    background: transparent;
    color: var(--black);
    transition: var(--transition-fast);
    width: 100%;
}

body.dark-mode .contact-modal__field input,
body.dark-mode .contact-modal__field textarea {
    border-color: rgba(255,255,255,0.1);
    color: #ffffff;
}

.contact-modal__field input:focus,
.contact-modal__field textarea:focus {
    outline: none;
    border-color: var(--steel-blue);
}

.contact-modal__field textarea {
    resize: none;
    min-height: 70px;
    max-height: 100px;
}

.contact-modal__submit {
    margin-top: 6px;
}

.contact-modal__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-accent);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--white);
    background: linear-gradient(135deg, var(--steel-blue) 0%, var(--steel-blue-dark) 100%);
    padding: 10px 20px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.contact-modal__btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--steel-blue-light) 0%, var(--steel-blue) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.contact-modal__btn:hover::before {
    opacity: 1;
}

.contact-modal__btn span,
.contact-modal__btn svg {
    position: relative;
    z-index: 1;
}

.contact-modal__btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(70, 130, 180, 0.3);
}

.contact-modal__btn svg {
    transition: transform 0.3s ease;
}

.contact-modal__btn:hover svg {
    transform: translateX(4px);
}

/* Success state */
.contact-modal__success {
    display: none;
    padding: 20px;
    text-align: center;
}

.contact-modal__success.active {
    display: block;
}

.contact-modal__success-icon {
    color: var(--steel-blue);
    margin-bottom: 10px;
}

.contact-modal__success-icon svg {
    width: 50px;
    height: 50px;
    animation: scaleIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes scaleIn {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.contact-modal__success-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--black);
    margin-bottom: 6px;
    line-height: 1.2;
}

.contact-modal__success-text {
    font-size: 0.85rem;
    color: var(--gray);
    line-height: 1.4;
}

/* Hide form when success shown */
.contact-modal__body.hidden {
    display: none;
}

/* ========================================
   Side Navigation - Right Sidebar
   ======================================== */
.side-nav {
    --nav-gap: 6px;
    --nav-width-collapsed: 50px;
    --nav-width-expanded: 200px;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: var(--nav-width-collapsed);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    padding: 6px;
    border-radius: 0;
    border: none;
    border-left: 1px solid rgba(0,0,0,0.08);
    box-shadow: var(--shadow-md);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: visible;
}

body.dark-mode .side-nav {
    background: rgba(26, 26, 26, 0.95);
    border-color: rgba(255,255,255,0.1);
}

.side-nav.expanded {
    top: var(--nav-gap);
    right: var(--nav-gap);
    bottom: var(--nav-gap);
    width: var(--nav-width-expanded);
    border-radius: var(--radius-lg) 0 var(--radius-lg) 0;
    border: 1px solid rgba(0,0,0,0.08);
}

/* Side Nav Header */
.side-nav__header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid rgba(0,0,0,0.06);
    margin-bottom: var(--space-xs);
}

body.dark-mode .side-nav__header {
    border-bottom-color: rgba(255,255,255,0.1);
}

.side-nav__copyright {
    font-family: var(--font-accent);
    font-size: 0.55rem;
    font-weight: 600;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    white-space: nowrap;
    opacity: 1;
    transition: all 0.3s ease;
}

.side-nav.expanded .side-nav__copyright {
    writing-mode: horizontal-tb;
    transform: none;
    font-size: 0.65rem;
}

/* Side Nav Toggle Button (hamburger) */
.side-nav__toggle {
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    padding: 8px;
    z-index: 10;
    transition: var(--transition-fast);
    flex-shrink: 0;
}

.side-nav__toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--gray);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.side-nav__toggle:hover span {
    background: var(--steel-blue);
}

.side-nav.expanded .side-nav__toggle span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.side-nav.expanded .side-nav__toggle span:nth-child(2) {
    opacity: 0;
}

.side-nav.expanded .side-nav__toggle span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Side Nav Links Container */
.side-nav__links {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
}

.side-nav__link {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 10px;
    border-radius: var(--radius-sm);
    color: var(--gray);
    text-decoration: none;
    transition: all var(--transition-fast);
    white-space: nowrap;
    overflow: hidden;
}

.side-nav__link:hover,
.side-nav__link.active {
    background: rgba(70, 130, 180, 0.1);
    color: var(--steel-blue);
}

.side-nav__link.active {
    background: var(--steel-blue);
    color: var(--white);
}

/* Side Nav Footer Controls */
.side-nav__footer {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-top: var(--space-sm);
    border-top: 1px solid rgba(0,0,0,0.06);
    margin-top: var(--space-xs);
}

body.dark-mode .side-nav__footer {
    border-top-color: rgba(255,255,255,0.1);
}

.side-nav__control {
    position: relative;
}

.side-nav__btn {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    width: 100%;
    padding: 10px;
    border-radius: var(--radius-sm);
    background: transparent;
    border: none;
    color: var(--gray);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    overflow: hidden;
}

.side-nav__btn:hover {
    background: rgba(70, 130, 180, 0.1);
    color: var(--steel-blue);
}

.side-nav__btn .icon-moon {
    display: none;
}

body.dark-mode .side-nav__btn .icon-sun {
    display: none;
}

body.dark-mode .side-nav__btn .icon-moon {
    display: block;
}

/* Language Current Flag Button - Aligned like .side-nav__btn */
.side-nav__lang-current {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: var(--space-sm);
    width: 100%;
    padding: 10px;
    border-radius: var(--radius-sm);
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--gray);
    transition: all var(--transition-fast);
}

.side-nav__lang-current:hover {
    background: rgba(70, 130, 180, 0.1);
    color: var(--steel-blue);
}

/* Circular flag wrapper */
.side-nav__flag-circle {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    display: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.side-nav__flag-circle svg {
    width: 100%;
    height: 100%;
}

/* Show only current language flag */
.side-nav__lang-current .flag-es { display: block; }

.side-nav__lang-current.lang-en .flag-es { display: none; }
.side-nav__lang-current.lang-en .flag-en { display: block; }

.side-nav__lang-current.lang-fr .flag-es { display: none; }
.side-nav__lang-current.lang-fr .flag-fr { display: block; }

.side-nav__lang-current.lang-de .flag-es { display: none; }
.side-nav__lang-current.lang-de .flag-de { display: block; }

.side-nav__lang-current.lang-pt .flag-es { display: none; }
.side-nav__lang-current.lang-pt .flag-pt { display: block; }

.side-nav__lang-current.lang-it .flag-es { display: none; }
.side-nav__lang-current.lang-it .flag-it { display: block; }

/* Language Popup in Side Nav */
.side-nav__lang-popup {
    position: absolute;
    right: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
    display: none;
    flex-direction: row;
    gap: 4px;
    padding: 8px;
    background: var(--white);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    z-index: 1001;
}

body.dark-mode .side-nav__lang-popup {
    background: #1a1a1a;
}

.side-nav__lang-popup.active {
    display: flex;
}

.side-nav__lang-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    border: 2px solid transparent;
    background: transparent;
    cursor: pointer;
    border-radius: 50%;
    overflow: hidden;
    opacity: 0.6;
    transition: all var(--transition-fast);
}

.side-nav__lang-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.side-nav__lang-btn.active {
    opacity: 1;
    border-color: var(--steel-blue);
}

.side-nav__lang-btn svg {
    width: 100%;
    height: 100%;
}

/* Scroll to Top Button */
.side-nav__scroll-top {
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.side-nav__scroll-top.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.side-nav__scroll-top.visible:hover {
    background: var(--steel-blue);
    color: var(--white);
}

.side-nav__icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    stroke-linecap: round;
    stroke-linejoin: round;
    color: var(--gray);
}

.side-nav__btn:hover .side-nav__icon,
.side-nav__link:hover .side-nav__icon {
    color: var(--steel-blue);
}

.side-nav__link.active .side-nav__icon {
    color: var(--white);
}

.side-nav__label {
    font-family: var(--font-accent);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--black);
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.2s ease;
    transition-delay: 0s;
}

body.dark-mode .side-nav__label {
    color: #e0e0e0;
}

body.dark-mode .side-nav__icon {
    color: #b0b0b0;
}

body.dark-mode .side-nav__link:hover .side-nav__icon,
body.dark-mode .side-nav__btn:hover .side-nav__icon {
    color: var(--steel-blue-light);
}

body.dark-mode .side-nav__link.active {
    background: var(--steel-blue);
}

body.dark-mode .side-nav__link.active .side-nav__icon {
    color: #ffffff;
}

body.dark-mode .side-nav__copyright {
    color: #808080;
}

body.dark-mode .side-nav__toggle span {
    background: #e0e0e0;
}

.side-nav.expanded .side-nav__label {
    opacity: 1;
    transform: translateX(0);
    transition-delay: 0.1s;
}

/* Hide navbar hamburger - use side-nav toggle instead */
.navbar__toggle {
    display: none;
}

/* Content margin for right sidebar */
main {
    margin-right: 50px;
    padding-bottom: 0;
}

.navbar {
    right: 50px;
}

.footer {
    margin-right: 50px;
}

/* Large screens - expanded side-nav extends 18% from right */
@media (min-width: 1400px) {
    .side-nav.expanded {
        width: 18%;
    }
}

/* ========================================
   Mobile Bottom Bar
   ======================================== */
.mobile-bottom-bar {
    display: none;
}

@media (max-width: 767px) {
    /* Hide desktop sidebar on mobile */
    .side-nav {
        --nav-width-expanded: 260px;
        width: var(--nav-width-expanded);
        top: 0;
        right: 0;
        bottom: 0;
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        border-radius: 0;
        border-left: 1px solid rgba(0,0,0,0.08);
        z-index: 1100;
    }

    .side-nav.expanded {
        transform: translateX(0);
        width: var(--nav-width-expanded);
        top: 0;
        right: 0;
        bottom: 0;
        border-radius: 0;
    }

    /* Labels always visible when sidebar opens on mobile */
    .side-nav.expanded .side-nav__label {
        opacity: 1;
        transform: translateX(0);
        transition-delay: 0.1s;
    }

    .side-nav.expanded .side-nav__copyright {
        writing-mode: horizontal-tb;
        transform: none;
        font-size: 0.65rem;
    }

    /* Remove right margin on mobile - no permanent sidebar */
    main {
        margin-right: 0;
    }

    .navbar {
        right: 0;
    }

    .footer {
        margin-right: 0;
    }

    /* Mobile overlay when sidebar is open */
    .mobile-sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 1099;
    }

    .mobile-sidebar-overlay.active {
        display: block;
    }

    /* Mobile Bottom Bar */
    .mobile-bottom-bar {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        min-height: 56px;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border-top: 1px solid rgba(0,0,0,0.08);
        box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
        z-index: 1050;
        align-items: center;
        justify-content: space-around;
        padding: 6px 8px;
        padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    body.dark-mode .mobile-bottom-bar {
        background: rgba(26, 26, 26, 0.95);
        border-top-color: rgba(255,255,255,0.1);
    }

    /* Hide bottom bar when sidebar is open */
    .mobile-bottom-bar.hidden {
        transform: translateY(100%);
    }

    .mobile-bottom-bar__btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        border: none;
        background: transparent;
        cursor: pointer;
        border-radius: var(--radius-sm);
        color: var(--gray);
        transition: all var(--transition-fast);
        position: relative;
    }

    .mobile-bottom-bar__btn:hover,
    .mobile-bottom-bar__btn:active {
        background: rgba(70, 130, 180, 0.1);
        color: var(--steel-blue);
    }

    .mobile-bottom-bar__btn svg {
        width: 22px;
        height: 22px;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    /* Flag display in bottom bar */
    .mobile-bottom-bar__flag {
        width: 24px;
        height: 24px;
        border-radius: 50%;
        overflow: hidden;
        display: none;
        box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    }

    .mobile-bottom-bar__flag svg {
        width: 100%;
        height: 100%;
    }

    /* Show current language flag */
    #mobile-lang-btn .flag-es { display: block; }
    #mobile-lang-btn.lang-en .flag-es { display: none; }
    #mobile-lang-btn.lang-en .flag-en { display: block; }
    #mobile-lang-btn.lang-fr .flag-es { display: none; }
    #mobile-lang-btn.lang-fr .flag-fr { display: block; }
    #mobile-lang-btn.lang-de .flag-es { display: none; }
    #mobile-lang-btn.lang-de .flag-de { display: block; }
    #mobile-lang-btn.lang-pt .flag-es { display: none; }
    #mobile-lang-btn.lang-pt .flag-pt { display: block; }
    #mobile-lang-btn.lang-it .flag-es { display: none; }
    #mobile-lang-btn.lang-it .flag-it { display: block; }

    /* Theme icons in bottom bar */
    .mobile-bottom-bar__btn .icon-moon { display: none; }
    body.dark-mode .mobile-bottom-bar__btn .icon-sun { display: none; }
    body.dark-mode .mobile-bottom-bar__btn .icon-moon { display: block; }

    /* Language popup above bottom bar */
    .mobile-bottom-bar__lang-popup {
        position: absolute;
        bottom: 60px;
        left: 50%;
        transform: translateX(-50%);
        display: none;
        flex-direction: row;
        gap: 6px;
        padding: 8px 12px;
        background: var(--white);
        border-radius: var(--radius-md);
        box-shadow: var(--shadow-lg);
        z-index: 1060;
    }

    body.dark-mode .mobile-bottom-bar__lang-popup {
        background: #1a1a1a;
    }

    .mobile-bottom-bar__lang-popup.active {
        display: flex;
    }

    .mobile-bottom-bar__lang-opt {
        width: 36px;
        height: 36px;
        padding: 0;
        border: 2px solid transparent;
        background: transparent;
        cursor: pointer;
        border-radius: 50%;
        overflow: hidden;
        opacity: 0.6;
        transition: all var(--transition-fast);
    }

    .mobile-bottom-bar__lang-opt:hover,
    .mobile-bottom-bar__lang-opt:active {
        opacity: 1;
        transform: scale(1.1);
    }

    .mobile-bottom-bar__lang-opt.active {
        opacity: 1;
        border-color: var(--steel-blue);
    }

    .mobile-bottom-bar__lang-opt svg {
        width: 100%;
        height: 100%;
    }

    /* Add bottom padding to main content for bottom bar */
    main {
        padding-bottom: 56px;
    }

    .footer {
        padding-bottom: 56px;
    }
}

/* ========================================
   Project Detail Pages (Modal Overlay Style)
   ======================================== */

/* Full-page modal */
.project-page {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: var(--bg-light, #EFF4F9);
    animation: projectFadeIn 0.25s ease;
}

body.dark-mode .project-page {
    background: var(--bg-dark, #121212);
}

@keyframes projectFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Modal wrapper — full page */
.project-page__modal {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* On large screens, constrain to 1024px centered modal */
@media (min-width: 1025px) {
    .project-page {
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(0, 0, 0, 0.5);
    }
    body.dark-mode .project-page {
        background: rgba(0, 0, 0, 0.65);
    }
    .project-page__modal {
        max-width: 1024px;
        max-height: 90vh;
        border-radius: 12px;
        box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
        background: var(--bg-light, #EFF4F9);
        overflow: hidden;
    }
    body.dark-mode .project-page__modal {
        background: var(--bg-dark, #121212);
    }
}

/* Close button */
.project-page__close {
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    z-index: 10;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(0,0,0,0.3);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.project-page__close:hover {
    background: rgba(0,0,0,0.6);
}

/* Scrollable body */
.project-page__body {
    overflow-y: auto;
    flex: 1;
}

/* Hero Banner */
.project-page__hero {
    position: relative;
    padding: 2.5rem 2rem 1.8rem;
    color: #fff;
    min-height: 160px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.project-page__back {
    position: absolute;
    top: 1rem;
    left: 1.2rem;
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-family: var(--font-accent);
    font-size: 0.82rem;
    font-weight: 600;
    transition: color 0.2s;
    cursor: pointer;
}

.project-page__back:hover {
    color: #fff;
}

.project-page__hero-content {
    max-width: 720px;
}

.project-page__tag {
    display: inline-block;
    font-family: var(--font-accent);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: rgba(255,255,255,0.18);
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
}

.project-page__title {
    font-family: var(--font-primary);
    font-size: 1.8rem;
    font-weight: 800;
    margin: 0 0 0.25rem;
    line-height: 1.15;
}

.project-page__client {
    font-family: var(--font-accent);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.8;
    margin: 0 0 0.4rem;
}

.project-page__subtitle {
    font-size: 0.9rem;
    line-height: 1.4;
    opacity: 0.9;
    margin: 0;
}

/* Stats Bar */
.project-page__stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 0.8rem 2rem;
    background: var(--white);
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

body.dark-mode .project-page__stats {
    background: #222;
    border-bottom-color: rgba(255,255,255,0.08);
}

.project-page__stat {
    text-align: center;
}

.project-page__stat-value {
    font-family: var(--font-primary);
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--steel-blue);
}

.project-page__stat-label {
    font-family: var(--font-accent);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gray);
    margin-top: 2px;
}

/* Main content area — two columns: details left, images right */
.project-page__content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1.5rem 2rem 2rem;
}

.project-page__content--with-images {
    grid-template-columns: 1fr 280px;
}

/* Left column: description + details + tech */
.project-page__main {
    min-width: 0;
}

.project-page__section {
    margin-bottom: 1.2rem;
}

.project-page__description {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--black);
    margin: 0;
}

body.dark-mode .project-page__description {
    color: #e0e0e0;
}

/* Details grid — single column */
.project-page__details-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.2rem;
}

/* Detail cards */
.project-page__detail-card {
    border-radius: var(--radius-md);
    padding: 1rem 1.2rem;
}

.project-page__detail--requirements {
    background: rgba(70, 130, 180, 0.08);
    border: 1px solid rgba(70, 130, 180, 0.15);
}

body.dark-mode .project-page__detail--requirements {
    background: rgba(70, 130, 180, 0.12);
    border-color: rgba(70, 130, 180, 0.25);
}

.project-page__detail--outcomes {
    background: #fff;
    border: 1px solid rgba(0,0,0,0.08);
    color: var(--black);
}

body.dark-mode .project-page__detail--outcomes {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.12);
    color: #e0e0e0;
}

.project-page__detail-heading {
    font-family: var(--font-accent);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 0.6rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid var(--steel-blue);
    color: var(--steel-blue);
}

.project-page__detail--outcomes .project-page__detail-heading {
    border-bottom-color: var(--accent-red, #8F1402);
    color: var(--accent-red, #8F1402);
}

body.dark-mode .project-page__detail--outcomes .project-page__detail-heading {
    color: #ff6b4a;
    border-bottom-color: #ff6b4a;
}

.project-page__detail-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.project-page__detail-list li {
    position: relative;
    padding-left: 1.1rem;
    font-size: 0.8rem;
    line-height: 1.2;
    color: var(--black);
}

body.dark-mode .project-page__detail-list li {
    color: #d0d0d0;
}

.project-page__detail-list li::before {
    content: '\25B8';
    position: absolute;
    left: 0;
    color: var(--steel-blue);
    font-weight: 700;
}

.project-page__detail--outcomes .project-page__detail-list li::before {
    color: var(--accent-red, #8F1402);
}

body.dark-mode .project-page__detail--outcomes .project-page__detail-list li::before {
    color: #ff6b4a;
}

.project-page__detail-list li b {
    font-weight: 700;
    color: var(--steel-blue);
}

.project-page__detail--outcomes .project-page__detail-list li b {
    color: var(--accent-red, #8F1402);
}

body.dark-mode .project-page__detail-list li b {
    color: var(--steel-blue-light, #6ba8d4);
}

body.dark-mode .project-page__detail--outcomes .project-page__detail-list li b {
    color: #ff6b4a;
}

/* Tech Tags */
.project-page__tech-title {
    font-family: var(--font-accent);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gray);
    margin: 0 0 0.6rem;
}

.project-page__tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.project-page__tech-tag {
    font-family: var(--font-accent);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 100px;
    background: rgba(70, 130, 180, 0.1);
    color: var(--steel-blue);
    border: 1px solid rgba(70, 130, 180, 0.2);
}

body.dark-mode .project-page__tech-tag {
    background: rgba(70, 130, 180, 0.15);
    border-color: rgba(70, 130, 180, 0.3);
    color: var(--steel-blue-light, #6ba8d4);
}

/* Diagram / SVG image */
.project-page__diagram {
    width: 100%;
    border-radius: var(--radius-md, 12px);
    border: 1px solid rgba(0,0,0,0.08);
    cursor: pointer;
    transition: box-shadow 0.2s;
    background: #fff;
}

.project-page__diagram:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

body.dark-mode .project-page__diagram {
    border-color: rgba(255,255,255,0.1);
    filter: invert(0.85) hue-rotate(180deg);
}

.project-page__pdf-link {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 1.2rem;
    border-radius: var(--radius-sm, 8px);
    background: rgba(70, 130, 180, 0.08);
    border: 1px solid rgba(70, 130, 180, 0.2);
    color: #4682B4;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
}

.project-page__pdf-link:hover {
    background: rgba(70, 130, 180, 0.15);
    box-shadow: 0 2px 8px rgba(70, 130, 180, 0.15);
}

body.dark-mode .project-page__pdf-link {
    background: rgba(70, 130, 180, 0.15);
    border-color: rgba(70, 130, 180, 0.3);
    color: #7ab3d4;
}

/* Right column: Image Gallery */
.project-page__gallery {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.project-page__gallery-title {
    font-family: var(--font-accent);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gray);
    margin: 0 0 0.3rem;
}

.project-page__gallery-img {
    width: 100%;
    border-radius: var(--radius-sm, 8px);
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid rgba(0,0,0,0.08);
}

.project-page__gallery-img:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

body.dark-mode .project-page__gallery-img {
    border-color: rgba(255,255,255,0.1);
}

/* Lightbox for full image view */
.project-page__lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(0,0,0,0.85);
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

.project-page__lightbox.active {
    display: flex;
}

.project-page__lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: var(--radius-md, 12px);
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

/* Mobile responsive */
@media (max-width: 767px) {
    .project-page__hero {
        padding: 2.2rem 1rem 1.2rem;
        min-height: 140px;
    }

    .project-page__title {
        font-size: 1.4rem;
    }

    .project-page__stats {
        flex-wrap: wrap;
        gap: 0.8rem 1.5rem;
        padding: 0.6rem 1rem;
    }

    .project-page__content {
        grid-template-columns: 1fr;
        padding: 1rem 1rem 4rem;
    }

    .project-page__content--with-images {
        grid-template-columns: 1fr;
    }

    .project-page__detail-card {
        padding: 0.8rem 1rem;
    }

    .project-page__gallery {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .project-page__gallery-title {
        grid-column: 1 / -1;
    }
}

/* ========================================
   Section Backgrounds with Images
   ======================================== */
.section {
    position: relative;
    overflow: hidden;
}

.section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    opacity: 0.08;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    pointer-events: none;
}

.section > * {
    position: relative;
    z-index: 1;
}

/* Services section background */
#servicios::before {
    background-image: url('/web/static/img/backgrounds/consulting-bg.jpg');
    opacity: 0.06;
}

/* Products section background */
#productos::before {
    background-image: url('/web/static/img/backgrounds/technology-bg.jpg');
    opacity: 0.1;
}

/* Contact section background */
#contacto::before {
    background-image: url('/web/static/img/backgrounds/contact-bg.jpg');
    opacity: 0.08;
}

body.dark-mode .section::before {
    opacity: 0.15;
    filter: brightness(0.5);
}

/* Fallback gradient backgrounds if images not available */
#servicios::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    background: radial-gradient(ellipse at 20% 50%, rgba(70, 130, 180, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

#productos::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    background: radial-gradient(ellipse at 80% 30%, rgba(70, 130, 180, 0.08) 0%, transparent 50%);
    pointer-events: none;
}

/* Language Switcher with Flags */
.lang-switcher {
    display: flex;
    gap: 0.35rem;
}

.lang-btn {
    width: 36px;
    height: 28px;
    padding: 0;
    border: 2px solid transparent;
    background: transparent;
    cursor: pointer;
    border-radius: 4px;
    overflow: hidden;
    opacity: 0.5;
    transition: all var(--transition-fast);
    border-radius: 6px;
    transition: var(--transition-fast);
}

.lang-btn:hover {
    opacity: 0.8;
}

.lang-btn.active {
    opacity: 1;
    border-color: var(--steel-blue);
}

.lang-btn .flag-icon {
    width: 100%;
    height: 100%;
    display: block;
}

/* Theme Switcher Group in Menu */
.theme-switcher-group {
    display: flex;
    gap: 0.35rem;
}

.theme-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    border: 2px solid transparent;
    background: rgba(0,0,0,0.05);
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
    transition: all var(--transition-fast);
}

body.dark-mode .theme-btn {
    background: rgba(255,255,255,0.1);
}

.theme-btn:hover {
    opacity: 0.8;
}

.theme-btn.active {
    opacity: 1;
    border-color: var(--steel-blue);
    background: var(--white);
}

body.dark-mode .theme-btn.active {
    background: rgba(255,255,255,0.2);
}

.theme-btn svg {
    width: 18px;
    height: 18px;
    color: var(--gray);
}

body.dark-mode .theme-btn svg {
    color: rgba(255,255,255,0.7);
}

.theme-btn.active svg {
    color: var(--steel-blue);
}

/* Legacy Theme Switcher - Hidden */
.theme-switcher {
    display: none;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: none;
    background: rgba(0,0,0,0.05);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

body.dark-mode .theme-switcher {
    background: rgba(255,255,255,0.1);
}

.theme-switcher:hover {
    background: rgba(0,0,0,0.1);
}

body.dark-mode .theme-switcher:hover {
    background: rgba(255,255,255,0.2);
}

.theme-switcher svg {
    width: 22px;
    height: 22px;
    fill: var(--gray);
    stroke: var(--gray);
    stroke-width: 2;
    transition: var(--transition-fast);
}

.theme-switcher .sun-icon {
    display: none;
}

.theme-switcher .moon-icon {
    display: block;
}

body.dark-mode .theme-switcher .sun-icon {
    display: block;
    fill: var(--steel-blue-light);
    stroke: var(--steel-blue-light);
}

body.dark-mode .theme-switcher .moon-icon {
    display: none;
}

/* Remove old theme toggle button */
.theme-toggle {
    display: none !important;
}

/* Left sidebar removed - consolidated into right side-nav */

/* ===== API Hub Section ===== */
#apihub {
    background: linear-gradient(180deg, var(--bg-primary) 0%, #e8f0f8 100%);
}

body.dark-mode #apihub {
    background: linear-gradient(180deg, var(--bg-primary) 0%, #1a2332 100%);
}

.apihub-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    margin-top: 2.5rem;
}

@media (min-width: 768px) {
    .apihub-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .apihub-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1200px) {
    .apihub-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

a.apihub-card {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.apihub-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 1rem 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    border: 1px solid rgba(70, 130, 180, 0.08);
}

.apihub-card__header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.apihub-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(70, 130, 180, 0.15);
}

body.dark-mode .apihub-card {
    background: var(--bg-secondary);
}

body.dark-mode .apihub-card:hover {
    box-shadow: 0 0 16px rgba(255,255,255,0.06), 0 8px 24px rgba(0, 0, 0, 0.3);
}

.apihub-card__icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: rgba(70, 130, 180, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.apihub-card__icon svg {
    width: 20px;
    height: 20px;
    stroke: var(--steel-blue);
    fill: none;
    stroke-width: 1.8;
}

body.dark-mode .apihub-card__icon {
    background: rgba(70, 130, 180, 0.18);
}

.apihub-card__title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.apihub-card__desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.2;
    flex-grow: 1;
    margin: 0;
    padding: 3px 0;
}

.apihub-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.1rem;
}

.apihub-card__tag {
    font-size: 0.7rem;
    font-weight: 500;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: rgba(70, 130, 180, 0.1);
    color: var(--steel-blue);
    white-space: nowrap;
}

body.dark-mode .apihub-card__tag {
    background: rgba(70, 130, 180, 0.2);
    color: var(--steel-blue-light);
}
