/* ==================== Theme colors (light = default, dark = [data-theme="dark"]) ==================== */
:root {
    /* light */
    --sec-bg-a: #ffffff;                       /* vision + process background */
    --sec-bg-b: #f0f5fa;                       /* services background */
    --card-surface: #ffffff;                   /* service cards */
    --step-surface: #f5f9fc;                   /* process cards */
    --ink: #0b192c;                            /* headings and strong text */
    --ink-muted: #4a5b6e;                      /* body text */
    --line: rgba(11, 25, 44, 0.1);             /* card borders */
    --accent-text: #178246;                    /* green that stays readable on light backgrounds */
    --card-shadow: 0 10px 30px rgba(11, 25, 44, 0.06);
    --card-shadow-hover: 0 20px 40px rgba(11, 25, 44, 0.12);
    --num-stroke: rgba(23, 130, 70, 0.55);     /* outlined step numbers */
    --glow: rgba(46, 204, 113, 0.18);          /* glow behind the vision image */
    --img-shadow: rgba(11, 25, 44, 0.18);
}

:root[data-theme="dark"] {
    --sec-bg-a: #0d1f35;
    --sec-bg-b: #0b192c;
    --card-surface: #112238;
    --step-surface: #112238;
    --ink: #ffffff;
    --ink-muted: rgba(255, 255, 255, 0.78);
    --line: rgba(46, 204, 113, 0.1);
    --accent-text: #2ecc71;
    --card-shadow: none;
    --card-shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.4);
    --num-stroke: rgba(46, 204, 113, 0.55);
    --glow: rgba(46, 204, 113, 0.15);
    --img-shadow: rgba(0, 0, 0, 0.35);
}

/* Smooth color change when the theme is switched */
.vision-section,
.services-section,
.process-section {
    transition: background-color 0.4s ease;
}


.about-hero {
    min-height: 50vh;
    background-color: var(--dark-bg);
}

.about-hero .hero-title span {
    background: linear-gradient(90deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.vision-text,
.vision-text strong,
.vision-feature h4,
.vision-feature p,
.services-section .section-title,
.services-section .section-subtitle,
.process-section .section-title,
.process-section .section-subtitle,
.services-section .service-card h3,
.services-section .service-card p,
.service-list li,
.process-step h4,
.process-step p {
    transition: color 0.4s ease;
}

/* ==================== Theme toggle button (lives in the navbar, which stays dark) ==================== */
.theme-toggle {
    position: relative;
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    padding: 0;
    overflow: hidden;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: rgba(46, 204, 113, 0.12);
    transform: translateY(-2px);
}

.theme-toggle:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.theme-toggle i {
    position: absolute;
    top: 50%;
    left: 50%;
    font-size: 1.05rem;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

/* light mode: show the moon (click to go dark) */
.theme-toggle .icon-moon {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(0deg) scale(1);
}

.theme-toggle .icon-sun {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(-90deg) scale(0.4);
}

/* dark mode: show the sun (click to go light) */
:root[data-theme="dark"] .theme-toggle .icon-moon {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(90deg) scale(0.4);
}

:root[data-theme="dark"] .theme-toggle .icon-sun {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(0deg) scale(1);
}

/* ==================== Section badges ==================== */
.services-section .section-badge,
.process-section .section-badge {
    color: var(--accent-text);
    background: rgba(46, 204, 113, 0.12);
    border-color: rgba(46, 204, 113, 0.4);
}

.services-section .section-title,
.process-section .section-title {
    color: var(--ink);
}

.services-section .section-subtitle,
.process-section .section-subtitle {
    color: var(--ink-muted);
}

/* ==================== Scroll reveal ==================== */
/* Elements only start hidden when JS is running (the .js class is set in <head>). */
.js .reveal {
    opacity: 0;
    transition: opacity 0.9s ease, transform 1s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: var(--delay, 0s);
    will-change: transform, opacity;
}

.js .reveal-right {
    transform: translateX(120px) scale(0.96);
}

.js .reveal-left {
    transform: translateX(-80px);
}

.js .reveal-up {
    transform: translateY(30px);
}

.js .reveal.is-visible {
    opacity: 1;
    transform: none;
}

/* ==================== Grid reveal (services + process) ==================== */
/* Direction depends on the column each card sits in.
   The animation is on the column wrapper so the card's own hover effect still works. */
.js .reveal-grid > .reveal {
    transform: translate(var(--from-x, 0px), var(--from-y, 0px));
}

.js .reveal-grid > .reveal.is-visible {
    transform: none;
}

/* Desktop */
@media (min-width: 992px) {
    /* Services (3 columns): left from the left, middle from the bottom, right from the right */
    .services-grid > .reveal:nth-child(3n + 1) {
        --from-x: -100px;
    }

    .services-grid > .reveal:nth-child(3n + 2) {
        --from-y: 100px;
        --delay: 0.15s;
    }

    .services-grid > .reveal:nth-child(3n) {
        --from-x: 100px;
        --delay: 0.3s;
    }

    /* Process (4 columns): first from the left, middle two from the bottom, last from the right */
    .process-grid > .reveal:nth-child(1) {
        --from-x: -100px;
    }

    .process-grid > .reveal:nth-child(2) {
        --from-y: 100px;
        --delay: 0.12s;
    }

    .process-grid > .reveal:nth-child(3) {
        --from-y: 100px;
        --delay: 0.24s;
    }

    .process-grid > .reveal:nth-child(4) {
        --from-x: 100px;
        --delay: 0.36s;
    }
}

/* Tablet (2 columns): left card from the left, right card from the right */
@media (min-width: 768px) and (max-width: 991.98px) {
    .reveal-grid > .reveal:nth-child(odd) {
        --from-x: -70px;
    }

    .reveal-grid > .reveal:nth-child(even) {
        --from-x: 70px;
        --delay: 0.15s;
    }
}

/* Phone (1 column): everything rises from the bottom */
@media (max-width: 767.98px) {
    .reveal-grid > .reveal {
        --from-y: 60px;
    }
}

/* ==================== CTA reveal ==================== */
/* Text slides from the left and buttons from the right (set in the HTML).
   On phones the two blocks are stacked, so they rise from the bottom instead. */
@media (max-width: 767.98px) {
    .js .cta-wrapper > .reveal:not(.is-visible) {
        transform: translateY(40px);
    }
}

/* ==================== Vision ==================== */
.vision-section {
    background: var(--sec-bg-a);
    padding: 90px 0;
    position: relative;
    overflow: hidden; /* stops the sliding image from causing a horizontal scrollbar */
}

/* Title with short underline bar */
.vision-title {
    position: relative;
    display: inline-block;
    padding-bottom: 14px;
    margin-bottom: 20px;
    font-family: var(--font-heading);
    font-size: 2.4rem;
    font-weight: 700;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.vision-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 60px;
    height: 4px;
    border-radius: 4px;
    background: var(--accent);
}

.vision-text {
    font-size: 1.05rem;
    line-height: 1.9;
    color: var(--ink-muted);
    margin-bottom: 40px;
}

.vision-text strong {
    color: var(--ink);
    font-weight: 700;
}

/* Three icon features */
.vision-feature {
    text-align: center;
}

.vision-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    font-size: 1.5rem;
    box-shadow: 0 10px 20px rgba(46, 204, 113, 0.25);
    transition: all 0.3s ease;
}

.vision-feature:hover .vision-icon {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 30px rgba(46, 204, 113, 0.4);
}

.vision-feature h4 {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 6px;
}

.vision-feature p {
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--ink-muted);
    margin-bottom: 0;
}

/* Illustration */
.vision-visual {
    position: relative;
    text-align: center;
}

.vision-visual::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 80%;
    height: 80%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, var(--glow), transparent 70%);
    z-index: 0;
}

.vision-visual img {
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 20px 30px var(--img-shadow));
}

/* Gentle floating starts only after the image has slid into place */
.vision-visual.is-visible img {
    animation: visionFloat 6s ease-in-out 1.2s infinite;
}

@keyframes visionFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* ==================== Services ==================== */
.services-section {
    background: var(--sec-bg-b);
}

/* .service-card, .service-icon and .service-link come from style.css.
   Here we recolor them for the active theme and pin the link to the bottom. */
.services-section .service-card {
    display: flex;
    flex-direction: column;
    background: var(--card-surface);
    border: 1px solid var(--line);
    box-shadow: var(--card-shadow);
}

.services-section .service-card:hover {
    border-color: rgba(46, 204, 113, 0.5);
    box-shadow: var(--card-shadow-hover);
}

.services-section .service-card h3 {
    color: var(--ink);
}

.services-section .service-card p {
    color: var(--ink-muted);
    margin-bottom: 16px;
}

.service-list {
    list-style: none;
    padding: 0;
    margin: 0 0 24px 0;
}

.service-list li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 8px;
    color: var(--ink-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.service-list li::before {
    content: "\f00c"; /* Font Awesome check */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    left: 0;
    top: 1px;
    font-size: 0.75rem;
    color: var(--accent-text);
}

.services-section .service-link {
    margin-top: auto;
    align-self: flex-start;
    color: var(--accent-text);
}

.services-section .service-link:hover {
    color: var(--ink);
}

/* ==================== Process ==================== */
.process-section {
    background-color: var(--sec-bg-a);
    padding: 90px 0;
}

.process-step {
    position: relative;
    height: 100%;
    padding: 30px;
    background: var(--step-surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    transition: all 0.4s ease;
}

.process-step:hover {
    transform: translateY(-8px);
    border-color: rgba(46, 204, 113, 0.5);
    box-shadow: var(--card-shadow-hover);
}

.process-number {
    display: block;
    margin-bottom: 14px;
    font-family: var(--font-heading);
    font-size: 3.2rem;
    font-weight: 800;
    line-height: 1;
    color: transparent;
    -webkit-text-stroke: 1.5px var(--num-stroke);
}

.process-step h4 {
    color: var(--ink);
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.process-step p {
    color: var(--ink-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 0;
}

/* ==================== Small fixes ==================== */
.cta-btn-primary i {
    transition: transform 0.3s ease;
}

.cta-btn-primary:hover i {
    transform: translateX(4px);
}

.footer-contact .contact-label {
    color: #94a3b8;
}

/* ==================== Responsive ==================== */
@media (max-width: 991.98px) {
    /* smaller slide distance on tablets and phones */
    .js .reveal-right {
        transform: translateX(60px) scale(0.96);
    }

    .js .reveal-left {
        transform: translateX(-40px);
    }
}

@media (max-width: 767px) {
    .process-section {
        padding: 70px 0;
    }
}

@media (max-width: 575.98px) {
    .vision-section {
        padding: 70px 0;
    }

    .vision-title {
        font-size: 2rem;
    }
}

/* Respect users who turn animations off */
@media (prefers-reduced-motion: reduce) {
    .js .reveal,
    .js .reveal-grid > .reveal,
    .js .cta-wrapper > .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .process-step,
    .process-step:hover {
        transition: none;
        transform: none;
    }

    .vision-section,
    .services-section,
    .process-section,
    .theme-toggle i {
        transition: none;
    }

    .vision-visual.is-visible img {
        animation: none;
    }
}