/* Colors: tokens in the <style> of index.html. The rest is copied from lucka/src/app/globals.css. */
:root {
  --font-sans: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  --text-2xs: 0.6875rem;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-md: 1rem;
  --text-lg: 1.25rem;
  --text-xl: 1.75rem;
  --tracking-tight: -0.02em;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 999px;
  --line-soft: 1px solid var(--color-border);

  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 200ms;
  --duration: 320ms;
  --duration-slow: 640ms;
  --stagger: 90ms;

  --gutter: clamp(1rem, 4vw, 3rem);
  --max: 76rem;
}

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

html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
}

body {
  position: relative;
  overflow-x: clip;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--text-md);
  line-height: 1.55;
  font-variant-numeric: lining-nums tabular-nums;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

::selection {
  background: var(--color-primary-soft);
}

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

main,
.foot {
  max-width: var(--max);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

/* Background: lilac and mint blobs drifting very slowly. */
.blobs {
  position: absolute;
  inset: 0 0 auto;
  height: 120vh;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  width: 46vmax;
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  animation: drift 22s var(--ease) infinite alternate;
}

.blob-a {
  top: -18vmax;
  right: -10vmax;
  background: var(--color-primary-soft);
}

.blob-b {
  top: 20vh;
  left: -20vmax;
  background: var(--color-mint-soft);
  animation-duration: 28s;
  animation-direction: alternate-reverse;
}

.blob-c {
  top: 50vh;
  right: 10vw;
  width: 26vmax;
  background: color-mix(in srgb, var(--color-primary) 22%, transparent);
  animation-duration: 18s;
}

@keyframes drift {
  to {
    transform: translate(6vmax, 4vmax) scale(1.12);
  }
}

/* Brand */
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
  text-decoration: none;
}

/* Same drawing as the app icon (lucka/src-tauri/icons/source.svg), painted with the tokens. */
.mark {
  display: block;
  flex: none;
  width: 36px;
  height: 36px;
  transition: transform var(--duration) var(--ease-out);
}

.mark-tile {
  fill: var(--color-primary);
}

.mark-back {
  fill: var(--color-mint);
}

.mark-back-rim {
  fill: none;
  stroke: var(--color-positive);
  stroke-opacity: 0.35;
}

/* The tile-colored stroke opens the gap between the coins. */
.mark-front {
  fill: var(--color-surface);
  stroke: var(--color-primary);
}

.mark-front-rim {
  fill: none;
  stroke: var(--color-primary);
  stroke-opacity: 0.22;
}

.wordmark:hover .mark {
  transform: rotate(-8deg) scale(1.06);
}

/* Top bar */
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* Full-width background; the content lines up with main. */
  padding: var(--space-4) max(var(--gutter), (100% - var(--max)) / 2 + var(--gutter));
  background: color-mix(in srgb, var(--color-bg) 72%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.top-nav {
  display: flex;
  align-items: center;
  gap: var(--space-5);
}

.top-link {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease);
}

.top-link:hover {
  color: var(--color-text);
}

.pill {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-primary-hover);
  background: var(--color-primary-soft);
  border-radius: var(--radius-full);
  text-decoration: none;
  transition:
    color var(--duration-fast) var(--ease),
    background var(--duration-fast) var(--ease);
}

.pill:hover {
  color: var(--color-text-inverse);
  background: var(--color-primary);
}

/* Language switch: two short pills, the current one filled. */
.lang {
  display: inline-flex;
  padding: 3px;
  background: var(--color-surface);
  border: var(--line-soft);
  border-radius: var(--radius-full);
}

.lang-option {
  min-width: 34px;
  padding: var(--space-1) var(--space-2);
  font: inherit;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  background: transparent;
  border: 0;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition:
    color var(--duration-fast) var(--ease),
    background var(--duration-fast) var(--ease);
}

.lang-option:hover {
  color: var(--color-text);
}

.lang-option[aria-pressed="true"] {
  color: var(--color-text-inverse);
  background: var(--color-ink);
}

/* Set by the head script until i18n.js has translated the page. */
.i18n-wait body {
  visibility: hidden;
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: var(--space-12);
  padding-block: clamp(2rem, 7vw, 5rem) clamp(4rem, 9vw, 7rem);
}

@media (min-width: 1000px) {
  .hero {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  }
}

.badge {
  display: inline-flex;
  text-decoration: none;
  align-items: center;
  gap: var(--space-2);
  margin: 0 0 var(--space-6);
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-positive);
  background: var(--color-surface);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
}

.pulse {
  position: relative;
  width: 8px;
  height: 8px;
  background: var(--color-mint);
  border-radius: var(--radius-full);
}

.pulse::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--color-mint);
  animation: ping 1.8s var(--ease-out) infinite;
}

@keyframes ping {
  to {
    opacity: 0;
    transform: scale(3);
  }
}

h1 {
  margin: 0;
  font-size: clamp(2.6rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.035em;
}

h1 > span {
  display: block;
}

/* Mint underline painted after the sentence comes in. */
h1 mark {
  color: var(--color-primary);
  background: linear-gradient(var(--color-mint-soft), var(--color-mint-soft))
    left 88% / 0% 38% no-repeat;
  animation: marker 900ms calc(var(--i) * var(--stagger) + 700ms)
    var(--ease-out) forwards;
}

@keyframes marker {
  to {
    background-size: 100% 38%;
  }
}

.lead {
  max-width: 34rem;
  margin: var(--space-6) 0 0;
  font-size: 1.125rem;
  color: var(--color-text-muted);
}

.download {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-4);
  margin-top: var(--space-10);
}

.button {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 56px;
  padding: 0 var(--space-8);
  overflow: hidden;
  font-weight: 600;
  color: var(--color-text-inverse);
  text-decoration: none;
  background: var(--color-primary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  transition:
    background var(--duration-fast) var(--ease),
    transform var(--duration-fast) var(--ease),
    box-shadow var(--duration-fast) var(--ease);
}

.button svg {
  width: 20px;
  height: 20px;
  stroke-width: 2.2;
}

/* A shine that crosses the button every so often. */
.button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    110deg,
    transparent 35%,
    color-mix(in srgb, var(--color-surface) 35%, transparent) 50%,
    transparent 65%
  );
  transform: translateX(-100%);
  animation: shine 4.5s 2s var(--ease) infinite;
}

@keyframes shine {
  30%,
  100% {
    transform: translateX(100%);
  }
}

.button:hover {
  background: var(--color-primary-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.button:hover svg {
  animation: nudge 700ms var(--ease) infinite alternate;
}

@keyframes nudge {
  to {
    transform: translateY(3px);
  }
}

.button:active {
  transform: scale(0.98);
}

.alt {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-underline-offset: 3px;
}

.alt:hover {
  color: var(--color-primary);
}

.note {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.note-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  margin-top: var(--space-8);
}

/* Staggered hero entrance. */
.rise {
  animation: rise 900ms calc(var(--i, 0) * var(--stagger) + 100ms)
    var(--ease-out) both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(24px);
    filter: blur(6px);
  }
}

/* Dashboard mock */
.stage {
  position: relative;
  perspective: 1400px;
}

.app {
  --rx: 0deg;
  --ry: 0deg;
  overflow: hidden;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transform-style: preserve-3d;
  transition: transform 500ms var(--ease-out);
  animation: float 7s var(--ease) infinite alternate;
}

@keyframes float {
  to {
    translate: 0 -10px;
  }
}

.app-bar {
  display: flex;
  gap: 6px;
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  border-bottom: var(--line-soft);
}

.app-bar i {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background: var(--color-danger);
}

.app-bar i:nth-child(2) {
  background: var(--color-warning);
}

.app-bar i:nth-child(3) {
  background: var(--color-mint);
}

.app-body {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
}

.app-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) 0;
  background: var(--color-surface);
  border-right: var(--line-soft);
}

.mark-sm {
  width: 28px;
  height: 28px;
  margin-bottom: var(--space-4);
}

.side-link {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--color-text-muted);
  border-radius: var(--radius-sm);
}

.side-link svg {
  width: 16px;
  height: 16px;
}

.side-link.is-active {
  color: var(--color-primary);
  background: var(--color-primary-soft);
}

.app-main {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-5);
}

.app-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-title {
  margin: 0;
  font-size: var(--text-md);
  font-weight: 700;
}

.app-cycle {
  margin: 0;
  font-size: var(--text-2xs);
  color: var(--color-text-muted);
}

.app-cycle strong {
  color: var(--color-positive);
}

.app-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-2xs);
  font-weight: 600;
  color: var(--color-text-inverse);
  background: var(--color-primary);
  border-radius: 8px;
}

.app-btn svg {
  width: 12px;
  height: 12px;
  stroke-width: 2.4;
}

.app-btn.is-tap {
  animation: tap 400ms var(--ease-out);
}

@keyframes tap {
  50% {
    transform: scale(0.9);
    box-shadow: 0 0 0 6px var(--color-primary-soft);
  }
}

.app-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-3);
}

.app-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.w {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  animation: rise var(--duration-slow) var(--ease-out) both;
}

.w-ring {
  animation-delay: 500ms;
}

.w-fixed {
  animation-delay: 600ms;
}

.w-budget {
  animation-delay: 700ms;
}

.w-title {
  margin: 0;
  font-size: var(--text-xs);
  font-weight: 700;
}

/* Ring: same strokes as ring.tsx. Default lengths = 30% and 34.6% of 578. */
.ring {
  position: relative;
  container-type: inline-size;
  width: min(100%, 190px);
  aspect-ratio: 1;
  margin: 0 auto;
}

.ring svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.ring-track,
.ring-spent,
.ring-committed {
  stroke-width: 16;
  stroke-linecap: round;
  transition:
    stroke-dasharray 900ms var(--ease-out),
    stroke-dashoffset 900ms var(--ease-out);
}

.ring-track {
  stroke: var(--color-track);
}

.ring-spent {
  stroke: var(--color-primary);
  stroke-dasharray: 173 578;
  animation: draw 1.4s 700ms var(--ease-out) both;
}

.ring-committed {
  stroke: var(--color-mint);
  stroke-dasharray: 200 578;
  stroke-dashoffset: -173;
  animation: draw 1.4s 950ms var(--ease-out) both;
}

@keyframes draw {
  from {
    stroke-dasharray: 0 999;
  }
}

.ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.ring-center p {
  margin: 0;
}

.ring-label,
.ring-sub {
  font-size: clamp(0.55rem, 6cqi, 0.75rem);
  color: var(--color-text-muted);
}

.ring-amount {
  font-size: clamp(1rem, 12cqi, 1.6rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: var(--tracking-tight);
}

.ring-amount.is-bump {
  animation: bump 500ms var(--ease-out);
}

@keyframes bump {
  40% {
    color: var(--color-primary);
    transform: scale(1.06);
  }
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
  margin: 0;
  padding: var(--space-3);
  background: var(--color-field);
  border-radius: var(--radius-sm);
  text-align: center;
}

.stats dt {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  font-size: 0.625rem;
  color: var(--color-text-muted);
}

.stats dd {
  margin: 0;
  font-size: var(--text-xs);
  font-weight: 700;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
}

.dot-spent {
  background: var(--color-primary);
}

.dot-committed {
  background: var(--color-mint);
}

/* Fixed expenses: the first two check themselves on load. */
.fixed {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.fixed li {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-2xs);
}

.fixed b {
  font-weight: 600;
}

.check {
  position: relative;
  display: block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-full);
}

.check::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 0;
  width: 3px;
  height: 6px;
  border: solid var(--color-text-inverse);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
}

.fixed li:nth-child(-n + 2) .check,
.bill .check {
  animation: paid 400ms calc(1.4s + var(--i) * 450ms) var(--ease-out) forwards;
}

.fixed li:nth-child(-n + 2) .check::after,
.bill .check::after {
  animation: tick 300ms calc(1.5s + var(--i) * 450ms) var(--ease-out) forwards;
}

.fixed li:nth-child(-n + 2) span,
.fixed li:nth-child(-n + 2) b {
  animation: done 400ms calc(1.4s + var(--i) * 450ms) var(--ease) forwards;
}

@keyframes paid {
  to {
    background: var(--color-mint);
    border-color: var(--color-mint);
  }
}

@keyframes tick {
  to {
    transform: rotate(45deg) scale(1);
  }
}

@keyframes done {
  to {
    color: var(--color-text-muted);
  }
}

.fixed li:nth-child(-n + 2) b {
  text-decoration: line-through transparent;
  animation-name: done, strike;
}

@keyframes strike {
  to {
    text-decoration-color: var(--color-text-muted);
  }
}

/* Category bars */
.bar-row {
  display: grid;
  grid-template-columns: 1fr auto;
  row-gap: 4px;
  font-size: var(--text-2xs);
}

.bar-row small {
  color: var(--color-text-muted);
}

.bar {
  grid-column: 1 / -1;
  display: block;
  height: 6px;
  overflow: hidden;
  background: var(--color-track);
  border-radius: var(--radius-full);
}

.bar b {
  display: block;
  width: var(--v);
  height: 100%;
  background: var(--color-primary);
  border-radius: inherit;
  transform-origin: left;
  animation: grow 1.1s 900ms var(--ease-out) both;
}

.bar b.mint {
  background: var(--color-mint);
}

.bar b.warn {
  background: var(--color-warning);
}

@keyframes grow {
  from {
    transform: scaleX(0);
  }
}

/* Floating toast: fakes a freshly recorded expense. */
.toast {
  position: absolute;
  left: clamp(-1.5rem, -3vw, 0rem);
  bottom: -1.5rem;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(16px) scale(0.96);
  transition:
    opacity var(--duration) var(--ease-out),
    transform var(--duration-slow) var(--ease-out);
}

.toast.is-on {
  opacity: 1;
  transform: none;
}

.toast-avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-primary-hover);
  background: var(--color-primary-soft);
  border-radius: var(--radius-full);
}

.toast[data-income] .toast-avatar {
  color: var(--color-positive);
  background: var(--color-mint-soft);
}

.toast-text {
  display: flex;
  flex-direction: column;
  font-size: var(--text-sm);
  line-height: 1.25;
}

.toast-text small {
  font-size: var(--text-2xs);
  color: var(--color-text-muted);
}

.toast-amount {
  margin-left: var(--space-4);
  font-size: var(--text-sm);
  font-weight: 700;
}

.toast[data-income] .toast-amount {
  color: var(--color-positive);
}

/* Sections */
.section {
  padding-block: clamp(3rem, 8vw, 6rem);
}

.section-head {
  max-width: 44rem;
  margin-bottom: var(--space-10);
}

.eyebrow {
  margin: 0 0 var(--space-3);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-primary);
}

h2 {
  margin: 0;
  font-size: clamp(2rem, 4.4vw, 3rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.muted {
  color: var(--color-text-muted);
}

h3 {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
}

/* Reveal on scroll (main.js adds .is-in). */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(32px);
  transition:
    opacity 800ms var(--ease-out),
    transform 900ms var(--ease-out);
  transition-delay: calc(var(--i, 0) * 120ms);
}

.js [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

/* Inner animations wait for the card to come in. */
.js [data-reveal]:not(.is-in) * {
  animation-play-state: paused !important;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(18rem, 100%), 1fr));
  gap: var(--space-6);
}

.card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-6);
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.cards .card {
  transition:
    opacity 800ms var(--ease-out) calc(var(--i, 0) * 120ms),
    transform 900ms var(--ease-out) calc(var(--i, 0) * 120ms),
    box-shadow var(--duration) var(--ease);
}

.cards .card.is-in:hover,
html:not(.js) .cards .card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
  transition-delay: 0s;
}

.card p {
  margin: 0;
  color: var(--color-text-muted);
}

.card-art {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 150px;
  margin-bottom: var(--space-3);
  background: var(--color-field);
  border-radius: var(--radius-md);
}

/* Formula: each piece comes in order. */
.formula {
  flex-wrap: wrap;
  align-content: center;
  gap: var(--space-2);
  padding: var(--space-4);
}

.formula > * {
  animation: pop 500ms var(--ease-out) both;
}

.formula > :nth-child(2) {
  animation-delay: 150ms;
}
.formula > :nth-child(3) {
  animation-delay: 300ms;
}
.formula > :nth-child(4) {
  animation-delay: 450ms;
}
.formula > :nth-child(5) {
  animation-delay: 600ms;
}
.formula > :nth-child(6) {
  animation-delay: 750ms;
}
.formula > :nth-child(7) {
  animation-delay: 1000ms;
}

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.9);
  }
}

.chip {
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 600;
  background: var(--color-surface);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
}

.chip-primary {
  color: var(--color-primary-hover);
  background: var(--color-primary-soft);
}

.chip-mint {
  color: var(--color-positive);
  background: var(--color-mint-soft);
}

.chip-ink {
  color: var(--color-text-inverse);
  background: var(--color-primary);
}

.op {
  font-weight: 700;
  color: var(--color-text-muted);
}

/* Fixed expenses that get checked */
.bills {
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-6);
}

.bill {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  font-weight: 500;
  background: var(--color-surface);
  border-radius: var(--radius-sm);
  animation: pop 500ms calc(var(--i) * 150ms) var(--ease-out) both;
}

.bill .check {
  width: 18px;
  height: 18px;
  flex: none;
}

.bill .check::after {
  left: 4px;
  top: 1px;
  width: 4px;
  height: 8px;
}

.bill-bar {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-1);
}

.bill-bar .bar {
  grid-column: auto;
}

/* Vault: a lock with ripples. */
.vault {
  position: relative;
  flex-direction: column;
  gap: var(--space-3);
  overflow: hidden;
}

.vault-core {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  color: var(--color-text-inverse);
  background: var(--color-primary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  animation: breathe 3s var(--ease) infinite alternate;
}

.vault-core svg {
  width: 26px;
  height: 26px;
  stroke-width: 2;
}

.vault-ring {
  position: absolute;
  top: calc(50% - 16px);
  left: 50%;
  width: 56px;
  height: 56px;
  margin: -28px 0 0 -28px;
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-md);
  opacity: 0;
  animation: wave 3s var(--ease-out) infinite;
}

.vault-ring-2 {
  animation-delay: 1.5s;
}

@keyframes wave {
  from {
    opacity: 0.5;
    transform: scale(1);
  }

  to {
    opacity: 0;
    transform: scale(3);
  }
}

@keyframes breathe {
  to {
    transform: scale(1.06);
  }
}

.vault-file {
  position: relative;
  z-index: 1;
  padding: 2px var(--space-3);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-positive);
  background: var(--color-mint-soft);
  border-radius: var(--radius-full);
}

/* Widgets */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: var(--space-12);
}

@media (min-width: 900px) {
  .split {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  margin-top: var(--space-8);
  padding: 0 var(--space-5);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-primary-hover);
  background: var(--color-primary-soft);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition:
    color var(--duration-fast) var(--ease),
    background var(--duration-fast) var(--ease),
    transform var(--duration-fast) var(--ease);
}

.toggle svg {
  width: 18px;
  height: 18px;
}

.toggle:hover {
  color: var(--color-text-inverse);
  background: var(--color-primary);
}

.toggle:active {
  transform: scale(0.98);
}

.board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  padding: var(--space-6);
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 140px;
  padding: var(--space-4);
  font-size: var(--text-sm);
  background: var(--color-field);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  transition:
    border-color var(--duration-fast) var(--ease),
    background var(--duration-fast) var(--ease);
}

/* Customize mode: same as widget.module.css. */
.board[data-editing] .tile {
  border-color: var(--color-border);
  border-style: dashed;
  background: var(--color-surface);
  animation: wiggle 2.4s var(--ease) infinite;
}

.board[data-editing] .tile:nth-child(2n) {
  animation-delay: -1.2s;
}

.board .tile.is-moving {
  z-index: 1;
  border-color: var(--color-primary);
  border-style: solid;
  box-shadow: var(--shadow-md);
  animation: none;
}

@keyframes wiggle {
  0%,
  100% {
    rotate: 0deg;
  }

  25% {
    rotate: -0.8deg;
  }

  75% {
    rotate: 0.8deg;
  }
}

.tile-grip {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  width: 14px;
  height: 14px;
  background: radial-gradient(
      circle,
      var(--color-text-muted) 1.5px,
      transparent 2px
    )
    0 0 / 7px 7px;
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease);
}

.board[data-editing] .tile-grip {
  opacity: 0.7;
}

.tile-donut {
  width: 52px;
  height: 52px;
  stroke-width: 6;
  transform: rotate(-90deg);
}

.tile-donut circle {
  stroke: var(--color-track);
}

.tile-donut .tile-donut-fill {
  stroke: var(--color-primary);
  stroke-dasharray: 70 107;
  animation: draw 1.4s 300ms var(--ease-out) both;
}

.tile-lines {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tile-lines i {
  height: 8px;
  background: var(--color-track);
  border-radius: var(--radius-full);
}

.tile-lines i:nth-child(1) {
  width: 90%;
  background: var(--color-mint-soft);
}

.tile-lines i:nth-child(2) {
  width: 70%;
}

.tile-lines i:nth-child(3) {
  width: 80%;
}

.tile-bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 52px;
}

.tile-bars i {
  width: 14px;
  height: var(--v);
  background: var(--color-primary);
  border-radius: 4px;
  transform-origin: bottom;
  animation: rise-bar 900ms var(--ease-out) both;
}

.tile-bars i:nth-child(2) {
  background: var(--color-mint);
  animation-delay: 120ms;
}

.tile-bars i:nth-child(3) {
  background: var(--color-primary-soft);
  animation-delay: 240ms;
}

@keyframes rise-bar {
  from {
    transform: scaleY(0);
  }
}

.tile-avatars {
  display: flex;
}

.tile-avatars i {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-right: -8px;
  font-size: var(--text-xs);
  font-style: normal;
  font-weight: 700;
  color: var(--color-primary-hover);
  background: var(--color-primary-soft);
  border: 2px solid var(--color-surface);
  border-radius: var(--radius-full);
}

.tile-avatars i:nth-child(2) {
  color: var(--color-positive);
  background: var(--color-mint-soft);
}

.tile-avatars i:nth-child(3) {
  color: var(--color-warning);
  background: var(--color-warning-soft);
}

/* Voice demo: main.js moves the data-* of .screen over time. */
.demo {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-8);
}

@media (min-width: 960px) {
  .demo {
    grid-template-columns: minmax(0, 18rem) minmax(0, 1fr);
    align-items: center;
    gap: var(--space-12);
  }
}

.chapters {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.chapter {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  column-gap: var(--space-3);
  row-gap: var(--space-1);
  padding: var(--space-4);
  font: inherit;
  text-align: left;
  color: var(--color-text-muted);
  background: none;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition:
    background var(--duration) var(--ease),
    box-shadow var(--duration) var(--ease);
}

.chapter:hover {
  background: color-mix(in srgb, var(--color-surface) 60%, transparent);
}

.chapter[aria-current] {
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.chapter-bar {
  grid-column: 1 / -1;
  display: block;
  height: 3px;
  margin-bottom: var(--space-2);
  overflow: hidden;
  background: var(--color-track);
  border-radius: var(--radius-full);
}

.chapter-bar b {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--color-primary);
  transform: scaleX(var(--p, 0));
  transform-origin: left;
}

.chapter-n {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  font-size: var(--text-xs);
  font-weight: 700;
  background: var(--color-track);
  border-radius: var(--radius-full);
  transition:
    color var(--duration) var(--ease),
    background var(--duration) var(--ease);
}

.chapter[aria-current] .chapter-n {
  color: var(--color-text-inverse);
  background: var(--color-primary);
}

.chapter strong {
  color: var(--color-text);
}

.chapter small {
  grid-column: 2;
  font-size: var(--text-sm);
  line-height: 1.45;
}

.demo-stage {
  position: relative;
}

.demo-play {
  position: absolute;
  top: 5px;
  right: var(--space-3);
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  color: var(--color-text-muted);
  background: var(--color-field);
  border: var(--line-soft);
  border-radius: var(--radius-full);
  cursor: pointer;
}

.demo-play[hidden],
html:not(.js) .cursor {
  display: none;
}

.demo-play:hover {
  color: var(--color-primary);
}

.demo-play svg {
  width: 13px;
  height: 13px;
  stroke-width: 2.4;
}

.demo-play .i-play {
  fill: currentColor;
  stroke-width: 1.6;
}

.demo-play[aria-pressed="false"] .i-pause,
.demo-play[aria-pressed="true"] .i-play {
  display: none;
}

.screen {
  position: relative;
  overflow: hidden;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

/* A free lane at the bottom for the subtitle and the microphone. */
.screen-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-5) 6.5rem;
  transition: opacity 400ms var(--ease);
}

.screen[data-fade] .screen-body,
.screen[data-fade] .cursor {
  opacity: 0;
}

/* Fixed expenses */
.v-fixed,
.recent {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}

.v-fixed {
  gap: var(--space-2);
}

.v-fixed li {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-2xs);
}

.v-fixed b {
  font-weight: 600;
  text-decoration: line-through transparent;
}

.v-fixed .check,
.v-fixed span,
.v-fixed b {
  transition:
    background var(--duration) var(--ease-out),
    border-color var(--duration) var(--ease-out),
    color var(--duration) var(--ease),
    text-decoration-color var(--duration) var(--ease);
}

.v-fixed .check::after {
  transition: transform var(--duration) 120ms var(--ease-out);
}

.v-fixed .is-paid .check {
  background: var(--color-mint);
  border-color: var(--color-mint);
}

.v-fixed .is-paid .check::after {
  transform: rotate(45deg) scale(1);
}

.v-fixed .is-paid span,
.v-fixed .is-paid b {
  color: var(--color-text-muted);
  text-decoration-color: var(--color-text-muted);
}

/* Recent: fixed height so the mock doesn't resize when rows are added. */
.recent {
  height: 7rem;
  overflow: hidden;
}

.recent li {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: var(--space-2);
  max-height: 2rem;
  padding-block: 3px;
  font-size: var(--text-2xs);
  transition:
    max-height 500ms var(--ease-out),
    padding 500ms var(--ease-out),
    opacity 500ms var(--ease-out),
    transform 500ms var(--ease-out);
}

.recent .toast-avatar {
  width: 22px;
  height: 22px;
  font-size: 0.625rem;
}

.recent b {
  font-weight: 600;
}

.recent li[data-income] .toast-avatar {
  color: var(--color-positive);
  background: var(--color-mint-soft);
}

.recent li[data-income] b {
  color: var(--color-positive);
}

.recent li.is-new:not(.is-in) {
  max-height: 0;
  padding-block: 0;
  opacity: 0;
  transform: translateX(-12px);
}

/* Subtitle: what the person says. */
.said {
  position: absolute;
  left: var(--space-5);
  right: calc(52px + var(--space-5) * 2);
  bottom: var(--space-5);
  z-index: 2;
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin: 0;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--color-text-inverse);
  background: var(--color-ink);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity var(--duration) var(--ease-out),
    transform var(--duration-slow) var(--ease-out);
}

.screen[data-said] .said {
  opacity: 1;
  transform: none;
}

html:not(.js) .said {
  display: none;
}

.said-wave {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 1.5em;
  flex: none;
}

.said-wave i {
  width: 3px;
  height: 4px;
  background: var(--color-mint);
  border-radius: var(--radius-full);
  transition: height var(--duration) var(--ease);
}

.screen[data-fab="recording"] .said-wave i {
  animation: talk 700ms var(--ease) infinite alternate;
}

.said-wave i:nth-child(2) {
  animation-delay: -300ms !important;
}
.said-wave i:nth-child(3) {
  animation-delay: -150ms !important;
}
.said-wave i:nth-child(4) {
  animation-delay: -500ms !important;
}
.said-wave i:nth-child(5) {
  animation-delay: -250ms !important;
}

@keyframes talk {
  from {
    height: 4px;
  }

  to {
    height: 16px;
  }
}

/* The AI highlights what it understood, in each type's color. */
.said mark {
  color: inherit;
  background: transparent;
  border-radius: 6px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  transition:
    color var(--duration) var(--ease),
    background var(--duration) var(--ease),
    padding var(--duration) var(--ease);
}

.screen[data-parsed] .said mark {
  padding: 1px 4px;
  font-weight: 600;
  color: var(--color-primary-hover);
  background: var(--color-primary-soft);
}

.screen[data-parsed] .said mark[data-kind="fixed"] {
  color: var(--color-warning);
  background: var(--color-warning-soft);
}

.screen[data-parsed] .said mark[data-kind="income"] {
  color: var(--color-positive);
  background: var(--color-mint-soft);
}

/* Floating microphone: same as voice.module.css. */
.v-dock {
  position: absolute;
  right: var(--space-5);
  bottom: var(--space-5);
  z-index: 2;
}

.v-fab {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  color: var(--color-text-inverse);
  background: var(--color-primary);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-lg);
  transition:
    background var(--duration-fast) var(--ease),
    opacity var(--duration-fast) var(--ease);
}

.v-fab > * {
  grid-area: 1 / 1;
  display: none;
}

.v-mic {
  width: 24px;
  height: 24px;
  stroke-width: 2;
}

.v-stop {
  width: 16px;
  height: 16px;
  background: var(--color-text-inverse);
  border-radius: 4px;
}

.v-spin {
  width: 22px;
  height: 22px;
  border: 3px solid var(--color-primary-soft);
  border-top-color: var(--color-text-inverse);
  border-radius: var(--radius-full);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.screen:not([data-fab]) .v-mic,
.screen[data-fab="idle"] .v-mic,
.screen[data-fab="recording"] .v-stop,
.screen[data-fab="busy"] .v-spin {
  display: block;
}

.screen[data-fab="recording"] .v-fab {
  background: var(--color-danger);
  animation: rec 1.4s var(--ease) infinite;
}

.screen[data-fab="busy"] .v-fab {
  opacity: 0.85;
}

@keyframes rec {
  50% {
    box-shadow:
      var(--shadow-lg),
      0 0 0 12px var(--color-danger-soft);
  }
}

.v-bubble {
  position: absolute;
  right: 0;
  bottom: calc(100% + var(--space-3));
  display: flex;
  flex-direction: column;
  padding: var(--space-3) var(--space-4);
  white-space: nowrap;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity var(--duration) var(--ease-out),
    transform var(--duration) var(--ease-out);
}

.screen[data-bubble] .v-bubble {
  opacity: 1;
  transform: none;
}

.v-bubble b {
  font-size: var(--text-sm);
  font-weight: 600;
}

.v-bubble small {
  font-size: var(--text-2xs);
  font-weight: 600;
  color: var(--color-positive);
}

/* Summary before saving. Without JS it shows open. */
.v-modal-wrap {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  padding: var(--space-5);
  background: color-mix(in srgb, var(--color-ink) 28%, transparent);
  transition: opacity var(--duration) var(--ease-out);
}

.v-modal {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  width: min(100%, 26rem);
  padding: var(--space-5);
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  transition: transform var(--duration-slow) var(--ease-out);
}

.js .screen:not([data-modal]) .v-modal-wrap {
  opacity: 0;
}

.js .screen:not([data-modal]) .v-modal {
  transform: translateY(18px) scale(0.97);
}

.v-modal p {
  margin: 0;
}

.v-eyebrow {
  font-size: var(--text-2xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-primary);
}

.v-title {
  margin-top: calc(var(--space-2) * -1) !important;
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
}

.v-heard {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  font-style: italic;
  color: var(--color-text-muted);
  background: var(--color-field);
  border-radius: var(--radius-sm);
}

.v-items {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.v-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  border: var(--line-soft);
  border-radius: var(--radius-md);
  transition:
    opacity var(--duration) var(--ease-out),
    transform var(--duration-slow) var(--ease-out);
}

.js .v-item:not(.is-in) {
  opacity: 0;
  transform: translateY(10px);
}

.v-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.v-info b {
  font-weight: 600;
}

.v-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-2xs);
  color: var(--color-text-muted);
}

.v-tag {
  padding: 1px var(--space-2);
  font-style: normal;
  font-weight: 600;
  color: var(--color-primary);
  background: var(--color-primary-soft);
  border-radius: var(--radius-full);
}

.v-tag[data-kind="fixed"] {
  color: var(--color-warning);
  background: var(--color-warning-soft);
}

.v-tag[data-kind="income"] {
  color: var(--color-positive);
  background: var(--color-mint-soft);
}

.v-select {
  padding: 1px var(--space-2);
  color: var(--color-text);
  background: var(--color-field);
  border-radius: 6px;
}

.v-select::after {
  content: " ▾";
  color: var(--color-text-muted);
}

.v-money {
  padding: var(--space-1) var(--space-3);
  font-weight: 600;
  background: var(--color-field);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  transition:
    border-color var(--duration-fast) var(--ease),
    box-shadow var(--duration-fast) var(--ease);
}

.v-item.is-focus .v-money {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}

.v-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-1);
}

.v-save,
.v-ghost {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition:
    background var(--duration-fast) var(--ease),
    transform var(--duration-fast) var(--ease);
}

.v-save {
  color: var(--color-text-inverse);
  background: var(--color-primary);
}

.v-save.is-press {
  background: var(--color-primary-hover);
  transform: scale(0.96);
}

.v-ghost {
  color: var(--color-text-muted);
}

.v-toast {
  top: calc(var(--space-12) + var(--space-2));
  right: var(--space-5);
  bottom: auto;
  left: auto;
  z-index: 2;
}

.screen[data-toast] .v-toast {
  opacity: 1;
  transform: none;
}

.v-toast .toast-avatar {
  color: var(--color-positive);
  background: var(--color-mint-soft);
}

.v-toast .toast-avatar svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.6;
}

/* Pointer: the tip is at (0, 0). */
.cursor {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 4;
  width: 20px;
  height: 24px;
  pointer-events: none;
  filter: drop-shadow(0 0 1px var(--color-surface)) drop-shadow(0 0 1px var(--color-surface))
    drop-shadow(0 3px 4px color-mix(in srgb, var(--color-ink) 30%, transparent));
  transform: translate(var(--x, 70%), var(--y, 70%));
  transition:
    transform 900ms var(--ease-out),
    opacity 400ms var(--ease);
}

.cursor::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--color-ink);
  clip-path: polygon(0 0, 0 80%, 24% 62%, 40% 98%, 56% 91%, 40% 57%, 76% 57%);
  transition: transform 120ms var(--ease);
}

.cursor::after {
  content: "";
  position: absolute;
  top: -16px;
  left: -16px;
  width: 32px;
  height: 32px;
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-full);
  opacity: 0;
}

.cursor.is-click::before {
  transform: scale(0.85);
}

.cursor.is-click::after {
  animation: click 500ms var(--ease-out);
}

@keyframes click {
  from {
    opacity: 0.9;
    transform: scale(0.3);
  }

  to {
    opacity: 0;
    transform: scale(1.3);
  }
}

/* "Your AI" cards */
.voice-art,
.keys-art {
  display: grid;
  grid-template-columns: repeat(var(--cols, 2), auto);
  place-content: center;
  align-items: center;
  gap: var(--space-3) var(--space-4);
}

.voice-art .vault-file,
.keys-art .key-pill {
  grid-column: 1 / -1;
  justify-self: center;
}

.voice-core {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  color: var(--color-text-inverse);
  background: var(--color-primary);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-md);
}

.voice-core svg {
  width: 26px;
  height: 26px;
  stroke-width: 2;
}

.voice-wave {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 40px;
}

.voice-wave i {
  width: 4px;
  height: 100%;
  background: var(--color-mint);
  border-radius: var(--radius-full);
  transform: scaleY(0.2);
  animation: wave-bar 1.1s var(--ease) infinite alternate;
}

.voice-wave i:nth-child(2n) {
  animation-delay: -0.4s;
}

.voice-wave i:nth-child(3n) {
  animation-delay: -0.7s;
  background: var(--color-primary);
}

@keyframes wave-bar {
  to {
    transform: scaleY(1);
  }
}

.model-art {
  flex-direction: column;
  gap: var(--space-3);
}

.model-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  width: min(100% - 2rem, 14rem);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  animation: pop 500ms var(--ease-out) both;
}

.model-name {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
  font-size: var(--text-sm);
}

.model-name small,
.model-done {
  font-size: var(--text-2xs);
  font-weight: 600;
  color: var(--color-positive);
}

.model-card .bar b {
  animation-duration: 2.4s;
  animation-delay: 300ms;
}

.keys-art {
  --cols: 3;
  gap: var(--space-3) var(--space-2);
}

.keys-art .chip {
  animation: pop 500ms calc(var(--i) * 150ms) var(--ease-out) both;
}

.key-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-inverse);
  background: var(--color-ink);
  border-radius: var(--radius-full);
  animation: pop 500ms 500ms var(--ease-out) both;
}

.key-pill svg {
  width: 14px;
  height: 14px;
  stroke-width: 2.2;
}

@media (max-width: 959px) {
  .demo-stage {
    order: -1;
  }

  /* On small screens only the current step's text shows. */
  .chapter:not([aria-current]) small {
    display: none;
  }
}

/* Narrow mock: the summary has to fit over the ring. */
@media (max-width: 560px) {
  .screen-body {
    padding: var(--space-4) var(--space-4) 7.5rem;
  }

  .said {
    left: var(--space-4);
    right: calc(52px + var(--space-4) * 2);
    bottom: var(--space-4);
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-xs);
  }

  .v-dock {
    right: var(--space-4);
    bottom: var(--space-4);
  }

  .v-modal-wrap {
    padding: var(--space-3);
  }

  .v-modal {
    gap: var(--space-2);
    padding: var(--space-4);
  }

  .v-eyebrow,
  .v-heard {
    display: none;
  }

  .v-title {
    margin-top: 0 !important;
    font-size: var(--text-md);
  }
}

/* How it's built: the architecture video and the way to the code. */
.built {
  display: grid;
  gap: var(--space-6);
}

.built-video {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  background: var(--color-surface);
  border: var(--line-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.built-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4) var(--space-6);
}

/* A filled mark, unlike the page's line icons. */
.button .github {
  fill: currentColor;
  stroke: none;
}

.built-note {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* First launch */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(20rem, 100%), 1fr));
  gap: var(--space-6);
}

.steps .card {
  gap: var(--space-5);
  padding: var(--space-8);
}

.os-tag {
  align-self: flex-start;
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary-hover);
  background: var(--color-primary-soft);
  border-radius: var(--radius-full);
}

ol {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

ol li {
  position: relative;
  padding-left: var(--space-10);
  counter-increment: step;
}

ol li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -2px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-text-inverse);
  background: var(--color-primary);
  border-radius: var(--radius-full);
}

details {
  font-size: var(--text-sm);
}

summary {
  cursor: pointer;
  color: var(--color-text-muted);
}

summary:hover {
  color: var(--color-primary);
}

pre {
  margin: var(--space-3) 0 0;
  padding: var(--space-3) var(--space-4);
  overflow-x: auto;
  background: var(--color-field);
  border-radius: var(--radius-sm);
}

code {
  font-size: 0.8125rem;
}

/* Closing */
.cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-6);
  margin-bottom: clamp(3rem, 8vw, 6rem);
  padding: clamp(3rem, 8vw, 5rem) var(--space-6);
  text-align: center;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.cta h2 {
  max-width: 36rem;
}

.mark-lg {
  width: 64px;
  height: 64px;
  animation: spin-in 1s var(--ease-out) both;
}

@keyframes spin-in {
  from {
    opacity: 0;
    transform: rotate(-90deg) scale(0.6);
  }
}

/* Footer */
.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-2);
  padding-block: var(--space-8) var(--space-12);
  border-top: var(--line-soft);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.foot a {
  text-underline-offset: 3px;
}

.foot a:hover {
  color: var(--color-primary);
}

/* Small screens: the mock keeps only the ring. */
@media (max-width: 560px) {
  .app-side,
  .app-col {
    display: none;
  }

  .app-body,
  .app-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .toast {
    left: var(--space-3);
    right: var(--space-3);
  }

  .top-link {
    display: none;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    transition-delay: 0s !important;
  }
}
