/* ============================================================================
   BUYA landing — hero, receipt signature, layer cake, products, pricing
   ========================================================================== */

/* ---- Ambient ground: faint return-arc field ------------------------------ */
.hero { position: relative; padding-top: clamp(2.5rem, 6vw, 5rem); padding-bottom: clamp(3rem, 7vw, 6rem); overflow: hidden; }
.hero__field {
  position: absolute; inset: -10% -10% auto -10%; height: 620px; z-index: 0; pointer-events: none;
  opacity: .55; -webkit-mask-image: linear-gradient(180deg, #000 40%, transparent);
          mask-image: linear-gradient(180deg, #000 40%, transparent);
}
.hero__field path, .hero__field circle { vector-effect: non-scaling-stroke; }

.hero__in { position: relative; z-index: 1; display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.hero__copy { max-width: 30ch; }
.hero h1 {
  font-size: var(--step-4); line-height: .98; letter-spacing: -.035em; font-weight: 850;
  margin: 1rem 0 0;
}
.hero h1 .ret { color: var(--accent); position: relative; white-space: nowrap; }
.hero h1 .ret::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: .06em; height: .09em;
  background: var(--accent); transform-origin: left; transform: scaleX(0);
  animation: underscore 1s var(--ease) .5s forwards;
}
@keyframes underscore { to { transform: scaleX(1); } }
.hero__sub { color: var(--text-dim); font-size: var(--step-1); margin-top: 1.5rem; max-width: 40ch; }
.hero__sub b { color: var(--text); font-weight: 650; }
.hero__cta { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2rem; }
.hero__trust { display: flex; flex-wrap: wrap; gap: .5rem .5rem; margin-top: 2.2rem; }

/* ---- The receipt signature ----------------------------------------------- */
.receipt-stage { position: relative; display: flex; justify-content: center; perspective: 1400px; }
.receipt {
  --tear: 14px;
  position: relative; width: min(360px, 100%);
  background: var(--receipt-bg); color: var(--receipt-ink);
  font-family: var(--mono); font-size: .82rem; line-height: 1.5;
  padding: 1.6rem 1.5rem 2.2rem; border-radius: 3px 3px 0 0;
  box-shadow: var(--shadow), 0 2px 0 rgba(0,0,0,.06);
  transform: rotate(-1.4deg);
  animation: print 1.1s var(--ease) both .3s;
}
@keyframes print {
  from { opacity: 0; transform: rotate(-1.4deg) translateY(-36px); clip-path: inset(0 0 100% 0); }
  to   { opacity: 1; transform: rotate(-1.4deg) translateY(0); clip-path: inset(0 0 0 0); }
}
/* torn bottom edge */
.receipt::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: calc(var(--tear) * -1); height: var(--tear);
  background:
    linear-gradient(45deg, transparent 50%, var(--receipt-bg) 51%) 0 0,
    linear-gradient(-45deg, transparent 50%, var(--receipt-bg) 51%) 0 0;
  background-size: calc(var(--tear) * 2) var(--tear); background-repeat: repeat-x;
  filter: drop-shadow(0 3px 2px rgba(0,0,0,.12));
}
.receipt__head { text-align: center; border-bottom: 1.5px dashed color-mix(in oklab, var(--receipt-ink) 35%, transparent); padding-bottom: .9rem; margin-bottom: .9rem; }
.receipt__head .lg { font-weight: 700; letter-spacing: .28em; font-size: .95rem; }
.receipt__head .sm { font-size: .68rem; letter-spacing: .1em; color: color-mix(in oklab, var(--receipt-ink) 60%, transparent); margin-top: .3rem; }
.receipt__row { display: flex; align-items: baseline; gap: .5rem; }
.receipt__row .lead { flex: 1; border-bottom: 1px dotted color-mix(in oklab, var(--receipt-ink) 40%, transparent); position: relative; top: -.28em; }
.receipt__row .k { white-space: nowrap; }
.receipt__row .v { white-space: nowrap; font-variant-numeric: tabular-nums; }
.receipt__rule { border: none; border-top: 1.5px dashed color-mix(in oklab, var(--receipt-ink) 35%, transparent); margin: .9rem 0; }
.receipt__big { display: flex; justify-content: space-between; align-items: baseline; font-weight: 700; }
.receipt__big .amt { color: #b0521a; font-size: 1.25rem; }
:root[data-theme="light"] .receipt__big .amt { color: #b0521a; }
.receipt__stamp {
  margin-top: 1rem; text-align: center; font-weight: 700; letter-spacing: .12em; font-size: .72rem;
  color: #1f7a71; border: 2px solid #1f7a71; border-radius: 6px; padding: .45rem; transform: rotate(-3deg);
  opacity: 0; animation: stamp .35s var(--ease) 1.4s forwards;
}
@keyframes stamp { from { opacity: 0; transform: rotate(-3deg) scale(1.5); } to { opacity: .9; transform: rotate(-3deg) scale(1); } }
.receipt__barcode { margin-top: 1.1rem; height: 34px;
  background: repeating-linear-gradient(90deg, var(--receipt-ink) 0 2px, transparent 2px 4px, var(--receipt-ink) 4px 5px, transparent 5px 9px, var(--receipt-ink) 9px 12px, transparent 12px 14px);
}
.receipt__no { text-align: center; font-size: .64rem; letter-spacing: .3em; margin-top: .5rem; color: color-mix(in oklab, var(--receipt-ink) 60%, transparent); }
.receipt-note { position: absolute; bottom: -2.4rem; left: 0; right: 0; text-align: center; font-family: var(--mono); font-size: var(--step--1); color: var(--text-faint); }

/* ---- Marquee of POS / verticals ------------------------------------------ */
.marquee { border-block: 1px solid var(--line); padding-block: 1.1rem; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.marquee__track { display: flex; gap: 3rem; width: max-content; animation: scroll 34s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__track span { font-family: var(--mono); font-size: var(--step--1); letter-spacing: .12em; text-transform: uppercase; color: var(--text-dim); display: inline-flex; align-items: center; gap: 3rem; }
.marquee__track span::after { content: "✳"; color: var(--accent); }
@keyframes scroll { to { transform: translateX(-50%); } }

/* ---- Layer cake ----------------------------------------------------------- */
.layers { display: grid; gap: 10px; }
.layer {
  display: grid; grid-template-columns: 4.5rem 1fr auto; gap: 1.2rem; align-items: center;
  padding: 1.15rem 1.4rem; border-radius: var(--r-md); border: 1px solid var(--line);
  background: var(--surface); color: var(--text-dim);
}
.layer .ln { font-family: var(--mono); font-size: var(--step--1); color: var(--text-faint); letter-spacing: .1em; }
.layer .lt { color: var(--text); font-weight: 600; }
.layer .lo { font-family: var(--mono); font-size: var(--step--1); color: var(--text-faint); text-align: right; }
.layer--buya {
  border-color: var(--accent); color: var(--text);
  background: linear-gradient(100deg, color-mix(in oklab, var(--accent) 16%, var(--surface)), var(--surface));
  box-shadow: 0 0 0 1px var(--accent), 0 20px 40px -28px var(--accent);
  transform: scale(1.015);
}
.layer--buya .lt { font-weight: 800; }
.layer--buya .lo { color: var(--accent); }
.layer--enemy { border-style: dashed; }
.layer--enemy .lo { color: var(--accent); }

/* ---- Products (two panels) ------------------------------------------------ */
.products { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.product {
  position: relative; border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: clamp(1.6rem, 3vw, 2.4rem); background: var(--surface); overflow: hidden;
  transition: border-color .25s, transform .25s var(--ease);
}
.product:hover { border-color: var(--line-strong); transform: translateY(-3px); }
.product__no { font-family: var(--mono); font-size: var(--step--1); letter-spacing: .18em; color: var(--text-faint); }
.product h3 { font-size: var(--step-2); letter-spacing: -.02em; line-height: 1.05; margin: .7rem 0 .3rem; font-weight: 800; }
.product__tag { font-family: var(--mono); font-size: var(--step--1); color: var(--rail); letter-spacing: .06em; }
.product p { color: var(--text-dim); margin-top: 1rem; }
.product ul { list-style: none; margin-top: 1.3rem; display: grid; gap: .6rem; }
.product li { display: flex; gap: .7rem; align-items: flex-start; font-size: var(--step-0); }
.product li::before { content: ""; width: 8px; height: 8px; margin-top: .55em; flex: none; border-radius: 2px; background: var(--accent); transform: rotate(45deg); }
.product--api li::before { background: var(--rail); }
.product__foot { margin-top: 1.7rem; display: flex; gap: .8rem; flex-wrap: wrap; }
.product__code {
  margin-top: 1.4rem; background: var(--ground); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 1rem 1.1rem; font-family: var(--mono); font-size: .76rem; color: var(--text-dim); overflow-x: auto; line-height: 1.7;
}
.product__code .cm { color: var(--text-faint); }
.product__code .fn { color: var(--rail-2); }
.product__code .st { color: var(--gold); }

/* ---- Why grid ------------------------------------------------------------- */
.why { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
.why__card { border: 1px solid var(--line); border-radius: var(--r-md); padding: 1.5rem; background: var(--surface); }
.why__card.span2 { grid-column: span 2; }
.why__ic { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in oklab, var(--rail) 16%, transparent); color: var(--rail-2); margin-bottom: 1rem; }
.why__card h3 { font-size: var(--step-1); letter-spacing: -.01em; margin-bottom: .5rem; font-weight: 700; }
.why__card p { color: var(--text-dim); font-size: var(--step-0); }
.why__card p b { color: var(--text); }
.why__metric { font-family: var(--mono); color: var(--gold); font-weight: 700; }
/* Concierge card feature */
.why__card--persona { background: linear-gradient(140deg, color-mix(in oklab, var(--accent) 12%, var(--surface)), var(--surface)); border-color: color-mix(in oklab, var(--accent) 30%, var(--line)); }
.persona-chip { display: inline-flex; align-items: center; gap: .6rem; font-family: var(--mono); font-size: var(--step--1); padding: .4rem .7rem; border-radius: 999px; background: var(--ground); border: 1px solid var(--line); margin-top: 1rem; }
.persona-chip .av { width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, var(--return-2), var(--accent)); }
@media (max-width: 900px) { .why { grid-template-columns: 1fr 1fr; } .why__card.span2 { grid-column: span 2; } }
@media (max-width: 620px) { .why { grid-template-columns: 1fr; } .why__card.span2 { grid-column: auto; } }

/* ---- Pricing -------------------------------------------------------------- */
.pricing { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; align-items: stretch; }
.tier { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.5rem; background: var(--surface); }
.tier--featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); position: relative; }
.tier--featured::before { content: "Most merchants"; position: absolute; top: -.7rem; left: 1.5rem; font-family: var(--mono); font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; background: var(--accent); color: var(--accent-ink); padding: .25rem .6rem; border-radius: 999px; }
.tier__name { font-family: var(--mono); font-size: var(--step--1); letter-spacing: .12em; text-transform: uppercase; color: var(--text-dim); }
.tier__price { font-size: var(--step-2); font-weight: 800; letter-spacing: -.02em; margin: .8rem 0 .1rem; }
.tier__price small { font-size: .5em; font-weight: 500; color: var(--text-dim); font-family: var(--mono); }
.tier__who { color: var(--text-dim); font-size: var(--step-0); min-height: 3.2em; }
.tier ul { list-style: none; margin: 1.1rem 0 1.4rem; display: grid; gap: .55rem; font-size: var(--step--1); color: var(--text-dim); }
.tier li { display: flex; gap: .55rem; }
.tier li::before { content: "→"; color: var(--rail); }
.tier .btn { margin-top: auto; justify-content: center; }
.pricing-note { text-align: center; margin-top: 1.5rem; font-family: var(--mono); font-size: var(--step--1); color: var(--text-faint); }
@media (max-width: 980px) { .pricing { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .pricing { grid-template-columns: 1fr; } }

/* ---- CTA band ------------------------------------------------------------- */
.cta-band { border-radius: var(--r-lg); padding: clamp(2.2rem, 5vw, 4rem); background: linear-gradient(120deg, var(--ink-2), var(--ink)); border: 1px solid var(--line-strong); position: relative; overflow: hidden; text-align: center; }
:root[data-theme="light"] .cta-band { background: linear-gradient(120deg, var(--surface-2), var(--surface)); }
.cta-band h2 { font-size: var(--step-3); letter-spacing: -.025em; line-height: 1.02; font-weight: 850; max-width: 18ch; margin-inline: auto; }
.cta-band p { color: var(--text-dim); margin: 1rem auto 0; max-width: 48ch; }
.cta-band__row { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; margin-top: 2rem; }
.cta-band__arc { position: absolute; inset: auto -20% -60% -20%; height: 300px; opacity: .5; pointer-events: none; }

/* ---- API capture modal ---------------------------------------------------- */
dialog.modal { border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--surface); color: var(--text); padding: 0; width: min(460px, calc(100% - 2rem)); box-shadow: var(--shadow); }
dialog.modal::backdrop { background: rgba(8,5,2,.6); backdrop-filter: blur(3px); }
.modal__in { padding: 1.8rem; }
.modal h3 { font-size: var(--step-2); letter-spacing: -.02em; font-weight: 800; }
.modal p { color: var(--text-dim); margin-top: .5rem; font-size: var(--step-0); }
.modal form { margin-top: 1.4rem; display: grid; gap: .8rem; }
.modal label { font-family: var(--mono); font-size: var(--step--1); letter-spacing: .08em; text-transform: uppercase; color: var(--text-dim); }
.modal input, .modal select, .modal textarea { width: 100%; padding: .8rem .9rem; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--ground); color: var(--text); }
.modal input:focus, .modal select:focus, .modal textarea:focus { outline: none; border-color: var(--rail); }
.modal__actions { display: flex; gap: .6rem; justify-content: flex-end; margin-top: .5rem; }
.modal__ok { text-align: center; padding: 1rem 0; }
.modal__ok .big { font-size: 2.4rem; }

/* ---- Responsive hero ------------------------------------------------------ */
@media (max-width: 900px) {
  .hero__in { grid-template-columns: 1fr; }
  .hero__copy { max-width: none; }
  .receipt-stage { margin-top: 1rem; }
  .products { grid-template-columns: 1fr; }
  .layer { grid-template-columns: 3.5rem 1fr; }
  .layer .lo { grid-column: 2; text-align: left; }
}
