:root {
    --primary: #3b85c2;
    /* Sky Blue */
    --secondary: #0b233b;
    /* Deep Navy */
    --accent: #3b85c2;
    /* Sky Blue */
    --bg-light: #ffffff;
    /* Pure White */
    --text-dark: #0b233b;
    /* Deep Navy */
    --text-muted: #50667a;
    /* Muted Blue-Grey */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(11, 35, 59, 0.1);
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
    --shadow-soft: 0 12px 40px rgba(11, 35, 59, 0.08);
    --deco-1: rgba(200, 190, 180, 0.15);
    --deco-2: rgba(148, 128, 94, 0.12);
    --deco-3: var(--bg-light);
    --deco-glow: rgba(148, 128, 94, 0.08);
    --header-deco-1: rgba(200, 190, 180, 0.1);
    --header-deco-2: rgba(148, 128, 94, 0.05);

    /* Button System - Light */
    --btn-primary-bg: linear-gradient(135deg, #0b233b 0%, #3b85c2 100%);
    --btn-primary-text: #ffffff;
    --btn-primary-shadow: 0 10px 30px rgba(11, 35, 59, 0.2);
    --btn-primary-hover-shadow: 0 15px 40px rgba(11, 35, 59, 0.3);
    
    --btn-secondary-bg: transparent;
    --btn-secondary-border: rgba(11, 35, 59, 0.2);
    --btn-secondary-text: #0b233b;
    --btn-secondary-hover-bg: rgba(11, 35, 59, 0.05);

    /* Input System - Light */
    --input-bg: rgba(255, 255, 255, 0.5);
    --input-border: rgba(11, 35, 59, 0.1);
    --input-text: #0b233b;
    --input-focus-bg: #ffffff;
    --input-placeholder: rgba(11, 35, 59, 0.4);
}

[data-theme="dark"] {
    --bg-light: #0b233b;
    --text-dark: #ffffff;
    --text-muted: #94a3b8;
    --primary: #60a5fa;
    --secondary: #ffffff;
    --accent: #60a5fa;
    --glass-bg: rgba(15, 23, 42, 0.8);
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow-soft: 0 20px 50px rgba(0, 0, 0, 0.5);
    --deco-1: rgba(59, 133, 194, 0.1);
    --deco-2: rgba(11, 35, 59, 0.6);
    --deco-3: var(--bg-light);
    --deco-glow: rgba(59, 133, 194, 0.15);
    --header-deco-1: rgba(96, 165, 250, 0.1);
    --header-deco-2: rgba(11, 35, 59, 0.3);

    /* Button System - Dark */
    --btn-primary-bg: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    --btn-primary-text: #0b233b;
    --btn-primary-shadow: 0 10px 30px rgba(96, 165, 250, 0.3);
    --btn-primary-hover-shadow: 0 0 50px rgba(96, 165, 250, 0.4);
    
    --btn-secondary-bg: rgba(255, 255, 255, 0.05);
    --btn-secondary-border: rgba(255, 255, 255, 0.2);
    --btn-secondary-text: #ffffff;
    --btn-secondary-hover-bg: rgba(255, 255, 255, 0.1);

    /* Input System - Dark */
    --input-bg: rgba(15, 23, 42, 0.4);
    --input-border: rgba(255, 255, 255, 0.1);
    --input-text: #ffffff;
    --input-focus-bg: rgba(15, 23, 42, 0.8);
    --input-placeholder: rgba(255, 255, 255, 0.3);
}

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

html, body {
    overflow-x: hidden;
    width: 100%;
}

body {
    background-color: var(--bg-light);
    color: var(--text-dark);
    font-family: var(--font-main);
    overflow-x: hidden;
    overflow-y: auto;
    line-height: 1.6;
    transition: background-color 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Chronos Thread */
.chronos-thread {
    position: fixed;
    top: 0;
    left: 40px;
    height: 100vh;
    width: 2px;
    z-index: 1001;
    pointer-events: none;
}

.thread-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: linear-gradient(to bottom, transparent, var(--primary), transparent);
    opacity: 0.3;
}

.thread-node {
    position: absolute;
    top: 0;
    left: 50%;
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 15px var(--primary);
    transition: top 0.1s linear;
}

/* Shutter Transition */
.shutter-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--secondary);
    z-index: 9999;
    transform: translateY(100%);
    pointer-events: none;
    display: flex;
    flex-direction: column;
}

.shutter-vane {
    flex: 1;
    background: var(--secondary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.shutter-overlay.active {
    transform: translateY(0);
}

.shutter-overlay.active .shutter-vane {
    transform: scaleX(1);
}

.site-header {
    min-height: 85vh;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-light);
    background-image: radial-gradient(circle at 70% 30%, var(--header-deco-1), transparent 60%);
    position: relative;
    z-index: 10;
}

.site-header.header-minimal {
    min-height: auto;
}

.floating-dock {
    position: fixed;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    padding: 0.6rem 2.5rem;
    display: flex;
    align-items: center;
    gap: 3rem;
    background: var(--glass-bg);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 100px;
    box-shadow: 0 20px 40px rgba(11, 35, 59, 0.08);
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.floating-dock:hover {
    background: var(--glass-bg);
    filter: brightness(1.1);
    box-shadow: 0 30px 60px rgba(11, 35, 59, 0.12);
}

.dock-logo {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 3px;
    color: var(--secondary);
    border-right: 1px solid rgba(11, 35, 59, 0.1);
    padding-right: 2rem;
}

/* The Core Toggle */
.core-toggle {
    display: none;
    position: relative;
    width: 40px;
    height: 40px;
    cursor: pointer;
    z-index: 1100;
}

.core-node {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 12px;
    background: var(--secondary);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.core-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border: 2px solid var(--primary);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    opacity: 0.3;
}

.core-toggle:hover .core-node {
    width: 16px;
    height: 16px;
    background: var(--primary);
}

.core-toggle:hover .core-ring {
    width: 120%;
    height: 120%;
    opacity: 1;
    border-width: 1px;
}

.core-toggle.active .core-node {
    background: var(--primary);
    width: 100%;
    height: 100%;
    border-radius: 4px;
    transform: translate(-50%, -50%) rotate(45deg);
}

.core-toggle.active .core-ring {
    width: 100%;
    height: 100%;
    opacity: 1;
    border-radius: 4px;
    transform: translate(-50%, -50%) rotate(-45deg);
}

/* Neural Overlay */
.neural-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 1090;
    visibility: hidden;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.overlay-close {
    position: absolute;
    top: 1rem;
    right: 2rem;
    font-size: 3rem;
    color: var(--secondary);
    cursor: pointer;
    z-index: 10;
    line-height: 1;
    transition: transform 0.3s ease;
}

.overlay-close:hover {
    transform: rotate(90deg) scale(1.1);
    color: var(--primary);
}

.neural-overlay.active {
    visibility: visible;
}

.overlay-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--glass-bg);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    transform: translateY(-100%);
    transition: transform 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

.neural-overlay.active .overlay-background {
    transform: translateY(0);
}

.overlay-content {
    position: relative;
    z-index: 2;
    text-align: center;
    width: 90%;
    max-width: 600px;
}

.overlay-logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 5px;
    color: var(--secondary);
    margin-bottom: 4rem;
    opacity: 0;
    transform: translateY(20px);
}

.overlay-nav {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.overlay-nav a {
    font-size: 2.5rem;
    font-weight: 800;
    text-decoration: none;
    color: var(--secondary);
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

.overlay-nav a span {
    font-family: monospace;
    font-size: 0.9rem;
    opacity: 0.3;
}

.overlay-nav a:hover {
    color: var(--primary);
    transform: scale(1.05);
}

.neural-overlay.active .overlay-logo {
    animation: fadeInUp 0.6s forwards 0.4s;
}

.neural-overlay.active .overlay-nav a {
    animation: fadeInUp 0.6s forwards;
    animation-delay: calc(var(--i) * 0.1s + 0.5s);
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.overlay-footer {
    margin-top: 5rem;
    font-weight: 600;
    color: var(--text-muted);
    opacity: 0;
}

.neural-overlay.active .overlay-footer {
    animation: fadeIn 0.8s forwards 1s;
}

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

.dock-links {
    display: flex;
    gap: 2.5rem;
}

.dock-links a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    opacity: 0.5;
    transition: all 0.3s ease;
}

.nav-icon {
    font-size: 0.6rem;
    opacity: 0.4;
    transition: transform 0.3s ease;
}

.dock-links a:hover {
    opacity: 1;
    color: var(--primary);
}

.dock-links a:hover .nav-icon {
    transform: rotate(90deg) scale(1.2);
    opacity: 1;
}

.nav-cta {
    padding: 0.8rem 2.2rem;
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    text-decoration: none;
    border-radius: 100px;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: var(--btn-primary-shadow);
}

.nav-cta:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: var(--btn-primary-hover-shadow);
    filter: brightness(1.1);
}

.hero {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    padding: 0 10%;
    gap: 4rem;
}

.hero-tag {
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--primary);
    margin-bottom: 1.5rem;
    display: block;
}

.hero-main-title {
    font-size: clamp(3rem, 6vw, 5rem);
    font-weight: 800;
    line-height: 1.1;
    color: var(--secondary);
    margin-bottom: 2rem;
}

.hero-desc {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 500px;
    margin-bottom: 3rem;
}

.hero-btns {
    display: flex;
    gap: 1.5rem;
}

.primary-cta {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    box-shadow: var(--btn-primary-shadow);
}

.primary-cta:hover {
    box-shadow: var(--btn-primary-hover-shadow);
}

.secondary-cta {
    background: var(--btn-secondary-bg);
    border: 2px solid var(--btn-secondary-border);
    color: var(--btn-secondary-text);
    box-shadow: none;
}

.secondary-cta:hover {
    background: var(--btn-secondary-hover-bg);
    border-color: var(--btn-secondary-text);
}

.hero-visual {
    position: relative;
    height: 600px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.neural-core-wrapper {
    position: relative;
    width: 600px;
    height: 600px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
}

#neural-core {
    max-width: 100%;
    max-height: 100%;
    filter: drop-shadow(0 0 30px rgba(59, 133, 194, 0.1));
}

.water-drop-wrapper {
    position: relative;
    width: 450px;
    height: 450px;
    animation: floatDrop 6s ease-in-out infinite;
}

.glass-blob {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(59, 133, 194, 0.4), rgba(11, 35, 59, 0.15));
    border-radius: var(--blob-radius, 50% 50% 50% 50% / 50% 50% 50% 50%);
    backdrop-filter: blur(25px) contrast(1.15);
    -webkit-backdrop-filter: blur(25px) contrast(1.15);
    border: 1px solid rgba(59, 133, 194, 0.45);
    box-shadow:
        inset 12px 12px 25px rgba(255, 255, 255, 0.35),
        inset -12px -12px 25px rgba(59, 133, 194, 0.1),
        30px 50px 80px rgba(11, 35, 59, 0.12);
    transition: border-radius 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
    overflow: hidden;
    z-index: 2;
}

.reflection-large {
    position: absolute;
    top: 15%;
    left: 15%;
    width: 30%;
    height: 20%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.6), transparent);
    border-radius: 50%;
    transform: rotate(var(--refl-rot, -35deg));
    filter: blur(2px);
    pointer-events: none;
}

.reflection-small {
    position: absolute;
    top: 12%;
    left: 45%;
    width: 10%;
    height: 8%;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    filter: blur(1px);
    pointer-events: none;
}

.inner-glow {
    position: absolute;
    bottom: 15%;
    right: 15%;
    width: 50%;
    height: 40%;
    background: radial-gradient(circle, rgba(59, 133, 194, 0.3) 0%, transparent 75%);
    filter: blur(15px);
    pointer-events: none;
}

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

.bubble {
    position: absolute;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    filter: blur(1px);
    animation: bubbleRise linear infinite;
}

@keyframes bubbleRise {
    0% {
        transform: translateY(100%) scale(0.5);
        opacity: 0;
    }

    20% {
        opacity: 0.6;
    }

    80% {
        opacity: 0.6;
    }

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

.ripple {
    position: absolute;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0);
    animation: rippleEffect 0.8s ease-out forwards;
}

@keyframes rippleEffect {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(2.5);
        opacity: 0;
    }
}

.drop-shadow {
    position: absolute;
    bottom: -40px;
    left: 50%;
    width: 60%;
    height: 40px;
    background: radial-gradient(ellipse at center, rgba(11, 35, 59, 0.1) 0%, transparent 70%);
    transform: translateX(-50%);
    filter: blur(10px);
    z-index: 1;
}

@keyframes floatDrop {

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

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

.site-footer {
    padding: 8rem 10% 4rem;
    background: var(--bg-light);
    border-top: 1px solid rgba(11, 35, 59, 0.05);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 6rem;
    margin-bottom: 6rem;
}

.footer-brand .logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 4px;
    color: var(--secondary);
    margin-bottom: 1.5rem;
}

.footer-brand p {
    color: var(--text-muted);
    max-width: 300px;
}

.footer-links h4,
.footer-contact h4 {
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 2rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-links a {
    text-decoration: none;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-contact p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.social-links {
    display: flex;
    gap: 1.5rem;
}

.social-links a {
    font-weight: 800;
    text-decoration: none;
    color: var(--secondary);
    font-size: 0.8rem;
    letter-spacing: 1px;
}

/* Theme Toggle */
.theme-toggle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    color: var(--text-dark);
    margin-left: 1rem;
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-soft);
}

.theme-toggle:hover {
    transform: scale(1.1) rotate(15deg);
    border-color: var(--primary);
    background: var(--bg-light);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.theme-toggle .sun-icon {
    position: absolute;
    transform: translateY(40px);
}

[data-theme="dark"] .theme-toggle .moon-icon {
    transform: translateY(-40px);
}

[data-theme="dark"] .theme-toggle .sun-icon {
    transform: translateY(0);
}



.footer-bottom {
    padding-top: 4rem;
    border-top: 1px solid rgba(11, 35, 59, 0.05);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.placeholder-content {
    text-align: center;
    padding: 2rem;
}

.placeholder-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--secondary);
}

.three-d-isolated-section {
    position: relative;
    height: 100vh;
    overflow: hidden;
    background-color: var(--bg-light);
    perspective: 1500px;
    box-shadow: var(--shadow-soft);
}

.spatial-nav {
    position: absolute;
    bottom: clamp(1.5rem, 8vh, 6rem);
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    padding: 0.8rem 1.5rem;
    display: flex;
    gap: 1.5rem;
    border-radius: 100px;
    box-shadow: var(--shadow-soft);
}

.spatial-nav a {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    opacity: 0.5;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.s-nav-icon {
    font-size: 1rem;
    opacity: 0.4;
    transition: transform 0.3s ease;
}

.spatial-nav a:hover,
.spatial-nav a.active {
    opacity: 1;
    color: var(--primary);
}

.spatial-nav a:hover .s-nav-icon,
.spatial-nav a.active .s-nav-icon {
    transform: rotate(90deg) scale(1.2);
    opacity: 1;
}

.container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    perspective: 1000px;
    perspective-origin: 50% 50%;
}

.world {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 1.5s cubic-bezier(0.2, 0.8, 0.2, 1);
    will-change: transform;
}

.layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: clamp(6rem, 12vh, 8rem) 2rem clamp(8rem, 16vh, 12rem);
    backface-visibility: hidden;
    opacity: 0;
    visibility: hidden;
    filter: blur(10px);
    transform-style: preserve-3d;
    transition: opacity 1s ease, filter 1s ease, transform 1.2s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 1.2s ease;
    pointer-events: none;
    will-change: opacity, filter, transform;
    transform: translateZ(0);
}

.layer.active,
.layer.visible-neighbor {
    opacity: 1;
    visibility: visible;
    filter: blur(0);
    pointer-events: auto;
}

.layer.visible-neighbor {
    opacity: 0.6;
    filter: blur(8px);
    pointer-events: none;
}

.layer.visible-neighbor .content-wrapper {
    animation: simpleFloat 6s ease-in-out infinite alternate;
}

@keyframes simpleFloat {
    0% {
        transform: translateY(-15px) rotateX(2deg);
    }

    100% {
        transform: translateY(15px) rotateX(-2deg);
    }
}

.layer.active {
    opacity: 1;
    filter: blur(0) grayscale(0);
    /* Bring focus to the foreground */
    pointer-events: auto;
}

.content-wrapper {
    padding: 5rem;
    max-width: 900px;
    width: 95%;
    max-height: 100%;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) transparent;
}

/* Glassmorphism Refined for Light Theme */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 32px;
    box-shadow: var(--shadow-soft);
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.glass:hover {
    filter: brightness(1.05);
}

.hero-title {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 800;
    line-height: 1.1;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 2rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 3rem;
}

.cta-btn {
    padding: 1.2rem 3.5rem;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--btn-primary-text);
    background: var(--btn-primary-bg);
    border-radius: 100px;
    border: none;
    cursor: pointer;
    box-shadow: var(--btn-primary-shadow);
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.cta-btn:hover {
    transform: translateY(-5px);
    box-shadow: var(--btn-primary-hover-shadow);
    filter: brightness(1.1);
}

.section-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 3rem;
    background: linear-gradient(135deg, var(--text-dark), var(--primary));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    width: 100%;
    max-width: 1200px;
}

.card {
    padding: 3rem 2.5rem;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--glass-border) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 0;
}

.card:hover::before {
    opacity: 0.5;
}

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

.card:hover {
    transform: translateY(-12px) rotateX(4deg) rotateY(-4deg);
    box-shadow: 0 25px 50px rgba(11, 35, 59, 0.12);
    background: var(--bg-light);
    filter: brightness(1.05);
    border-color: var(--primary);
}

.card-tag {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--primary);
    font-weight: 800;
    margin-bottom: 1.5rem;
    display: inline-block;
    padding: 0.3rem 0.8rem;
    background: rgba(59, 133, 194, 0.1);
    border-radius: 50px;
    transition: all 0.3s ease;
}

.card:hover .card-tag {
    background: var(--primary);
    color: white;
}

.card-line {
    width: 30px;
    height: 2px;
    background-color: var(--primary);
    margin: 1.5rem 0;
    transition: width 0.4s ease;
    opacity: 0.6;
}

.card:hover .card-line {
    width: 60px;
    opacity: 1;
}

.card h3 {
    font-size: 1.5rem;
    margin-bottom: 0;
    color: var(--secondary);
    line-height: 1.3;
}

.card p {
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-top: auto;
    /* Pushes content strictly to the alignment logic */
}

/* Specific styling for quotes */
.quote-card p {
    font-style: italic;
    color: var(--text-dark);
    font-size: 1.1rem;
}

.quote-card h3 {
    font-size: 1rem;
    color: var(--text-muted);
}

.quote-card .card-tag {
    margin-bottom: 0;
    margin-top: 0.5rem;
    background: transparent;
    padding: 0;
    color: var(--primary);
}

.title-line {
    width: 60px;
    height: 3px;
    background: var(--primary);
    margin: -1.5rem auto 2.5rem;
    border-radius: 2px;
}

.contact-wrapper {
    padding: 4rem;
    width: 100%;
    max-width: 700px;
    max-height: 100%;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) transparent;
}

form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

input,
textarea,
select {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    padding: 1.4rem;
    color: var(--input-text);
    border-radius: 18px;
    font-family: inherit;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    width: 100%;
    transform-origin: left center;
    backdrop-filter: blur(5px);
}

select {
    cursor: pointer;
    background-image: linear-gradient(45deg, transparent 50%, var(--input-text) 50.1%), linear-gradient(135deg, var(--input-text) 50%, transparent 50.1%);
    background-position: calc(100% - 25px) calc(1.4rem + 8px), calc(100% - 20px) calc(1.4rem + 8px);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    appearance: none;
    -webkit-appearance: none;
    padding-right: 3rem;
}

textarea {
    resize: vertical;
    min-height: 120px;
}

input::placeholder,
textarea::placeholder {
    color: var(--input-placeholder);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    background: var(--input-focus-bg);
    border-color: var(--primary);
    box-shadow: 
        15px 15px 35px rgba(0, 0, 0, 0.05),
        0 0 0 4px rgba(59, 133, 194, 0.15);
    transform: perspective(1000px) rotateY(-3deg) translateX(8px);
}

/* Background & Environment */
.mesh-bg {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    z-index: -2;
    background:
        radial-gradient(at 20% 20%, var(--deco-1) 0, transparent 50%),
        radial-gradient(at 80% 80%, var(--deco-2) 0, transparent 50%),
        radial-gradient(at 50% 50%, var(--deco-3) 0, transparent 100%);
    animation: slowDrift 30s ease-in-out infinite alternate;
}

@keyframes slowDrift {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(-5%, -5%) scale(1.05);
    }
}

.glow-sphere {
    position: absolute;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, var(--deco-glow) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: -1;
    animation: pulseGlow 8s ease-in-out infinite alternate;
}

@keyframes pulseGlow {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.8;
    }

    100% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 1;
    }
}

.particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    box-shadow: 0 0 15px rgba(148, 128, 94, 0.4);
    opacity: 0.4;
    pointer-events: none;
    animation: twinkle 4s ease-in-out infinite alternate;
}

@keyframes twinkle {
    0% {
        opacity: 0.2;
        transform: scale(0.8);
    }

    100% {
        opacity: 0.8;
        transform: scale(1.5);
    }
}


.btn-nav {
    cursor: pointer;
    border: none;
    margin-top: 2rem;
}

/* -------- Inner Page Enhancements -------- */

body.inner-page {
    background: radial-gradient(circle at top right, rgba(148, 128, 94, 0.06), transparent 45%),
        radial-gradient(circle at bottom left, rgba(44, 44, 46, 0.04), transparent 45%),
        var(--bg-light);
}

.page-intro {
    padding: 12rem 10% 8rem;
    position: relative;
    overflow: hidden;
}

.page-intro::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 70% 30%, rgba(148, 128, 94, 0.08) 0%, transparent 60%);
    pointer-events: none;
    z-index: -1;
}

.page-kicker {
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 4px;
    color: var(--primary);
    margin-bottom: 2rem;
    display: block;
    animation: fadeInUp 0.8s ease-out forwards;
}

.page-title {
    font-size: clamp(3rem, 5vw, 4.5rem);
    font-weight: 800;
    line-height: 1.1;
    color: var(--secondary);
    max-width: 900px;
    margin-bottom: 3rem;
    animation: fadeInUp 1s ease-out 0.2s forwards;
    opacity: 0;
}

.page-subtitle {
    font-size: 1.4rem;
    color: var(--text-muted);
    max-width: 700px;
    animation: fadeInUp 1s ease-out 0.4s forwards;
    opacity: 0;
}

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

.decorative-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    opacity: 0.4;
    animation: pulseBlob 10s infinite alternate;
}

@keyframes pulseBlob {
    0% { transform: scale(1); opacity: 0.3; }
    100% { transform: scale(1.2); opacity: 0.5; }
}

.page-section {
    padding: 10rem 10%;
    position: relative;
}

.page-section-header {
    margin-bottom: 6rem;
    max-width: 800px;
}

.page-section-title {
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--secondary);
    margin-bottom: 1.5rem;
}

.page-section-caption {
    font-size: 1.1rem;
    color: var(--text-muted);
}

/* Grid Layouts Improved */
.page-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
}

.page-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

/* Service Card Enhancements */
.service-card {
    padding: 4rem 3rem;
    background: white;
    border-radius: 32px;
    border: 1px solid rgba(0,0,0,0.03);
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
    overflow: hidden;
}

.service-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 40px 80px rgba(0,0,0,0.06);
    border-color: rgba(148, 128, 94, 0.2);
}

.service-card:hover::after {
    transform: scaleX(1);
}

.service-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 2.5rem;
    background: rgba(148, 128, 94, 0.05);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    transition: all 0.3s ease;
}

.service-card:hover .service-icon {
    background: var(--primary);
    color: white;
    transform: rotate(10deg);
}

.service-card h3 {
    font-size: 1.6rem;
    margin-bottom: 1.5rem;
    color: var(--secondary);
}

.service-card p {
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.7;
}

/* Stat Pills Enhancement */
.stat-pill {
    display: flex;
    flex-direction: column;
    margin-bottom: 2rem;
}

.stat-pill span:first-child {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}

.stat-pill span:last-child {
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin-top: 0.5rem;
}
.page-main {
    padding: 6rem 10% 8rem;
    transition: opacity 0.5s ease;
    transform: translate3d(var(--drift-x), var(--drift-y), 0);
    transform-style: preserve-3d;
}

/* Removing duplicate .glass definition */

/* Creative Layout Twists */
.shard-frame {
    position: relative;
    padding: 6rem 10%;
    margin: 4rem 0;
    background: rgba(148, 128, 94, 0.02);
    border-top: 1px solid rgba(148, 128, 94, 0.1);
    border-bottom: 1px solid rgba(148, 128, 94, 0.1);
}

/* Chronos Precision Elements */
.blueprint-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    background-image: 
        linear-gradient(var(--glass-border) 1px, transparent 1px),
        linear-gradient(90deg, var(--glass-border) 1px, transparent 1px);
    background-size: 60px 60px;
    opacity: 0;
    transition: opacity 1s ease;
}

.page-home .blueprint-grid,
.page-about .blueprint-grid,
.page-solutions .blueprint-grid,
.page-contact .blueprint-grid,
.page-studio .blueprint-grid {
    opacity: 1;
}

/* Ensure grid visibility on home page by removing overlapping backgrounds */
.page-home .site-header,
.page-home .three-d-isolated-section {
    background-color: transparent !important;
}

.precision-frame {
    position: relative;
    border: 1px solid transparent;
    transition: border-color 0.8s ease;
}

.precision-frame::before,
.precision-frame::after {
    content: '';
    position: absolute;
    background: var(--primary);
    transition: transform 0.8s cubic-bezier(0.23, 1, 0.32, 1);
    opacity: 0.2;
}

/* Corner Tracers */
.precision-frame::before {
    top: -1px;
    left: -1px;
    width: 40px;
    height: 40px;
    border-top: 2px solid var(--primary);
    border-left: 2px solid var(--primary);
    transform: translate(-10px, -10px);
}

.precision-frame::after {
    bottom: -1px;
    right: -1px;
    width: 40px;
    height: 40px;
    border-bottom: 2px solid var(--primary);
    border-right: 2px solid var(--primary);
    transform: translate(10px, 10px);
}

.precision-frame.in-view::before,
.precision-frame.in-view::after {
    transform: translate(0, 0);
    opacity: 0.5;
}

.vertical-label {
    position: absolute;
    writing-mode: vertical-rl;
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 5px;
    color: var(--primary);
    opacity: 0.2;
    top: 0;
    left: -20px;
    height: 100%;
    display: flex;
    align-items: center;
    pointer-events: none;
}

.aperture-card {
    position: relative;
    overflow: hidden;
    clip-path: circle(150% at 50% 50%);
    transition: clip-path 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

.aperture-card:hover {
    clip-path: circle(70% at 50% 50%);
}

.z-offset-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4rem;
    padding: 4rem 0;
}

.z-card {
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.z-card:hover {
    transform: translateY(-20px);
}

/* Premium Card Hover Refinements */
.service-card:hover .service-icon svg {
    transform: scale(1.1);
    transition: transform 0.3s ease;
}

.card:hover h3 {
    color: var(--primary);
}

.profile-card:hover {
    background: white !important;
    box-shadow: 0 50px 100px rgba(0,0,0,0.08) !important;
}

/* Section Smooth Loading */
.page-section {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

.page-section.show {
    opacity: 1;
    transform: translateY(0);
}

.page-intro {
    max-width: 760px;
    margin: 0 auto 4rem;
    text-align: center;
}

.page-kicker {
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--primary);
    margin-bottom: 1.2rem;
}

.page-title {
    font-size: clamp(2.8rem, 5vw, 3.8rem);
    font-weight: 800;
    line-height: 1.1;
    color: var(--secondary);
    margin-bottom: 1.5rem;
}

.page-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
}

.page-section {
    margin-bottom: 5rem;
}

.page-section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 2rem;
    gap: 2rem;
}

.page-section-title {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--secondary);
}

.page-section-caption {
    max-width: 420px;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.page-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem;
}

.page-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem;
}

.stat-pill {
    display: inline-flex;
    align-items: baseline;
    gap: 0.35rem;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    background: rgba(148, 128, 94, 0.06);
    color: var(--secondary);
    font-size: 0.8rem;
    font-weight: 600;
}

.stat-pill span:first-child {
    font-size: 1rem;
    font-weight: 800;
}

.detail-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

.detail-list li {
    display: flex;
    gap: 0.8rem;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.detail-bullet {
    width: 8px;
    height: 8px;
    margin-top: 0.45rem;
    border-radius: 999px;
    background: var(--primary);
}

.profile-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.profile-name {
    font-weight: 700;
    color: var(--secondary);
}

.profile-role {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.profile-bio {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.process-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.5rem;
}

.process-step-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.process-step-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.process-step-body {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.contact-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr);
    gap: 4rem;
}

.contact-panel {
    padding: 3rem 2.5rem;
    border-color: var(--primary);
}

.contact-meta {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.contact-meta-block span {
    display: block;
}

.contact-meta-label {
    font-size: 0.8rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.contact-meta-value {
    font-weight: 600;
    color: var(--secondary);
}

.contact-note {
    font-size: 0.9rem;
    color: var(--text-muted);
}

@media (max-width: 960px) {
    .page-main {
        padding: 5rem 6% 6rem;
    }

    .page-grid-3,
    .process-steps,
    .contact-layout {
        grid-template-columns: 1fr;
    }

    .page-grid-2 {
        grid-template-columns: 1fr;
    }

    .page-section-header {
        flex-direction: column;
        align-items: flex-start;
    }
}
/* Firefox-specific handling to prevent 3D context flattening */
@supports (-moz-appearance:none) {
    .three-d-isolated-section {
        overflow: visible !important;
    }
    .container {
        perspective: none !important;
    }
    .layer {
        /* Firefox flattens 3D context when filters are applied to elements in the preserve-3d chain */
        filter: none !important;
    }
}

/* Experimental Portal Reveal */
.portal-reveal {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: var(--bg-dark);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 10000;
    animation: portalGrow 1.2s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

@keyframes portalGrow {
    0% { width: 0; height: 0; opacity: 1; border-radius: 50%; }
    50% { width: 150vmax; height: 150vmax; opacity: 1; border-radius: 50%; }
    100% { width: 200vmax; height: 200vmax; opacity: 0; border-radius: 0%; }
}

/* Anima Bot Styling */
.anima-bot-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 200px;
    height: 200px;
    z-index: 10001;
    pointer-events: none;
    /* Removed transition from transform as it conflicts with JS animation */
}

.anima-bot-message {
    position: absolute;
    bottom: 80%;
    right: 20%;
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    padding: 1rem 1.5rem;
    border-radius: 20px 20px 0 20px;
    box-shadow: var(--shadow-soft);
    max-width: 250px;
    opacity: 0;
    transform: translateY(10px) scale(0.9);
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    pointer-events: auto;
}

.anima-bot-message.active {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.message-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--secondary);
    line-height: 1.4;
}

.anima-bot-container lottie-player {
    pointer-events: auto;
    cursor: pointer;
    width: 100% !important;
    height: 100% !important;
    transition: filter 0.5s ease;
}

.anima-bot-container lottie-player:hover {
    filter: drop-shadow(0 0 30px rgba(148, 128, 94, 0.4));
}

/* Advanced Bot Animations */
@keyframes bot-bounce {
    0%, 100% { transform: translateY(0) scale(1); }
    30% { transform: translateY(-20px) scale(1.05); }
    50% { transform: translateY(0) scale(0.95); }
}

@keyframes bot-wiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(10deg); }
    75% { transform: rotate(-10deg); }
}

.bot-reacting-bounce {
    animation: bot-bounce 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.bot-reacting-wiggle {
    animation: bot-wiggle 0.5s ease-in-out;
}

@keyframes bot-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(1080deg); }
}

.bot-reacting-spin {
    animation: bot-spin 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes bot-glitch {
    0% { transform: translate(0); filter: hue-rotate(0deg); }
    20% { transform: translate(-5px, 5px); filter: hue-rotate(90deg) invert(0.2); }
    40% { transform: translate(5px, -5px); filter: hue-rotate(180deg) invert(0.3); }
    60% { transform: translate(-5px, -5px); filter: hue-rotate(270deg) invert(0.1); }
    80% { transform: translate(5px, 5px); filter: hue-rotate(360deg); }
    100% { transform: translate(0); filter: hue-rotate(0deg); }
}

@keyframes bot-pulse {
    0%, 100% { filter: drop-shadow(0 0 20px rgba(148, 128, 94, 0.2)); transform: scale(1); }
    50% { filter: drop-shadow(0 0 40px rgba(148, 128, 94, 0.5)); transform: scale(1.05); }
}

.bot-reacting-glitch {
    animation: bot-glitch 0.3s linear infinite;
}

.bot-reacting-pulse {
    animation: bot-pulse 2s ease-in-out infinite;
}

.bot-excited {
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.5));
    transform: scale(1.05);
}

@media (max-width: 1024px) {
    .floating-dock {
        width: 90%;
        padding: 0.6rem 2rem;
        gap: 0.6rem;
        justify-content: space-between;
    }

    .dock-logo {
        border: none;
        padding: 0;
    }

    .dock-links {
        display: none;
    }

    .core-toggle {
        display: block;
    }

    .lang-switcher {
        border-left: none;
        padding-left: 0;
    }

    .lang-link {
        opacity: 1;
        font-size: 0.78rem;
        letter-spacing: 0.4px;
        padding: 0.45rem 0.7rem;
        background: rgba(11, 35, 59, 0.06);
    }

    [data-theme="dark"] .lang-link {
        background: rgba(255, 255, 255, 0.1);
    }

    .theme-toggle {
        width: 42px;
        height: 42px;
        margin-left: 0.35rem;
    }

    .hero {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 8rem 5% 4rem;
        gap: 2rem;
    }

    .hero-content {
        order: 2;
    }

    .hero-visual {
        order: 1;
        height: 400px;
    }

    .neural-core-wrapper {
        width: 100%;
        height: 100%;
    }

    #neural-core {
        width: 300px;
        height: 300px;
    }

    .hero-desc {
        margin: 0 auto 3rem;
    }

    .hero-btns {
        justify-content: center;
    }

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

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

    .footer-brand p {
        margin: 0 auto;
    }
    
    .social-links {
        justify-content: center;
    }

    .spatial-nav {
        display: flex !important;
        position: fixed;
        top: calc(6rem + env(safe-area-inset-top)); /* Below the floating dock */
        bottom: auto;
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: auto !important;
        max-width: 95vw;
        gap: 0.3rem;
        padding: 0.4rem;
        justify-content: center;
        flex-wrap: nowrap;
        overflow: hidden;
        border-radius: 100px;
        z-index: 1085;
        background: var(--glass-bg);
        backdrop-filter: blur(20px) saturate(180%);
        -webkit-backdrop-filter: blur(20px) saturate(180%);
        box-shadow: var(--shadow-soft);
        border: 1px solid var(--glass-border);
    }

    .spatial-nav a {
        padding: 0.6rem;
        border-radius: 100px;
        background: transparent;
        color: var(--text-dark) !important;
        opacity: 0.4;
        gap: 0;
        transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    }

    .s-nav-icon {
        font-size: 1.1rem;
        transition: transform 0.4s ease;
    }

    .s-nav-text {
        display: none;
        font-weight: 700;
        font-size: 0.8rem;
        letter-spacing: 0.5px;
        white-space: nowrap;
    }

    .spatial-nav a.active {
        background: var(--primary);
        color: white !important;
        opacity: 1;
        padding: 0.6rem 1.2rem;
        gap: 0.5rem;
        box-shadow: 0 10px 20px rgba(59, 133, 194, 0.3);
    }

    .spatial-nav a.active .s-nav-text {
        display: block;
    }

    .spatial-nav a.active .s-nav-icon {
        transform: rotate(90deg) scale(1.1);
    }

    .content-wrapper,
    .contact-wrapper {
        padding: 11rem 1.5rem 3rem;
        width: 100%;
        max-width: 100%;
        margin-top: 0;
    }

    .section-title {
        font-size: 1.8rem !important; /* Slightly smaller for mobile */
        margin-bottom: 2rem;
    }

    .hero-title {
        font-size: 2.2rem !important; /* Closer fit for mobile */
    }

    .hero-main-title {
        font-size: 2.5rem !important;
        margin-bottom: 1.5rem;
    }

    .hero-subtitle {
        font-size: 1rem;
        color: var(--secondary) !important; /* Force darker text for contrast */
        opacity: 1 !important;
        margin-bottom: 2rem;
    }

    .chronos-thread {
        display: none !important;
    }

    .layer {
        padding: 0;
    }
}

@media (max-width: 768px) {
    .hero-main-title {
        font-size: 3rem;
    }

    .card {
        padding: 2rem 1.5rem;
        transform: none !important; /* Disable 3D tilt on mobile for better usability */
    }

    .card-tag {
        margin-bottom: 1rem;
    }

    .site-footer {
        padding: 4rem 5% 2rem;
    }

    /* Anima Bot Mobile Optimization */
    .anima-bot-container {
        width: 80px !important;
        height: 80px !important;
    }

    .bot-message-bubble {
        bottom: 110px !important;
        right: 10px !important;
        left: auto !important;
        transform: scale(0.9) !important;
        white-space: normal;
        max-width: 200px;
    }

    .bot-message-bubble::after {
        left: auto;
        right: 15px;
    }
    
    .layer {
        /* Flatten 3D for mobile performance and readability */
        transform: none !important;
        opacity: 0;
        position: absolute;
        top: 0;
        left: 0;
    }

    .layer.active {
        opacity: 1;
        position: relative;
    }

    .world {
        transform: none !important;
        display: block;
        height: auto;
        overflow: visible;
        position: relative !important;
    }
    
    .container {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        width: 100%;
        height: auto !important;
        overflow: visible;
        perspective: none;
    }

    .three-d-isolated-section {
        height: auto;
        overflow: visible;
    }

    /* Inner Page Adjustments */
    .chronos-layout {
        padding-left: 5% !important;
        padding-right: 5% !important;
    }

    .page-grid-3 {
        display: grid;
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .z-offset-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .stat-pill {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 2rem;
    }

    .page-title {
        font-size: 2.2rem !important;
        line-height: 1.2;
    }

    .page-subtitle {
        font-size: 1.1rem;
    }

    .studio-matrix {
        gap: 4rem;
    }

    .viewport-card {
        padding: 1.5rem;
    }

    .viewport-iframe-wrapper {
        height: 300px !important;
    }

    .vertical-label {
        display: none; /* Hide on mobile to save space */
    }

    .particle {
        display: none !important;
    }
}

/* Language Switcher */
.lang-switcher {
    border-left: 1px solid rgba(11, 35, 59, 0.1);
    padding-left: 2rem;
    display: flex;
    align-items: center;
}

[data-theme="dark"] .lang-switcher {
    border-left-color: rgba(255, 255, 255, 0.1);
}

.lang-link {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 1px;
    opacity: 0.6;
    transition: all 0.3s ease;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
}

.lang-link:hover {
    opacity: 1;
    color: var(--primary);
    background: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .lang-link:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* RTL Support */
[dir="rtl"] {
    font-family: 'Inter', 'Noto Sans Arabic', system-ui, -apple-system, sans-serif;
}

[dir="rtl"] .dock-logo {
    border-right: none;
    border-left: 1px solid rgba(11, 35, 59, 0.1);
    padding-right: 0;
    padding-left: 2rem;
}

[dir="rtl"] .lang-switcher {
    border-left: none;
    border-right: 1px solid rgba(11, 35, 59, 0.1);
    padding-left: 0;
    padding-right: 2rem;
}

[dir="rtl"] .theme-toggle {
    margin-left: 0;
    margin-right: 1rem;
}

[dir="rtl"] .hero-desc {
    margin-right: 0;
    margin-left: auto;
}

[dir="rtl"] .footer-brand p {
    margin-right: 0;
    margin-left: auto;
}

[dir="rtl"] .spatial-nav {
    flex-direction: row-reverse;
}

[dir="rtl"] .overlay-nav a {
    flex-direction: row-reverse;
}

[dir="rtl"] .nav-icon {
    margin-left: 0.6rem;
    margin-right: 0;
}

[dir="rtl"] .hero-visual {
    order: -1;
}

/* Specific component flips */
[dir="rtl"] .chronos-thread {
    left: auto;
    right: 40px;
}

[dir="rtl"] .overlay-close {
    right: auto;
    left: 2rem;
}

/* Fix for grid layouts in RTL if needed */
[dir="rtl"] .footer-grid {
    direction: rtl;
}

[dir="rtl"] .hero {
    direction: rtl;
}

[dir="rtl"] .anima-bot-message {
    right: auto;
    left: 20%;
    border-radius: 20px 20px 20px 0;
}
