:root {
    /* DARK THEME (DEFAULT) */
    --bg-color: #0a1128;
    --bg-secondary: #111d4a;
    --text-color: #e2e8f0;
    --text-muted: #94a3b8;
    --accent-color: #38bdf8;
    --border-color: rgba(255, 255, 255, 0.1);
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-hover-bg: #1e2b58;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --panel-bg: #0f173a;
    --sticky-bg: rgba(10, 17, 40, 0.95);
    --dropdown-bg: rgba(15, 25, 60, 0.98);
    --footer-bg: #0a1128;
    --canvas-opacity: 0.10;

    --font-heading: 'Syne', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-display: 'Space Grotesk', sans-serif;

    --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --transition-speed: 0.4s;
}

[data-theme="light"] {
    --bg-color: #f8fafc;
    --bg-secondary: #f1f5f9;
    --text-color: #0f172a;
    --text-muted: #64748b;
    --accent-color: #2563eb;
    --border-color: rgba(0, 0, 0, 0.1);
    --card-bg: rgba(0, 0, 0, 0.02);
    --card-hover-bg: #f1f5f9;
    --glass-bg: rgba(255, 255, 255, 0.8);
    --panel-bg: #ffffff;
    --sticky-bg: rgba(248, 250, 252, 0.95);
    --dropdown-bg: #ffffff;
    --footer-bg: #ffffff;
    --canvas-opacity: 0.30;
}

/* RESET & CORE */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: none;
    /* Custom Cursor */
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    width: 100%;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
    transition: background-color var(--transition-speed) var(--ease), color var(--transition-speed) var(--ease);
}

body.loading {
    overflow: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

ul {
    list-style: none;
}

/* LAYOUT UTILS */
.container {
    width: 90%;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
}

.section {
    padding: 120px 0;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    z-index: 1;
}

/* Glassmorphism Section Utility */
.section-glass {
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
}

.services-section.section-glass {
    background: rgba(56, 189, 248, 0.04);
    /* Cyan/Accent Tint */
}

.showcase-section.section-glass {
    background: var(--glass-bg);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.05);
}

.process-section.section-glass {
    background: var(--bg-color);
    /* Match background for clean look */
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}



/* CANVAS */
#fabric-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: var(--canvas-opacity);
    transition: opacity var(--transition-speed) var(--ease);
}




/* SPLIT LAYOUTS (About & Process) */
.split-layout {
    display: grid;
    grid-template-columns: 1.2fr 1.8fr;
    gap: 4rem;
    align-items: center;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 4rem;
    line-height: 0.9;
    font-weight: 800;
    position: sticky;
    top: 100px;
}

.highlight-text {
    font-family: var(--font-display);
    font-size: 2.5rem;
    color: var(--accent-color);
    margin-bottom: 2rem;
    line-height: 1.1;
}

/* PROTOCOL VISUAL: MECHANICAL HEART */
.protocol-visual-container {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 2rem;
    position: relative;
}

.protocol-visual {
    width: 100%;
    max-width: 600px;
    min-height: 400px;
    /* Ensure space for SVG */
    height: auto;
    z-index: 5;
}

/* Base SVG styling */
.heart-svg {
    overflow: visible;
}

/* Orbital Rotation */
.heart-orbit {
    fill: none;
    stroke: var(--border-color);
    stroke-width: 1.5;
    stroke-dasharray: 5 10;
    animation: orbit-rotate 60s linear infinite;
    transform-origin: center;
}

@keyframes orbit-rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Node Animations */
.heart-node {
    animation: node-float 6s ease-in-out infinite alternate;
    backface-visibility: hidden;
    transform-box: fill-box;
    transform-origin: center;
}

.node-icon-wrap {
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: icon-breathe 4s ease-in-out infinite alternate;
}

.node-shell {
    fill: var(--bg-secondary);
    stroke-width: 2.5;
    /* Slightly thicker */
    opacity: 1 !important;
}

/* Staggered Node animations */
.heart-node:nth-child(2) {
    animation-delay: 1s;
}

.heart-node:nth-child(3) {
    animation-delay: 2s;
}

.heart-node:nth-child(4) {
    animation-delay: 3s;
}

.heart-node:nth-child(5) {
    animation-delay: 4s;
}

/* Energy Pulse Particle */
.energy-pulse {
    filter: drop-shadow(0 0 10px var(--accent-color));
    opacity: 1;
}

/* Node Label Styles */
.node-label-wrap {
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(10px);
}

.node-label {
    font-weight: 700;
    letter-spacing: 0.05em;
    font-family: var(--font-heading);
    fill: var(--text-color);
}

.label-bg {
    fill: var(--glass-bg);
    stroke-width: 1;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.1));
}

/* Sequential Active State */
.node-group.active-flow {
    z-index: 10;
}

.node-group.active-flow .heart-node {
    transform: scale(1.2);
}

.node-group.active-flow .node-label-wrap {
    opacity: 1;
    transform: translateY(0);
}

.node-group.active-flow .node-shell {
    stroke-width: 4;
    stroke: var(--accent-color);
    filter: drop-shadow(0 0 20px var(--accent-color));
}

.node-group.active-flow .node-glow {
    opacity: 0.4;
    transform: scale(1.3);
}

@keyframes node-float {

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

    50% {
        transform: translateY(10px);
    }
}

@keyframes icon-breathe {
    from {
        transform: scale(0.95);
    }

    to {
        transform: scale(1.05);
    }
}

@keyframes active-pulse-glow {
    from {
        filter: drop-shadow(0 0 5px rgba(56, 189, 248, 0.2));
    }

    to {
        transform: scale(1.1);
        filter: drop-shadow(0 0 20px rgba(56, 189, 248, 0.5));
    }
}


@keyframes core-pulse {

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

    50% {
        transform: scale(1.1);
        opacity: 1;
    }
}

@keyframes core-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes core-spin-rev {
    to {
        transform: rotate(-360deg);
    }
}

/* Light Mode Contrast for SVG */
[data-theme="light"] .node-shell {
    fill: #ffffff;
}

[data-theme="light"] .main-icon {
    filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.1));
}


.body-text {
    font-size: 1.125rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    max-width: 800px;
}

.stat-row {
    display: flex;
    gap: 3rem;
    margin-top: 3rem;
    border-top: 1px solid var(--border-color);
    padding-top: 2rem;
}

.stat-num {
    display: block;
    font-family: var(--font-display);
    font-size: 2.5rem;
    color: var(--text-color);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* SERVICES GRID */
.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--border-color);
    /* fake border grid */
    border: 1px solid var(--border-color);
    margin-top: 4rem;
}

.service-card {
    background: var(--bg-color);
    padding: 3rem 2rem;
    position: relative;
    transition: background 0.3s;
}

.service-card:hover {
    background: var(--card-hover-bg);
}

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

.service-idx {
    font-family: var(--font-display);
    color: var(--accent-color);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    display: block;
}

.service-card h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    min-height: 3rem;
}

.service-card p {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.service-list {
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

.service-list li {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 0.5rem;
}

/* SHOWCASE (ACCORDION) */
.container-fluid {
    width: 100%;
    padding: 0;
}

.accordion-gallery {
    display: flex;
    height: 600px;
    width: 100%;
    overflow: hidden;
    margin-top: 4rem;
}

.acc-panel {
    position: relative;
    flex: 1;
    /* All equal start */
    background-size: cover;
    background-position: center;
    transition: flex 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    border-right: 1px solid rgba(0, 0, 0, 0.5);
    overflow: hidden;
    cursor: none;
}

.acc-panel:last-child {
    border-right: none;
}

.acc-panel:hover {
    flex: 3;
    /* Expand on hover */
}

/* Dim others when one is hovered */
.accordion-gallery:hover .acc-panel:not(:hover) {
    filter: grayscale(100%) brightness(0.5);
}

.acc-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, transparent 60%);
    transition: opacity 0.4s;
    opacity: 0.8;
}

.acc-panel:hover .acc-overlay {
    opacity: 0.4;
    /* Reveal image */
}

.acc-content {
    position: absolute;
    bottom: 2rem;
    left: 2rem;
    z-index: 2;
    width: 100%;
    pointer-events: none;
    /* Let clicks pass to A tag */
}

.acc-num {
    font-family: var(--font-display);
    font-size: 4rem;
    color: rgba(255, 255, 255, 0.1);
    position: absolute;
    top: -5rem;
    left: 0;
    font-weight: 700;
    transition: all 0.5s;
}

.acc-panel:hover .acc-num {
    color: rgba(255, 255, 255, 0.8);
    transform: translateY(-20px);
}

.acc-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    transform: rotate(-90deg);
    transform-origin: left bottom;
    position: absolute;
    bottom: 0;
    left: 2rem;
    white-space: nowrap;
    transition: all 0.4s;
    color: #ffffff;
    -webkit-text-stroke: 1px #000000;
    text-shadow: 1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000;
}

.acc-panel:hover .acc-title {
    transform: rotate(0deg);
    position: static;
    font-size: 3rem;
    margin-bottom: 1rem;
}

.acc-hidden-info {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.5s ease;
}

.acc-panel:hover .acc-hidden-info {
    max-height: 200px;
    opacity: 1;
}

.acc-hidden-info p {
    font-family: var(--font-body);
    font-size: 1.1rem;
    color: var(--text-color);
    margin-bottom: 1.5rem;
}

.acc-btn {
    font-family: var(--font-display);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent-color);
    border-bottom: 1px solid var(--accent-color);
    padding-bottom: 5px;
}

/* PROCESS LIST */
.process-list {
    border-left: 1px solid var(--border-color);
}

.process-item {
    padding-left: 2rem;
    margin-bottom: 3rem;
    position: relative;
}

.process-item::before {
    content: '';
    position: absolute;
    left: -5px;
    top: 0;
    width: 9px;
    height: 9px;
    background: var(--bg-color);
    border: 1px solid var(--accent-color);
    border-radius: 50%;
}

.p-num {
    font-family: var(--font-display);
    color: var(--accent-color);
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    display: block;
}

.p-content h4 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.p-content p {
    color: var(--text-muted);
}

/* Sync Hover from list to visual */
.process-item {
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    padding: 1.5rem;
    border-radius: 1rem;
    border: 1px solid transparent;
}

.process-item:hover {
    background: var(--glass-bg);
    border-color: var(--border-color);
    transform: translateX(15px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.process-item:hover .p-num {
    transform: scale(1.3);
    color: var(--text-color);
}


/* ARCHIVE (Parallax Mosaic) */
.archive-section {
    padding-bottom: 200px;
    /* Space for parallax offset */
    overflow: hidden;
}

.archive-header {
    margin-bottom: 4rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.archive-meta {
    max-width: 300px;
    text-align: right;
    color: var(--text-muted);
}

.archive-mosaic {
    display: flex;
    gap: 2rem;
    height: 120vh;
    /* Taller than screen for scroll */
    margin: 0 -2rem;
    /* Bleed slightly */
}

.archive-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    will-change: transform;
}

.col-fast {
    margin-top: 0;
}

.col-medium {
    margin-top: 10vh;
}

.col-slow {
    margin-top: 20vh;
}

.archive-item {
    position: relative;
    overflow: hidden;
    /* Aspect ratios mix */
}

.archive-item img,
.archive-item video {
    width: 100%;
    display: block;
    filter: grayscale(100%) contrast(1.2);
    transition: all 0.5s ease;
    opacity: 0.8;
}

.archive-item:hover img,
.archive-item:hover video {
    filter: grayscale(0%) contrast(1);
    opacity: 1;
    transform: scale(1.02);
}

.img-caption {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    background: var(--bg-color);
    padding: 0.2rem 0.8rem;
    font-family: var(--font-display);
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--accent-color);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    border: 1px solid var(--accent-color);
}

.archive-item:hover .img-caption {
    opacity: 1;
    transform: translateY(0);
}

.subsection-title {
    font-family: var(--font-display);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 2rem;
    color: var(--text-muted);
}

.logo-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border: 1px solid var(--border-color);
}

.logo-box {
    padding: 2rem;
    text-align: center;
    border-right: 1px solid var(--border-color);
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-muted);
    transition: color 0.3s, background 0.3s;
}

.logo-box:last-child {
    border-right: none;
}

.logo-box:hover {
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.02);
}

/* FOOTER */
.site-footer {
    padding: 80px 0;
    background: var(--footer-bg);
    border-top: 1px solid var(--border-color);
    transition: background-color var(--transition-speed) var(--ease);
}

.footer-main {
    text-align: center;
    margin-bottom: 5rem;
}

.footer-heading {
    font-family: var(--font-heading);
    font-size: clamp(1rem, 6vw, 5rem);
    margin-bottom: 2rem;
    color: var(--text-color);
    transition: color var(--transition-speed) var(--ease);
}

.footer-btn {
    display: inline-block;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    padding: 1rem 3rem;
    font-family: var(--font-display);
    text-transform: uppercase;
    font-weight: 600;
    transition: all 0.3s;
}

.footer-btn:hover {
    background: var(--accent-color);
    color: black;
}

.footer-info {
    display: flex;
    justify-content: space-between;
    text-align: left;
    border-top: 1px solid var(--border-color);
    padding-top: 3rem;
}

.info-group h4 {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 1rem;
}

.info-group p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* UTIL ANIMATIONS */
.reveal-text,
.reveal-card,
.reveal-up {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s var(--ease);
}

.reveal-text.active,
.reveal-card.active,
.reveal-up.active {
    opacity: 1;
    transform: translateY(0);
}

.delay-1 {
    transition-delay: 0.1s;
}

.delay-2 {
    transition-delay: 0.2s;
}

/* RESPONSIVE */
@media (max-width: 1024px) {
    .split-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .section-title {
        position: static;
        margin-bottom: 2rem;
    }

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

    .footer-info {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .section {
        padding: 60px 0;
    }

    .section-title {
        font-size: clamp(1.4rem, 7.5vw, 2.2rem) !important;
        line-height: 1.1;
        margin-bottom: 2rem;
        position: static;
        padding-left: 0 !important;
        /* Prevent mid-word breaks to force scaling */
        overflow-wrap: normal;
        word-wrap: normal;
    }

    .section-title br {
        display: none;
    }

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

    .accordion-gallery {
        flex-direction: column;
        height: auto;
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

    .acc-panel {
        width: 100% !important;
        max-width: 100%;
        height: 400px;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        flex: none;
        position: relative;
    }

    .acc-panel:hover {
        height: 400px;
        /* Disable expansion */
        flex: none;
    }

    /* Show content always on mobile */
    .acc-hidden-info {
        max-height: 200px;
        opacity: 1;
        margin-top: 1rem;
    }

    /* Ensure title and num are positioned correctly */
    .acc-title {
        transform: none;
        position: static;
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }

    .acc-num {
        position: static;
        font-size: 2rem;
        margin-bottom: 0.5rem;
        color: rgba(255, 255, 255, 0.8);
        /* Visible by default */
        top: auto;
        transform: none;
    }

    .acc-content {
        position: absolute;
        bottom: 2rem;
        left: 2rem;
        right: 2rem;
        /* Ensure text doesn't flow out */
        width: auto;
    }

    .acc-overlay {
        opacity: 0.6;
        /* Make text readable always */
    }

    .acc-panel:hover .acc-overlay {
        opacity: 0.6;
        /* Keep consistent */
    }

    /* Fix Stat Row */
    .stat-row {
        flex-direction: row;
        /* Force single row */
        flex-wrap: nowrap;
        gap: 0.5rem;
        /* Tight gap to fit */
        padding-top: 1.5rem;
        margin-top: 2rem;
        justify-content: space-between;
        /* Spread them out */
    }

    .stat-item {
        flex: 1;
        /* Distribute space equally */
        min-width: 0;
        /* Allow shrinking */
    }

    .stat-num {
        font-size: 1.8rem;
        /* Smaller font for mobile */
    }

    .stat-label {
        font-size: 0.7rem;
        /* Smaller label */
        white-space: nowrap;
        /* Prevent wrapping if possible, or allow it if strict on width */
        white-space: normal;
        /* Actually allow wrapping for text "Years Operational" etc */
        line-height: 1.1;
        display: block;
    }

    /* Fix Archive Mosaic Overflow */
    .archive-mosaic {
        flex-direction: column;
        height: auto;
        margin: 0;
        gap: 1rem;
    }

    /* Archive Header Fix */
    .archive-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        margin-bottom: 2rem;
    }

    .archive-meta {
        text-align: center;
        max-width: 100%;
        margin-top: 1rem;
    }

    .archive-col {
        margin-top: 0 !important;
        /* Reset existing margins */
        gap: 1rem;
    }

    .archive-section {
        padding-bottom: 60px;
    }

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

    .logo-box:nth-child(2n) {
        border-right: none;
    }

    .logo-box:nth-child(odd) {
        border-right: 1px solid var(--border-color);
    }

    /* .logo-box:nth-child(2n)::after removed */

    /* Navigation Adjustments */
    .nav-right {
        display: none;
    }

    /* --- MOBILE ALIGNMENT FIXES --- */
    .hero-content {
        text-align: center;
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .hero-title {
        font-size: 6vw;
        /* Ensure it doesn't break */
        word-break: break-word;
    }

    .hero-meta {
        margin: 0 auto;
        text-align: center;
    }

    .section-title,
    .split-left,
    .split-right {
        text-align: center;
    }

    .highlight-text {
        text-align: center;
        font-size: 1.8rem;
        /* Adjustment for mobile */
    }

    .body-text {
        text-align: center;
        margin-left: auto;
        margin-right: auto;
    }

    .stat-row {
        justify-content: center;
    }

    /* Services Alignment */
    .service-card {
        text-align: center;
        padding: 2rem 1.5rem;
    }

    .service-list {
        text-align: center;
        padding-top: 1rem;
    }

    .service-list li {
        display: inline-block;
        margin: 0 5px;
    }

    .service-list li::after {
        content: "•";
        margin-left: 10px;
        opacity: 0.5;
    }

    .service-list li:last-child::after {
        content: "";
    }

    /* Process Timeline */
    .process-list {
        margin: 0 auto;
        max-width: 400px;
        border-left: 1px solid var(--border-color);
        /* Keep the line */
        text-align: left;
        /* Keep content left aligned for readability */
    }

    .process-item {
        text-align: left;
    }

    /* Footer Alignment */
    .footer-main,
    .footer-info {
        text-align: center;
    }

    .footer-info {
        align-items: center;
    }

    .info-group {
        margin-bottom: 2rem;
    }
}

@media (max-width: 480px) {
    .section-title {
        font-size: 2rem;
    }

    .highlight-text {
        font-size: 2rem;
    }

    .stat-num {
        font-size: 2rem;
    }

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

    .logo-box {
        border-bottom: 1px solid var(--border-color);
        padding: 1.5rem 1rem;
    }

    .logo-box:nth-child(3n) {
        border-right: none;
    }

    /* Fix potential negative margins in container if any */
    .container {
        width: 92%;
    }
}