/* Ultimate Kami — the receipt. Thermal paper on a dark counter, one monospace face. */
:root {
  --counter: #1b1a18;
  --counter-2: #2c2a26;
  --paper: #f6f4ee;
  --ink: #1f1f1e;
  --ink-soft: #4b4a46;
  --muted: #8f8b82;
  --blue: #3fb8ff;

  --f: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --paper-w: min(540px, calc(100vw - 40px));
  --ease: cubic-bezier(.2, .9, .2, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { overflow-x: clip; scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--paper);
  font-family: var(--f);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  background:
    radial-gradient(70% 55% at 50% 0%, var(--counter-2), transparent 70%),
    var(--counter);
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

/* ---------- Top bar ---------- */
.top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 5;
  display: flex; justify-content: space-between; align-items: center;
  padding: calc(20px + env(safe-area-inset-top, 0px)) clamp(20px, 4vw, 48px) 20px;
  font-size: .8rem; text-transform: uppercase; letter-spacing: .08em;
}
.top-mark { font-weight: 700; }
.top-store { color: #c9c5bb; transition: color .2s; }
.top-store:hover { color: #fff; }

/* ---------- App Store badge ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 11px 22px 11px 16px; border-radius: 12px;
  background: var(--paper); color: var(--ink); font-weight: 700;
  transition: transform .3s var(--ease);
}
.badge:hover { transform: translateY(-2px); }
.badge svg { width: 24px; height: 24px; fill: currentColor; flex: none; }
.badge span { display: flex; flex-direction: column; line-height: 1.1; font-size: 1.1rem; letter-spacing: -0.02em; }
.badge small { font-size: .64rem; font-weight: 500; letter-spacing: 0; }

/* ---------- Rotato placeholders ----------
   Each .rotato has data-video="videos/name". script.js swaps in
   videos/name.webm or videos/name.mp4 as soon as one exists. */
.rotato {
  position: relative; aspect-ratio: 9 / 19.5; width: 100%;
  border-radius: 14% / 6.5%;
  background: linear-gradient(165deg, #2c2f35, #111215);
  border: 7px solid #0d0d0e;
  box-shadow: 0 0 0 1px rgba(255,255,255,.07), 30px 40px 60px -20px rgba(0,0,0,.6);
  overflow: hidden; display: grid; place-items: center;
}
.rotato::before { content: ""; position: absolute; top: 2.6%; left: 50%; translate: -50% 0; width: 31%; height: 3.4%; border-radius: 99px; background: #000; }
.rotato::after {
  content: attr(data-label); position: absolute; left: 0; right: 0; bottom: 6%; text-align: center;
  font-size: .6rem; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.35);
}
.rotato-mark { width: 46%; border-radius: 24%; }
.rotato.has-video { background: none; border: 0; box-shadow: none; border-radius: 0; }
.rotato.has-video::before, .rotato.has-video::after, .rotato.has-video > :not(video) { display: none; }
.rotato video { width: 100%; height: 100%; object-fit: contain; }

/* ---------- Hero ---------- */
.till { position: relative; display: flex; flex-direction: column; align-items: center; }
.hero {
  position: relative; width: 100%; min-height: 72vh; min-height: 72svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  padding: 110px clamp(20px, 4vw, 48px) 48px;
}
.hero h1 {
  margin: 0; max-width: 17ch;
  font-size: clamp(2.2rem, 5vw, 4.6rem); line-height: 1.02; font-weight: 700; letter-spacing: -0.05em;
}
.hero p { margin: 26px 0 30px; max-width: 34em; color: #c9c5bb; font-size: clamp(.95rem, 1.2vw, 1.05rem); }
.hero-phone {
  position: absolute; right: max(4vw, calc(50% - 640px)); top: 26%;
  width: clamp(150px, 14vw, 210px); rotate: 9deg;
}

/* ---------- Receipt ---------- */
.receipt {
  position: relative; z-index: 1; width: var(--paper-w);
  padding: 36px 30px 44px;
  background:
    repeating-linear-gradient(0deg, rgba(0,0,0,.012) 0 2px, transparent 2px 4px),
    linear-gradient(90deg, #ebe8e0, var(--paper) 8%, var(--paper) 92%, #ebe8e0);
  color: var(--ink);
  filter: drop-shadow(0 30px 40px rgba(0,0,0,.45));
}
/* Torn top and bottom edges. */
.receipt::before, .receipt::after {
  content: ""; position: absolute; left: 0; right: 0; height: 10px;
  background-size: 12px 10px; background-repeat: repeat-x;
}
.receipt::before { top: -9px; background-image: conic-gradient(from 135deg at 50% 0%, var(--paper) 90deg, transparent 0); }
.receipt::after { bottom: -9px; background-image: conic-gradient(from -45deg at 50% 100%, var(--paper) 90deg, transparent 0); }

.ln { position: relative; min-height: 1.5em; }
.ln.c { text-align: center; }
.ln.big { font-weight: 700; font-size: 1.5em; line-height: 1.25; letter-spacing: -0.02em; margin-top: .3em; }
.ln.row { display: flex; align-items: baseline; gap: 6px; }
.ln.row i { flex: 1; border-bottom: 2px dotted rgba(31,31,30,.35); translate: 0 -4px; min-width: 12px; }
.ln.row span:last-child { white-space: nowrap; font-weight: 500; }
.ln.sub { color: var(--ink-soft); padding-left: 1.2em; }
.ln.rule { height: 0; min-height: 0; border-top: 2px dashed rgba(31,31,30,.55); margin: 18px 0; }
.ln.rule.light { border-top-style: dotted; border-color: rgba(31,31,30,.3); }
.ln.void span:first-child { text-decoration: line-through; text-decoration-thickness: 2px; color: var(--ink-soft); }
.ln.total {
  display: flex; justify-content: space-between; gap: 12px; margin: 14px -10px 10px; padding: 10px 10px;
  background: var(--ink); color: var(--paper); font-weight: 700; font-size: 1.35em; letter-spacing: -0.02em;
}
.ln.note { color: var(--ink-soft); }
.ln.spaced { letter-spacing: .3em; color: var(--muted); }
.logo { margin: 0 auto 10px; border-radius: 14px; filter: grayscale(1) contrast(1.6) brightness(1.05); mix-blend-mode: multiply; }

.barcode { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 0 4px; }
.bars { display: flex; align-items: stretch; height: 74px; }
.bars b { display: block; background: var(--ink); }
.barcode-num { font-size: .72rem; letter-spacing: .2em; }
.barcode:hover .bars b { background: #000; }
.barcode:hover .barcode-num { text-decoration: underline; }

/* Lines print as they leave the printer. */
.js .ln { clip-path: inset(0 100% 0 0); }
.js .ln.rule { clip-path: none; opacity: 0; }
.js .ln.printed { clip-path: inset(0 0 0 0); transition: clip-path .32s steps(14, end); }
.js .ln.rule.printed { opacity: 1; transition: opacity .15s; }

/* ---------- Phones on the counter ---------- */
.grp { position: relative; }
.side-phone { position: absolute; top: -30px; width: 180px; z-index: 0; }
.side-left { right: calc(100% + 90px); rotate: -7deg; }
.side-right { left: calc(100% + 90px); rotate: 6deg; }
.side-low { top: 90px; rotate: -3deg; }

/* ---------- Printer ---------- */
.printer {
  position: sticky; bottom: 0; z-index: 10;
  width: calc(var(--paper-w) + 90px); max-width: 100vw;
  margin-top: -6px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: linear-gradient(#2d2c2a, #161514);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -18px 40px -10px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.08);
}
.printer-slot {
  height: 14px; margin: 0 26px; border-radius: 0 0 8px 8px;
  background: linear-gradient(#000, #2a2927);
  box-shadow: inset 0 3px 6px rgba(0,0,0,.8);
}
.printer-face { display: flex; align-items: center; gap: 12px; padding: 14px 22px 18px; }
.led { width: 8px; height: 8px; border-radius: 50%; background: #3a3936; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); flex: none; transition: background .15s, box-shadow .15s; }
.printer.busy .led { background: var(--blue); box-shadow: 0 0 10px var(--blue); }
.printer.done .led { background: #59d38c; box-shadow: 0 0 10px #59d38c; }
.display {
  flex: 1; padding: 6px 12px; border-radius: 6px; background: #0e1410; color: #8fe3b0;
  font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  box-shadow: inset 0 1px 3px rgba(0,0,0,.7);
}
.printer-btn {
  flex: none; padding: 8px 14px; border-radius: 8px; font-size: .78rem; font-weight: 700; letter-spacing: .02em;
  background: var(--paper); color: var(--ink); transition: background .2s;
}
.printer-btn:hover { background: #fff; }

/* ---------- After ---------- */
.after { text-align: center; padding: clamp(120px, 18vh, 200px) 20px clamp(100px, 14vh, 160px); }
.after h2 { margin: 0 0 40px; font-size: clamp(2.2rem, 5vw, 4.4rem); line-height: 1.02; font-weight: 700; letter-spacing: -0.05em; }

.footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  padding: 24px clamp(20px, 4vw, 48px) calc(24px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(255,255,255,.08); color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .06em;
}
.footer p { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .ln, .js .ln.rule { clip-path: none; opacity: 1; transition: none; }
}

/* ---------- Narrow screens: phones lie on the receipt ---------- */
@media (max-width: 1180px) {
  .side-phone, .side-left, .side-right { position: relative; inset: auto; top: auto; width: 56%; margin: 6px auto 26px; rotate: 0deg; z-index: 2; }
  .hero-phone { display: none; }
}
@media (max-width: 520px) {
  body { font-size: 13px; }
  .receipt { padding: 30px 20px 38px; }
  .ln.big { font-size: 1.35em; }
  .printer { width: 100vw; border-radius: 16px 16px 0 0; }
  .printer-face { padding: 12px 14px 14px; gap: 10px; }
  .display { font-size: .64rem; letter-spacing: .08em; }
  .printer-btn { font-size: .72rem; padding: 7px 10px; }
}
