/* zappopos.com home page. The drawings are ink lines on paper, like a shopkeeper's bill book; carbon blue is the
   only colour that isn't ink, and the red PAID stamp the only loud mark. One moment moves on its own (the bill
   printing, stamped, sent on WhatsApp); the rest moves only when it explains something or when scrolled to.
   Notes in Kalam are the shopkeeper's handwriting on the screen. Loaded after landing.css. */
:root {
    --wash: #e6ebfb;          /* carbon paper's pale blue impression */
    --hand: "Kalam", "Segoe Print", "Comic Sans MS", cursive;
    --wa: #dcf8c6;            /* a sent WhatsApp message */
}

/* shared drawing strokes */
.ink, .ink-light, .carbon-line { fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.ink.thin, .ink-light.thin { stroke-width: 1.6; }
.ink.dashes { stroke-dasharray: 2 9; }
.ink.fill-paper { fill: #fff; }
.ink.fill-carbon { fill: var(--carbon); stroke: none; }
.ink-light { stroke: #c3ccd8; }
.carbon-line { stroke: var(--carbon); stroke-width: 2.6; }
.carbon-line.dashed { stroke-dasharray: 3 7; }
.h-hand { margin: 0; color: var(--carbon); font: 700 1.2rem/1.2 var(--hand); }

/* ---------- hero ---------- */
.h-hero { display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); align-items: center; gap: 40px; padding: 36px 0 110px; border-top: none; }
.h-hero h1 { max-width: 11ch; font-size: clamp(2.7rem, 1.3rem + 4.6vw, 4.9rem); font-weight: 800; line-height: 0.98; letter-spacing: -0.042em; }
.h-lead { max-width: 44ch; margin: 24px 0 0; color: #2c3a4d; font-size: 1.18rem; }
.h-note { max-width: 46ch; margin: 18px 0 0; color: var(--grey); font-size: 0.95rem; }
.h-scene { position: relative; justify-self: center; width: min(560px, 100%); }
.h-shop { display: block; width: 100%; height: auto; overflow: visible; }
.awning path { fill: var(--carbon); stroke: var(--ink); stroke-width: 2.4; stroke-linejoin: round; }
/* the printer stands on the drawn counter (its top is at 300 of 470); the bill hangs over the counter's front */
.h-printer-wrap { position: absolute; left: 38%; top: calc(300 / 470 * 100% - 34px); width: 50%; }
.h-printer-wrap .printer { margin: 0 -10px; }
.h-slip { padding: 20px 16px 22px; font-size: 11.5px; box-shadow: 0 22px 40px -26px rgba(20, 32, 46, 0.6); }
.h-slip .slip-head strong { font-size: 12.5px; }
.h-slip .slip-lines li { grid-template-columns: 1fr auto 58px; gap: 6px; }
.h-slip .stamp { font-size: 18px; }
.h-wa {
    position: absolute; right: -2%; top: 31%; display: grid; gap: 3px; width: 200px; padding: 10px 12px 8px; border-radius: 14px 14px 3px 14px;
    background: var(--wa); color: #1f2733; font-size: 0.8rem; line-height: 1.35; box-shadow: 0 18px 34px -20px rgba(20, 32, 46, 0.55);
    animation: wa-pop 0.45s cubic-bezier(0.2, 1.4, 0.4, 1) 2.7s both;
}
.h-wa-head { display: flex; align-items: center; gap: 6px; color: #1b7340; font-weight: 700; font-size: 0.72rem; }
.h-wa-head svg { width: 14px; height: 14px; fill: none; stroke: #1b7340; stroke-width: 2.2; stroke-linejoin: round; }
.h-wa-tick { justify-self: end; color: #34b7f1; font-size: 0.75rem; letter-spacing: -0.15em; }
.h-hand-hero { position: absolute; left: 0; top: 74%; transform: rotate(-6deg); animation: fade 0.5s ease 3.2s both; }
.h-hand-hero::after { /* a drawn arrow towards the bill */
    content: ""; display: block; width: 74px; height: 30px; margin: 2px 0 0 96px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 74 30' fill='none' stroke='%232743c4' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M2 4 C 22 24, 46 26, 70 14'/%3E%3Cpath d='M60 8 L70 14 L59 20'/%3E%3C/svg%3E") no-repeat;
}
@keyframes wa-pop { from { opacity: 0; transform: translateY(14px) scale(0.85); } }
@keyframes fade { from { opacity: 0; } }

/* ---------- the signboards ---------- */
.h-boards { padding: 44px 0 56px; text-align: center; }
.h-quiet-title { color: var(--grey); font-size: 1.05rem; font-weight: 600; letter-spacing: 0; }
.h-board-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 16px; margin: 22px 0 0; padding: 0; list-style: none; }
.h-board {
    display: inline-block; padding: 9px 18px 7px; border: 2px solid var(--ink); border-radius: 6px; background: #fff;
    box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 4.5px var(--ink), 0 3px 0 var(--ink);
    color: var(--ink); font: 700 1.12rem/1.2 var(--hand); text-decoration: none; transition: transform 0.18s ease;
}
.h-board-row li:nth-child(odd) .h-board { transform: rotate(-1.6deg); }
.h-board-row li:nth-child(even) .h-board { transform: rotate(1.2deg); }
.h-board-row li:nth-child(3n) .h-board { background: var(--wash); box-shadow: inset 0 0 0 3px var(--wash), inset 0 0 0 4.5px var(--ink), 0 3px 0 var(--ink); }
a.h-board:hover, a.h-board:focus-visible { transform: rotate(0) translateY(-3px); }

/* ---------- one screen, with notes ---------- */
.h-screen-copy { max-width: 56ch; }
.h-screen-copy p { margin: 14px 0 0; color: #3a4759; font-size: 1.08rem; }
.h-annotated { position: relative; margin: 92px 0 70px; }
.h-annotated img { display: block; width: 100%; height: auto; border: 1px solid var(--rule); border-radius: 14px; background: #fff; box-shadow: 0 40px 70px -46px rgba(20, 32, 46, 0.55); }
.h-arrows { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.h-arrows path { fill: none; stroke: var(--carbon); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.h-notes .h-hand { position: absolute; font-size: 1.3rem; white-space: nowrap; }
.h-notes .n1 { top: -78px; left: 6%; transform: rotate(-4deg); }
.h-notes .n2 { top: -78px; right: 10%; transform: rotate(3deg); }
.h-notes .n3 { bottom: -62px; right: -1%; transform: rotate(-3deg); }

/* ---------- the extras: a switch, what it does, and the phone screen peeking out of the card ---------- */
.h-extras-head { max-width: 62ch; }
.h-extras-head h2 { max-width: 20ch; }
.h-extras-head p { margin: 14px 0 0; color: #3a4759; font-size: 1.08rem; }
.h-extras-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin: 40px 0 0; padding: 0; list-style: none; }
.h-extra {
    display: flex; flex-direction: column; padding: 22px 24px 0; overflow: hidden;
    border: 2px solid var(--ink); border-radius: 18px; background: #fff; box-shadow: 0 6px 0 var(--ink);
}
/* the row in Shop settings that switches it on */
.h-switch {
    display: inline-flex; align-items: center; gap: 10px; align-self: flex-start; justify-self: start; margin: 0 0 18px; padding: 5px 13px 5px 5px;
    border: 1.5px solid var(--rule); border-radius: 999px; background: var(--paper); font-size: 0.82rem; font-weight: 700;
}
.h-toggle { position: relative; width: 34px; height: 20px; border-radius: 999px; background: var(--carbon); transition: background 0.3s ease; }
.h-toggle::after {
    content: ""; position: absolute; top: 3px; left: 17px; width: 14px; height: 14px; border-radius: 50%; background: #fff;
    box-shadow: 0 1px 2px rgba(20, 32, 46, 0.3); transition: left 0.3s cubic-bezier(0.3, 1.4, 0.5, 1);
}
.h-extra h3 { font-size: 1.32rem; letter-spacing: -0.02em; line-height: 1.2; }
.h-extra > p:not(.h-switch) { margin: 8px 0 28px; color: #3a4759; }
/* a phone drawn in ink, cut off by the bottom of the card */
.h-phone {
    position: relative; width: min(270px, 92%); height: 300px; margin: auto auto 0; padding: 24px 9px 0; flex: none;
    border: 2.4px solid var(--ink); border-bottom: 0; border-radius: 34px 34px 0 0; background: #fff;
}
.h-phone::before { content: ""; position: absolute; top: 9px; left: 50%; width: 46px; height: 6px; margin-left: -23px; border-radius: 3px; background: #c3ccd8; }
.h-phone img { display: block; width: 100%; height: auto; border: 1px solid var(--rule); border-bottom: 0; border-radius: 22px 22px 0 0; }
/* the shopkeeper's note, a chit stuck over the phone's top bar so the numbers below stay in sight */
.h-phone .h-hand {
    position: absolute; right: -11%; top: 20px; padding: 6px 12px 3px; border: 2px solid var(--ink); border-radius: 4px;
    background: #fff; box-shadow: 0 3px 0 var(--ink); font-size: 1.05rem; white-space: nowrap; transform: rotate(3deg);
}
.h-extra:nth-child(2) .h-hand { right: auto; left: -11%; transform: rotate(-3deg); }

/* ---------- plans as the shop grows ---------- */
.h-grow h2 { max-width: 20ch; }
.h-grow-lead { max-width: 56ch; margin: 12px 0 0; color: #3a4759; font-size: 1.08rem; }
.h-grow-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 38px; }
.h-stage { padding: 6px 30px 4px; }
.h-stage + .h-stage { border-left: 2px dashed var(--rule); }   /* the perforation between bill book pages */
.h-stage:first-child { padding-left: 0; }
.h-stage svg { display: block; width: 100%; max-width: 220px; height: auto; margin-bottom: 14px; overflow: visible; }
.h-stage svg .sign { fill: var(--ink); font: 700 10px var(--font); letter-spacing: 0.08em; }
.h-stage h3 { font-size: 1.2rem; }
.h-stage p { margin: 6px 0 0; color: #3a4759; }
.h-stage .h-price { margin-top: 14px; color: var(--ink); }
.h-price strong { font-size: 1.35rem; letter-spacing: -0.02em; }
.h-grow-foot { margin: 30px 0 0; color: var(--grey); }

/* ---------- power cuts ---------- */
.h-offline { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr); gap: 56px; align-items: center; }
.h-offline p { max-width: 50ch; margin: 14px 0 0; color: #3a4759; font-size: 1.08rem; }
.h-offline-card { display: grid; justify-items: center; gap: 14px; padding: 30px 24px; border: 2px solid var(--ink); border-radius: 18px; background: #fff; box-shadow: 0 6px 0 var(--ink); text-align: center; }
.h-bulb svg { width: 84px; height: 84px; overflow: visible; }
.h-bulb .ink:first-child { fill: #fff; transition: fill 0.4s; }
.h-bulb-rays { opacity: 0; transition: opacity 0.4s; }
.h-offline-card[data-state="synced"] .h-bulb .ink:first-child { fill: #fff3c4; }
.h-offline-card[data-state="synced"] .h-bulb-rays, .h-offline-card[data-state="syncing"] .h-bulb-rays { opacity: 1; stroke: var(--carbon); }
.h-pill { font-size: 0.95rem; transition: background 0.3s; }
.h-pill-text { min-height: 1.6em; margin: 0 !important; color: var(--grey) !important; font-size: 0.95rem !important; }

/* ---------- a week of sales ---------- */
.h-insight { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr); gap: 56px; align-items: center; }
.h-insight p { max-width: 50ch; margin: 14px 0 0; color: #3a4759; font-size: 1.08rem; }
.h-week { position: relative; margin: 0; }
.h-week svg { display: block; width: 100%; height: auto; overflow: visible; }
.h-bars rect { fill: var(--wash); stroke: var(--ink); stroke-width: 2; transform-box: fill-box; transform-origin: bottom; }
.h-bars rect.best { fill: var(--carbon); }
.h-days text { fill: var(--grey); font: 600 12px var(--font); text-anchor: middle; }
.h-hand-week { position: absolute; top: -8px; right: 0; transform: rotate(-4deg); }

/* ---------- book a demo ---------- */
.h-demo { padding-bottom: 40px; }
.h-demo-band { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 20px 32px; padding: 30px 38px; border-radius: 22px; background: var(--ink); color: #fff; }
.h-demo-band h2 { color: #fff; font-size: clamp(1.4rem, 1rem + 1.4vw, 2rem); }
.h-demo-band p { margin: 8px 0 0; max-width: 52ch; color: #c3ccd8; }
.h-demo-art { width: 96px; height: 96px; overflow: visible; }
.h-demo-art .wave { fill: none; stroke: #8da2ff; stroke-width: 2.6; stroke-linecap: round; }
.h-demo-band .button-quiet { color: #fff; border-color: rgba(255, 255, 255, 0.3); }
.h-demo-band .button-quiet:hover { background: rgba(255, 255, 255, 0.08); border-color: #fff; }

/* ---------- motion: things that are scrolled to draw themselves once (landing.js adds .in) ---------- */
@media (prefers-reduced-motion: no-preference) {
    .h-arrows path { stroke-dasharray: 1000; stroke-dashoffset: 1000; }
    .h-notes .h-hand { opacity: 0; transition: opacity 0.4s ease; }
    .h-annotated.in .h-arrows path { animation: draw 0.8s ease forwards; }
    .h-annotated.in .h-arrows path:nth-child(n + 3) { animation-delay: 0.35s; }
    .h-annotated.in .h-arrows path:nth-child(n + 5) { animation-delay: 0.7s; }
    .h-annotated.in .h-notes .h-hand { opacity: 1; }
    .h-annotated.in .h-notes .n2 { transition-delay: 0.35s; }
    .h-annotated.in .h-notes .n3 { transition-delay: 0.7s; }
    .h-bars rect { transform: scaleY(0); }
    .h-week.in .h-bars rect { animation: grow 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; animation-delay: var(--d); }
    .h-hand-week { opacity: 0; }
    .h-week.in .h-hand-week { animation: appear 0.5s ease 0.8s forwards; }
    /* each card's switch flips on, then its phone slides up and the note is stuck on */
    .h-extras-row:not(.in) .h-toggle { background: #c3ccd8; }
    .h-extras-row:not(.in) .h-toggle::after { left: 3px; }
    .h-extras-row:not(.in) .h-phone { transform: translateY(70px); }
    .h-extras-row:not(.in) .h-phone .h-hand { opacity: 0; }
    .h-phone { transition: transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) 0.25s; }
    .h-phone .h-hand { transition: opacity 0.4s ease 0.85s; }
    .h-extra:nth-child(2) .h-toggle, .h-extra:nth-child(2) .h-toggle::after { transition-delay: 0.15s; }
    .h-extra:nth-child(2) .h-phone { transition-delay: 0.4s; }
    .h-extra:nth-child(2) .h-hand { transition-delay: 1s; }
    .h-extra:nth-child(3) .h-toggle, .h-extra:nth-child(3) .h-toggle::after { transition-delay: 0.3s; }
    .h-extra:nth-child(3) .h-phone { transition-delay: 0.55s; }
    .h-extra:nth-child(3) .h-hand { transition-delay: 1.15s; }
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes appear { to { opacity: 1; } }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) {
    .h-wa, .h-hand-hero { animation: none; }
}

/* ---------- smaller screens ---------- */
@media (max-width: 980px) {
    .h-hero { grid-template-columns: 1fr; gap: 28px; padding-bottom: 150px; }
    .h-scene { width: min(520px, 100%); }
    .h-offline, .h-insight { grid-template-columns: 1fr; gap: 30px; }
    /* one card per row: what it does on the left, the phone on the right */
    .h-extras-row { grid-template-columns: 1fr; gap: 26px; }
    .h-extra { display: grid; grid-template-columns: minmax(0, 1fr) 250px; grid-template-rows: auto auto 1fr; column-gap: 30px; padding: 26px 28px 0; }
    .h-extra > :not(.h-phone) { grid-column: 1; }
    .h-extra .h-phone { grid-column: 2; grid-row: 1 / 4; width: 100%; height: 250px; margin: 0; align-self: end; }
    .h-demo-band { grid-template-columns: 1fr; }
    .h-demo-art { display: none; }
}
@media (max-width: 760px) {
    .h-annotated { margin: 30px 0 0; }
    .h-arrows { display: none; }
    .h-notes { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 14px; }
    .h-notes .h-hand { position: static; transform: none; font-size: 1.1rem; white-space: normal; opacity: 1 !important; }
    .h-grow-row { grid-template-columns: 1fr; }
    .h-stage, .h-stage:first-child { padding: 22px 0; }
    .h-stage + .h-stage { border-left: 0; border-top: 2px dashed var(--rule); }
    .h-stage svg { max-width: 190px; }
    .h-extras-row { margin-top: 30px; }
    .h-extra { display: flex; padding: 20px 20px 0; }
    .h-extra .h-phone { width: min(260px, 86%); height: 270px; margin: 0 auto; }
    .h-hero { padding-bottom: 230px; }
    .h-printer-wrap { left: 22%; width: 74%; }
    .h-slip { padding: 16px 12px 18px; font-size: 10px; }
    .h-slip .slip-head strong { font-size: 11px; }
    .h-slip .slip-lines li { grid-template-columns: 1fr auto 50px; gap: 4px; }
    .h-wa { right: 0; top: 14%; width: 158px; font-size: 0.74rem; }
    .h-hand-hero { display: none; }
    .h-board-row { flex-wrap: nowrap; justify-content: flex-start; margin-inline: -16px; padding: 6px 16px 10px; overflow-x: auto; scrollbar-width: none; }
    .h-board-row li { flex: none; }
    .h-demo-band { padding: 26px 22px; }
}
