/* One Bill: the scroll-driven billing flow on the home page, in the site's light theme. */
.bill {
  --panel: #fff; --panel-2: #f6f1fb; --accent: #1f9be8; --accent-soft: rgba(31, 155, 232, .14);
  --good: #0d8a57; --wire: rgba(21, 17, 27, .14); --faint-text: rgba(21, 17, 27, .45);
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, Menlo, monospace;
  --spring: cubic-bezier(.2, 1.3, .3, 1);
  position: relative; height: 620vh;
}
.bill-sticky { position: sticky; top: 0; height: 100svh; display: grid; grid-template-columns: minmax(0, .62fr) minmax(0, 1.38fr); gap: clamp(20px, 3vw, 44px); align-items: center; padding: 84px var(--gutter) 14px; overflow: hidden; }
.bill-copy h2 { margin: 8px 0 16px; font-size: clamp(1.8rem, 3vw, 3rem); line-height: 1.04; }
.bill-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.bill-steps li { padding: 8px 0 8px 14px; border-left: 2px solid var(--wire); opacity: .42; transition: opacity .4s, border-color .4s; }
.bill-steps li span { font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.bill-steps li h3 { margin: 2px 0 0; font-size: 1.04rem; letter-spacing: -.02em; }
.bill-steps li p { max-height: 0; overflow: hidden; margin: 0; font-size: .86rem; color: var(--muted); transition: max-height .45s var(--ease), margin .3s; }
.bill-steps li.on { opacity: 1; border-color: #22c3bb; }
.bill-steps li.on span { color: #22c3bb; }
.bill-steps li.on p { max-height: 90px; margin-top: 4px; }
.bill-progress { height: 3px; margin-top: 14px; background: var(--wire); }
.bill-progress span { display: block; height: 100%; background: var(--grad); transform: scaleX(0); transform-origin: left; }

.bill-stage { position: relative; min-width: 0; }
.bill-window { position: relative; overflow: hidden; border: 1px solid var(--stroke); border-radius: 22px; background: #fbf6ee; box-shadow: var(--card-shadow), 0 40px 80px -46px rgba(30, 60, 90, .4); }
.bill-bar { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 8px 14px; border-bottom: 1px solid var(--stroke); background: #fff; font-size: .82rem; }
.bill-bar b { font-weight: 700; }
.bill-bar .dots { display: flex; gap: 6px; flex: none; }
.bill-bar .dots i { width: 10px; height: 10px; border-radius: 50%; background: #d9a8a0; }
.bill-bar .dots i:nth-child(2) { background: #e3a321; }
.bill-bar .dots i:nth-child(3) { background: #9fb096; }
.bill-status { margin-left: auto; padding: 3px 10px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font: 600 .72rem var(--mono); }
.bill-status.done { background: var(--good); color: #fff; }
.bill-desk { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); column-gap: 7%; padding: clamp(10px, 1.3vw, 18px) clamp(10px, 1.3vw, 18px) 104px; min-height: min(70svh, 590px); background-image: radial-gradient(rgba(140, 120, 110, .3) 1.3px, transparent 1.4px); background-size: 24px 24px; }
.bill-note { position: absolute; right: 4px; bottom: -22px; margin: 0; font-size: .7rem; color: var(--faint-text); }

.receipt { position: relative; z-index: 2; display: flex; flex-direction: column; padding: 14px 15px; border: 1px solid var(--stroke); border-radius: 12px; background: #fff; color: #15111b; font-size: .84rem; box-shadow: 0 22px 44px -26px rgba(30, 60, 90, .45); }
.receipt header { display: grid; padding-bottom: 8px; border-bottom: 1px dashed #cfc6d6; }
.receipt header strong { font-size: 1.05rem; font-weight: 800; letter-spacing: -.02em; }
.receipt header span { font: .68rem var(--mono); color: #6b6170; }
.scanner { position: relative; height: 40px; margin: 9px 0; overflow: hidden; }
.barcode { height: 100%; background: repeating-linear-gradient(90deg, #15111b 0 2px, transparent 2px 5px, #15111b 5px 6px, transparent 6px 10px, #15111b 10px 13px, transparent 13px 15px); opacity: .85; }
.laser { position: absolute; top: 0; bottom: 0; left: 0; width: 3px; background: #ff2b4a; box-shadow: 0 0 14px 4px rgba(255, 43, 74, .7); opacity: 0; }
.is-scanning .laser { opacity: 1; animation: billLaser .8s ease-in-out infinite alternate; }
@keyframes billLaser { to { left: calc(100% - 3px); } }
.r-rows { list-style: none; margin: 0; padding: 0; min-height: 84px; }
.r-rows li { display: grid; grid-template-columns: 1fr auto 62px; gap: 8px; padding: 4px 0; opacity: 0; transform: translateX(-14px); transition: opacity .3s, transform .45s var(--spring); }
.r-rows li.on { opacity: 1; transform: none; }
.r-rows em { font-style: normal; font-size: .72rem; color: #6b6170; }
.r-rows b { text-align: right; font-variant-numeric: tabular-nums; }
.r-sum { margin: 6px 0 0; padding-top: 7px; border-top: 1px dashed #cfc6d6; }
.r-sum div { display: flex; justify-content: space-between; padding: 2px 0; opacity: 0; transition: opacity .3s; }
.r-sum div.on { opacity: 1; }
.r-sum dt, .r-sum dd { margin: 0; }
.r-sum dd { font-variant-numeric: tabular-nums; font-weight: 600; }
.r-sum .grand { margin-top: 5px; padding: 7px 9px; border-radius: 8px; background: #15111b; color: #fff; font-size: 1.06rem; font-weight: 800; }
.r-sum .grand dd { color: #ffcf7a; font-weight: 800; }
.r-done { list-style: none; margin: auto 0 0; padding: 8px 0 0; font-size: .78rem; font-weight: 600; color: var(--good); }
.r-done li { display: flex; gap: 7px; align-items: center; padding: 2px 0; opacity: 0; transform: translateY(8px); transition: opacity .3s, transform .45s var(--spring); }
.r-done li.on { opacity: 1; transform: none; }
.r-done i { display: grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--good); color: #fff; font-size: .62rem; font-style: normal; }
.stamp { display: inline-block; padding: 5px 10px; border: 2.5px solid currentColor; border-radius: 6px; font-size: .74rem; font-weight: 800; line-height: 1.15; letter-spacing: .05em; text-transform: uppercase; text-align: center; opacity: 0; transform: rotate(-12deg) scale(2.6); transition: opacity .12s, transform .28s var(--spring); }
.stamp.on { opacity: 1; transform: rotate(-9deg) scale(1); }
.stamp--irn { position: absolute; right: 12px; top: 10px; color: var(--good); background: rgba(255, 255, 255, .88); }

.wires { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.wires path { fill: none; stroke-linecap: round; stroke-dasharray: 1; }
.w-base { stroke: var(--wire); stroke-width: 1.5; }
.w-live { stroke: var(--accent); stroke-width: 2; stroke-dashoffset: 1; }
.w-pulse { stroke: #22c3bb; stroke-width: 3; stroke-dasharray: .06 .94; stroke-dashoffset: 1; opacity: 0; }
.w-pulse.run { opacity: 1; animation: billPulse 1.7s linear infinite; }
@keyframes billPulse { to { stroke-dashoffset: 0; } }

.tiles { position: relative; z-index: 2; display: grid; grid-template-rows: 1fr 1fr; grid-template-columns: 1fr 1fr; gap: 20px 12px; min-width: 0; }
.tile { position: relative; min-width: 0; padding: 11px 12px; overflow: hidden; border: 1px solid var(--stroke); border-radius: 14px; background: var(--panel); opacity: .5; filter: saturate(.2); transition: opacity .5s, filter .5s, border-color .4s, box-shadow .4s, transform .5s var(--spring); }
.tile.on { opacity: 1; filter: none; }
.tile.now { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 20px 44px -24px rgba(31, 155, 232, .55); transform: scale(1.025); z-index: 2; }
.tile h4 { margin: 0 0 7px; font-size: .7rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.tile h4 small { letter-spacing: 0; text-transform: none; font-weight: 500; }
.tile ul { list-style: none; margin: 0; padding: 0; font-size: .76rem; }
.tile:first-child li { display: grid; grid-template-columns: 1fr auto; gap: 1px 6px; margin-bottom: 7px; }
.tile:first-child b { font-variant-numeric: tabular-nums; color: var(--accent); }
.tile:first-child i { grid-column: 1 / -1; height: 4px; border-radius: 4px; background: var(--wire); overflow: hidden; }
.tile:first-child u { display: block; height: 100%; background: var(--grad); transform-origin: left; transition: transform .3s; }
.ledger li { display: grid; grid-template-columns: 1fr 20px auto; gap: 5px; padding: 3px 0; border-bottom: 1px solid var(--stroke); opacity: 0; transform: translateY(6px); transition: opacity .3s, transform .3s; }
.ledger li.on { opacity: 1; transform: none; }
.ledger em { font-style: normal; color: var(--faint-text); }
.ledger b, .form b { font-variant-numeric: tabular-nums; }
.ledger .ok { border: 0; color: var(--good); font-weight: 700; }
.form li { display: flex; justify-content: space-between; padding: 3px 0; border-bottom: 1px solid var(--stroke); }
.meter { display: block; height: 5px; margin-top: 9px; border-radius: 5px; background: var(--wire); overflow: hidden; }
.meter u { display: block; height: 100%; background: var(--grad); transform: scaleX(0); transform-origin: left; }
.stamp--filed { position: absolute; right: 10px; bottom: 8px; color: var(--good); font-size: .9rem; background: #fff; }
.tile--profit strong { display: block; font-size: clamp(1.5rem, 2.9vw, 2.7rem); font-weight: 800; line-height: 1; letter-spacing: -.03em; color: var(--good); font-variant-numeric: tabular-nums; }
.tile--profit small { display: block; margin-top: 3px; font-size: .72rem; color: var(--muted); }
.p-bars { position: absolute; left: 12px; right: 12px; bottom: 9px; height: 34%; display: flex; gap: 5px; align-items: flex-end; }
.p-bars i { flex: 1; height: 0; border-radius: 3px 3px 0 0; background: #d6ecfb; transition: height .7s var(--spring); transition-delay: calc(var(--k) * 60ms); }
.p-bars i:last-child { background: var(--good); }
.tile--profit.on .p-bars i { height: var(--h); }

.bill-finale { position: absolute; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--stroke); background: rgba(255, 255, 255, .96); transform: translateY(102%); transition: transform .6s var(--spring); }
.bill-finale.on { transform: none; }
.bill-finale strong { font-size: clamp(1.05rem, 1.9vw, 1.6rem); font-weight: 800; letter-spacing: -.03em; }
.bill-finale em { font-style: normal; color: var(--accent); }
.b-count { flex-basis: 100%; font-size: .76rem; color: var(--muted); }
.b-count b { color: var(--good); }
.bill.again .receipt { animation: billReprint .6s var(--spring); }
@keyframes billReprint { 0% { transform: translateY(-16px) scale(.98); opacity: .4; } 100% { transform: none; opacity: 1; } }
.bill-confetti { position: absolute; left: 66%; top: 62%; pointer-events: none; z-index: 8; }
.bill-confetti span { position: absolute; font-size: 1.05rem; font-weight: 800; color: var(--accent); animation: billBit 1.3s var(--ease) forwards; }
.bill-confetti span:nth-child(3n) { color: #22c3bb; }
.bill-confetti span:nth-child(4n) { color: #e3a321; }
@keyframes billBit { to { transform: translate(var(--dx), var(--dy)) rotate(var(--r)); opacity: 0; } }

@media (max-width: 1000px) {
  .bill { height: 560vh; }
  .bill-sticky { grid-template-columns: minmax(0, 1fr); align-content: start; gap: 8px; padding-top: 80px; }
  .bill-copy h2 { font-size: 1.35rem; margin: 2px 0 4px; }
  .bill-copy .eyebrow, .bill-steps li span, .bill-progress { display: none; }
  .bill-steps li { display: none; padding: 2px 0 2px 10px; } .bill-steps li.on { display: block; }
  .bill-steps li.on p { font-size: .8rem; }
  .bill-desk { grid-template-columns: minmax(0, 1fr); min-height: 0; gap: 8px; padding: 8px 8px 96px; }
  .wires { display: none; }
  .receipt { padding: 9px 11px; font-size: .76rem; } .scanner { height: 22px; margin: 5px 0; } .r-rows { min-height: 66px; }
  .r-done { padding-top: 4px; }
  .tiles { position: relative; display: block; height: 130px; }
  .tile { position: absolute; inset: 0; opacity: 0; transform: translateY(12px); } .tile.on { opacity: 0; } .tile.now { opacity: 1; transform: none; filter: none; }
  .tile--profit .p-bars { left: 55%; top: 16px; height: auto; bottom: 12px; }
  .bill-finale { padding: 9px 11px; } .bill-finale .btn { padding: .6em .9em; font-size: .86rem; }
  .bill-note { display: none; }
  .bill-sticky { padding-top: 66px; }
  .bill-steps li.on p { display: none; }
  .bill-bar { min-height: 36px; padding: 5px 10px; }
  .bill-bar b { display: none; }
  .bill-status { white-space: nowrap; }
  .scanner { height: 16px; margin: 4px 0; }
  .r-rows li { padding: 2px 0; }
  .tiles { height: 112px; }
  .tile { padding: 8px 10px; }
  .tile:first-child li { margin-bottom: 3px; }
  .tile h4 { margin-bottom: 4px; }
}
html.reduced .bill, .bill.is-static { height: auto; }
html.reduced .bill-sticky { position: relative; height: auto; }

/* Sketch mode: hand-drawn boxes, handwriting font and marker highlights */
@font-face { font-family: "Kalam"; src: url("assets/fonts/kalam-400-latin.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: "Kalam"; src: url("assets/fonts/kalam-400-ext.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0100-02BA, U+20A0-20AB, U+20AD-20C4, U+2113; }
@font-face { font-family: "Kalam"; src: url("assets/fonts/kalam-700-latin.woff2") format("woff2"); font-weight: 700 800; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: "Kalam"; src: url("assets/fonts/kalam-700-ext.woff2") format("woff2"); font-weight: 700 800; font-display: swap; unicode-range: U+0100-02BA, U+20A0-20AB, U+20AD-20C4, U+2113; }
.bill { --ink: #1d2733; --hand: "Kalam", "Comic Sans MS", cursive; --wobble: 18px 6px 16px 5px / 5px 16px 6px 18px; --wobble2: 6px 18px 5px 16px / 16px 5px 18px 6px; }
.bill-stage, .bill-stage .stamp, .bill-stage .bill-status, .bill-stage .receipt header span { font-family: var(--hand); }
.bill-copy h2 em { position: relative; z-index: 0; font-family: var(--hand); font-style: normal; font-weight: 700; color: var(--ink); background: none; -webkit-text-fill-color: var(--ink); padding: 0 .12em; }
.bill-copy h2 em::before { content: ""; position: absolute; z-index: -1; left: -.08em; right: -.1em; top: .18em; bottom: .02em; background: #fbb034; border-radius: 6px 14px 5px 12px / 12px 5px 14px 6px; transform: rotate(-1.2deg); }
.bill-copy h2 em .w span, .bill-copy h2 em span { background: none !important; -webkit-text-fill-color: var(--ink) !important; color: var(--ink) !important; }
.bill-copy h2 em .doodle { display: none; }
.bill-window { border: 2px solid var(--ink); border-radius: var(--wobble); box-shadow: 5px 6px 0 rgba(29, 39, 51, .9); background: #fffaf0; }
.bill-bar { border-bottom: 2px solid var(--ink); background: #fff; }
.bill-bar b { font-family: var(--hand); font-size: 1rem; }
.bill-bar .dots i { border: 1.5px solid var(--ink); }
.bill-status { border: 1.5px solid currentColor; font-size: .82rem; font-weight: 700; border-radius: 12px 5px 10px 4px; }
.bill-desk { background-image: linear-gradient(rgba(31, 155, 232, .09) 1px, transparent 1px), linear-gradient(90deg, rgba(31, 155, 232, .09) 1px, transparent 1px); background-size: 26px 26px; }
.receipt, .tile { border: 2px solid var(--ink); border-radius: var(--wobble2); box-shadow: 3px 4px 0 rgba(29, 39, 51, .85); }
.receipt { font-size: .95rem; transform: rotate(-.6deg); }
.tile:nth-child(2) { transform: rotate(.5deg); } .tile:nth-child(3) { transform: rotate(-.4deg); }
.tile.now { border-color: var(--accent); box-shadow: 3px 4px 0 var(--accent); transform: rotate(0) scale(1.025); }
.receipt header strong { font-size: 1.3rem; font-weight: 700; letter-spacing: 0; }
.receipt header, .r-sum { border-color: var(--ink); border-style: dashed; border-width: 0 0 2px; }
.r-sum { border-width: 2px 0 0; }
.r-rows em { font-size: .82rem; }
.r-sum .grand { position: relative; z-index: 0; background: none; color: var(--ink); font-size: 1.3rem; font-weight: 700; }
.r-sum .grand::before { content: ""; position: absolute; z-index: -1; inset: 0; background: #fbb034; border-radius: 6px 16px 5px 14px / 14px 5px 16px 6px; transform: rotate(-.8deg); }
.r-sum .grand dd { color: var(--ink); }
.r-done { font-size: .92rem; }
.tile h4 { font-family: var(--hand); font-size: .92rem; font-weight: 700; letter-spacing: .02em; color: var(--ink); }
.tile ul { font-size: .9rem; }
.ledger li, .form li { border-bottom: 1.5px dashed rgba(29, 39, 51, .35); }
.tile:first-child i, .meter { height: 7px; border: 1.5px solid var(--ink); border-radius: 6px 3px 7px 3px; background: #fff; }
.tile--profit strong { font-family: var(--hand); font-weight: 700; letter-spacing: 0; }
.tile--profit small { font-size: .85rem; }
.p-bars i { border: 1.5px solid var(--ink); border-bottom: 0; border-radius: 4px 6px 0 0; }
.stamp { border-width: 2.5px; border-radius: 10px 4px 12px 5px; font-weight: 700; font-size: .85rem; }
.w-base { stroke: rgba(29, 39, 51, .35); stroke-width: 2; stroke-dasharray: .012 .012; }
.w-live { stroke-width: 2.5; }
.bill-finale { border-top: 2px solid var(--ink); }
.bill-finale strong { font-family: var(--hand); font-weight: 700; letter-spacing: 0; }
.bill-confetti span { font-family: var(--hand); }
@media (max-width: 1000px) { .receipt { font-size: .84rem; } .r-sum .grand { font-size: 1.1rem; } .tile { transform: none; } .tile.now { transform: none; } }
/* auto-play: one screen tall, no scroll pinning */
.bill.is-auto { height: auto; }
.bill.is-auto .bill-sticky { position: relative; top: auto !important; height: auto; min-height: min(100svh, 860px); padding-top: clamp(40px, 6vw, 80px); padding-bottom: clamp(40px, 6vw, 80px); }
@media (max-width: 1000px) { .bill.is-auto .bill-sticky { min-height: 0; padding-top: 40px; padding-bottom: 40px; } }

/* speed: the scan line moves with transform, not left (no layout work each frame) */
.laser { left: 0; right: 0; width: auto; background: none; box-shadow: none; }
.laser::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 3px; background: #ff2b4a; box-shadow: 0 0 14px 4px rgba(255, 43, 74, .7); }
.is-scanning .laser { animation: billLaserX .8s ease-in-out infinite alternate; will-change: transform; }
@keyframes billLaserX { from { transform: translateX(0); } to { transform: translateX(calc(100% - 3px)); } }

