:root {
    /* Light Mode */
    --bg-color: #DDD2C1;                 /* .accentColorDark (Light) */
    --bg-logo-color: #EBE2E2;            /* .accentColorLight (Light) */
    --primary-color: #000000;
    --text-secondary: rgba(0, 0, 0, 0.65);
    
    /* Button */
    --btn-bg: #000000;
    --btn-text: #FFFFFF;
    --btn-shadow: rgba(0, 0, 0, 0.2);

    /* Card Background: .accentColorLight */
    --card-glass-bg: rgba(235, 226, 226, 0.65);
    --card-glass-border: rgba(43, 47, 50, 0.12);
    --card-glass-shadow: rgba(43, 47, 50, 0.14);

    /* Icon Tile Background: .accentColorDark */
    --tile-bg: #DDD2C1;
    --tile-border: rgba(43, 47, 50, 0.12);
    --tile-shadow: 0 10px 24px rgba(43, 47, 50, 0.14);

    /* Icon Color in Light Mode: BLACK */
    --tile-icon-filter: brightness(0) saturate(100%);

    /* Segmented Control Colors */
    --segment-bg: #EBE2E2;               /* .accentColorLight */
    --segment-border: rgba(43, 47, 50, 0.12);
    --segment-indicator-bg: #DDD2C1;     /* .accentColorDark */
    --segment-indicator-shadow: 0 4px 14px rgba(43, 47, 50, 0.15);
    --segment-color: #000000;            /* Black in Light Mode */

    /* Promo section */
    --promo-pill-bg: rgba(43, 47, 50, 0.08);
}

@media (prefers-color-scheme: dark) {
    :root {
        /* Dark Mode */
        --bg-color: #322F2B;             /* .accentColorDark (Dark) */
        --bg-logo-color: #54514A;        /* .accentColorLight (Dark) */
        --primary-color: #FFFFFF;
        --text-secondary: rgba(255, 255, 255, 0.65);
        
        /* Button */
        --btn-bg: #FFFFFF;
        --btn-text: #000000;
        --btn-shadow: rgba(0, 0, 0, 0.4);

        /* Card Background: .accentColorLight */
        --card-glass-bg: rgba(84, 81, 74, 0.55);
        --card-glass-border: rgba(255, 255, 255, 0.12);
        --card-glass-shadow: rgba(0, 0, 0, 0.35);

        /* Icon Tile Background: .accentColorDark */
        --tile-bg: #322F2B;
        --tile-border: rgba(255, 255, 255, 0.12);
        --tile-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);

        /* Icon Color in Dark Mode: WHITE */
        --tile-icon-filter: brightness(0) invert(1);

        /* Segmented Control Colors */
        --segment-bg: #54514A;           /* .accentColorLight */
        --segment-border: rgba(255, 255, 255, 0.12);
        --segment-indicator-bg: #322F2B; /* .accentColorDark */
        --segment-indicator-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
        --segment-color: #FFFFFF;        /* White in Dark Mode */

        /* Promo section */
        --promo-pill-bg: rgba(255, 255, 255, 0.1);
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Comfortaa', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100vw;
    min-height: 100vh;
    background-color: var(--bg-color);
    color: var(--primary-color);
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
    -webkit-touch-callout: none;
}

/* 1. Fixed Background Canvas */
.background-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.bg-logo-container {
    width: min(75vw, 75vh);
    height: min(75vw, 75vh);
    max-width: 600px;
    max-height: 600px;
    display: flex;
    justify-content: center;
    align-items: center;
    filter: blur(15px);
    -webkit-filter: blur(15px);
    transform: translateZ(0);
}

.bg-logo-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

#bg-logo-path {
    stroke: var(--bg-logo-color);
    transition: stroke 0.3s ease;
}

/* 2. Fixed Fullscreen Blur Layer */
.fullscreen-blur-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    pointer-events: none;
    z-index: 5;
    transform: translateZ(0);
}

/* 3. Foreground Scrolling Content Layer */
.page-content {
    position: relative;
    z-index: 10;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 70px 20px 36px;
    gap: 56px;
    overflow-x: hidden;
}

/* Hero Header */
.hero-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 800px;
}

.top-logo-container {
    width: clamp(96px, 14vw, 128px);
    height: clamp(96px, 14vw, 128px);
    margin-bottom: 24px;
}

.top-logo-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

#top-logo-path {
    stroke: var(--primary-color);
    transition: stroke 0.3s ease;
}

.brand-title {
    font-size: clamp(48px, 7vw, 68px);
    font-weight: 700;
    letter-spacing: -1px;
    color: var(--primary-color);
    margin-bottom: 16px;
}

.brand-tagline {
    font-size: clamp(20px, 3vw, 26px);
    font-weight: 500;
    color: var(--text-secondary);
    line-height: 1.45;
}

.cta-container {
    margin-top: 36px;
}

/* Apple Button: Silky Smooth Fluid Transition */
.btn-download-ios {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 18px 40px;
    background-color: var(--btn-bg);
    color: var(--btn-text);
    text-decoration: none;
    border: none;
    border-radius: 9999px;
    font-size: 19px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 10px 30px var(--btn-shadow);
    transform: scale(1) translateY(0);
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), 
                box-shadow 0.4s cubic-bezier(0.25, 1, 0.5, 1), 
                background-color 0.3s ease, 
                color 0.3s ease;
    user-select: none;
    -webkit-user-select: none;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

/* Desktop Hover */
@media (hover: hover) and (pointer: fine) {
    .btn-download-ios:hover {
        transform: translateY(-2px) scale(1.02);
        box-shadow: 0 14px 36px var(--btn-shadow);
    }
}

/* Smooth Soft Plunge */
.btn-download-ios.pressed {
    transform: translateY(1.5px) scale(0.95) !important;
    box-shadow: 0 4px 14px var(--btn-shadow) !important;
    transition: transform 0.18s ease-out, box-shadow 0.18s ease-out !important;
}

.apple-icon {
    width: 22px;
    height: 27px;
    fill: currentColor;
    flex-shrink: 0;
    display: block;
    margin-top: -2px;
}

.btn-download-ios span {
    display: inline-block;
    line-height: 1;
}

/* --- Features Section --- */
.features-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

/* --- 4-Tab Equal Width Segmented Control --- */
.segmented-control {
    position: relative;
    display: flex;
    width: min(94vw, 460px);
    height: 50px;
    background-color: var(--segment-bg);
    border: 1px solid var(--segment-border);
    padding: 4px;
    border-radius: 9999px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    user-select: none;
    -webkit-user-select: none;
    touch-action: pan-y;
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* Equal 25% Active Indicator Pill */
.segment-indicator {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(25% - 2px);
    height: calc(100% - 8px);
    background-color: var(--segment-indicator-bg);
    border-radius: 9999px;
    box-shadow: var(--segment-indicator-shadow);
    transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
    z-index: 1;
}

.segment-btn {
    position: relative;
    z-index: 2;
    flex: 1;
    width: 25%;
    height: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: var(--segment-color);
    border-radius: 9999px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 2px;
    transition: color 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.seg-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Text Layer: Elastic spring morph & slightly larger typography */
.seg-text {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    opacity: 0;
    font-size: 13.8px;
    font-weight: 700;
    letter-spacing: -0.25px;
    padding: 0 2px;
    transform: scale(0.6) translateY(5px);
    transition: opacity 0.32s cubic-bezier(0.25, 1, 0.35, 1), 
                transform 0.4s cubic-bezier(0.34, 1.45, 0.64, 1);
    text-align: center;
    pointer-events: none;
}

/* Icon Layer: Elastic spring morph */
.seg-icon {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transform: scale(1) translateY(0);
    transition: opacity 0.28s cubic-bezier(0.25, 1, 0.35, 1), 
                transform 0.4s cubic-bezier(0.34, 1.45, 0.64, 1);
    pointer-events: none;
}

.nav-svg {
    fill: currentColor;
    display: block;
}

/* Specific optical sizing per icon */
.nav-icon-ws {
    width: 22px;
    height: 22px;
}

.nav-icon-tx {
    width: 22px;
    height: 22px;
}

.nav-icon-acc {
    width: 19px;
    height: 19px;
}

.nav-icon-an {
    width: 19px;
    height: 19px;
}

/* Active State: Spring in Text, Shrink out Icon */
.segment-btn.active .seg-text {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.segment-btn.active .seg-icon {
    opacity: 0;
    transform: scale(0.35) translateY(-5px);
}

/* Inactive State: Hide Text, Spring in Icon */
.segment-btn:not(.active) .seg-text {
    opacity: 0;
    transform: scale(0.6) translateY(5px);
}

.segment-btn:not(.active) .seg-icon {
    opacity: 0.85;
    transform: scale(1) translateY(0);
}

/* --- Free-Standing Full-Screen Transition Cards --- */
.cards-wrapper {
    width: min(92vw, 390px);
    aspect-ratio: 1 / 1;
    position: relative;
    overflow: visible;
    touch-action: pan-y;
}

.feature-card {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--card-glass-bg);
    backdrop-filter: blur(28px) saturate(190%);
    -webkit-backdrop-filter: blur(28px) saturate(190%);
    border: 1px solid var(--card-glass-border);
    border-radius: 36px;
    padding: 0 0 24px 0;
    box-shadow: 0 24px 56px var(--card-glass-shadow);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    overflow: hidden;
    will-change: transform, opacity;
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

.feature-card:not(.active) {
    opacity: 0;
    pointer-events: none;
    transform: translateX(calc(100vw + 100px));
}

/* Visual Canvas */
.card-visual {
    width: 100%;
    height: 225px;
    position: relative;
    overflow: visible;
}

/* Icon Tile Platform (.accentColorDark) */
.icon-tile {
    position: absolute;
    background: var(--tile-bg);
    border: 1px solid var(--tile-border);
    border-radius: 22px;
    box-shadow: var(--tile-shadow);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px;
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    user-select: none;
}

.icon-tile:hover {
    transform: scale(1.08) translateY(-4px) !important;
    z-index: 10;
}

.tile-svg {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: var(--tile-icon-filter);
    transition: filter 0.3s ease;
}

/* --- Card 0: Workspaces 4 Tiles --- */
.tile-ws-1 {
    width: 78px;
    height: 78px;
    top: 12px;
    left: 24px;
    transform: rotate(-16deg);
    z-index: 1;
}

.tile-ws-2 {
    width: 82px;
    height: 82px;
    top: 18px;
    right: 28px;
    transform: rotate(18deg);
    z-index: 2;
}

.tile-ws-3 {
    width: 86px;
    height: 86px;
    top: 104px;
    left: 64px;
    transform: rotate(-8deg);
    z-index: 3;
}

.tile-ws-4 {
    width: 80px;
    height: 80px;
    top: 112px;
    right: 42px;
    transform: rotate(14deg);
    z-index: 2;
}

/* --- Card 1: Accounts 5 Tiles --- */
.tile-acc-1 {
    width: 72px;
    height: 72px;
    top: 10px;
    left: 20px;
    transform: rotate(-12deg);
}

.tile-acc-2 {
    width: 72px;
    height: 72px;
    top: 12px;
    right: 20px;
    transform: rotate(14deg);
}

.tile-acc-3 {
    width: 78px;
    height: 78px;
    top: 60px;
    left: 50%;
    transform: translateX(-50%) rotate(-4deg);
    z-index: 3;
}

.tile-acc-4 {
    width: 72px;
    height: 72px;
    top: 124px;
    left: 32px;
    transform: rotate(9deg);
}

.tile-acc-5 {
    width: 72px;
    height: 72px;
    top: 124px;
    right: 32px;
    transform: rotate(-11deg);
}

/* --- Card 2: Transactions 3 Tiles (Transfer, Categories, Tags) --- */
.tile-tx-1 {
    width: 84px;
    height: 84px;
    top: 14px;
    left: 26px;
    transform: rotate(-14deg);
    z-index: 1;
}

.tile-tx-2 {
    width: 84px;
    height: 84px;
    top: 18px;
    right: 26px;
    transform: rotate(16deg);
    z-index: 2;
}

.tile-tx-3 {
    width: 88px;
    height: 88px;
    top: 106px;
    left: 50%;
    transform: translateX(-50%) rotate(-4deg);
    z-index: 3;
}

/* --- Card 3: Analytics 3 Tiles (Calendar, Income, Expense) --- */
.tile-an-1 {
    width: 82px;
    height: 82px;
    top: 14px;
    left: 28px;
    transform: rotate(-14deg);
    z-index: 1;
}

.tile-an-2 {
    width: 84px;
    height: 84px;
    top: 18px;
    right: 28px;
    transform: rotate(16deg);
    z-index: 2;
}

.tile-an-3 {
    width: 90px;
    height: 90px;
    top: 106px;
    left: 50%;
    transform: translateX(-50%) rotate(-4deg);
    z-index: 3;
}

/* Card Content Typography - Centered on X Axis */
.card-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: center;
    align-items: center;
    width: 100%;
    padding: 0 20px 0;
}

.card-title {
    font-size: clamp(19px, 5vw, 22px);
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--primary-color);
    text-align: center;
    width: 100%;
}

.card-description {
    font-size: 13.5px;
    font-weight: 400;
    color: var(--text-secondary);
    line-height: 1.45;
    text-align: center;
    width: 100%;
}

/* --- Promo / Editorial Philosophy Section --- */
.promo-section {
    width: 100%;
    max-width: 780px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    text-align: center;
    margin-top: 10px;
}

.promo-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    width: 100%;
}

.promo-pill {
    display: inline-block;
    padding: 6px 18px;
    background-color: var(--promo-pill-bg);
    border-radius: 9999px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.promo-title {
    font-size: clamp(26px, 4.5vw, 36px);
    font-weight: 700;
    letter-spacing: -0.8px;
    line-height: 1.35;
    color: var(--primary-color);
    max-width: 680px;
}

.promo-subtitle {
    font-size: clamp(15.5px, 2.4vw, 18px);
    font-weight: 400;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 720px;
}

/* --- Legal Subpages & Document Styling --- */
.legal-brand-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    outline: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.legal-subtitle {
    font-size: clamp(22px, 3.8vw, 30px);
    font-weight: 600;
    color: var(--text-secondary);
    margin-top: 18px;
    letter-spacing: -0.5px;
    text-align: center;
}

.legal-document {
    width: min(92vw, 780px);
    display: flex;
    flex-direction: column;
    gap: 16px;
    color: var(--primary-color);
    line-height: 1.75;
    font-size: 15px;
    font-weight: 400;
    text-align: left;
}

.legal-document strong {
    display: block;
    margin-top: 20px;
    margin-bottom: 6px;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: var(--primary-color);
}

.legal-document p {
    color: var(--primary-color);
    margin-bottom: 6px;
}

.legal-document ul {
    padding-left: 24px;
    margin: 8px 0 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.legal-document li {
    color: var(--primary-color);
}

.legal-document a {
    color: var(--primary-color);
    text-decoration: underline;
    text-underline-offset: 4px;
    font-weight: 600;
    transition: opacity 0.2s ease;
}

.legal-document a:hover {
    opacity: 0.7;
}

/* --- Page Footer --- */
.page-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 68px;
    padding-bottom: 0px;
    text-align: center;
}

.copyright-text {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.footer-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: underline;
    text-underline-offset: 4px;
    cursor: pointer;
    transition: opacity 0.2s ease, color 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.footer-link:hover {
    opacity: 0.7;
}

.footer-separator {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    user-select: none;
}

/* Mobile Specific Optimizations */
@media (max-width: 480px) {
    .page-content {
        padding: 50px 16px 28px;
        gap: 36px;
    }

    .segmented-control {
        width: calc(100vw - 24px);
        max-width: 395px;
        height: 46px;
        padding: 3px;
    }

    .segment-indicator {
        top: 3px;
        left: 3px;
        height: calc(100% - 6px);
    }

    .seg-text {
        font-size: 11.8px;
        letter-spacing: -0.3px;
        padding: 0 1px;
    }

    .nav-icon-ws {
        width: 19px;
        height: 19px;
    }

    .nav-icon-tx {
        width: 19px;
        height: 19px;
    }

    .nav-icon-acc {
        width: 17px;
        height: 17px;
    }

    .nav-icon-an {
        width: 17px;
        height: 17px;
    }

    .cards-wrapper {
        width: min(92vw, 350px);
    }

    .page-footer {
        margin-top: 56px;
    }

    .legal-subtitle {
        margin-top: 14px;
    }

    .legal-document {
        font-size: 14px;
        line-height: 1.7;
    }

    .legal-document strong {
        font-size: 16px;
        margin-top: 16px;
    }
}
