@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/fonts/atkinson-hyperlegible-next-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #ffffff;
  --ink: #14201c;
  --muted: #56635e;
  --rule: #d9e2de;
  --accent: #0a6b55;
  --wash: #eef6f2;
  --counter: #0b4a3c;
  --brand-green: #03d0a6;

  /* Printed pieces (placard, receipt) stay light in both colour schemes. */
  --slip: #ffffff;
  --slip-ink: #14201c;
  --slip-muted: #56635e;
  --slip-rule: #b9c6c0;
  --slip-accent: #0a6b55;

  --measure: 42rem;
  --page: 68rem;
  --gutter: clamp(1.25rem, 5vw, 3rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0e1513;
    --ink: #e6eeea;
    --muted: #9db0a8;
    --rule: #24332d;
    --accent: #6fd3b5;
    --wash: #15221d;
    --counter: #123b31;
  }
}

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

html {
  font-size: 106.25%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Atkinson Hyperlegible Next", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--accent);
  text-decoration-thickness: 0.06em;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 0.12em;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

strong {
  font-weight: 700;
}

address {
  font-style: normal;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  z-index: 1;
  padding: 0.5rem 0.75rem;
  background: var(--ink);
  color: var(--paper);
}

.skip:focus {
  top: 0.75rem;
}

/* Masthead */

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem var(--gutter);
  border-bottom: 1px solid var(--rule);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.masthead nav {
  display: flex;
  gap: 1.5rem;
  font-size: 0.95rem;
}

.masthead nav a {
  color: var(--ink);
  text-decoration: none;
}

.masthead nav a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* ---------- Policy pages ---------- */

/* Page frame: section index beside the reading column */

.frame {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.5rem;
  max-width: var(--page);
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 4.5rem) var(--gutter) 5rem;
}

.policy {
  max-width: var(--measure);
  min-width: 0;
}

.index {
  font-size: 0.9rem;
  line-height: 1.35;
}

.index h2 {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--muted);
}

.index ul {
  margin: 0;
  padding: 0;
  list-style: none;
  columns: 2;
  column-gap: 1.5rem;
}

.index li {
  break-inside: avoid;
  padding: 0.3rem 0;
}

.index a {
  color: var(--ink);
  text-decoration: none;
}

.index a:hover {
  color: var(--accent);
  text-decoration: underline;
}

@media (min-width: 62rem) {
  .frame {
    grid-template-columns: 14rem minmax(0, 1fr);
    gap: 4rem;
  }

  .index {
    position: sticky;
    top: 2rem;
    align-self: start;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
    padding-left: 1rem;
    border-left: 2px solid var(--rule);
  }

  .index ul {
    columns: 1;
  }
}

.policy h1 {
  margin: 0;
  font-size: clamp(2.1rem, 6vw, 3.3rem);
  font-weight: 750;
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.policy .dated {
  margin: 0.9rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.policy .lead {
  margin: 2.5rem 0 0;
  font-size: clamp(1.45rem, 3.6vw, 2.05rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--accent);
  text-wrap: balance;
}

.policy .lead + p {
  margin-top: 1rem;
  font-size: 1.1rem;
}

.policy section {
  margin-top: 3.5rem;
  scroll-margin-top: 1.5rem;
}

.policy h2 {
  margin: 0 0 1rem;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.policy p {
  margin: 0 0 1rem;
}

.policy ul,
.policy ol {
  margin: 0 0 1rem;
  padding-left: 1.3rem;
}

.policy li {
  margin-bottom: 0.5rem;
}

.policy li::marker {
  color: var(--accent);
}

.policy table {
  width: 100%;
  margin: 1.25rem 0 1.5rem;
  border-collapse: collapse;
  font-size: 0.93rem;
  line-height: 1.45;
}

.policy thead th {
  padding: 0.6rem 0.75rem;
  background: var(--wash);
  color: var(--accent);
  font-weight: 700;
  text-align: left;
  vertical-align: bottom;
}

.policy tbody th,
.policy tbody td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}

.policy tbody th {
  width: 30%;
  font-weight: 700;
}

@media (max-width: 40rem) {
  .policy table,
  .policy tbody,
  .policy tbody tr,
  .policy tbody th,
  .policy tbody td {
    display: block;
    width: 100%;
  }

  .policy thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .policy tbody tr {
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--rule);
  }

  .policy tbody th,
  .policy tbody td {
    padding: 0;
    border: 0;
  }

  .policy tbody td {
    margin-top: 0.35rem;
  }

  .policy tbody td::before {
    content: attr(data-label) ": ";
    color: var(--muted);
    font-weight: 700;
  }
}

/* ---------- Home ---------- */

.wrap {
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3rem;
  align-items: center;
  padding-top: clamp(2.5rem, 7vw, 5rem);
  padding-bottom: clamp(3rem, 7vw, 5.5rem);
}

@media (min-width: 58rem) {
  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(0, 27rem);
    gap: 4rem;
  }
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.5rem, 6.2vw, 4.2rem);
  font-weight: 750;
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.hero h1 span {
  display: block;
  text-wrap: balance;
}

.hero-lead {
  max-width: 34rem;
  margin: 1.5rem 0 0;
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  line-height: 1.5;
}

.hero-where {
  margin: 1.25rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* The sale: a counter placard with a QR code, and the receipt that follows it */

.sale {
  margin: 0;
  padding: clamp(1.5rem, 4vw, 2.25rem) clamp(1.25rem, 4vw, 2rem) 1.25rem;
  background: var(--counter);
  border-radius: 1.5rem;
  color: #ffffff;
}

.placard {
  position: relative;
  width: min(13.5rem, 62%);
  padding: 0.85rem 1rem 1rem;
  background: var(--slip);
  color: var(--slip-ink);
  border-radius: 0.9rem;
  box-shadow: 0 1.25rem 1.75rem -1.25rem rgba(2, 24, 19, 0.75);
  transform: rotate(-3deg);
}

.placard-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.qr {
  position: relative;
  overflow: hidden;
}

.qr svg {
  display: block;
  width: 100%;
  height: auto;
}

.scanline {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 18%;
  background: linear-gradient(to bottom, rgba(3, 208, 166, 0), rgba(3, 208, 166, 0.45));
  border-bottom: 2px solid var(--brand-green);
  opacity: 0;
}

/* The receipt tucks over the placard's bottom margin only, so the code stays scannable.
   The shadow lives on the wrapper because the mask on the receipt would clip it. */
.receipt-wrap {
  position: relative;
  width: min(15.5rem, 84%);
  margin: -0.25rem 0 0 auto;
  filter: drop-shadow(0 1rem 0.9rem rgba(2, 24, 19, 0.5));
  transform: rotate(2.5deg);
}

.receipt {
  padding: 1rem 1rem 1.6rem;
  background: var(--slip);
  color: var(--slip-ink);
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
  /* Torn-paper teeth along the bottom edge */
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 0.75rem 100%;
  mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 0.75rem 100%;
}

.receipt-kind {
  margin: 0;
  color: var(--slip-muted);
  font-size: 0.75rem;
}

.receipt-shop {
  margin: 0.1rem 0 0.6rem;
  font-size: 1.05rem;
  font-weight: 750;
}

.receipt ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.receipt li,
.receipt-total {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}

.receipt li > span:last-child,
.receipt-total > span:last-child {
  white-space: nowrap;
}

.receipt-lines {
  padding: 0.55rem 0;
  border-top: 1px dashed var(--slip-rule);
  border-bottom: 1px dashed var(--slip-rule);
}

.receipt-total {
  margin: 0.55rem 0;
  font-size: 1.05rem;
  font-weight: 750;
}

.receipt-status li {
  padding: 0.15rem 0;
  color: var(--slip-muted);
}

.receipt-status .landed {
  color: var(--slip-accent);
  font-weight: 700;
}

.landed svg {
  width: 0.95em;
  height: 0.95em;
  margin-right: 0.3em;
  vertical-align: -0.1em;
}

.sale figcaption {
  margin-top: 1.25rem;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.9rem;
  line-height: 1.4;
}

/* One sequence on load: the code is scanned, the receipt arrives, the money lands. */
@media (prefers-reduced-motion: no-preference) {
  .scanline {
    animation: scan 1.5s 0.5s ease-in-out both;
  }

  .receipt-wrap {
    animation: arrive 0.6s 1.9s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  }

  .receipt-status .landed {
    animation: land 0.45s 2.7s ease-out both;
  }
}

@keyframes scan {
  0% {
    opacity: 0;
    transform: translateY(-100%);
  }

  12%,
  88% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translateY(560%);
  }
}

@keyframes arrive {
  from {
    opacity: 0;
    transform: translateY(1.75rem) rotate(2.5deg);
  }

  to {
    opacity: 1;
    transform: rotate(2.5deg);
  }
}

@keyframes land {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Bands */

.band {
  padding: clamp(3rem, 7vw, 5rem) 0;
  border-top: 1px solid var(--rule);
  scroll-margin-top: 1rem;
}

.band h2 {
  margin: 0 0 2.25rem;
  font-size: clamp(1.6rem, 3.4vw, 2.3rem);
  font-weight: 750;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

/* How a sale works: a real sequence, so the steps are numbered and joined */

.steps {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  position: relative;
  padding-left: 3.25rem;
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--paper);
  font-weight: 750;
  line-height: 1;
}

.steps h3 {
  margin: 0 0 0.4rem;
  padding-top: 0.2rem;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.steps p {
  margin: 0;
}

@media (min-width: 48rem) {
  .steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2.5rem;
  }

  .steps li {
    padding-top: 3.25rem;
    padding-left: 0;
  }

  .steps li:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 1.0625rem;
    right: -1.75rem;
    left: 3rem;
    height: 2px;
    background: var(--rule);
  }

  .steps h3 {
    padding-top: 0;
  }
}

/* What you get */

.gets {
  margin: 0;
}

.gets > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.35rem 2rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--rule);
}

.gets > div:last-child {
  border-bottom: 1px solid var(--rule);
}

.gets dt {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
}

.gets dd {
  margin: 0;
}

@media (min-width: 48rem) {
  .gets > div {
    grid-template-columns: 17rem minmax(0, 36rem);
  }
}

/* Where the money goes */

.band-wash {
  border-top: 0;
  background: var(--wash);
}

.band .statement {
  max-width: 38rem;
  margin-bottom: 2rem;
  color: var(--accent);
  font-size: clamp(1.9rem, 4.6vw, 3rem);
  line-height: 1.05;
}

.trust {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem 2.5rem;
}

.trust p {
  margin: 0;
}

@media (min-width: 48rem) {
  .trust {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Footer */

.foot {
  padding: 2.5rem 0 3rem;
  border-top: 1px solid var(--rule);
  font-size: 0.9rem;
  line-height: 1.5;
}

.foot .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem 2.5rem;
}

.foot p {
  margin: 0;
}

.foot .wordmark {
  font-size: 1.1rem;
}

.foot-meta {
  color: var(--muted);
}

@media (min-width: 48rem) {
  .foot .wrap {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
  }

  .foot-meta {
    text-align: right;
  }
}

@media print {
  .masthead,
  .index,
  .skip {
    display: none;
  }

  .frame {
    display: block;
    padding: 0;
  }

  body {
    color: #000;
    background: #fff;
    font-size: 10.5pt;
  }

  .policy section {
    margin-top: 1.5rem;
  }

  tr,
  li {
    break-inside: avoid;
  }

  a {
    color: inherit;
  }
}
