/*
 * The landing page's motion demos (static/js/landing-motion.js).
 *
 * Each demo's markup is its finished state, so with no script, or with
 * less motion asked for, the page still says everything. The script adds
 * .is-armed to set up the starting state and plays the rest.
 */

/* The invoice lettering the app offers (core/branding.py FONT_STACKS), as the
   small web copies made by marketing/web_fonts.py. */
@font-face { font-family: "Montserrat"; src: url("../fonts/web/Montserrat-Regular.5f4373dd8b8a.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Montserrat"; src: url("../fonts/web/Montserrat-Bold.4d87dd82b4c3.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Noto Serif"; src: url("../fonts/web/NotoSerif-Regular.44bd34f3cd40.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Noto Serif"; src: url("../fonts/web/NotoSerif-Bold.3a28695215de.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Lato"; src: url("../fonts/web/Lato-Regular.360a0f093602.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Lato"; src: url("../fonts/web/Lato-Bold.418a42ec4ac1.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Carlito"; src: url("../fonts/web/Carlito-Regular.934d5145c4fb.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Carlito"; src: url("../fonts/web/Carlito-Bold.c17b07d27b9b.woff2") format("woff2"); font-weight: 700; font-display: swap; }

.dm-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); }
.sr-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* -- Six tools collapse into one flow -------------------------------- */

.demo-collapse { position: relative; margin-top: 2.6rem; }
.js .demo-collapse { min-height: 420px; display: flex; flex-direction: column; justify-content: center; }
.dc-tools { list-style: none; margin: 0; padding: 0; position: absolute; inset: 0; display: none; pointer-events: none; }
.demo-collapse.is-armed .dc-tools { display: block; }
.dc-win {
  position: absolute; left: var(--x); top: var(--y); width: 24%; min-width: 170px; max-width: 250px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg);
  transform: rotate(var(--r)); opacity: 0; overflow: hidden;
}
.dc-win i {
  display: block; height: 30px; background: #f2f4f7; border-bottom: 1px solid var(--line);
  background-image: radial-gradient(circle at 14px 15px, #d0d5dd 4px, transparent 4.5px),
                    radial-gradient(circle at 28px 15px, #d0d5dd 4px, transparent 4.5px),
                    radial-gradient(circle at 42px 15px, #d0d5dd 4px, transparent 4.5px);
}
.dc-win span { position: absolute; top: 6px; left: 56px; font-size: .82rem; font-weight: 650; color: var(--muted); white-space: nowrap; }
.dc-win svg { display: block; width: 58px; height: 58px; margin: 16px auto 18px; fill: none; stroke: #98a2b3; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.dc-result { position: relative; transition: opacity .6s ease, transform .6s cubic-bezier(.2, .8, .2, 1); }
.demo-collapse.is-armed .dc-result { opacity: 0; transform: scale(.92); }
.demo-collapse.is-armed.is-done .dc-result { opacity: 1; transform: none; }
.dc-before { text-align: center; color: var(--muted); font-size: .95rem; margin-bottom: 1rem; }
.dc-before s { text-decoration-color: rgba(95, 104, 120, .55); }
.demo-collapse.is-armed .dc-before { opacity: 0; transition: opacity .3s ease; }
.demo-collapse.is-armed.is-done .dc-before { opacity: 1; transition: opacity .6s ease 1.4s; }
.dc-one {
  max-width: 560px; margin: 0 auto; padding: 28px 32px; border-radius: var(--radius); text-align: center;
  background: var(--night); color: #fff; box-shadow: var(--shadow-lg);
}
.dc-one .chain-label { color: #9fb4ff; font-size: .82rem; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 1rem; }
.dc-flow { list-style: none; margin: 0; padding: 0; display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; }
.dc-flow li { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 750; letter-spacing: -.02em; transition: opacity .5s ease; }
.dc-flow li + li::before { content: "\2192"; color: #6f8cff; margin-right: 10px; }
.dc-flow li:last-child { color: #6ee7b7; }
.demo-collapse.is-armed .dc-flow li { opacity: .15; }
.demo-collapse.is-armed.is-done .dc-flow li { opacity: 1; }
.demo-collapse.is-armed.is-done .dc-flow li:nth-child(1) { transition-delay: .35s; }
.demo-collapse.is-armed.is-done .dc-flow li:nth-child(2) { transition-delay: .7s; }
.demo-collapse.is-armed.is-done .dc-flow li:nth-child(3) { transition-delay: 1.05s; }
.dc-one .chain-foot { margin: 1.1rem 0 0; color: #c7d2fe; }

@media (max-width: 700px) {
  .js .demo-collapse { min-height: 460px; }
  .dc-win { width: 44%; min-width: 0; left: calc(var(--x) * .75); }
  .dc-win svg { width: 42px; height: 42px; margin: 12px auto 12px; }
  .dc-win span { font-size: .72rem; left: 50px; }
  .dc-one { padding: 22px 18px; }
}

/* -- Track once, bill from it ------------------------------------------ */

/* The week above, the invoice below: the entries travel down into it. */
.demo-bill { position: relative; display: grid; gap: 14px; max-width: 600px; margin-left: auto; }
.demo-bill .db-invoice { margin-left: 12%; }
.demo-bill .dm-card { padding: 18px; }
.db-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.db-head b { color: var(--ink); font-size: .95rem; }
.db-timer {
  display: inline-flex; align-items: center; gap: 6px; padding: .2rem .6rem; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary-dark); font-size: .78rem; font-weight: 650; font-variant-numeric: tabular-nums;
}
.db-timer i { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); }
.demo-bill.is-playing .db-timer i { animation: db-pulse 1.2s ease-in-out infinite; }
@keyframes db-pulse { 50% { opacity: .25; } }
.db-days { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; font-size: .72rem; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.db-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); grid-template-rows: repeat(6, 30px); gap: 6px;
  background: repeating-linear-gradient(#fff 0 35px, #eef0f3 35px 36px);
}
.db-block {
  grid-column: var(--c); grid-row: var(--r) / span var(--h); min-width: 0; overflow: hidden;
  padding: 6px 7px; border-radius: 8px; font-size: .7rem; font-weight: 650; line-height: 1.25; color: var(--ink);
  background: var(--primary-soft); border-left: 3px solid var(--primary);
  transition: opacity .4s ease, box-shadow .3s ease;
}
.db-block small { display: block; font-weight: 500; color: var(--muted); }
.db-block.is-own { background: #f2f4f7; border-left-color: #98a2b3; color: var(--muted); }
.db-block.is-ready { box-shadow: 0 0 0 2px var(--primary), 0 6px 16px -6px rgba(47, 91, 234, .5); }
.db-block.is-billed { opacity: .38; }
.db-fly { position: absolute; z-index: 5; pointer-events: none; box-shadow: 0 10px 24px -8px rgba(47, 91, 234, .5); }

.db-inv-head b { display: block; color: var(--ink); font-size: 1.05rem; }
.db-inv-head span { font-size: .82rem; color: var(--muted); }
.db-lines { margin: 12px 0 8px; }
.db-line {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  min-height: 52px; padding: 8px 0; border-bottom: 1px dashed #e4e7ec;
}
.db-line span { font-size: .88rem; font-weight: 600; color: var(--ink); }
.db-line small { display: block; font-size: .76rem; font-weight: 500; color: var(--muted); }
.db-line b { font-size: .9rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.db-line > * { transition: opacity .35s ease, transform .35s ease; }
.demo-bill.is-armed .db-line:not(.is-in) > * { opacity: 0; transform: translateY(6px); }
.db-total {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-top: 10px; border-top: 2px solid var(--ink); font-weight: 750; color: var(--ink);
}
.db-total b { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.db-note { display: flex; align-items: center; gap: 6px; margin: 12px 0 0; font-size: .85rem; font-weight: 600; color: var(--good); transition: opacity .4s ease, transform .4s ease; }
.db-note svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.demo-bill.is-armed .db-note:not(.is-in) { opacity: 0; transform: translateY(4px); }
@media (max-width: 900px) { .demo-bill { margin-left: 0; } }
@media (max-width: 560px) { .demo-bill .db-invoice { margin-left: 0; } .db-block { font-size: .64rem; padding: 5px; } }

/* -- An invoice's life, sent to paid ----------------------------------- */

.demo-paid { position: relative; display: grid; gap: 14px; }
.dp-invoice { position: relative; padding: 20px 22px; overflow: hidden; }
.dp-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.dp-top b { display: block; color: var(--ink); font-size: 1.1rem; }
.dp-top div span { color: var(--muted); font-size: .88rem; }
.dp-status { padding: .25rem .75rem; border-radius: 999px; font-size: .82rem; font-weight: 650; white-space: nowrap; background: #f2f4f7; color: var(--muted); }
.dp-status[data-status="sent"] { background: var(--primary-soft); color: var(--primary-dark); }
.dp-status[data-status="partially-paid"] { background: #fffaeb; color: #93370d; }
.dp-status[data-status="paid"] { background: var(--good-soft); color: var(--good); }
.dp-sums { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 18px 0 0; }
.dp-sums dt { font-size: .78rem; color: var(--muted); }
.dp-sums dd { margin: 0; font-size: 1.45rem; font-weight: 750; letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.dp-due dd { color: var(--good); }
.demo-paid.is-armed .dp-due dd { color: var(--ink); }
.demo-paid.is-armed.is-settled .dp-due dd { color: var(--good); }
.dp-stamp {
  position: absolute; right: 22px; top: 58px; padding: 4px 12px 5px; border: 2.5px solid var(--good); border-radius: 8px;
  color: var(--good); font-weight: 800; font-size: 1.15rem; letter-spacing: .1em; text-transform: uppercase; line-height: 1.1;
  text-align: center; transform: rotate(-10deg);
}
.dp-stamp small { display: block; font-size: .58rem; letter-spacing: .08em; }
.demo-paid.is-armed .dp-stamp { opacity: 0; transform: rotate(-10deg) scale(1.7); transition: opacity .18s ease, transform .28s cubic-bezier(.2, 1.4, .4, 1); }
.demo-paid.is-armed .dp-stamp.is-in { opacity: 1; transform: rotate(-10deg) scale(1); }
.dp-events { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.dp-events li {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px;
  background: #fff; border: 1px solid var(--line); font-size: .92rem; color: var(--ink);
  transition: opacity .45s ease, transform .45s cubic-bezier(.2, .8, .2, 1);
}
.dp-events small { margin-left: auto; padding-left: 8px; color: var(--muted); font-size: .8rem; text-align: right; }
.demo-paid.is-armed .dp-events li:not(.is-in) { opacity: 0; transform: translateY(8px); }
.dp-ico { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); }
.dp-ico svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dp-ico.is-good { background: var(--good-soft); color: var(--good); }
.dp-toast {
  position: absolute; z-index: 3; left: 38%; top: -24px; display: none; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 12px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  font-size: .85rem; color: var(--muted); transition: opacity .35s ease, transform .35s cubic-bezier(.2, .8, .2, 1);
}
.dp-toast b { display: block; color: var(--ink); font-size: .9rem; }
.is-armed .dp-toast { display: flex; opacity: 0; transform: translateY(-8px); }
.is-armed .dp-toast.is-in { opacity: 1; transform: none; }

@media (max-width: 560px) {
  .demo-paid { margin-top: 36px; }
  .dp-sums { grid-template-columns: 1fr; gap: 8px; }
  .dp-stamp { top: 76px; right: 16px; }
  .dp-toast { left: 0; right: 0; top: -40px; width: max-content; max-width: 100%; margin: 0 auto; }
}

/* -- One invoice, six real styles ------------------------------------- */

.im-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.im-tabs button {
  display: inline-flex; align-items: center; gap: 7px; padding: .5rem .95rem; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; color: var(--text); font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer;
  transition: background-color .2s, border-color .2s, color .2s, transform .15s;
}
.im-tabs button:hover { border-color: #c9ced6; }
.im-tabs button:active { transform: scale(.97); }
.im-tabs button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.im-tabs i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.im-stage { max-width: 760px; margin: 1.6rem auto 0; }
.im {
  --muted-ink: #5f6878;
  position: relative; padding: 40px 44px 34px; border-radius: 16px; border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  background: var(--paper); color: #191c22; font-size: 15px; line-height: 1.5;
  transition: background-color .6s ease;
}
.im[data-font="clean"] { font-family: "InterVariable", "Noto Sans", sans-serif; }
.im[data-font="modern"] { font-family: Montserrat, "Noto Sans", sans-serif; }
.im[data-font="elegant"] { font-family: "Noto Serif", Georgia, serif; }
.im[data-font="friendly"] { font-family: Lato, "Noto Sans", sans-serif; }
.im[data-font="minimal"] { font-family: Carlito, Calibri, "Noto Sans", sans-serif; }
.im-head { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: start; }
.im-logo {
  position: relative; display: grid; place-items: center; width: 58px; height: 58px; border-radius: 13px;
  background: #0f2a5f; color: #fff; font: 800 1.7rem/1 "InterVariable", sans-serif; font-feature-settings: normal;
  transition: opacity .4s ease;
}
.im-logo i { position: absolute; right: 12px; bottom: 15px; width: 8px; height: 8px; border-radius: 50%; background: #f26b3a; }
.im-name { display: block; font-size: 1.35rem; font-weight: 700; color: var(--dark); transition: color .6s ease; }
.im-addr { display: block; font-size: .85rem; color: var(--muted-ink); }
.im-title { text-align: right; }
.im-title b { display: block; font-size: 1.7rem; font-weight: 700; color: var(--accent); transition: color .6s ease; }
.im-title span { font-size: .85rem; color: var(--muted-ink); }
.im[data-header="centered"] .im-head { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 10px; }
.im[data-header="centered"] .im-title { text-align: center; }
.im[data-header="bold"] .im-head { grid-template-columns: 1fr auto; }
.im[data-header="bold"] .im-logo { grid-column: 2; grid-row: 1; width: 44px; height: 44px; font-size: 1.3rem; border-radius: 10px; }
.im[data-header="bold"] .im-logo i { right: 8px; bottom: 11px; width: 6px; height: 6px; }
.im[data-header="bold"] .im-who { grid-column: 1; grid-row: 1; }
.im[data-header="bold"] .im-name { font-size: 2.3rem; line-height: 1.1; color: var(--accent); }
.im[data-header="bold"] .im-title { grid-column: 1 / -1; text-align: left; }
.im[data-header="bold"] .im-title b { display: inline; font-size: 1.1rem; margin-right: 8px; color: var(--dark); }
.im[data-header="minimal"] .im-head { grid-template-columns: 1fr auto; }
.im[data-header="minimal"] .im-logo { position: absolute; opacity: 0; }
.im[data-header="minimal"] .im-title b { font-weight: 400; color: var(--dark); }
.im-rule { height: 2px; margin: 22px 0 16px; background: var(--accent); transition: background-color .6s ease; }
.im-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 0 0 18px; }
.im-meta dt, .im-lines th { font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-ink); }
.im-meta dd { margin: 0; font-weight: 700; }
.im-lines { width: 100%; border-collapse: collapse; }
.im-lines th { text-align: left; padding: 6px 0; border-bottom: 1.5px solid var(--accent); transition: border-color .6s ease; }
.im-lines td { padding: 10px 0; border-bottom: 1px solid rgba(25, 28, 34, .1); }
.im-lines th:nth-child(2), .im-lines td:nth-child(2) { text-align: center; width: 60px; }
.im-lines th:last-child, .im-lines td:last-child { text-align: right; }
.im-total {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px; max-width: 340px; margin: 18px 0 0 auto;
  padding: 12px 16px; border-radius: 10px; color: var(--dark);
  background: color-mix(in srgb, var(--accent) 14%, var(--paper));
  transition: background-color .6s ease, color .6s ease;
}
.im-total b { font-size: 1.15rem; }
.im-thanks { margin: 18px 0 0; font-size: .85rem; color: var(--muted-ink); }
.im[data-header="centered"] .im-thanks { text-align: center; }
.im-caption { margin: 1.2rem 0 0; text-align: center; color: var(--muted); font-size: .92rem; }
@media (max-width: 600px) {
  .im { padding: 26px 20px 22px; font-size: 13px; }
  .im-head { gap: 12px; }
  .im-logo { width: 46px; height: 46px; font-size: 1.35rem; }
  .im-name { font-size: 1.1rem; }
  .im-title b { font-size: 1.25rem; }
  .im[data-header="bold"] .im-name { font-size: 1.6rem; }
  .im-meta { grid-template-columns: 1fr 1fr; }
}

/* -- Income that moves -------------------------------------------------- */

.demo-income { position: relative; }
.di-panel { max-width: 920px; margin: 0 auto; padding: 20px 24px 14px; }
.di-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.di-head b { color: var(--ink); }
.di-legend { list-style: none; display: flex; gap: 16px; margin: 0; padding: 0; font-size: .85rem; color: var(--muted); }
.di-legend li { display: flex; align-items: center; gap: 6px; }
.di-legend i { width: 10px; height: 10px; border-radius: 3px; }
.di-chart { display: grid; grid-template-columns: repeat(6, 1fr); gap: 18px; height: 210px; }
.di-month { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; align-items: end; padding-bottom: 24px; }
.di-month span { position: absolute; left: 0; right: 0; bottom: 0; text-align: center; font-size: .8rem; color: var(--muted); }
.di-month i { display: block; height: calc(var(--v) * 100%); border-radius: 4px 4px 0 0; transform-origin: bottom; transition: height .6s cubic-bezier(.2, .8, .2, 1), transform .7s cubic-bezier(.2, .8, .2, 1); }
.is-inv { background: var(--primary); }
.is-col { background: var(--good); }
.demo-income.is-armed .di-month i { transform: scaleY(0); }
.demo-income.is-armed.is-grown .di-month i { transform: none; }
.demo-income.is-armed.is-grown .di-month:nth-child(2) i { transition-delay: .06s; }
.demo-income.is-armed.is-grown .di-month:nth-child(3) i { transition-delay: .12s; }
.demo-income.is-armed.is-grown .di-month:nth-child(4) i { transition-delay: .18s; }
.demo-income.is-armed.is-grown .di-month:nth-child(5) i { transition-delay: .24s; }
.demo-income.is-armed.is-grown .di-month:nth-child(6) i { transition-delay: .3s; }
.di-toast { top: -30px; left: auto; right: max(0px, calc(50% - 460px)); }
.tile { transition: box-shadow .4s ease, transform .2s ease; }
.tile.is-late.is-cleared strong { color: var(--ink); transition: color .6s ease; }
.tile.is-updated { box-shadow: 0 0 0 3px rgba(18, 128, 92, .28), var(--shadow-sm); }
@media (max-width: 600px) { .di-chart { gap: 8px; height: 170px; } .di-panel { padding: 16px 14px 10px; } }

/* -- Small touches ------------------------------------------------------ */

.btn:active { transform: translateY(0) scale(.97); }
.step, .price-card { transition: transform .25s ease, box-shadow .25s ease; }
.step:hover, .price-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.rows .row { transition: background-color .2s ease; }
.rows .row:hover { background: #fafbfc; }
.js .rows.reveal .row { opacity: 0; transform: translateX(-12px); transition: opacity .5s ease, transform .5s cubic-bezier(.2, .8, .2, 1), background-color .2s ease; }
.js .rows.reveal.is-in .row { opacity: 1; transform: none; }
.js .rows.reveal.is-in .row:nth-child(2) { transition-delay: .1s; }
.js .rows.reveal.is-in .row:nth-child(3) { transition-delay: .2s; }
.js .rows.reveal.is-in .row:nth-child(4) { transition-delay: .3s; }
.faq details[open] p { animation: faq-open .28s ease; }
@keyframes faq-open { from { opacity: 0; transform: translateY(-4px); } }

@media (prefers-reduced-motion: reduce) {
  .js .rows.reveal .row { opacity: 1; transform: none; }
  .faq details[open] p { animation: none; }
  .step:hover, .price-card:hover, .btn:hover, .btn:active { transform: none; }
}
