/* ============================================================
   Cynefine — Shared Stylesheet
   Design System: "The Illuminated Lab" (Light Theme)
   ============================================================ */

/* --- Smooth Scroll --- */
html {
    scroll-behavior: smooth;
}

/* --- Page Load Fade-In --- */
body {
    opacity: 0;
    animation: pageIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    scroll-behavior: smooth;
}
@keyframes pageIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* --- Material Symbols --- */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* --- Aurora Gradient --- */
.aurora-gradient {
    background: linear-gradient(135deg, #006668 0%, #52f2f5 100%);
}

/* --- Active Nav Link --- */
.nav-link-active {
    color: #006668 !important;
    position: relative;
    font-weight: 700;
}
.nav-link-active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #006668, #52f2f5);
    border-radius: 2px;
    box-shadow: 0 2px 8px rgba(0, 102, 104, 0.2);
}

/* --- Glass Effects --- */
.glass-card {
    backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.7);
}
.glass-panel {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
}

/* --- Glow Hover Effects --- */
.glow-teal { transition: box-shadow 0.3s, transform 0.3s; }
.glow-violet { transition: box-shadow 0.3s, transform 0.3s; }
.glow-gold { transition: box-shadow 0.3s, transform 0.3s; }
.glow-hover { transition: box-shadow 0.3s, transform 0.3s; }
.glow-hover:hover {
    box-shadow: 0 0 40px -10px rgba(0, 102, 104, 0.15);
    transform: scale(1.02);
}
.glow-border { position: relative; transition: box-shadow 0.3s, transform 0.3s; }
.glow-border:hover { box-shadow: 0 0 40px -10px rgba(0, 102, 104, 0.15); }
.glow-border::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(0, 102, 104, 0.2), rgba(129, 28, 217, 0.2));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}
.glow-shadow {
    box-shadow: 0 40px 40px -10px rgba(0, 102, 104, 0.06);
}
.text-glow {
    text-shadow: 0 0 20px rgba(82, 242, 245, 0.3);
}

/* --- Header Enhancements --- */
.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 102, 104, 0.08);
    padding: 6px 16px 6px 8px;
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    max-width: 100%;
}

@media (max-width: 640px) {
    .logo-area {
        padding: 4px 10px 4px 6px;
        gap: 8px;
    }
    .header-divider, .page-name-display {
        display: none !important;
    }
    .logo-area img {
        height: 38px !important;
    }
}
.logo-area:hover {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 102, 104, 0.15);
    box-shadow: 0 4px 20px rgba(0, 102, 104, 0.05);
}
.logo-area::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(82, 242, 245, 0.2), transparent, rgba(129, 28, 217, 0.1));
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s;
}
.logo-area:hover::before { opacity: 1; }

.header-divider {
    width: 1px;
    height: 24px;
    background: linear-gradient(180deg, transparent, rgba(0, 102, 104, 0.2), transparent);
}

.page-name-display {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    color: #2c2f30;
    letter-spacing: -0.01em;
    opacity: 0;
    transform: translateX(-10px);
    animation: slideInName 0.5s ease-out 0.2s forwards;
    white-space: nowrap;
}
@keyframes slideInName {
    to { opacity: 1; transform: translateX(0); }
}

/* --- Cinematic Dark Topology --- */
.dark-topology {
    background: radial-gradient(circle at 72% 50%, #161b22 0%, #0d1117 100%);
    backdrop-filter: blur(20px);
    border-radius: 2.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    min-height: 520px;
    transition: min-height 0.4s ease;
}

@media (max-width: 768px) {
    .dark-topology {
        flex-direction: column;
        min-height: 800px;
        background: #0d1117;
        align-items: flex-start;
        padding-top: 2rem;
    }
}

.globe-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    cursor: grab;
}
.globe-canvas:active { cursor: grabbing; }

.globe-content {
    position: relative;
    z-index: 5;
    width: 100%;
    max-width: 600px;
    padding: 3rem 4rem;
    pointer-events: none;
}
@media (max-width: 768px) {
    .globe-content {
        padding: 2rem;
        max-width: 100%;
        text-align: center;
    }
    .globe-content h2 { font-size: 2.5rem; }
    .globe-content .flex.gap-10 { 
        justify-content: center;
        gap: 1.5rem;
        flex-wrap: wrap;
    }
    .globe-content .node-tag { font-size: 0.65rem; }
}
.globe-content * { pointer-events: auto; }

.globe-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(64, 169, 255, 0.1);
    border: 1px solid rgba(64, 169, 255, 0.2);
    border-radius: 99px;
    color: #40a9ff;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.dark-topology h2 { color: #ffffff; }
.dark-topology p { color: rgba(255, 255, 255, 0.6); }

.dark-topology .stat-label { 
    color: rgba(255, 255, 255, 0.4); 
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.dark-topology .node-tag {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.4rem 1rem;
    border-radius: 99px;
    transition: all 0.3s ease;
}
.dark-topology .node-tag:hover {
    background: rgba(64, 169, 255, 0.1);
    border-color: rgba(64, 169, 255, 0.3);
    color: #40a9ff;
}

/* --- Illumination Trace --- */
.illumination-trace { position: relative; overflow: hidden; }
.illumination-trace:hover::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent, #52f2f5, transparent);
    animation: slide 2s infinite linear;
    z-index: 10;
}
@keyframes slide {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* --- Animated Mesh Background (Homepage) --- */
.mesh-gradient-bg {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: -2;
    background: #ffffff;
    overflow: hidden;
}
.mesh-blob {
    position: absolute;
    width: 80vmax; height: 80vmax;
    filter: blur(80px);
    opacity: 0.15;
    animation: move-blob 40s infinite alternate ease-in-out;
    border-radius: 50%;
}
.blob-1 { background: #52f2f5; top: -20%; left: -20%; animation-delay: 0s; }
.blob-2 { background: #e4c6ff; bottom: -20%; right: -20%; animation-delay: -10s; }
.blob-3 { background: #ffffff; top: 20%; right: 10%; animation-duration: 50s; }
@keyframes move-blob {
    0%   { transform: translate(0, 0) scale(1); }
    33%  { transform: translate(10%, 15%) scale(1.1); }
    66%  { transform: translate(-15%, 5%) scale(0.9); }
    100% { transform: translate(0, 0) scale(1); }
}

/* --- Particle Field --- */
.particle-field {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: -1;
    pointer-events: none;
}
.particle {
    position: absolute;
    background: currentColor;
    border-radius: 50%;
    opacity: 0.1;
    animation: drift var(--duration) linear infinite;
}
@keyframes drift {
    from { transform: translateY(110vh) translateX(0); }
    to   { transform: translateY(-10vh) translateX(var(--drift-x)); }
}

/* --- Mesh BG (Service Pages) --- */
.mesh-bg {
    background-color: #f5f6f7;
    background-image:
        radial-gradient(at 0% 0%, hsla(181, 100%, 90%, 1) 0px, transparent 50%),
        radial-gradient(at 100% 0%, hsla(268, 77%, 92%, 1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, hsla(181, 100%, 95%, 1) 0px, transparent 50%),
        radial-gradient(at 0% 100%, hsla(268, 77%, 95%, 1) 0px, transparent 50%);
}

/* --- Scroll Reveal --- */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}
.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* --- Mobile Menu --- */
.mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out, opacity 0.3s;
    opacity: 0;
}
.mobile-menu.open {
    max-height: 800px;
    opacity: 1;
}

/* --- Services Dropdown (Dark) --- */
.services-dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    min-width: 280px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 1rem;
    box-shadow: 0 20px 60px -15px rgba(0, 0, 0, 0.4);
    padding: 0.75rem 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s, transform 0.25s;
    z-index: 100;
    border: 1px solid rgba(255,255,255,0.08);
}
.services-dropdown.show,
.nav-services:hover .services-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}
.services-dropdown a {
    display: block;
    padding: 0.6rem 1.5rem;
    font-size: 0.875rem;
    color: #2c2f30;
    transition: color 0.2s, background 0.2s, padding-left 0.2s;
    font-weight: 500;
}
.services-dropdown a:hover {
    color: #00c8e0;
    background: rgba(0, 200, 224, 0.08);
    padding-left: 1.75rem;
}


/* --- Hero Slideshow --- */
.slideshow-container {
    position: relative;
    width: 100%; height: 100%;
}
.slideshow-container img {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}
.slideshow-container img.active {
    opacity: 1;
}

/* --- Hamburger Icon --- */
.hamburger span {
    display: block;
    width: 24px; height: 2px;
    background: #2c2f30;
    margin: 6px 0;
    transition: transform 0.3s, opacity 0.3s;
    border-radius: 2px;
}
.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 6px);
}
.hamburger.active span:nth-child(2) {
    opacity: 0;
}
.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -6px);
}

/* --- Footer --- */
.footer-light {
    background: linear-gradient(180deg, #f8fafb 0%, #ffffff 100%);
    color: #2c2f30;
    border-top: none;
    position: relative;
}
.footer-light::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    max-width: 1200px;
    height: 1px;
    background: linear-gradient(90deg, transparent, #006668, #52f2f5, #006668, transparent);
}
.footer-light a {
    color: #64748b;
    transition: color 0.3s, transform 0.2s;
}
.footer-light a:hover {
    color: #006668;
    transform: translateX(2px);
}

/* --- Contact Modal --- */
.contact-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(13, 17, 23, 0.85);
    backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s, visibility 0.4s;
}
.contact-modal.active {
    opacity: 1;
    visibility: visible;
}
.contact-modal .modal-card {
    background: #0d1117;
    border: 1px solid transparent;
    border-image: linear-gradient(135deg, #006668, #811cd9) 1;
    border-radius: 1.5rem;
    padding: 3rem;
    max-width: 560px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(40px);
    transition: transform 0.4s ease-out;
    position: relative;
}
.contact-modal.active .modal-card {
    transform: translateY(0);
}
.modal-card-wrapper {
    position: relative;
    border-radius: 1.5rem;
    padding: 2px;
    background: linear-gradient(135deg, #006668, #811cd9);
    max-width: 560px;
    width: 90%;
    transform: translateY(40px);
    transition: transform 0.4s ease-out;
}
.contact-modal.active .modal-card-wrapper {
    transform: translateY(0);
}
.modal-card-wrapper .modal-card {
    border: none;
    border-image: none;
    border-radius: calc(1.5rem - 2px);
    transform: none;
    width: 100%;
    max-width: 100%;
}
.modal-card input,
.modal-card select,
.modal-card textarea {
    width: 100%;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    color: #e2e8f0;
    font-size: 0.9rem;
    transition: border-color 0.2s;
    outline: none;
}
.modal-card input:focus,
.modal-card select:focus,
.modal-card textarea:focus {
    border-color: #00c8e0;
}
.modal-card input::placeholder,
.modal-card textarea::placeholder {
    color: #64748b;
}
.modal-card select option {
    background: #0d1117;
    color: #e2e8f0;
}
.modal-card label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #94a3b8;
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* --- World Map Dots --- */
@keyframes map-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.8); opacity: 0.4; }
}
.map-dot {
    animation: map-pulse 2s ease-in-out infinite;
}
.map-dot:nth-child(2) { animation-delay: 0.3s; }
.map-dot:nth-child(3) { animation-delay: 0.6s; }
.map-dot:nth-child(4) { animation-delay: 0.9s; }

/* --- Neural Grid Animation (AI page) --- */
.neural-grid {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}
.neural-grid .pulse-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(82, 242, 245, 0.15);
    animation: neural-pulse 4s ease-out infinite;
}
@keyframes neural-pulse {
    0% { transform: scale(0.5); opacity: 0.6; }
    100% { transform: scale(3); opacity: 0; }
}

/* --- Stats Grid Responsive --- */
@media (min-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

/* --- Animated Gradient Border on Service Cards --- */
@keyframes border-rotate {
    0%   { --border-angle: 0deg; }
    100% { --border-angle: 360deg; }
}
@property --border-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}
.service-card {
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.service-card:hover {
    /* Kept only the underline animation handled via HTML classes */
}

/* --- Back to Top Button --- */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #006668;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(0, 102, 104, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px);
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s, background 0.2s;
    z-index: 1000;
}
.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.back-to-top:hover {
    background: #00595b;
    transform: translateY(-2px);
}


/* --- Selection --- */
::selection {
    background: #52f2f5;
    color: #005859;
}
