/* Roonda landing — design tokens aligned with KMP Color.kt */
:root {
    --roonda-secondary: #4c7e81;
    --roonda-secondary-dark: #326568;
    --roonda-accent: #3d8c80;
    --roonda-chart-orange: #e0a844;
    --roonda-positive: #009688;
    --roonda-negative: #d32f2f;
    --roonda-error: #ba1a1a;
    --roonda-bg: #ffffff;
    --roonda-on-bg: #1b1b1b;
    --roonda-surface: #f3f3f3;
    --roonda-surface-high: #e8e8e8;
    --roonda-outline: #c6c6ca;
    --roonda-muted: #45474a;
    --roonda-card: #ffffff;
    --roonda-shadow: 0 24px 48px -12px rgba(27, 27, 27, 0.12);
    --roonda-radius: 1.25rem;
    --font-display: 'Nunito', system-ui, sans-serif;
    --font-body: 'Poppins', system-ui, sans-serif;
}

.dark {
    --roonda-bg: #131313;
    --roonda-on-bg: #e2e2e2;
    --roonda-surface: #1f1f1f;
    --roonda-surface-high: #2a2a2a;
    --roonda-outline: #45474a;
    --roonda-muted: #c6c6ca;
    --roonda-card: #1b1b1b;
    --roonda-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.45);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--roonda-bg);
    color: var(--roonda-on-bg);
    position: relative;
}

.font-display {
    font-family: var(--font-display);
}

/* Hero atmosphere — gradient extends behind header + hero */
.hero-atmosphere {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: min(52rem, 100vh);
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    background: radial-gradient(
        ellipse 130% 95% at 50% -5%,
        #ffffff 0%,
        #f8fbfb 28%,
        #eef5f5 52%,
        var(--roonda-bg) 100%
    );
}

.dark .hero-atmosphere {
    background: radial-gradient(
        ellipse 130% 95% at 50% -5%,
        #1c2121 0%,
        #171b1b 32%,
        #141818 55%,
        var(--roonda-bg) 100%
    );
}

.hero-shell__glow {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(72px);
}

.hero-shell__glow--right {
    top: -6rem;
    right: -8%;
    width: min(32rem, 95vw);
    height: 32rem;
    background: rgba(76, 126, 129, 0.2);
}

.hero-shell__glow--left {
    bottom: 5%;
    left: -12%;
    width: 22rem;
    height: 22rem;
    background: rgba(61, 140, 128, 0.14);
}

.dark .hero-shell__glow--right {
    background: rgba(76, 126, 129, 0.12);
}

.dark .hero-shell__glow--left {
    background: rgba(61, 140, 128, 0.08);
}

.hero-section__inner {
    padding-top: clamp(1.5rem, 4vw, 2.5rem);
    padding-bottom: clamp(4rem, 10vw, 6.5rem);
}

main {
    position: relative;
    z-index: 1;
}

/* Header */
#site-header {
    background: transparent;
    transition: background-color 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

#site-header.header-scrolled {
    background-color: color-mix(in srgb, var(--roonda-bg) 88%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 var(--roonda-outline);
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--roonda-secondary) 0%, var(--roonda-accent) 100%);
    color: #feffff;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.btn-primary:hover {
    filter: brightness(1.05);
    box-shadow: 0 12px 28px -8px rgba(76, 126, 129, 0.55);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Store badges */
.store-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid var(--roonda-outline);
    background: var(--roonda-card);
    color: var(--roonda-on-bg);
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.2;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.store-badge:hover {
    border-color: var(--roonda-secondary);
    transform: translateY(-2px);
    box-shadow: var(--roonda-shadow);
}

.store-badge svg {
    width: 1.5rem;
    height: 1.5rem;
    flex-shrink: 0;
}

/* Device mockup glow */
.device-glow {
    position: absolute;
    inset: -12%;
    background: radial-gradient(ellipse at center, rgba(76, 126, 129, 0.22) 0%, transparent 68%);
    pointer-events: none;
    z-index: 0;
}

.device-frame img {
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 32px 48px rgba(0, 0, 0, 0.18));
}

.dark .device-frame img {
    filter: drop-shadow(0 32px 48px rgba(0, 0, 0, 0.5));
}

/* App preview cards — mirrors ElevatedCard / surfaceContainerLow */
.app-preview-card {
    background: var(--roonda-surface);
    border-radius: 1.75rem;
    padding: 1.5rem;
    box-shadow: none;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.app-preview-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--roonda-shadow);
}

.app-preview-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 1rem;
    color: var(--roonda-on-bg);
}

/* Cycle — LinearProgressIndicator (RemainingTime) */
.cycle-preview .cycle-progress-track {
    height: 4px;
    border-radius: 999px;
    background: var(--roonda-outline);
    overflow: hidden;
}

.cycle-preview .cycle-progress-fill {
    height: 100%;
    border-radius: inherit;
    background: var(--roonda-secondary);
}

.cycle-preview .cycle-remaining {
    color: var(--roonda-muted);
    font-size: 0.875rem;
    font-weight: 400;
    font-family: var(--font-body);
}

/* Spending trends — SpendingTrendsSection */
.trends-chart-wrap {
    margin-top: 0.25rem;
    height: 13.5rem;
}

.trends-chart {
    width: 100%;
    height: 100%;
    display: block;
}

.trends-grid-line {
    stroke: var(--roonda-outline);
    stroke-width: 1;
    opacity: 0.35;
}

/* Spending breakdown — SpendingBreakdownCard */
.breakdown-preview .breakdown-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.breakdown-chart {
    position: relative;
    width: 8.5rem;
    height: 8.5rem;
    flex-shrink: 0;
}

.breakdown-donut {
    width: 100%;
    height: 100%;
    display: block;
}

.breakdown-total {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 1rem;
    color: var(--roonda-on-bg);
    pointer-events: none;
}

.breakdown-legend {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: var(--roonda-on-bg);
}

.breakdown-legend li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-dot {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Pager dots — HorizontalPager indicators */
.pager-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.25rem;
}

.pager-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 999px;
    background: var(--roonda-on-bg);
    opacity: 0.2;
    transition: width 0.2s ease, opacity 0.2s ease;
}

.pager-dot--active {
    width: 1.25rem;
    opacity: 1;
}

/* Groups composition — CompositionCard */
.composition-header {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.composition-count {
    font-size: clamp(2.5rem, 6vw, 3.5rem);
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.02em;
}

.composition-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--roonda-muted);
    padding-bottom: 0.65rem;
}

.composition-bar {
    display: flex;
    gap: 2px;
    height: 0.75rem;
    border-radius: 999px;
    overflow: hidden;
    margin: 0.5rem 0 1.5rem;
}

.composition-bar-shared {
    flex: 1;
    max-width: 33%;
    background: #1b1b1b;
    border-radius: 999px 0 0 999px;
}

.dark .composition-bar-shared {
    background: #c6c6c6;
}

.composition-bar-personal {
    flex: 2;
    background: var(--roonda-secondary);
    border-radius: 0 999px 999px 0;
}

.composition-legend {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.composition-legend-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    flex: 1;
}

.composition-legend-item--end {
    justify-content: flex-end;
    text-align: right;
}

.composition-legend-title {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 700;
}

.composition-legend-sub {
    margin: 0.15rem 0 0;
    font-size: 0.75rem;
    color: var(--roonda-muted);
}

.legend-indicator {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 0.25rem;
}

.legend-indicator--primary {
    background: #1b1b1b;
}

.dark .legend-indicator--primary {
    background: #c6c6c6;
}

.legend-indicator--secondary {
    background: var(--roonda-secondary);
}

.composition-legend-item--end .legend-indicator {
    margin-top: 0.25rem;
}

/* Balance preview — BalanceSection / BalanceCard */
.balance-preview {
    position: relative;
    max-width: 22rem;
    margin: 0 auto;
    min-height: 20rem;
}

.balance-card {
    border-radius: 1.75rem;
    padding: 1.5rem 1.25rem 1.25rem;
    background: #1b1b1b;
    color: #ffffff;
    box-shadow: var(--roonda-shadow);
}

.dark .balance-card {
    background: #c6c6c6;
    color: #303030;
}

.dark .balance-pill {
    background: rgba(0, 0, 0, 0.08);
}

.dark .balance-label {
    color: inherit;
}

.balance-card--peek {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    right: -1rem;
    opacity: 0.35;
    transform: scale(0.96);
    z-index: 0;
    pointer-events: none;
}

.balance-card--active {
    position: relative;
    z-index: 2;
}

.balance-label {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0.7;
    margin: 0 0 0.25rem;
}

.balance-amount {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.1;
    margin: 0 0 1rem;
}

.balance-pills {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.balance-pill {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.12);
    font-size: 0.8125rem;
}

.balance-pill--wide {
    flex-wrap: wrap;
}

.balance-pill-label {
    opacity: 0.65;
}

.balance-pill-value {
    font-weight: 600;
}

.balance-pill-value--positive {
    color: var(--roonda-positive);
}

.balance-pager {
    margin-top: 1rem;
}

.balance-pager .pager-dot,
.balance-pager .pager-dot--active {
    background: var(--roonda-on-bg);
}

.dark .balance-pager .pager-dot,
.dark .balance-pager .pager-dot--active {
    background: #fff;
}

.harmony-settle {
    position: absolute;
    left: 50%;
    bottom: 2.5rem;
    transform: translateX(-50%);
    z-index: 4;
    background: var(--roonda-error);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    border: none;
    box-shadow: 0 8px 20px rgba(186, 26, 26, 0.35);
    white-space: nowrap;
    cursor: default;
}

/* Feature pills */
.feature-pill {
    background: var(--roonda-card);
    border: 1px solid var(--roonda-outline);
    border-radius: var(--roonda-radius);
    padding: 1.25rem 1.5rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.feature-pill:hover {
    transform: translateX(4px);
    box-shadow: var(--roonda-shadow);
}

.feature-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.875rem;
    background: color-mix(in srgb, var(--roonda-secondary) 14%, transparent);
    color: var(--roonda-secondary);
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

/* Section spacing */
.section-pad {
    padding-top: clamp(4rem, 10vw, 6.5rem);
    padding-bottom: clamp(4rem, 10vw, 6.5rem);
}

@media (min-width: 640px) {
    .breakdown-preview .breakdown-row {
        gap: 1.5rem;
    }

    .breakdown-chart {
        width: 10rem;
        height: 10rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .btn-primary:hover,
    .app-preview-card:hover,
    .feature-pill:hover,
    .store-badge:hover {
        transform: none;
    }
}
