:root {
    --bg: #f5f7fb;
    --surface: rgba(255, 255, 255, 0.86);
    --surface-strong: #ffffff;
    --fg: #101827;
    --muted: #526071;
    --border: rgba(16, 24, 39, 0.1);
    --primary: #1652f0;
    --primary-strong: #0f3fba;
    --primary-contrast: #ffffff;
    --teal: #1bb8a9;
    --gold: #c8912f;
    --coral: #db5d4b;
    --green: #16875f;
    --shadow: rgba(16, 24, 39, 0.12);
}

body.dark {
    --bg: #08111f;
    --surface: rgba(13, 25, 42, 0.82);
    --surface-strong: #111f32;
    --fg: #e8eef9;
    --muted: #a8b3c4;
    --border: rgba(255, 255, 255, 0.12);
    --primary: #58d7cb;
    --primary-strong: #34bfb1;
    --primary-contrast: #06231f;
    --shadow: rgba(0, 0, 0, 0.32);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Instrument Sans", system-ui, sans-serif;
    background: var(--bg);
    color: var(--fg);
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
}

.icon-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.page-shell {
    min-height: 100vh;
    overflow: clip;
}

.container {
    width: min(1120px, calc(100% - 2rem));
    margin: 0 auto;
}

.glass {
    background: var(--surface);
    backdrop-filter: blur(18px);
    border: 1px solid var(--border);
    box-shadow: 0 20px 50px var(--shadow);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 1rem 0 0;
}

.nav-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-radius: 8px;
    padding: 0.85rem 1rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 800;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.45rem;
    height: 2.45rem;
    border-radius: 10px;
    overflow: hidden;
    background: #061a35;
    box-shadow: 0 14px 30px rgba(22, 82, 240, 0.2);
}

.brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.desktop-nav,
.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.desktop-nav a {
    color: var(--muted);
    font-size: 0.95rem;
    font-weight: 600;
}

.desktop-nav a:hover {
    color: var(--fg);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.85rem;
    padding: 0 1rem;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: 180ms ease;
    font-weight: 700;
}

.button-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-strong));
    color: var(--primary-contrast);
    box-shadow: 0 18px 36px rgba(22, 82, 240, 0.24);
}

.button-primary:hover {
    transform: translateY(-1px);
}

.button-ghost {
    border-color: var(--border);
    background: rgba(255, 255, 255, 0.05);
}

.theme-toggle {
    position: relative;
    width: 3.25rem;
    height: 2rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    cursor: pointer;
    padding: 0.15rem;
}

.theme-toggle-track {
    display: block;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--primary), var(--teal));
    transition: transform 180ms ease;
}

body.dark .theme-toggle-track {
    transform: translateX(1.2rem);
}

.menu-toggle,
.mobile-menu {
    display: none;
}

.hero {
    position: relative;
    min-height: 760px;
    margin-top: -5.05rem;
    display: grid;
    align-items: end;
    isolation: isolate;
}

.hero-media {
    position: absolute;
    inset: 0;
    z-index: -2;
}

.hero-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(90deg, rgba(5, 12, 24, 0.86) 0%, rgba(5, 12, 24, 0.56) 44%, rgba(5, 12, 24, 0.08) 100%),
        linear-gradient(180deg, rgba(5, 12, 24, 0.42) 0%, rgba(5, 12, 24, 0.08) 42%, rgba(245, 247, 251, 1) 100%);
}

body.dark .hero-overlay {
    background:
        linear-gradient(90deg, rgba(3, 8, 15, 0.9) 0%, rgba(3, 8, 15, 0.58) 48%, rgba(3, 8, 15, 0.14) 100%),
        linear-gradient(180deg, rgba(3, 8, 15, 0.38) 0%, rgba(3, 8, 15, 0.08) 44%, var(--bg) 100%);
}

.hero-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 410px;
    gap: 2rem;
    align-items: end;
    padding: 10rem 0 4.5rem;
}

.hero-copy {
    color: #ffffff;
    max-width: 670px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--teal);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.hero h1,
.section-heading h2 {
    margin: 0.75rem 0 0;
    line-height: 0.98;
    font-weight: 800;
}

.hero h1 {
    font-size: clamp(3rem, 6vw, 5.8rem);
    max-width: 720px;
}

.section-heading h2 {
    font-size: clamp(2rem, 3vw, 3.3rem);
}

.hero-text,
.section-heading p,
.story-card p,
.feature-card p,
.timeline-step p,
.footer-card p,
.preview-card p,
.provider-note,
.process-card p {
    color: var(--muted);
    line-height: 1.7;
}

.hero-text {
    max-width: 43rem;
    margin-top: 1.2rem;
    color: rgba(255, 255, 255, 0.86);
    font-size: 1.08rem;
}

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

.dashboard-preview {
    border-radius: 8px;
    padding: 1.15rem;
}

.preview-top {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    align-items: center;
}

.preview-kicker {
    font-size: 0.8rem;
    color: var(--muted);
}

.preview-title {
    display: block;
    margin-top: 0.45rem;
    font-weight: 800;
}

.preview-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.42);
    padding: 1rem;
}

body.dark .preview-card {
    background: rgba(255, 255, 255, 0.04);
}

.primary-card {
    margin: 1rem 0;
    padding: 1.25rem;
}

.preview-label,
.panel-kicker {
    display: block;
    color: var(--muted);
    font-size: 0.73rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.preview-amount {
    display: block;
    margin-top: 0.65rem;
    font-size: 2.1rem;
    font-weight: 800;
}

.preview-subtext {
    margin-top: 0.75rem;
}

.mini-chart {
    display: flex;
    align-items: end;
    gap: 0.55rem;
    height: 6.3rem;
    margin-top: 1.25rem;
}

.bar {
    flex: 1;
    border-radius: 999px 999px 0 0;
    background: rgba(148, 163, 184, 0.26);
}

.bar.active {
    background: linear-gradient(180deg, var(--primary), var(--teal));
    box-shadow: 0 0 28px rgba(27, 184, 169, 0.26);
}

.h-30 { height: 30%; }
.h-40 { height: 40%; }
.h-50 { height: 50%; }
.h-65 { height: 65%; }
.h-90 { height: 90%; }

.hero-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.metric {
    min-height: 6.4rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.9rem;
    background: rgba(255, 255, 255, 0.36);
}

body.dark .metric {
    background: rgba(255, 255, 255, 0.04);
}

.metric svg,
.feature-icon svg,
.story-index svg {
    width: 1.3rem;
    height: 1.3rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.metric svg {
    color: var(--primary);
}

.metric span {
    display: block;
    margin-top: 0.75rem;
    font-weight: 800;
    line-height: 1.25;
}

section {
    padding: 3rem 0;
}

.section-heading {
    max-width: 46rem;
    margin-bottom: 1.6rem;
}

.section-heading.left {
    margin-bottom: 0;
}

.story-grid,
.features-grid,
.process-grid {
    display: grid;
    gap: 1rem;
}

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

.features-section {
    background: linear-gradient(135deg, rgba(22, 82, 240, 0.08), rgba(27, 184, 169, 0.08));
}

.split-section {
    display: grid;
    grid-template-columns: 0.75fr 1.25fr;
    gap: 2rem;
    align-items: start;
}

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

.process-grid,
.journey-timeline {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.story-card,
.feature-card,
.process-card,
.timeline-step {
    border-radius: 8px;
    padding: 1.35rem;
}

.story-index,
.feature-icon,
.timeline-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 8px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary), var(--teal));
}

.feature-card:nth-child(2) .feature-icon,
.story-card:nth-child(2) .story-index {
    background: linear-gradient(135deg, var(--green), var(--teal));
}

.feature-card:nth-child(3) .feature-icon,
.story-card:nth-child(3) .story-index {
    background: linear-gradient(135deg, var(--gold), var(--coral));
}

.feature-card:nth-child(4) .feature-icon {
    background: linear-gradient(135deg, var(--primary-strong), var(--coral));
}

.story-card h3,
.feature-card h3,
.process-card h3,
.timeline-step h3,
.insight-panel h3 {
    margin: 1rem 0 0.55rem;
    font-size: 1.12rem;
}

.process-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 8px;
    background: rgba(22, 82, 240, 0.12);
    color: var(--primary);
    font-size: 0.83rem;
    font-weight: 800;
}

.timeline-step {
    position: relative;
}

.timeline-number {
    background: var(--surface-strong);
    color: var(--primary);
    border: 1px solid var(--border);
}

.insights-layout {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 1rem;
}

.insight-panel,
.footer-card {
    border-radius: 8px;
    padding: 1.5rem;
}

.accent-panel {
    background:
        linear-gradient(135deg, rgba(22, 82, 240, 0.12), rgba(27, 184, 169, 0.1)),
        var(--surface);
}

.assistant-thread {
    display: grid;
    gap: 0.9rem;
    margin-top: 1rem;
}

.assistant-bubble {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem 1.1rem;
    background: rgba(255, 255, 255, 0.44);
}

body.dark .assistant-bubble {
    background: rgba(255, 255, 255, 0.05);
}

.assistant-bubble p,
.assistant-bubble h3 {
    margin: 0;
}

.user-bubble {
    background: rgba(22, 82, 240, 0.12);
}

.spending-list {
    display: grid;
    gap: 0.85rem;
    margin-top: 1rem;
}

.spending-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.44);
}

body.dark .spending-row {
    background: rgba(255, 255, 255, 0.05);
}

.spending-row span {
    color: var(--muted);
}

.spending-row strong {
    font-size: 1rem;
}

.provider-note {
    margin-top: 1rem;
    font-size: 0.95rem;
}

.site-footer {
    padding: 1rem 0 3rem;
}

.footer-card {
    position: relative;
    display: grid;
    grid-template-columns: 0.95fr 1.05fr;
    gap: 2rem;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(22, 82, 240, 0.12), rgba(27, 184, 169, 0.1) 46%, rgba(200, 145, 47, 0.1)),
        var(--surface);
}

.footer-card::after {
    content: "";
    position: absolute;
    right: -5rem;
    bottom: -8rem;
    width: 20rem;
    height: 20rem;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(27, 184, 169, 0.2), transparent 65%);
    pointer-events: none;
}

.footer-intro,
.footer-side {
    position: relative;
    z-index: 1;
}

.footer-intro h2 {
    max-width: 32rem;
    margin: 1.4rem 0 0;
    font-size: clamp(2rem, 3vw, 3.1rem);
    line-height: 1;
}

.footer-intro p {
    max-width: 32rem;
    margin: 1rem 0 0;
}

.footer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 1.4rem;
}

.footer-highlights {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 1.4rem;
}

.footer-highlights div,
.footer-bowie-card,
.footer-column {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.42);
}

body.dark .footer-highlights div,
body.dark .footer-bowie-card,
body.dark .footer-column {
    background: rgba(255, 255, 255, 0.05);
}

.footer-highlights div {
    padding: 0.9rem;
}

.footer-highlights strong,
.footer-highlights span {
    display: block;
}

.footer-highlights strong {
    font-size: 1.2rem;
    color: var(--primary);
}

.footer-highlights span {
    margin-top: 0.35rem;
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.35;
}

.footer-side {
    display: grid;
    gap: 1rem;
}

.footer-bowie-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
}

.footer-bowie-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 8px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary), var(--teal));
}

.footer-bowie-icon svg {
    width: 1.35rem;
    height: 1.35rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.footer-bowie-card h3,
.footer-bowie-card p {
    margin: 0;
}

.footer-bowie-card p {
    margin-top: 0.25rem;
}

.footer-columns {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.footer-column {
    padding: 1rem;
}

.footer-column h3 {
    margin: 0 0 1rem;
    font-size: 1rem;
}

.footer-column a,
.footer-column span {
    display: block;
    margin-bottom: 0.7rem;
    color: var(--muted);
    line-height: 1.6;
}

.footer-column a:hover {
    color: var(--fg);
}

@media (max-width: 1080px) {
    .hero-content,
    .split-section,
    .insights-layout,
    .footer-card {
        grid-template-columns: 1fr;
    }

    .dashboard-preview {
        max-width: 560px;
    }

    .story-grid,
    .journey-timeline,
    .process-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

@media (max-width: 820px) {
    .desktop-nav,
    .nav-actions .button,
    .nav-actions .theme-toggle {
        display: none;
    }

    .menu-toggle {
        display: inline-flex;
        flex-direction: column;
        justify-content: center;
        gap: 0.3rem;
        width: 2.8rem;
        height: 2.8rem;
        border: 1px solid var(--border);
        border-radius: 8px;
        background: transparent;
        cursor: pointer;
    }

    .menu-toggle span {
        width: 1.15rem;
        height: 2px;
        background: var(--fg);
        margin: 0 auto;
    }

    .mobile-menu {
        display: none;
        flex-direction: column;
        gap: 0.8rem;
        width: min(1120px, calc(100% - 2rem));
        margin: 0.75rem auto 0;
        padding: 1rem;
        border-radius: 8px;
    }

    .mobile-menu.open {
        display: flex;
    }

    .hero {
        min-height: auto;
    }

    .hero-content {
        padding-top: 8.5rem;
    }

    .hero-overlay {
        background:
            linear-gradient(180deg, rgba(5, 12, 24, 0.86) 0%, rgba(5, 12, 24, 0.58) 45%, rgba(245, 247, 251, 1) 100%);
    }

    body.dark .hero-overlay {
        background:
            linear-gradient(180deg, rgba(3, 8, 15, 0.9) 0%, rgba(3, 8, 15, 0.62) 48%, var(--bg) 100%);
    }

    .hero-media img {
        object-position: 62% center;
    }

    .story-grid,
    .features-grid,
    .journey-timeline,
    .hero-metrics,
    .footer-highlights,
    .footer-columns,
    .process-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .container {
        width: min(100% - 1rem, 1120px);
    }

    .hero h1,
    .section-heading h2 {
        font-size: 2.25rem;
    }

    .hero-content {
        padding-bottom: 3rem;
    }

    .preview-amount {
        font-size: 1.65rem;
    }
}
