:root {
    /* Brand Colors - Adjusted for Premium Feel */
    --primary: #0F4C81;
    /* Deep Blue */
    --primary-dark: #0a355c;
    --secondary: #F25C05;
    /* Warm Orange */
    --secondary-hover: #fa6c1b;
    --accent: #2F2F2F;
    /* Dark Charcoal */
    --bg: #F4F4F2;
    /* Minimalist Light */
    --white: #ffffff;
    --text-light: #555555;

    /* Spacing & Layout - Breathable */
    --container-width: 1100px;
    /* Slightly tighter for better readbility */
    --header-height: 90px;
    --spacing-xs: 0.75rem;
    --spacing-sm: 1.5rem;
    --spacing-md: 3rem;
    --spacing-lg: 6rem;
    --spacing-xl: 10rem;

    /* Aesthetics - "Humane Tech" */
    --radius: 12px;
    --shadow-soft: 0 10px 40px -10px rgba(15, 76, 129, 0.08);
    /* Colored shadow */
    --shadow-hover: 0 20px 50px -12px rgba(15, 76, 129, 0.15);

    /* Refined Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.85);
    /* Whiter, less transparent */
    --glass-border: 1px solid rgba(255, 255, 255, 1);
    --glass-blur: blur(20px);

    /* Transitions */
    --transition: cubic-bezier(0.2, 0.8, 0.2, 1) 0.3s;
    /* Snappy */
}

@keyframes scanline {
    0% {
        transform: translateY(-100%);
    }

    100% {
        transform: translateY(100%);
    }
}

@keyframes pulse-glow {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 0.6;
    }
}

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
    background-color: var(--bg);
    background-image: radial-gradient(circle at 10% 10%, rgba(15, 76, 129, 0.03) 0%, transparent 40%),
        radial-gradient(circle at 90% 90%, rgba(242, 92, 5, 0.03) 0%, transparent 40%);
    background-attachment: fixed;
    color: var(--accent);
    line-height: 1.7;
    /* More breathing room */
}

img,
video,
svg {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--primary);
    line-height: 1.15;
    margin-bottom: var(--spacing-sm);
    font-weight: 700;
    letter-spacing: -0.025em;
    /* Modern tight tracking */
}

h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
}

h2 {
    font-size: clamp(2rem, 5vw, 3rem);
    letter-spacing: -0.03em;
}

h3 {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

p {
    margin-bottom: var(--spacing-sm);
    max-width: 65ch;
    margin-inline: auto;
    color: var(--text-light);
    font-size: 1.05rem;
}

/* Animations - Wow Factor */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    opacity: 0;
    /* Hidden initially */
}

.delay-100 {
    animation-delay: 0.1s;
}

.delay-200 {
    animation-delay: 0.2s;
}

.delay-300 {
    animation-delay: 0.3s;
}

.delay-500 {
    animation-delay: 0.5s;
}

/* Utilities */
.container {
    width: 90%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--spacing-sm);
}

.grid {
    display: grid;
    gap: var(--spacing-md);
}

.flex {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
}

.flex-col {
    flex-direction: column;
}

.flex-between {
    justify-content: space-between;
}

.flex-center {
    justify-content: center;
    align-items: center;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-primary {
    color: var(--primary);
}

.text-secondary {
    color: var(--secondary);
}

.mt-lg {
    margin-top: var(--spacing-lg);
}

.mb-lg {
    margin-bottom: var(--spacing-lg);
}

/* Components */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2.5rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    letter-spacing: -0.01em;
}

.btn-primary {
    background-color: var(--secondary);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(242, 92, 5, 0.2);
}

.btn-primary:hover {
    background-color: var(--secondary-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(242, 92, 5, 0.3);
}

.btn-outline {
    border: 2px solid var(--primary);
    color: var(--primary);
    background: transparent;
}

.btn-outline:hover {
    background-color: var(--primary);
    color: var(--white);
    transform: translateY(-2px);
}

.card {
    background: var(--white);
    border-radius: var(--radius);
    padding: var(--spacing-sm);
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(255, 255, 255, 0.6);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

.glass {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    box-shadow: var(--shadow-soft);
}

/* Navigation - Adjusted for mobile fix */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--header-height);
    background: rgba(244, 244, 242, 0.8);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
    transition: all 0.3s ease;
}

header .container {
    height: 100%;
}

nav ul {
    gap: var(--spacing-md);
    display: flex;
    /* Default desktop display */
    align-items: center;
}

nav a {
    font-weight: 500;
    color: var(--primary);
    font-size: 1rem;
    padding: 0.5rem 0;
    position: relative;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--secondary);
    transition: width 0.3s ease;
}

nav a:hover::after,
nav a.active::after {
    width: 100%;
}

nav a:hover,
nav a.active {
    color: var(--primary);
    /* Keep text color stable */
}

/* Footer */
/* Footer */
footer {
    background-color: var(--primary);
    color: var(--white);
    padding: var(--spacing-lg) 0 2rem;
    margin-top: var(--spacing-xl);
    font-size: 0.95rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 4rem;
    margin-bottom: 4rem;
}

.footer-col h4 {
    color: var(--white);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.footer-logo {
    display: inline-block;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--white);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.footer-desc {
    opacity: 0.7;
    line-height: 1.6;
    max-width: 30ch;
}

.footer-links li {
    margin-bottom: 0.8rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--secondary);
    padding-left: 5px;
}

.footer-contact-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
    color: rgba(255, 255, 255, 0.7);
}

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    opacity: 0.6;
}

/* Footer Responsive */
@media (max-width: 900px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
        text-align: center;
    }

    .footer-links a:hover {
        padding-left: 0;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
    }

    .footer-contact-item {
        justify-content: center;
    }

    .footer-desc {
        margin: 0 auto;
    }
}

/* Responsive Services Grid */
.services-grid {
    display: grid;
    gap: var(--spacing-md);
    grid-template-columns: repeat(4, 1fr);
    /* Desktop: 1 row */
}

/* Mobile Menu base */
.mobile-toggle {
    display: none;
}

/* Responsive */
@media (max-width: 1200px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        /* Laptop: 2x2 */
    }
}

@media (max-width: 900px) {
    :root {
        --spacing-md: 2rem;
        --spacing-lg: 4rem;
        --header-height: 70px;
    }

    h1 {
        font-size: 2.5rem;
    }

    .mobile-toggle {
        display: block;
        font-size: 1.8rem;
        color: var(--primary);
        cursor: pointer;
        z-index: 2001;
        /* Ensure above menu */
    }

    .nav-list {
        display: flex;
        position: fixed;
        top: 0;
        right: -100%;
        /* Hidden off-screen */
        width: 100%;
        height: 100vh;
        background: rgba(255, 255, 255, 0.98);
        /* Solid white bg for readability */
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding: 4rem 2rem;
        z-index: 2000;
        gap: 2rem;
        transition: right 0.3s ease-in-out;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    }

    .nav-list.open {
        right: 0;
        /* Slide in */
    }

    .services-grid {
        grid-template-columns: 1fr;
        /* Mobile: 1 column */
    }

    .mobile-close {
        display: block !important;
        color: var(--primary);
        position: absolute;
        top: 1.5rem;
        right: 2rem;
    }
}

/* Client Grid */
.client-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    align-items: center;
    justify-content: center;
}

.client-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.5rem;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.8);
    transition: var(--transition);
}

.client-item:hover {
    background: var(--white);
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.client-item img {
    height: 60px;
    object-fit: contain;
    margin-bottom: 1rem;
    filter: grayscale(100%);
    opacity: 0.8;
    transition: var(--transition);
}

.client-item:hover img {
    filter: none;
    opacity: 1;
}

.client-item span {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-light);
}

/* Strategic Partners */
.partner-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin: 3rem 0;
}

.partner-logo {
    height: 80px;
    width: auto;
    object-fit: contain;
    margin-bottom: 1.5rem;
}

.partner-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

@media (max-width: 992px) {
    .partner-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .partner-grid {
        grid-template-columns: 1fr;
    }
}

/* Chart Container */
.chart-container {
    position: relative;
    width: 100%;
    height: 400px;
    /* Taller for better visibility */
    background: var(--white);
    padding: 1rem;
    border-radius: var(--radius);
}

.client-logo:hover {
    transform: scale(1.1);
}

/* ================= Performance Gauge Section ================= */
.performance-section {
    background: #f8f9fb;
    padding: 5rem 1.5rem;
    text-align: center;
    margin-bottom: var(--spacing-lg);
    border-radius: var(--radius);
    position: relative;
    overflow: hidden;
}

.performance-section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(15, 76, 129, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 76, 129, 0.02) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: 0;
    pointer-events: none;
}

.performance-header-meta {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

.device-toggle {
    display: flex;
    background: #eef2f6;
    padding: 0.3rem;
    border-radius: 50px;
    gap: 0.2rem;
}

.device-btn {
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.device-btn.active {
    background: var(--white);
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.device-btn svg {
    width: 16px;
    height: 16px;
}

/* Gauge Grid */
/* Gauge Grid */
.gauge-grid {
    display: grid;
    grid-template-columns: 1fr;
    /* Mobile: 1 column */
    gap: 2rem;
    max-width: 1200px;
    margin: 3rem auto;
}

/* Tablet & Desktop Standard ( < 1500px ): 2 Columns */
@media (min-width: 768px) {
    .gauge-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Wide Screens ( >= 1500px ): 4 Columns (Single Row) */
@media (min-width: 1500px) {
    .gauge-grid {
        grid-template-columns: repeat(4, 1fr);
        max-width: 1600px;
        /* Allow wider width for the single row */
    }
}

/* Gauge Card */
.gauge-card {
    background: var(--white);
    padding: 2rem 1.5rem;
    border-radius: 16px;
    box-shadow: 0 5px 15px rgba(15, 76, 129, 0.05);
    /* Softer shadow */
    border: 1px solid rgba(15, 76, 129, 0.05);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.gauge-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(15, 76, 129, 0.1);
    border-color: var(--primary);
}

.gauge-card:hover .score-overlay {
    color: var(--secondary);
    transform: translate(-50%, -50%) scale(1.1);
}

/* Gauge Wrapper (Canvas + Overlay) */
.gauge-wrapper {
    position: relative;
    width: 150px;
    height: 150px;
    margin-bottom: 1.5rem;
}

.score-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
    transition: var(--transition);
}

/* Detailed Metrics Wrapper */
.metric-details {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin: 1.5rem 0;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.metric-item {
    text-align: left;
}

.metric-label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #888;
    margin-bottom: 0.25rem;
}

.metric-value {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--accent);
}

.metric-value.good {
    color: #008060;
}

.metric-value.warn {
    color: #f25c05;
}

/* Typography */
.gauge-card h3 {
    font-size: 1.25rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.gauge-desc {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
    min-height: 3em;
    /* Align cards */
}

/* Algoriva Solution Box */
.algoriva-solution {
    background: #f0f7ff;
    /* Very light blue */
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--primary);
    line-height: 1.5;
    width: 100%;
    border-left: 3px solid var(--primary);
    text-align: left;
}

.algoriva-solution strong {
    display: block;
    margin-bottom: 0.2rem;
    font-weight: 700;
}

/* ================= Stats Section (New) ================= */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

.stat-card {
    padding: 3rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--white);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
}

.stat-icon-wrapper {
    width: 48px;
    height: 48px;
    background: rgba(242, 92, 5, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.stat-title {
    font-size: 1.15rem;
    color: var(--primary);
    margin-bottom: 1rem;
    font-weight: 700;
}

.stat-desc {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.6;
    margin: 0 auto;
    max-width: 100%;
}

@media (max-width: 992px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ================= Technology Section (Premium) ================= */
.tech-dna-section {
    background-color: var(--accent);
    /* Dark Charcoal */
    background-image:
        radial-gradient(circle at 20% 20%, rgba(15, 76, 129, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(242, 92, 5, 0.1) 0%, transparent 40%);
    color: var(--white);
    padding: 8rem 0;
    position: relative;
    overflow: hidden;
}

.tech-dna-section h2 {
    color: var(--white);
}

.tech-dna-section p {
    color: rgba(255, 255, 255, 0.8);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.tech-dna-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h40v40H0V0zm1 1h38v38H1V1z' fill='%23ffffff' fill-opacity='0.02'/%3E%3C/svg%3E");
    z-index: 0;
    pointer-events: none;
}

.tech-dna-header {
    margin-bottom: 5rem;
    position: relative;
    z-index: 1;
}

.tech-dna-label {
    display: inline-block;
    background: rgba(242, 92, 5, 0.1);
    color: var(--secondary);
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1.5rem;
}

.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
    position: relative;
    z-index: 1;
}

.tech-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
    padding: 3.5rem 2.5rem;
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    height: 100%;
    display: flex;
    flex-direction: column;
    text-align: left;
}

.tech-card:hover {
    transform: translateY(-10px);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(242, 92, 5, 0.3);
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.5);
}

.tech-icon-box {
    width: 70px;
    height: 70px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    transition: var(--transition);
}

.tech-card:hover .tech-icon-box {
    background: var(--secondary);
    color: var(--white);
    transform: scale(1.1) rotate(5deg);
}

.tech-card:hover .tech-icon-box svg {
    stroke: var(--white);
}

.tech-card h3 {
    color: var(--white);
    font-size: 1.5rem;
    margin-bottom: 1.25rem;
    letter-spacing: -0.02em;
}

.tech-card p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.05rem;
    line-height: 1.7;
    margin: 0;
    max-width: 100%;
}

@media (max-width: 768px) {
    .tech-dna-section {
        padding: 6rem 0;
    }

    .tech-card {
        padding: 2.5rem 2rem;
    }
}

/* ================= Story Section (Premium) ================= */
.story-grid {
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 4rem;
}

.vision-card {
    padding: 4rem 3rem;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.stats-flex {
    gap: 3rem;
    margin-top: 2.5rem;
}

@media (max-width: 992px) {
    .story-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }

    .stats-flex {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .vision-card {
        padding: 3rem 1.5rem;
    }

    .stats-flex {
        gap: 2rem;
    }
}

/* ================= Values Grid Refinement ================= */
.values-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(2, 1fr);
    /* Default: 2x2 */
}

@media (min-width: 1501px) {
    .values-grid {
        grid-template-columns: repeat(4, 1fr);
        /* Single row */
        max-width: 1400px;
        margin-left: auto;
        margin-right: auto;
    }
}

@media (max-width: 768px) {
    .values-grid {
        grid-template-columns: 1fr;
        /* Mobile stack */
    }
}