/* ExpenseTracker sales page: the app's Wise-inspired world at page scale. */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400 900;
    font-display: swap;
    src: url('/home/fonts/inter-latin-var.woff2') format('woff2');
}
:root {
    --sage: #e8ebe6;
    --sage-deep: #dde2d9;
    --ink: #0e0f0c;
    --ink-raised: #1a1c18;
    --body: #454745;
    --white: #ffffff;
    --lime: #9fe870;
    --lime-hover: #cdffad;
    --lime-pale: #e2f6d5;
    --peach: #ffc091;
    --cyan: #38c8ff;
    --yellow: #ffd11a;
    --on-dark: #f1f2ee;
    --on-dark-muted: #c8cbc5;
    --line: #e7eae4;
    --radius: 24px;
    --wrap: 1200px;
    --gutter: clamp(20px, 4vw, 40px);
    --font: 'Inter', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--sage);
    color: var(--ink);
    font: 400 1rem/1.55 var(--font);
    font-feature-settings: "calt" 1;
    -webkit-font-smoothing: antialiased;
    caret-color: var(--ink);
}

::selection { background: var(--lime); color: var(--ink); }

a { color: inherit; text-underline-offset: 3px; }

:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 8px; }

.visually-hidden {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

.skip {
    position: absolute; left: 16px; top: -48px; padding: 8px 16px; border-radius: 999px;
    background: var(--ink); color: var(--on-dark); z-index: 10; text-decoration: none;
}
.skip:focus { top: 12px; }

.num, .hero-figure, .hero-stats dd, .amt, .price-big, output { font-variant-numeric: tabular-nums; }

/* ─── Bar ─── */
.bar {
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 20px var(--gutter);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand {
    display: inline-flex; align-items: center; gap: 10px;
    font-weight: 900; font-size: 1.25rem; letter-spacing: -0.04em; text-decoration: none;
}

/* The Monthpot mark: the month's pot in the four bucket colours; the lid follows the text colour. */
.mark { width: 30px; height: 30px; flex: none; color: var(--ink); }

/* The mark's entrance (once per page load): the four bucket layers fill from the bottom up, then the lid drops on.
   The resting state is the finished mark, so without animation support or with reduced motion nothing is hidden. */
.mp-animate .mp-layer, .mp-animate .mp-lid { transform-box: fill-box; }
.mp-animate .mp-layer { transform-origin: bottom; animation: mp-fill .45s cubic-bezier(.3, .7, .3, 1) calc(var(--mp-step) * .15s) both; }
.mp-animate .mp-lid { animation: mp-lid .6s cubic-bezier(.3, .7, .3, 1) .75s both; }
@keyframes mp-fill { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes mp-lid {
    0% { transform: translateY(-7px); opacity: 0; }
    60% { transform: translateY(.75px); opacity: 1; }
    80% { transform: translateY(-.5px); }
    100% { transform: none; }
}
@media (prefers-reduced-motion: reduce) { .mp-animate .mp-layer, .mp-animate .mp-lid { animation: none; } }

.bar-links { display: flex; align-items: center; gap: 24px; font-weight: 600; font-size: 0.9375rem; }
.bar-links a:not(.pill) { text-decoration: none; }
.bar-links a:not(.pill):hover { text-decoration: underline; }

/* ─── Pills ─── */
.pill {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 52px; padding: 0 28px; border-radius: 999px;
    font-weight: 700; font-size: 1.0625rem; text-decoration: none; white-space: nowrap;
    transition: background-color 160ms ease, transform 160ms ease;
}
.pill-lime { background: var(--lime); color: var(--ink); }
.pill-lime:hover { background: var(--lime-hover); }
.pill-lime:active { transform: scale(0.98); }
.pill-small { min-height: 40px; padding: 0 18px; font-size: 0.9375rem; }
.pill-block { width: 100%; }

/* ─── Hero: the product itself ─── */
.hero {
    max-width: var(--wrap);
    margin: 0 auto;
    padding: clamp(16px, 3vw, 40px) var(--gutter) 0;
}

.hero-copy { max-width: 760px; }

h1 {
    margin: 0;
    font-weight: 900;
    font-size: clamp(2.75rem, 6.6vw, 5.5rem);
    line-height: 0.98;
    letter-spacing: -0.045em;
    text-wrap: balance;
}

.lead {
    margin: 18px 0 0;
    max-width: 58ch;
    font-size: clamp(1.0625rem, 1.4vw, 1.25rem);
    color: var(--body);
}

.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 24px; }
.price-note { margin: 0; font-weight: 600; color: var(--body); }
.ref-note { flex-basis: 100%; margin: 0; padding: 10px 16px; border-radius: 16px; background: var(--lime-pale); color: #054d28; font-weight: 600; }

.hero-card {
    position: relative;
    margin-top: clamp(32px, 4vw, 48px);
    background: var(--ink);
    color: var(--on-dark);
    border-radius: var(--radius);
}

.hero-lead {
    padding: 28px clamp(24px, 3.5vw, 44px) 26px;
    border-bottom: 1px solid rgba(241, 242, 238, 0.12);
}

.hero-label { margin: 0; color: var(--on-dark-muted); font-weight: 500; }
.sample {
    margin-left: 10px; padding: 3px 10px; border-radius: 999px;
    background: rgba(241, 242, 238, 0.1); color: var(--on-dark-muted); font-size: 0.8125rem; white-space: nowrap;
}

.hero-figure {
    margin: 14px 0 0;
    font-weight: 900;
    font-size: clamp(3rem, 7vw, 6rem);
    line-height: 1;
    letter-spacing: -0.045em;
    color: var(--lime);
    white-space: nowrap;
}

.hero-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; }
.hero-stats > div { padding: 18px clamp(24px, 3.5vw, 44px) 22px; border-left: 1px solid rgba(241, 242, 238, 0.12); }
.hero-stats > div:first-child { border-left: 0; }
.hero-stats dt { color: var(--on-dark-muted); font-weight: 500; }
.hero-stats dd { margin: 4px 0 0; font-weight: 800; font-size: clamp(1.25rem, 2vw, 1.625rem); letter-spacing: -0.02em; }
.hero-stats dd.note { margin-top: 4px; font-weight: 400; font-size: 0.875rem; letter-spacing: 0; color: var(--on-dark-muted); }
.lime { color: var(--lime); }

/* The 3D calculator breaks the card's top edge */
.calc { position: absolute; z-index: 2; cursor: pointer; }
.calc:empty { display: none; }
.hero-card .calc { top: -300px; right: clamp(8px, 2vw, 32px); width: min(32%, 380px); height: 440px; }

/* ─── Features: copy beside a real piece of the interface ─── */
.feature {
    max-width: var(--wrap);
    margin: 0 auto;
    padding: clamp(80px, 11vw, 160px) var(--gutter) 0;
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: clamp(32px, 5vw, 72px);
    align-items: center;
}
.feature-flip { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.feature-flip .feature-copy { order: 2; }

h2 {
    margin: 0;
    font-weight: 900;
    font-size: clamp(2rem, 3.6vw, 3rem);
    line-height: 1.02;
    letter-spacing: -0.035em;
    text-wrap: balance;
}
.feature-copy p, .pricing-copy p { margin: 20px 0 0; font-size: 1.125rem; color: var(--body); max-width: 46ch; }

.panel { background: var(--white); border-radius: var(--radius); padding: 28px clamp(20px, 2.5vw, 32px); }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.panel-head h3 { margin: 0; font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; }
.panel-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
.muted { color: var(--body); font-size: 0.9375rem; }

.split { display: flex; gap: 3px; height: 14px; border-radius: 999px; overflow: hidden; background: var(--sage); margin-bottom: 14px; }
.split span { display: block; height: 100%; }
.b-needs { background: var(--cyan); }
.b-wants { background: var(--peach); }
.b-savings { background: var(--lime); }
.b-debts { background: var(--yellow); }

.buckets { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.buckets th { text-align: left; font-weight: 500; color: var(--body); font-size: 0.8125rem; padding: 10px 6px; }
.buckets td { padding: 12px 6px; border-top: 1px solid var(--line); font-weight: 600; vertical-align: middle; }
.buckets .num { text-align: right; white-space: nowrap; }
.buckets .sub { display: block; margin-left: 20px; font-weight: 400; font-size: 0.8125rem; color: var(--body); }
.m-target { display: none; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 10px; }

.tag { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 0.8125rem; font-weight: 600; color: var(--ink); white-space: nowrap; }
.t-needs { background: color-mix(in srgb, var(--cyan) 24%, white); }
.t-wants { background: color-mix(in srgb, var(--peach) 34%, white); }
.t-savings { background: color-mix(in srgb, var(--lime) 34%, white); }
.t-debts { background: color-mix(in srgb, var(--yellow) 30%, white); }

.ledger, .import, .history { list-style: none; margin: 0; padding: 0; }
.ledger li, .import li {
    display: grid; align-items: center; gap: 12px; min-height: 52px; border-top: 1px solid var(--line);
}
.ledger li { grid-template-columns: 64px minmax(0, 1fr) auto auto; }
.import li { grid-template-columns: minmax(0, 1fr) auto auto; }
.day { color: var(--body); font-size: 0.875rem; font-variant-numeric: tabular-nums; }
.what { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.amt { font-weight: 700; text-align: right; white-space: nowrap; }
.raw { font-size: 0.875rem; font-weight: 500; letter-spacing: 0.01em; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status { font-size: 0.8125rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.s-paid { background: var(--lime-pale); color: #054d28; }
.s-due { background: color-mix(in srgb, var(--yellow) 30%, white); color: #4a3b1c; }
.s-planned { background: var(--sage); color: var(--ink); }

.agree { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 18px; }
.agree dt { color: var(--body); font-size: 0.875rem; }
.agree dd { margin: 2px 0 0; font-weight: 800; font-size: 1.125rem; letter-spacing: -0.01em; }
.track { height: 10px; border-radius: 999px; background: var(--sage); overflow: hidden; }
.track span { display: block; height: 100%; background: var(--lime); border-radius: 999px; }
.history { margin-top: 18px; }
.history li { display: flex; gap: 14px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 0.9375rem; }
.history .day { width: 48px; flex: none; }

/* ─── Pricing: the calculator does the sum ─── */
.pricing {
    max-width: var(--wrap);
    margin: 0 auto;
    padding: clamp(96px, 13vw, 180px) var(--gutter) 0;
    display: grid;
    grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
    gap: clamp(32px, 5vw, 72px);
    align-items: center;
}

.price-form { margin-top: 32px; display: grid; gap: 16px; justify-items: start; }

.seg { display: inline-flex; padding: 4px; border: 0; margin: 0; border-radius: 999px; background: var(--white); }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 18px; border-radius: 999px; font-weight: 600; }
.seg input:checked + span { background: var(--ink); color: var(--on-dark); }
.seg input:focus-visible + span { outline: 3px solid var(--ink); outline-offset: 2px; }

.stepper { display: inline-flex; align-items: center; gap: 12px; background: var(--white); border-radius: 999px; padding: 6px 6px 6px 22px; }
.stepper-label { font-weight: 600; margin-right: 8px; }
.step {
    width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--sage);
    font: 700 1.375rem/1 var(--font); color: var(--ink); cursor: pointer;
}
.step svg { display: block; margin: auto; fill: none; stroke: currentColor; stroke-width: 2.25; stroke-linecap: round; }
.step:hover { background: var(--lime); }
.step:disabled { opacity: 0.4; cursor: default; background: var(--sage); }
output { min-width: 28px; text-align: center; font-weight: 900; font-size: 1.375rem; }

.included { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 10px; }
.included li { position: relative; padding-left: 30px; font-weight: 500; }
.included li::before {
    content: ""; position: absolute; left: 0; top: 4px; width: 18px; height: 18px; border-radius: 50%; background: var(--lime);
}
.included li::after {
    content: ""; position: absolute; left: 6px; top: 8px; width: 4px; height: 8px;
    border: solid var(--ink); border-width: 0 2px 2px 0; transform: rotate(45deg);
}

.price-card {
    position: relative;
    background: var(--ink);
    color: var(--on-dark);
    border-radius: var(--radius);
    padding: 260px 32px 32px;
}
.price-card .calc { top: -40px; left: 50%; transform: translateX(-50%); width: 300px; height: 300px; }
.price-big { margin: 0; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.price-big #price { font-weight: 900; font-size: clamp(3.5rem, 7vw, 5.5rem); letter-spacing: -0.045em; line-height: 1; color: var(--lime); }
.per { font-weight: 600; font-size: 1.125rem; color: var(--on-dark-muted); }
.price-detail { margin: 12px 0 24px; color: var(--on-dark-muted); }

/* ─── FAQ ─── */
.faq { max-width: var(--wrap); margin: 0 auto; padding: clamp(96px, 12vw, 160px) var(--gutter) 0; }
.faq dl { margin: 40px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.faq dl { column-gap: clamp(32px, 5vw, 72px); row-gap: 0; }
.faq dl > div { padding: 24px 0 28px; border-top: 2px solid var(--ink); }
.faq dt { font-weight: 800; font-size: 1.1875rem; letter-spacing: -0.015em; }
.faq dd { margin: 10px 0 0; color: var(--body); }

/* ─── Close ─── */
.close {
    margin-top: clamp(96px, 12vw, 160px);
    background: var(--ink);
    color: var(--on-dark);
    padding: clamp(56px, 8vw, 104px) var(--gutter) 40px;
}
.close > * { max-width: var(--wrap); margin-left: auto; margin-right: auto; }
.close-name { margin-top: 0; margin-bottom: 0; font-weight: 900; font-size: clamp(2.25rem, 10.5vw, 10.5rem); line-height: 0.9; letter-spacing: -0.055em; color: var(--lime); }
.close-row { display: flex; align-items: center; gap: 24px; margin-top: 36px; flex-wrap: wrap; }
.close-link { font-weight: 600; }
.close-note { margin-top: 64px; color: var(--on-dark-muted); font-size: 0.875rem; }
.close-legal { margin-left: 16px; color: var(--on-dark); font-weight: 600; }

/* ─── Narrow screens ─── */
@media (max-width: 960px) {
    .feature, .pricing { grid-template-columns: minmax(0, 1fr); }
    .feature-flip .feature-copy { order: 0; }
    .hero-card { margin-top: 112px; }
    .hero-card .calc { top: -96px; right: 8px; width: 170px; height: 200px; }
    .hero-lead { padding-top: 112px; }
    .faq dl { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
    .bar-links a:not(.pill) { display: none; }
    .hero-stats { grid-template-columns: minmax(0, 1fr); }
    .hero-stats > div { border-left: 0; border-top: 1px solid rgba(241, 242, 238, 0.12); display: grid; grid-template-columns: 1fr auto; align-items: baseline; padding: 14px 24px; }
    .hero-stats > div:first-child { border-top: 0; }
    .hero-stats dd.note { grid-column: 1 / -1; }
    .hero-figure { font-size: clamp(2.5rem, 11vw, 3.5rem); }
    .sample { display: inline-block; margin: 8px 0 0; }
    .ledger li { grid-template-columns: 52px minmax(0, 1fr) auto; grid-template-rows: auto auto; padding: 10px 0; row-gap: 4px; }
    .ledger .what { white-space: normal; overflow: visible; }
    .ledger .day { grid-row: 1; }
    .ledger .amt { grid-row: 1; grid-column: 3; }
    .ledger .status { grid-row: 2; grid-column: 2; justify-self: start; }
    .m-target { display: inline; }
    .import li { grid-template-columns: minmax(0, 1fr) auto; }
    .import .tag { grid-column: 1; grid-row: 2; justify-self: start; margin-bottom: 10px; }
    .import .amt { grid-row: 1; grid-column: 2; }
    .buckets .num:last-child, .buckets th:last-child { display: none; }
    .agree { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stepper { padding-left: 16px; gap: 8px; }
    .stepper-label { font-size: 0.875rem; margin-right: 4px; }
    .price-card { padding-top: 220px; }
    .price-card .calc { width: 240px; height: 240px; }
}

/* One authored moment besides the calculator: as an interface panel scrolls in, its rows arrive one by one,
   the way data lands in the app. Content is visible by default; only the .js class hides it before arrival. */
.js .arrive > li,
.js .arrive tbody tr {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 420ms cubic-bezier(0.16, 1, 0.3, 1), transform 520ms cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: calc(var(--i, 0) * 90ms);
}

.js .arrive.in > li,
.js .arrive.in tbody tr {
    opacity: 1;
    transform: none;
}

.js .panel .split span {
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 900ms cubic-bezier(0.16, 1, 0.3, 1);
}

.js .panel.in .split span { transform: none; }

@media (max-width: 960px) {
    .feature-flip { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .pill { transition: none; }
    .js .arrive > li, .js .arrive tbody tr, .js .panel .split span { opacity: 1; transform: none; transition: none; }
}
