/* The hero image: a simplified ledger inside a plain phone outline, built in
   markup on the tokens so it re-skins with them. Layout and rhythm live here;
   every colour, face and radius comes from tokens.css. */

/* The outline runs off below the last row rather than framing an empty screen. */
.phone {
  box-sizing: border-box;
  width: min(100%, 21rem);
  margin-inline: auto;
  padding: 0.625rem 0.625rem 0;
  border: 2px solid var(--input);
  border-bottom: 0;
  border-radius: var(--hero-phone-radius) var(--hero-phone-radius) 0 0;
  background: var(--background);
  -webkit-mask-image: var(--hero-runoff);
  mask-image: var(--hero-runoff);
}

.phone-screen {
  position: relative;
  container-type: inline-size;
  padding: 3.25rem 0 4.5rem;
  border-radius: var(--hero-screen-radius) var(--hero-screen-radius) 0 0;
  border: 1px solid var(--border);
  border-bottom: 0;
  background: var(--background);
  overflow: hidden;
}

.phone-screen::before {
  content: "";
  position: absolute;
  top: 0.75rem;
  left: 50%;
  width: 5.5rem;
  height: 1.5rem;
  translate: -50% 0;
  border-radius: 999px;
  background: var(--muted);
}

.ledger {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0 clamp(1.25rem, 6cqi, 2rem);
  color: var(--foreground);
  font-family: var(--font-sans);
}

.ledger-label {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.ledger-figure {
  margin: 0.125rem 0 0;
  font-family: var(--font-heading);
  font-weight: 300;
  font-size: clamp(2.5rem, 15.5cqi, 5rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-variant-numeric: lining-nums tabular-nums;
  white-space: nowrap;
}

/* The allocation band: assets only, each segment its class hue, widths in
   proportion to the row values (--w carries the row's own figure). */
.band {
  display: flex;
  gap: 3px;
  height: 0.625rem;
  margin-top: clamp(1rem, 5cqi, 1.5rem);
}

.band > span {
  flex: var(--w) 1 0;
  min-width: 0;
  border-radius: 999px;
  background: var(--hue);
}

.rows {
  list-style: none;
  margin: clamp(0.75rem, 3.5cqi, 1.25rem) 0 0;
  padding: 0;
}

.row {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: clamp(0.5625rem, 2.8cqi, 0.875rem) 0;
  border-top: 1px solid var(--border);
}

.row:first-child {
  border-top: 0;
}

.swatch {
  flex: none;
  align-self: center;
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 999px;
  background: var(--hue);
}

.row-name {
  flex: 1;
  min-width: 0;
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: clamp(1.0625rem, 4.6cqi, 1.3125rem);
  line-height: 1.2;
}

.row-value {
  font-size: clamp(0.9375rem, 4cqi, 1.125rem);
  font-variant-numeric: tabular-nums;
}

/* Liabilities take no hue: a dashed outline, a minus, and a heavier rule above
   — the line a ledger draws before it subtracts. */
.row--subtracts {
  border-top: 1px solid var(--input);
  margin-top: 0.25rem;
  color: var(--muted-foreground);
}

.row--subtracts .swatch,
.swatch--hollow {
  background: none;
  border: 1px dashed var(--muted-foreground);
}

.ledger-note {
  margin: clamp(0.5rem, 2.5cqi, 0.875rem) 0 0;
  font-size: 0.6875rem;
  letter-spacing: 0.02em;
  color: var(--muted-foreground);
}

/* One settle on first paint, then still. Absent entirely under reduced motion. */
@media (prefers-reduced-motion: no-preference) {
  .ledger-figure {
    animation: settle 700ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }
  .band,
  .row,
  .ledger-note {
    animation: land 500ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
    animation-delay: calc(350ms + var(--i, 0) * 60ms);
  }
}

@keyframes settle {
  from {
    opacity: 0;
    transform: translateY(0.375rem);
    letter-spacing: 0.01em;
  }
}

@keyframes land {
  from {
    opacity: 0;
    transform: translateY(0.25rem);
  }
}
