:root {
    /* ── Bootstrap Primary Color Overrides (Emerald Growth) ── */
    --bs-primary: #059669;
    --bs-primary-rgb: 5, 150, 105;
    --bs-link-color: #059669;
    --bs-link-color-rgb: 5, 150, 105;
    --bs-link-hover-color: #047857;
    --bs-link-hover-color-rgb: 4, 120, 87;

    /* Bootstrap light/bg overrides for mint tint */
    --bs-light: #f0fdf4;
    --bs-light-rgb: 240, 253, 244;
    --bs-body-bg: #f0fdf4;
    --bs-body-bg-rgb: 240, 253, 244;

    /* ── FM Custom Variables ── */
    --fm-primary: #059669;
    --fm-primary-dark: #047857;
    --fm-secondary: #10b981;
    --fm-accent: #34d399;
    --fm-bg: #f0fdf4;
    --fm-surface: #ffffff;
    --fm-surface-soft: #ecfdf5;
    --fm-border: #e2e8f0;
    --fm-text: #0f172a;
    --fm-muted: #64748b;
    --fm-shadow: 0 18px 45px rgba(5, 150, 105, 0.1);
    --fm-shadow-sm: 0 10px 25px rgba(5, 150, 105, 0.07);
    --fm-radius: 1.25rem;
}

/* ── Bootstrap Button Overrides ─────────────────────────────── */

.btn-primary {
    --bs-btn-color: #fff;
    --bs-btn-bg: #059669;
    --bs-btn-border-color: #059669;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #047857;
    --bs-btn-hover-border-color: #047857;
    --bs-btn-focus-shadow-rgb: 5, 150, 105;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #065f46;
    --bs-btn-active-border-color: #065f46;
    --bs-btn-disabled-color: #fff;
    --bs-btn-disabled-bg: #059669;
    --bs-btn-disabled-border-color: #059669;
}

.btn-outline-primary {
    --bs-btn-color: #059669;
    --bs-btn-border-color: #059669;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #059669;
    --bs-btn-hover-border-color: #059669;
    --bs-btn-focus-shadow-rgb: 5, 150, 105;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #059669;
    --bs-btn-active-border-color: #059669;
}

/* ── Global ──────────────────────────────────────────────────── */

html {
    overflow-x: hidden;
}

* {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    overflow-x: hidden;
    padding-top: 48px; /* Offset for fixed-top navbar */
    color: var(--fm-text);
    background:
        radial-gradient(
            circle at top left,
            rgba(5, 150, 105, 0.12),
            transparent 32rem
        ),
        radial-gradient(
            circle at top right,
            rgba(16, 185, 129, 0.1),
            transparent 28rem
        ),
        var(--fm-bg);
    font-family:
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

a {
    text-decoration: none;
}

.section-padding {
    padding: 5rem 0;
}

.section-title {
    font-weight: 800;
    letter-spacing: -0.04em;
}

.section-subtitle {
    max-width: 760px;
    color: var(--fm-muted);
    line-height: 1.75;
}

/* ── Navbar ──────────────────────────────────────────────────── */

.navbar {
    background-color: rgba(255, 255, 255, 0.88);
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
    backdrop-filter: blur(16px);
}

.navbar-brand {
    color: var(--fm-text);
    font-weight: 800;
    letter-spacing: -0.03em;
}

.navbar-brand span {
    color: var(--fm-primary);
}

.nav-link {
    color: var(--fm-muted);
    font-weight: 600;
}

.nav-link:hover,
.nav-link:focus,
.nav-link.active {
    color: var(--fm-primary);
}

/* ── Hero ────────────────────────────────────────────────────── */

.hero {
    position: relative;
    overflow: hidden;
    padding: 7rem 0 5rem;
}

.hero::before {
    position: absolute;
    top: 6rem;
    right: -9rem;
    width: 24rem;
    height: 24rem;
    content: "";
    background: linear-gradient(
        135deg,
        rgba(5, 150, 105, 0.16),
        rgba(16, 185, 129, 0.16)
    );
    border-radius: 50%;
    filter: blur(2px);
    z-index: -1;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.85rem;
    color: var(--fm-primary-dark);
    background-color: rgba(5, 150, 105, 0.09);
    border: 1px solid rgba(5, 150, 105, 0.18);
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 700;
}

.hero-title {
    max-width: 920px;
    margin-top: 1.25rem;
    font-size: clamp(2.3rem, 6vw, 4.9rem);
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.07em;
}

.hero-title .text-gradient {
    color: transparent;
    background: linear-gradient(135deg, var(--fm-primary), var(--fm-secondary));
    background-clip: text;
    -webkit-background-clip: text;
}

.hero-description {
    max-width: 850px;
    color: var(--fm-muted);
    font-size: 1.12rem;
    line-height: 1.8;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    margin-top: 2rem;
}

/* ── Buttons ─────────────────────────────────────────────────── */

.btn-primary {
    background: linear-gradient(
        135deg,
        var(--fm-primary),
        var(--fm-primary-dark)
    );
    border: 0;
    box-shadow: 0 14px 26px rgba(5, 150, 105, 0.22);
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, var(--fm-primary-dark), #065f46);
    transform: translateY(-1px);
}

.btn-outline-primary {
    color: var(--fm-primary);
    border-color: rgba(5, 150, 105, 0.38);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background-color: var(--fm-primary);
    border-color: var(--fm-primary);
}

/* ── Cards ───────────────────────────────────────────────────── */

.glass-card {
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: var(--fm-radius);
    box-shadow: var(--fm-shadow);
    backdrop-filter: blur(18px);
}

.stat-card {
    height: 100%;
    padding: 1.35rem;
    background-color: var(--fm-surface);
    border: 1px solid var(--fm-border);
    border-radius: 1rem;
    box-shadow: var(--fm-shadow-sm);
}

.stat-number {
    color: var(--fm-primary);
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: -0.05em;
}

.stat-label {
    margin-bottom: 0;
    color: var(--fm-muted);
    font-weight: 600;
}

/* ── Description Cards ───────────────────────────────────────── */

.description-card {
    height: 100%;
    padding: 1.5rem;
    background-color: var(--fm-surface);
    border: 1px solid var(--fm-border);
    border-radius: var(--fm-radius);
    box-shadow: var(--fm-shadow-sm);
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.description-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--fm-shadow);
}

.description-icon {
    display: grid;
    width: 3rem;
    height: 3rem;
    margin-bottom: 1.1rem;
    color: var(--fm-primary);
    background-color: rgba(5, 150, 105, 0.1);
    border-radius: 1rem;
    place-items: center;
    font-size: 1.35rem;
}

.description-card h3 {
    font-size: 1.15rem;
    font-weight: 800;
}

.description-card p,
.description-card li {
    color: var(--fm-muted);
    line-height: 1.7;
}

/* ── Project Cards ───────────────────────────────────────────── */

.project-card {
    position: relative;
    height: 100%;
    overflow: hidden;
    background-color: var(--fm-surface);
    border: 1px solid var(--fm-border);
    border-radius: var(--fm-radius);
    box-shadow: var(--fm-shadow-sm);
    transition:
        transform 0.24s ease,
        box-shadow 0.24s ease,
        border-color 0.24s ease;
}

.project-card::before {
    position: absolute;
    inset: 0 0 auto;
    height: 0.35rem;
    content: "";
    background: linear-gradient(90deg, var(--fm-primary), var(--fm-secondary));
}

.project-card:hover {
    border-color: rgba(5, 150, 105, 0.32);
    box-shadow: var(--fm-shadow);
    transform: translateY(-6px);
}

.project-card-body {
    padding: 1.75rem;
}

.project-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.9rem;
    color: var(--fm-secondary);
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.project-title {
    margin-bottom: 0.65rem;
    font-size: 1.55rem;
    font-weight: 900;
    letter-spacing: -0.04em;
}

.project-description {
    color: var(--fm-muted);
    line-height: 1.75;
}

/* ── Feature List ────────────────────────────────────────────── */

.feature-list {
    padding-left: 0;
    margin-bottom: 1.5rem;
    list-style: none;
}

.feature-list li {
    display: flex;
    gap: 0.7rem;
    margin-bottom: 0.7rem;
    color: var(--fm-muted);
    line-height: 1.55;
}

.feature-list li::before {
    flex: 0 0 auto;
    width: 0.55rem;
    height: 0.55rem;
    margin-top: 0.5rem;
    content: "";
    background-color: var(--fm-primary);
    border-radius: 50%;
}

.project-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

/* ── Misc ────────────────────────────────────────────────────── */

.project-note {
    padding: 1.5rem;
    background-color: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: var(--fm-radius);
}

.project-note strong {
    color: #92400e;
}

/* ── Footer ──────────────────────────────────────────────────── */

.footer {
    padding: 2.5rem 0;
    color: var(--fm-muted);
    background-color: #ffffff;
    border-top: 1px solid var(--fm-border);
}

.footer a {
    color: var(--fm-primary);
    font-weight: 700;
}

/* ── Back to Top ─────────────────────────────────────────────── */

.back-to-top {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 1030;
    display: grid;
    width: 3rem;
    height: 3rem;
    color: #ffffff;
    background: linear-gradient(135deg, var(--fm-primary), var(--fm-secondary));
    border: 0;
    border-radius: 50%;
    box-shadow: var(--fm-shadow-sm);
    opacity: 0;
    visibility: hidden;
    transform: translateY(0.75rem);
    transition:
        opacity 0.2s ease,
        transform 0.2s ease,
        visibility 0.2s ease;
    place-items: center;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-2px);
}

/* ── Reveal Animation ────────────────────────────────────────── */

.reveal {
    opacity: 0;
    transform: translateY(1.25rem);
    transition:
        opacity 0.6s ease,
        transform 0.6s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ── Responsive ──────────────────────────────────────────────── */

@media (max-width: 991.98px) {
    .hero {
        padding-top: 6rem;
    }

    .navbar-collapse {
        padding: 1rem 0;
    }
}

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

    .hero-actions,
    .project-actions {
        flex-direction: column;
    }

    .hero-actions .btn,
    .project-actions .btn {
        width: 100%;
    }

    .project-card-body,
    .description-card {
        padding: 1.25rem;
    }
}
