:root {
    /* Base Transition */
    --service-transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Energy Theme */
[data-theme="energy"] {
    --brand-bg-deep: #0A0A0A;
    --brand-bg-charcoal: #1A1A1A;
    --brand-accent-primary: #00F2FF;
    --brand-accent-secondary: #B026FF;
    --brand-text-main: #FFFFFF;
    --brand-text-muted: #B0B0B0;
    --brand-font-heading: 'Inter', sans-serif; /* Placeholder, to be refined */
    --brand-font-mono: 'JetBrains Mono', monospace;
}

/* Energy Theme Layouts */
[data-theme="energy"] .glass-card {
    background: rgba(26, 26, 26, 0.7);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(0, 242, 255, 0.3);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.8);
    color: var(--brand-text-main);
}

[data-theme="energy"] .energy-flow-container {
    position: relative;
}

[data-theme="energy"] .energy-section {
    position: relative;
    transition: var(--service-transition);
    padding: 80px 0;
}

[data-theme="energy"] .energy-section.left {
    text-align: left;
    padding-left: 10%;
}

[data-theme="energy"] .energy-section.right {
    text-align: right;
    padding-right: 10%;
}

[data-theme="energy"] .energy-section-number {
    font-family: var(--brand-font-mono);
    font-size: 12rem;
    font-weight: 900;
    position: absolute;
    color: var(--brand-accent-primary);
    opacity: 0.1;
    z-index: -1;
    pointer-events: none;
    user-select: none;
}

[data-theme="energy"] .energy-section.left .energy-section-number {
    right: -5%;
    top: -20px;
}

[data-theme="energy"] .energy-section.right .energy-section-number {
    left: -5%;
    top: -20px;
}

[data-theme="energy"] .efficiency-gauge-wrapper {
    position: relative;
    width: 150px;
    height: 150px;
}

[data-theme="energy"] .efficiency-gauge {
    width: 150px;
    height: 150px;
    transform: rotate(-90deg);
}

[data-theme="energy"] .gauge-bg {
    fill: none;
    stroke: var(--brand-bg-charcoal);
    stroke-width: 10;
}

[data-theme="energy"] .gauge-value {
    fill: none;
    stroke: var(--brand-accent-primary);
    stroke-width: 10;
    stroke-linecap: round;
    stroke-dasharray: 440;
    stroke-dashoffset: 440;
    transition: stroke-dashoffset 2s ease-out;
}

[data-theme="energy"] .efficiency-gauge.gauge-active .gauge-value {
    stroke-dashoffset: 308; /* 30% filled */
}

[data-theme="energy"] .circuitry-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    opacity: 0.2;
    pointer-events: none;
}

[data-theme="energy"] .circuit-pulse {
    stroke: var(--brand-accent-primary);
    stroke-width: 1;
    fill: none;
    stroke-dasharray: 10, 20;
    animation: energy-pulse 3s linear infinite;
}

@keyframes energy-pulse {
    0% { stroke-dashoffset: 100; }
    100% { stroke-dashoffset: 0; }
}

[data-theme="energy"] .animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

[data-theme="energy"] .animate-on-scroll.active {
    opacity: 1;
    transform: translateY(0);
}

[data-theme="energy"] .sec-main,
[data-theme="safety"] .sec-main,
[data-theme="sustainability"] .sec-main {
    overflow: hidden;
}

[data-theme="energy"] .sec-title h1,
[data-theme="energy"] .sec-title h2,
[data-theme="energy"] .sec-title h3,
[data-theme="safety"] .sec-title h1,
[data-theme="safety"] .sec-title h2,
[data-theme="safety"] .sec-title h3,
[data-theme="sustainability"] .sec-title h1,
[data-theme="sustainability"] .sec-title h2,
[data-theme="sustainability"] .sec-title h3 {
    letter-spacing: -0.02em;
    line-height: 1.15;
}

[data-theme="energy"] .glass-card,
[data-theme="safety"] .glass-card,
[data-theme="sustainability"] .glass-card {
    position: relative;
    overflow: hidden;
}

[data-theme="energy"] .glass-card::before,
[data-theme="safety"] .glass-card::before,
[data-theme="sustainability"] .glass-card::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(255,255,255,0.06), rgba(255,255,255,0));
}

[data-theme="energy"] .service-box,
[data-theme="energy"] .glass-card,
[data-theme="safety"] .bento-box,
[data-theme="safety"] .glass-card,
[data-theme="sustainability"] .sustain-card,
[data-theme="sustainability"] .glass-card {
    transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
}

[data-theme="energy"] .service-box:hover,
[data-theme="energy"] .glass-card:hover,
[data-theme="safety"] .bento-box:hover,
[data-theme="safety"] .glass-card:hover,
[data-theme="sustainability"] .sustain-card:hover,
[data-theme="sustainability"] .glass-card:hover {
    transform: translateY(-6px);
}

[data-theme="energy"] .service-box,
[data-theme="safety"] .bento-box,
[data-theme="sustainability"] .sustain-card {
    border-radius: 20px;
}

[data-theme="energy"] .service-box,
[data-theme="energy"] .glass-card {
    background: linear-gradient(180deg, rgba(26, 26, 26, 0.92), rgba(16, 16, 16, 0.96));
    border: 1px solid rgba(0, 242, 255, 0.18);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

[data-theme="energy"] .energy-section {
    padding: 72px 0;
}

[data-theme="energy"] .energy-section .service-box {
    border-left-width: 4px !important;
    border-radius: 24px;
}

[data-theme="energy"] .energy-section .service-box h3,
[data-theme="energy"] .energy-section .glass-card h3 {
    text-wrap: balance;
}

[data-theme="energy"] .energy-section .row > [class*='col-'] > div,
[data-theme="energy"] .energy-section .row > [class*='col-'] > .service-box {
    border-radius: 16px;
}

[data-theme="energy"] .service-hero,
[data-theme="safety"] .service-hero,
[data-theme="sustainability"] .service-hero {
    position: relative;
    isolation: isolate;
    padding: 88px 0 72px;
    margin-bottom: 0;
}

[data-theme="energy"] .service-hero::after,
[data-theme="safety"] .service-hero::after,
[data-theme="sustainability"] .service-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0,0,0,0.52), rgba(0,0,0,0.18));
    z-index: 0;
}

[data-theme="energy"] .service-hero > *,
[data-theme="safety"] .service-hero > *,
[data-theme="sustainability"] .service-hero > * {
    position: relative;
    z-index: 1;
}

[data-theme="safety"] .glass-card,
[data-theme="safety"] .bento-box {
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(247,247,247,0.98));
    border: 1px solid rgba(255, 140, 0, 0.12);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.08);
}

[data-theme="safety"] .security-grid {
    gap: 18px;
    border: 0;
    background: transparent;
}

[data-theme="safety"] .security-grid > .bento-box {
    border-radius: 18px;
    min-height: 100%;
}

[data-theme="safety"] .compliance-tag {
    border-radius: 999px;
    padding: 8px 16px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

[data-theme="safety"] .bento-box .coordinate-label {
    opacity: 0.7;
}

[data-theme="sustainability"] .glass-card,
[data-theme="sustainability"] .sustain-card {
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(249,251,249,0.98));
    border: 1px solid rgba(46, 125, 50, 0.12);
    box-shadow: 0 18px 40px rgba(27, 48, 34, 0.08);
}

[data-theme="sustainability"] .sustain-card {
    border-radius: 18px;
}

body.services-page {
    background: #f5f7fb;
}

body.services-page .sec-main {
    background: transparent;
}

body.services-page .services-hero {
    position: relative;
    overflow: hidden;
    padding: 90px 0 70px;
    border-bottom: 1px solid rgba(15, 76, 129, 0.08);
    background:
        radial-gradient(circle at top left, rgba(67, 97, 238, 0.24), transparent 34%),
        radial-gradient(circle at top right, rgba(0, 168, 232, 0.18), transparent 28%),
        linear-gradient(135deg, #0f172a 0%, #173a63 52%, #0f4c81 100%);
}

body.services-page .services-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0));
    pointer-events: none;
}

body.services-page .services-hero .hero-shell {
    position: relative;
    z-index: 1;
}

body.services-page .services-hero .hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    margin-bottom: 18px;
    border-radius: 999px;
    background: rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.92);
    border: 1px solid rgba(255,255,255,0.16);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

body.services-page .services-hero h1 {
    color: #fff;
    font-size: clamp(2.2rem, 4vw, 4rem);
    line-height: 1.05;
    margin-bottom: 18px;
    max-width: 12ch;
    margin-left: auto;
    margin-right: auto;
}

body.services-page .services-hero .hero-copy {
    color: rgba(255,255,255,0.88);
    font-size: 1.08rem;
    line-height: 1.8;
    max-width: 920px;
    margin: 0 auto;
}

body.services-page .service-card {
    position: relative;
    height: 100%;
    background: #fff !important;
    border: 1px solid rgba(15, 76, 129, 0.08) !important;
    border-radius: 22px !important;
    padding: 28px !important;
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

body.services-page .service-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 5px;
    background: linear-gradient(90deg, #0f4c81, #1976d2, #00a8e8);
}

body.services-page .service-card .icon-box img {
    border-radius: 16px !important;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

body.services-page .service-card h3 {
    margin-top: 6px;
    margin-bottom: 14px;
    font-size: 1.35rem;
}

body.services-page .service-card .text {
    font-size: 0.98rem;
    line-height: 1.75;
}

body.services-page .service-card ul {
    margin-top: 18px !important;
}

body.services-page .service-card ul li {
    color: #445;
}

body.services-page .service-card .read-more {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 999px;
    background: rgba(25, 118, 210, 0.08);
    color: #0f4c81 !important;
    text-decoration: none !important;
}

body.services-page .service-card .read-more:hover {
    background: rgba(25, 118, 210, 0.14);
}

body.services-page .services-feature-grid,
body.services-page .services-industry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
}

body.services-page .feature-tile,
body.services-page .industry-tile {
    background: #fff;
    border: 1px solid rgba(15, 76, 129, 0.08);
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.06);
    height: 100%;
}

body.services-page .feature-tile h4,
body.services-page .industry-tile p {
    margin-bottom: 0;
}

body.services-page .section-card {
    background: #fff;
    border: 1px solid rgba(15, 76, 129, 0.08);
    border-radius: 24px;
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.06);
}

body.services-page .section-card .sec-title h2,
body.services-page .section-card .sec-title p {
    margin-bottom: 0;
}

@media (max-width: 991px) {
    [data-theme="energy"] .energy-section.left,
    [data-theme="energy"] .energy-section.right {
        padding-left: 0;
        padding-right: 0;
        text-align: left;
    }

    [data-theme="energy"] .energy-section-number {
        font-size: 7rem;
    }

    body.services-page .services-hero {
        padding: 72px 0 56px;
    }

    body.services-page .service-card {
        padding: 24px !important;
    }
}

@media (max-width: 575px) {
    [data-theme="energy"] .glass-card,
    [data-theme="safety"] .glass-card,
    [data-theme="sustainability"] .glass-card {
        padding: 24px;
        border-radius: 18px;
    }

    body.services-page .services-hero h1 {
        max-width: none;
    }
}

body.energy-page[data-theme="energy"] {
    --brand-bg-deep: #f5f8fc;
    --brand-bg-charcoal: #e7eef7;
    --brand-accent-primary: #0f4c81;
    --brand-accent-secondary: #1976d2;
    --brand-text-main: #102033;
    --brand-text-muted: #526174;
    background: #f5f8fc;
    color: #102033;
}

body.energy-page[data-theme="energy"] .energy-hero {
    min-height: auto !important;
    padding: 88px 0 72px;
    background:
        radial-gradient(circle at top left, rgba(15, 76, 129, 0.15), transparent 30%),
        radial-gradient(circle at top right, rgba(0, 168, 232, 0.12), transparent 26%),
        linear-gradient(135deg, #eef5fb 0%, #dbe9f7 100%) !important;
}

body.energy-page[data-theme="energy"] .energy-hero .glass-card {
    background: #fff !important;
    border: 1px solid rgba(15, 76, 129, 0.12) !important;
    box-shadow: 0 20px 44px rgba(15, 23, 42, 0.08) !important;
    color: #102033 !important;
}

body.energy-page[data-theme="energy"] .energy-flow-container {
    background: #f5f8fc !important;
    color: #102033 !important;
}

body.energy-page[data-theme="energy"] .energy-flow-container .energy-section,
body.energy-page[data-theme="energy"] .energy-flow-container .section-card,
body.energy-page[data-theme="energy"] .energy-flow-container .glass-card,
body.energy-page[data-theme="energy"] .energy-flow-container .service-box {
    color: #102033;
}

body.energy-page[data-theme="energy"] .energy-flow-container .glass-card,
body.energy-page[data-theme="energy"] .energy-flow-container .service-box,
body.energy-page[data-theme="energy"] .energy-flow-container .row > [class*='col-'] > div,
body.energy-page[data-theme="energy"] .energy-flow-container .row > [class*='col-'] > .service-box,
body.energy-page[data-theme="energy"] .energy-flow-container .row > [class*='col-'] > .glass-card {
    background: #fff !important;
    border-color: rgba(15, 76, 129, 0.12) !important;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08) !important;
}

body.energy-page[data-theme="energy"] .energy-flow-container [style*="background: rgba(255,255,255,0.05)"] ,
body.energy-page[data-theme="energy"] .energy-flow-container [style*="background: rgba(255,255,255,0.1)"] ,
body.energy-page[data-theme="energy"] .energy-flow-container [style*="background: rgba(176, 38, 255, 0.1)"] {
    background: #fff !important;
    border-color: rgba(15, 76, 129, 0.12) !important;
}

body.energy-page[data-theme="energy"] .energy-flow-container .service-box h3,
body.energy-page[data-theme="energy"] .energy-flow-container .glass-card h3,
body.energy-page[data-theme="energy"] .energy-flow-container h1,
body.energy-page[data-theme="energy"] .energy-flow-container h2,
body.energy-page[data-theme="energy"] .energy-flow-container h4 {
    color: #0f4c81;
}

body.energy-page[data-theme="energy"] .circuitry-bg {
    opacity: 0.08;
}

body.energy-page[data-theme="energy"] .circuit-pulse {
    stroke: rgba(15, 76, 129, 0.35);
}

body.energy-page[data-theme="energy"] .energy-section-number {
    color: rgba(15, 76, 129, 0.09);
}

body.energy-page[data-theme="energy"] .gauge-bg {
    stroke: #d5e2ef;
}

body.energy-page[data-theme="energy"] .gauge-value {
    stroke: #0f4c81;
}

body.energy-page[data-theme="energy"] .btn-energy {
    box-shadow: 0 12px 24px rgba(15, 76, 129, 0.18);
}

@media (max-width: 991px) {
    body.energy-page[data-theme="energy"] .energy-section.left,
    body.energy-page[data-theme="energy"] .energy-section.right {
        padding-left: 0;
        padding-right: 0;
    }
}

/* Safety Theme */
[data-theme="safety"] {
    --brand-bg-deep: #FDFDFD;
    --brand-bg-charcoal: #E5E7E9;
    --brand-accent-primary: #FF8C00;
    --brand-accent-secondary: #FFD700;
    --brand-text-main: #1A1A1A;
    --brand-text-muted: #666666;
    --brand-font-heading: 'Oswald', sans-serif;
    --brand-font-serif: 'Playfair Display', serif;
}

[data-theme="safety"] body {
    scroll-snap-type: y mandatory;
    background-color: var(--brand-bg-deep);
    color: var(--brand-text-main);
}

[data-theme="safety"] section {
    scroll-snap-align: start;
    transition-timing-function: cubic-bezier(0, 1, 0, 1) !important;
}

[data-theme="safety"] .security-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1px;
    background-color: var(--brand-bg-charcoal);
    border: 1px solid var(--brand-bg-charcoal);
}

[data-theme="safety"] .bento-box {
    background-color: var(--brand-bg-deep);
    padding: 30px;
    position: relative;
    transition: all 0.3s cubic-bezier(0, 1, 0, 1);
}

[data-theme="safety"] .coordinate-label {
    position: absolute;
    top: 10px;
    right: 10px;
    font-family: var(--brand-font-heading);
    font-size: 10px;
    color: var(--brand-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

[data-theme="safety"] .compliance-matrix {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
    justify-content: center;
}

[data-theme="safety"] .compliance-tag {
    padding: 5px 12px;
    border: 1px solid var(--brand-accent-primary);
    color: var(--brand-accent-primary);
    font-family: var(--brand-font-heading);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0, 1, 0, 1);
    background: transparent;
}

[data-theme="safety"] .compliance-tag:hover,
[data-theme="safety"] .compliance-tag.active {
    background-color: var(--brand-accent-primary);
    color: #fff;
}

[data-theme="safety"] .bento-box.highlighted {
    background-color: var(--brand-bg-charcoal);
    outline: 2px solid var(--brand-accent-primary);
    z-index: 10;
}

/* Sustainability Theme */
[data-theme="sustainability"] {
    --brand-bg-deep: #1B3022;
    --brand-bg-charcoal: #F5F5F0;
    --brand-accent-primary: #C5B358;
    --brand-accent-secondary: #4A6B41;
    --brand-text-main: #F5F5F0;
    --brand-text-muted: #D1D1D1;
    --brand-font-heading: 'Fraunces', serif;
    --brand-font-body: 'Montserrat', sans-serif;
}

/* Professional Theme */
[data-theme="professional"] {
    --brand-bg-deep: #002366;
    --brand-bg-charcoal: #708090;
    --brand-accent-primary: #E5E4E2;
    --brand-accent-secondary: #C0C0C0;
    --brand-text-main: #FFFFFF;
    --brand-text-muted: #B0B0B0;
    --brand-font-heading: 'Playfair Display', serif;
    --brand-font-body: 'Lato', sans-serif;
}
