/* AFRWebBridge landing page.
   Palette and type follow the guest ordering app (frontend/src/index.css), so the page and the
   screenshot inside it read as one product. Light theme only, by design. */

@font-face {
  font-family: 'Figtree';
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url('fonts/figtree-latin-wght-normal.woff2') format('woff2');
}

:root {
  color-scheme: light;

  --tomato: #ff2f34; /* brand red: marks, accent bars */
  --tomato-deep: #e31822; /* red that carries white text at AA */
  --tomato-soft: #fff1f1;
  --ink: #2d2f33;
  --slate: #5f646d;
  --mist: #f1f3f6;
  --rule: #e3e6eb;
  --rule-strong: #d3d8df;
  --paper: #fffdf9;
  --white: #ffffff;

  --font: 'Figtree', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'Cascadia Mono', 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;

  --gutter: 16px;
  --header-height: 64px;
}

@media (min-width: 640px) {
  :root {
    --gutter: 32px;
  }
}

@media (min-width: 1100px) {
  :root {
    --gutter: 40px;
  }
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@media (min-width: 900px) {
  body {
    font-size: 1.125rem;
  }
}

h1,
h2,
h3,
p,
figure {
  margin: 0;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--tomato-deep);
}

:focus-visible {
  outline: 3px solid var(--tomato-deep);
  outline-offset: 3px;
  border-radius: 4px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--white);
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

.wrap {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.nowrap {
  white-space: nowrap;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 26px;
  border: 2px solid transparent;
  border-radius: 12px;
  font: inherit;
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease;
}

.btn-primary {
  background: var(--tomato-deep);
  color: var(--white);
}

.btn-primary:hover {
  background: #c8121b;
}

.btn-secondary {
  border-color: var(--ink);
  background: transparent;
  color: var(--ink);
}

.btn-secondary:hover {
  background: var(--mist);
}

.btn-small {
  min-height: 42px;
  padding: 0 18px;
  font-size: 1rem;
  white-space: nowrap;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--rule);
  background: var(--white);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: var(--header-height);
}

@media (max-width: 379px) {
  .header-inner {
    gap: 12px;
  }

  .header-inner .btn-small {
    padding-inline: 14px;
  }
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  color: var(--ink);
  font-size: 1.1875rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-decoration: none;
}

/* The guest app's shopping-bag mark (.cart-mark), scaled down: a filled body with the
   handle knocked out of it in white. */
.brand-mark {
  position: relative;
  flex: none;
  width: 28px;
  height: 28px;
}

.brand-mark::before {
  content: '';
  position: absolute;
  top: 4px;
  left: 2px;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--tomato);
}

.brand-mark::after {
  content: '';
  position: absolute;
  top: 10px;
  left: 9px;
  width: 10px;
  height: 5px;
  border: 2.5px solid var(--white);
  border-top: 0;
  border-radius: 2px 2px 999px 999px;
}

.site-nav {
  display: none;
  gap: 28px;
}

.site-nav a {
  color: var(--slate);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--ink);
}

@media (min-width: 900px) {
  .site-nav {
    display: flex;
  }
}

/* ---------- Hero ---------- */

.hero-grid {
  display: grid;
  gap: 40px;
  padding-top: 44px;
}

.hero-copy {
  max-width: 36rem;
}

.hero-title {
  font-size: clamp(2.5rem, 1.55rem + 4.2vw, 4.5rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.hero-lead {
  max-width: 34em;
  margin-top: 22px;
  color: var(--slate);
  font-size: clamp(1.125rem, 1rem + 0.5vw, 1.3125rem);
  text-wrap: pretty;
}

.hero-fee {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 18px;
  font-weight: 700;
}

.hero-fee-icon {
  flex: none;
  width: 24px;
  height: 24px;
  margin-top: 1px;
}

.hero-fee-icon circle {
  fill: var(--tomato-deep);
}

.hero-fee-icon path {
  fill: none;
  stroke: var(--white);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

@media (max-width: 479px) {
  .hero-actions .btn {
    flex: 1 1 100%;
  }
}

/* The red tabletop. On phones it is a full-bleed band under the copy; from 960px the whole
   right half of the hero is red instead (see the media query below). */
.hero-table {
  margin-inline: calc(-1 * var(--gutter));
  padding: 36px var(--gutter) 30px;
  background: var(--tomato-deep);
}

/* Everything in the scene is sized in container units, so the card, the QR code and the
   phone scale together at any width. */
.scene {
  container-type: inline-size;
  position: relative;
  width: min(100%, 500px);
  margin-inline: auto;
  aspect-ratio: 1 / 1.02;
}

.tent {
  position: absolute;
  top: 2cqi;
  left: 3cqi;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 60cqi;
  padding: 6.5cqi 5.5cqi 6cqi;
  border-radius: 2.2cqi;
  background: var(--white);
  box-shadow: 0 1.6cqi 3.2cqi rgba(80, 0, 4, 0.3);
  color: var(--ink);
  text-align: center;
  text-decoration: none;
}

/* The fold at the top of an A-frame table card. */
.tent::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 2.6cqi;
  border-radius: 2.2cqi 2.2cqi 0 0;
  background: linear-gradient(#e6e7ea, var(--white));
}

/* Contact shadow where the card meets the table. */
.tent::after {
  content: '';
  position: absolute;
  right: 3%;
  bottom: -2.6cqi;
  left: 3%;
  z-index: -1;
  height: 4cqi;
  background: radial-gradient(closest-side, rgba(60, 0, 3, 0.45), transparent);
}

.tent:focus-visible {
  outline-color: var(--white);
  outline-offset: 6px;
  border-radius: 2.2cqi;
}

.tent-table {
  font-size: 8.6cqi;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
}

.tent-qr {
  width: 100%;
  margin-top: 3cqi;
}

.tent-cta {
  margin-top: 3cqi;
  font-size: 4.4cqi;
  font-weight: 700;
  line-height: 1.15;
}

.tent-store {
  margin-top: 1.2cqi;
  color: var(--slate);
  font-size: 3.4cqi;
  font-weight: 600;
}

.phone {
  position: absolute;
  right: 2.5cqi;
  bottom: 1cqi;
  z-index: 2;
  width: 37cqi;
  padding: 1.4cqi;
  border-radius: 6cqi;
  background: var(--ink);
  box-shadow: 0 2.4cqi 5cqi rgba(60, 0, 3, 0.4);
  transform: rotate(4deg);
}

.phone img {
  width: 100%;
  border-radius: 4.8cqi;
}

.scene-caption {
  max-width: 30rem;
  margin: 26px auto 0;
  color: var(--white);
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  text-wrap: balance;
}

/* Nobody can scan their own screen, so phones get a tap prompt instead. */
.caption-tap {
  display: none;
}

@media (hover: none) and (pointer: coarse) {
  .caption-scan {
    display: none;
  }

  .caption-tap {
    display: inline;
  }
}

@media (min-width: 960px) {
  /* Two equal columns put the column boundary at the page's centre line, so a hard 50%
     split paints the whole right half red, edge to edge. */
  .hero {
    background: linear-gradient(90deg, var(--white) 50%, var(--tomato-deep) 50%);
  }

  .hero-grid {
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 64px;
    padding-block: 72px 64px;
  }

  .hero-table {
    margin: 0;
    padding: 0;
    background: none;
  }
}

/* ---------- Sections ---------- */

.section {
  padding-block: 64px;
  scroll-margin-top: var(--header-height);
}

@media (min-width: 900px) {
  .section {
    padding-block: 104px;
  }
}

.section-mist {
  background: var(--mist);
}

/* The red bar before each section title is the guest app's own heading mark. */
.section-title {
  position: relative;
  padding-left: 20px;
  font-size: clamp(1.875rem, 1.4rem + 1.8vw, 2.625rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.section-title::before {
  content: '';
  position: absolute;
  top: 0.12em;
  bottom: 0.12em;
  left: 0;
  width: 6px;
  border-radius: 3px;
  background: var(--tomato);
}

.section-lead {
  max-width: 38em;
  margin-top: 16px;
  color: var(--slate);
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);
  text-wrap: pretty;
}

/* ---------- Demo ---------- */

.demo-grid {
  display: grid;
  gap: 36px;
}

@media (min-width: 900px) {
  .demo-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      'intro details'
      'steps details';
    align-items: start;
    gap: 40px 72px;
  }

  .demo-intro {
    grid-area: intro;
  }

  .demo-details {
    grid-area: details;
  }

  .steps {
    grid-area: steps;
  }
}

.demo-details {
  border: 1px solid var(--rule);
  border-radius: 16px;
  background: var(--white);
}

.detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 16px;
  padding: 24px;
}

.detail + .detail {
  border-top: 1px solid var(--rule);
}

.detail-label,
.detail-value,
.detail-note {
  grid-column: 1;
}

.detail-label {
  color: var(--slate);
  font-size: 0.9375rem;
  font-weight: 600;
}

.detail-value {
  font-size: clamp(1.375rem, 1.1rem + 1.1vw, 1.75rem);
  font-weight: 800;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.detail-url a {
  color: var(--ink);
  text-decoration-color: var(--tomato);
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

.detail-card {
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.detail-note {
  margin-top: 4px;
  color: var(--slate);
  font-size: 0.9375rem;
}

.detail-actions {
  grid-column: 2;
  grid-row: 1 / span 3;
}

@media (max-width: 459px) {
  .detail {
    grid-template-columns: minmax(0, 1fr);
  }

  .detail-actions {
    grid-column: 1;
    grid-row: auto;
    margin-top: 12px;
  }
}

.btn-copy {
  min-height: 40px;
  padding: 0 14px;
  border: 1.5px solid var(--rule-strong);
  border-radius: 10px;
  background: var(--white);
  color: var(--tomato-deep);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.btn-copy:hover {
  border-color: var(--tomato-deep);
}

.steps {
  display: grid;
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.step {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  column-gap: 16px;
  counter-increment: step;
}

.step::before {
  content: counter(step);
  display: grid;
  grid-row: 1 / span 2;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--white);
  font-size: 1rem;
  font-weight: 800;
}

.step-title {
  align-self: center;
  font-size: 1.1875rem;
  font-weight: 750;
  line-height: 1.3;
}

.step p {
  grid-column: 2;
  margin-top: 2px;
  color: var(--slate);
}

.step strong {
  color: var(--ink);
}

/* ---------- Labor comparison ---------- */

.compare {
  width: 100%;
  margin-top: 40px;
  border-collapse: separate;
  border-spacing: 0;
}

.compare th,
.compare td {
  padding: 18px 20px;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}

.compare thead th {
  border-bottom: 2px solid var(--ink);
  color: var(--slate);
  font-size: 0.9375rem;
  font-weight: 700;
}

.compare tbody th {
  width: 26%;
  font-weight: 750;
}

.compare td {
  color: var(--slate);
}

.compare .compare-with {
  background: var(--tomato-soft);
  color: var(--ink);
}

.compare thead .compare-with {
  border-radius: 12px 12px 0 0;
}

.compare tbody tr:last-child .compare-with {
  border-radius: 0 0 12px 12px;
}

@media (max-width: 719px) {
  .compare,
  .compare tbody,
  .compare tr,
  .compare th,
  .compare td {
    display: block;
  }

  .compare thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .compare {
    margin-top: 28px;
  }

  .compare tr {
    padding-block: 20px;
    border-bottom: 1px solid var(--rule);
  }

  .compare tr:first-child {
    border-top: 2px solid var(--ink);
  }

  .compare tbody th {
    width: auto;
    padding: 0 0 8px;
    border: 0;
    font-size: 1.125rem;
  }

  .compare td,
  .compare tbody tr:last-child .compare-with {
    padding: 10px 14px;
    border: 0;
    border-radius: 12px;
  }

  .compare td::before {
    content: attr(data-label);
    display: block;
    color: var(--slate);
    font-size: 0.875rem;
    font-weight: 700;
  }

  .compare td.compare-with {
    margin-top: 6px;
  }
}

/* ---------- Features ---------- */

.features {
  display: grid;
  gap: 0 48px;
  margin: 36px 0 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 720px) {
  .features {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1040px) {
  .features {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.feature {
  padding: 24px 0 28px;
  border-top: 1px solid var(--rule-strong);
}

.feature-title {
  font-size: 1.25rem;
  font-weight: 750;
  line-height: 1.25;
}

.feature p {
  max-width: 34em;
  margin-top: 8px;
  color: var(--slate);
}

/* ---------- Pricing ---------- */

.pricing-grid {
  display: grid;
  gap: 48px;
}

@media (min-width: 900px) {
  .pricing-grid {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    align-items: center;
    gap: 72px;
  }
}

.pricing-copy .btn {
  margin-top: 28px;
}

.fine-print {
  max-width: 30em;
  margin-top: 20px;
  color: var(--slate);
  font-size: 0.9375rem;
}

/* A receipt printer: the slot, and the paper that feeds out of it. */
.printer {
  width: min(100%, 380px);
  margin-inline: auto;
}

.printer-slot {
  position: relative;
  z-index: 1;
  height: 18px;
  border-radius: 9px;
  background: var(--ink);
  box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.35);
}

.printer-feed {
  margin: -9px 12px 0;
  padding: 9px 14px 30px;
  overflow: hidden;
}

.receipt-shadow {
  filter: drop-shadow(0 10px 16px rgba(45, 47, 51, 0.14));
}

.receipt {
  --zig: 9px;
  --zigzag: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / calc(2 * var(--zig)) 100%;
  padding: 30px 24px 44px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.9375rem;
  line-height: 1.6;
  -webkit-mask: var(--zigzag);
  mask: var(--zigzag);
}

.receipt-head {
  font-size: 1.125rem;
  font-weight: 700;
  text-align: center;
}

.receipt-sub {
  color: var(--slate);
  text-align: center;
}

.receipt-lines {
  margin: 18px 0 0;
  padding-top: 14px;
  border-top: 2px dashed #c9ccd2;
}

.receipt-line {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-block: 3px;
}

.receipt-line dt,
.receipt-line dd {
  margin: 0;
}

.receipt-line dd {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.receipt-total {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 2px dashed #c9ccd2;
  font-size: 1.0625rem;
  font-weight: 700;
}

.receipt-foot {
  margin-top: 22px;
  color: var(--slate);
  text-align: center;
}

/* script.js arms the printer only when motion is allowed, so without JS the receipt is
   simply there. It prints once, the first time it scrolls into view. */
.printer.is-armed .receipt-shadow {
  transform: translateY(-101%);
}

.printer.is-printed .receipt-shadow {
  transform: none;
  transition: transform 1.5s cubic-bezier(0.25, 0.6, 0.3, 1);
}

/* ---------- Footer ---------- */

.site-footer {
  padding-block: 40px 48px;
  border-top: 1px solid var(--rule);
}

.footer-inner {
  display: grid;
  gap: 20px;
}

@media (min-width: 900px) {
  .footer-inner {
    grid-template-columns: 1fr 1fr;
    align-items: end;
  }
}

.footer-brand p {
  margin-top: 10px;
  color: var(--slate);
}

.footer-legal {
  max-width: 36em;
  color: var(--slate);
  font-size: 0.875rem;
}

@media (min-width: 900px) {
  .footer-legal {
    justify-self: end;
  }
}

/* ---------- Motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .printer.is-armed .receipt-shadow {
    transform: none;
  }
}
