/* MoneyHome page layer. ScrollCraft's engine remains a separate, byte-exact file. */
:root {
  --sc-canvas: var(--bg);
  --sc-surface: var(--surface);
  --sc-surface-2: var(--soft);
  --sc-ink: var(--ink);
  --sc-ink-soft: var(--muted);
  --sc-primary: var(--primary);
  --sc-accent: var(--primary);
  --sc-line: var(--line);
  --sc-font-family: Geist, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --sc-font-text: Geist, sans-serif;
  --sc-font-display: Geist, sans-serif;
  --sc-track-tight: 0;
  --sc-track-snug: 0;
  --sc-track-normal: 0;
  --sc-track-wide: 0;
  --sc-r-sm: var(--control);
  --sc-r-md: var(--frame);
  --sc-r-lg: var(--frame);
  --sc-accent-ink: var(--on-primary);
  --sc-t-xs: .8rem;
  --sc-t-sm: .9rem;
  --sc-t-base: 1rem;
  --sc-t-lg: 1.05rem;
  --sc-t-xl: 1.35rem;
  --sc-t-2xl: 1.9rem;
  --sc-t-3xl: 2.4rem;
  --sc-t-4xl: 4.5rem;
  --sc-leading-body: 1.5;
}

html,
body,
button,
input,
textarea,
select {
  letter-spacing: 0;
}

[data-sc-root] {
  font-family: var(--sc-font-family);
}

.sc-hero {
  overflow: clip;
}

.hero-proof-stage {
  overflow: hidden;
}

.hero-proof-image {
  transform-origin: 50% 45%;
  will-change: transform;
}

@keyframes mh-hero-proof {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(0, 1.25rem, 0) scale(1.025); }
}

@supports (animation-timeline: view()) and (animation-range: entry 0% cover 40%) {
  .hero-proof-image {
    animation: mh-hero-proof linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 38%;
  }
}

.product-walkthrough {
  overflow: visible;
}

.ledger-stage,
.budget-stage {
  position: relative;
  overflow: hidden;
  background: #151a1c;
}

.ledger-stage > img,
.budget-shot img {
  display: block;
  width: 100%;
  height: auto;
}

.ledger-search {
  position: absolute;
  inset: 0;
  z-index: 1;
  clip-path: inset(0 0 0 0);
}

.mh-enhanced .ledger-search {
  clip-path: inset(0 0 calc(100% * (1 - var(--mh-ledger-clip, 0))) 0);
}

.budget-visual {
  overflow: visible;
}

[data-sc-root="moneyhome"]:not(.mh-enhanced) .budget-visual[data-sc-act="pin"],
.mh-flow .budget-visual[data-sc-act="pin"],
.mh-flow .budget-visual[data-sc-act="flow"] {
  position: static !important;
  height: auto !important;
  min-height: 0 !important;
}

.budget-stage {
  overflow: hidden;
}

.budget-shot {
  display: block;
}

.budget-shot + .budget-shot {
  margin-top: 18px;
}

.budget-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.month-button {
  min-height: 44px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: var(--control);
  background: transparent;
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
}

.month-button[aria-pressed="true"] {
  border-color: var(--primary);
  background: var(--soft-strong);
  color: var(--ink);
}

.month-button:hover {
  background: var(--soft);
}

.budget-readout {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: .86rem;
  font-variant-numeric: tabular-nums;
}

.budget-values {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: baseline;
  width: 100%;
}

.budget-values strong {
  color: var(--ink);
  font-weight: 600;
}

.budget-values b {
  color: var(--ink);
  font-weight: 600;
}

.budget-negative b,
.budget-negative {
  color: var(--expense);
}

.budget-positive b,
.budget-positive {
  color: var(--primary);
}

.mh-enhanced .budget-shot,
.mh-enhanced .budget-values {
  display: none;
}

.mh-enhanced .budget-shot[data-month="june"],
.mh-enhanced .budget-values[data-month="june"] {
  display: block;
}

.mh-enhanced .budget-values[data-month="june"] {
  display: flex;
}

.mh-enhanced .budget-shot[data-month="july"],
.mh-enhanced .budget-values[data-month="july"] {
  display: none;
}

.mh-enhanced[data-mh-month="july"] .budget-shot[data-month="june"],
.mh-enhanced[data-mh-month="july"] .budget-values[data-month="june"] {
  display: none;
}

.mh-enhanced[data-mh-month="july"] .budget-shot[data-month="july"] {
  display: block;
}

.mh-enhanced[data-mh-month="july"] .budget-values[data-month="july"] {
  display: flex;
}

.device-band {
  overflow: clip;
}

.device-heading {
  max-width: 700px;
}

.device-heading .section-intro {
  margin-bottom: 0;
}

.device-stage {
  position: relative;
  display: flex;
  gap: 28px;
  align-items: end;
  max-width: 1000px;
  min-height: 450px;
  margin: 38px auto 0;
}

.device-desktop {
  flex: 1 1 auto;
  min-width: 0;
}

.device-phone {
  flex: 0 0 180px;
}

.device-stage figure {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--frame);
  background: #151a1c;
}

.device-stage img {
  display: block;
  width: 100%;
  height: auto;
}

.device-desktop,
.device-phone {
  transition: transform .4s ease, opacity .4s ease;
}

.mh-enhanced .device-desktop {
  transform: translateY(0);
}

.mh-enhanced .device-phone {
  transform: translateY(0);
}

@media (max-width: 820px), (prefers-reduced-motion: reduce), (max-height: 640px) and (min-width: 821px) {
  .hero-proof-image {
    transform: none;
    animation: none !important;
  }

  .budget-visual,
  .budget-visual[data-sc-act="pin"],
  .budget-visual[data-sc-act="flow"] {
    position: static !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  .budget-stage {
    height: auto !important;
  }

  .mh-enhanced .budget-shot,
  .mh-enhanced .budget-shot[data-month="june"],
  .mh-enhanced .budget-shot[data-month="july"],
  .mh-enhanced .budget-values,
  .mh-enhanced .budget-values[data-month="june"],
  .mh-enhanced .budget-values[data-month="july"] {
    display: block;
  }

  .mh-enhanced .budget-values[data-month="june"],
  .mh-enhanced .budget-values[data-month="july"] {
    display: flex;
  }

  .ledger-search,
  .mh-enhanced .ledger-search {
    clip-path: none;
  }

  .device-heading {
    display: block;
  }

  .device-stage {
    gap: 14px;
    min-height: 0;
  }

  .device-phone {
    flex-basis: 116px;
  }

  .device-desktop,
  .device-phone {
    transform: none !important;
    opacity: 1 !important;
    animation: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mh-enhanced .ledger-search,
  .ledger-search {
    clip-path: none;
  }

  .mh-enhanced .budget-shot,
  .mh-enhanced .budget-shot[data-month="june"],
  .mh-enhanced .budget-shot[data-month="july"] {
    display: block;
  }

  .mh-enhanced .budget-values,
  .mh-enhanced .budget-values[data-month="june"],
  .mh-enhanced .budget-values[data-month="july"] {
    display: flex;
  }
}

html { scroll-padding-top: 80px; }
figure { margin: 0; }
.budget-walk { padding: 0; border: 0; }
.budget-pin-layout {
  display: grid;
  grid-template-columns: minmax(0, .7fr) minmax(0, 1.3fr);
  gap: 44px;
  align-items: center;
  background: var(--bg);
}
.budget-pin-layout > .proof-copy, .budget-visual { min-width: 0; }
.budget-pin-layout .budget-stage { position: relative; height: auto; }
.mh-enhanced .budget-pin-layout { padding-top: 80px; padding-bottom: 24px; }
.budget-controls, .budget-readout { padding-inline: 0; background: var(--bg); }
.month-button:active { transform: translateY(1px); }
.budget-visual .screen-label {
  color: var(--muted);
  background: transparent;
  padding-inline: 0;
  border-top-color: var(--line);
}
.mh-flow .budget-walk { height: auto !important; }
.mh-flow .budget-pin-layout { position: static; height: auto; overflow: visible; }
.mh-flow .budget-shot, .mh-flow .budget-shot[data-month="july"] { display: block; }
.mh-flow .budget-values, .mh-flow .budget-values[data-month="july"] { display: flex; }
.mh-flow .budget-controls { display: none; }
.budget-controls { display: none; }
.mh-enhanced .budget-controls { display: flex; }
.month-track { height: 2px; background: var(--line); overflow: clip; }
.month-track span { display: block; height: 100%; background: var(--primary); transform-origin: left; transform: scaleX(var(--mh-month-progress, 0)); }
.mh-flow .month-track { display: none; }
.mh-static [data-sc-in] { opacity: 1; transform: none; }
[data-sc-root="moneyhome"]:not(.mh-enhanced) [data-sc-in] { opacity: 1; transform: none; }
.device-desktop { --mh-device-shift: -24px; }
.device-phone { --mh-device-shift: 32px; transition-delay: 70ms; }
.mh-enhanced .device-stage [data-sc-in]:not(.sc-in) {
  opacity: .72;
  transform: translate3d(var(--mh-device-shift), 20px, 0);
}
@media (max-width: 820px), (max-height: 640px), (prefers-reduced-motion: reduce) {
  .budget-walk { height: auto !important; }
  .budget-pin-layout, .budget-pin-layout.sc-stage {
    display: block;
    position: static;
    height: auto;
    padding: 0;
    overflow: visible;
  }
  .budget-visual { margin-top: 24px; }
  .budget-controls, .mh-enhanced .budget-controls { display: none; }
  .month-track { display: none; }
  .device-stage [data-sc-in] { opacity: 1 !important; transform: none !important; }
}
@keyframes mh-ledger-reveal {
  from { clip-path: inset(0 0 100% 0); }
  to { clip-path: inset(0); }
}
@media (prefers-reduced-motion: no-preference) and (min-width: 821px) and (min-height: 641px) {
  @supports ((animation-timeline: view()) and (animation-range: entry 0% cover 100%)) {
    .mh-enhanced .ledger-search {
      animation: mh-ledger-reveal linear both;
      animation-timeline: view();
      animation-range: entry 15% cover 55%;
    }
  }
}
@media (max-width: 620px) {
  .device-stage { display: block; }
  .device-phone { width: 160px; margin: 24px auto 0; }
}

@media (max-width: 620px) {
  .device-stage {
    gap: 10px;
  }

  .device-phone {
    flex-basis: 88px;
  }

  .budget-values {
    gap: 7px 12px;
  }
}
