/* Tabys — the public page. One family (Onest), the colours of the app:
   paper, ink, and the yellow of a shelf price tag for money only. */
@font-face {
  font-family: "Onest";
  src: url("/fonts/Onest.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --paper: #f4f4f1;
  --card: #ffffff;
  --ink: #14140f;
  --muted: #5f5f55;
  --line: #dadad2;
  --tag: #ffd60a;
  --good: #1b6e36;
  --focus: #1b66c9;
  --measure: 34rem;
  --wide: 72rem;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.55 "Onest", system-ui, sans-serif;
  font-feature-settings: "tnum" 0;
}

a { color: inherit; }

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

.wrap { max-width: var(--wide); margin: 0 auto; padding: 0 1.25rem; }

/* Header: the name and the two doors. */
.top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.25rem 0; }
.brand { font-weight: 800; font-size: 1.375rem; letter-spacing: -0.02em; text-decoration: none; }
.top nav { display: flex; gap: 1.25rem; align-items: center; font-size: 0.9375rem; }
.top nav a { text-decoration: none; color: var(--muted); }
.top nav a:hover { color: var(--ink); }
.top nav .lang { border: 1px solid var(--line); border-radius: 999px; padding: 0.2rem 0.7rem; }

.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3.25rem; padding: 0 1.5rem; border-radius: 0.75rem;
  background: var(--ink); color: #fff; font-weight: 600; text-decoration: none;
  transition: transform 120ms ease;
}
.button:active { transform: translateY(1px); }
.button.quiet { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }

/* Hero: the words on the left; on the right, the receipt this is about. */
.hero { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 3rem; align-items: center; padding: 3.5rem 0 4.5rem; }
.hero h1 { font-size: clamp(2.25rem, 4.6vw, 3.75rem); line-height: 1.04; letter-spacing: -0.035em; font-weight: 800; margin: 0 0 1.25rem; max-width: 15ch; }
.hero .lead { font-size: 1.1875rem; color: var(--muted); max-width: var(--measure); margin: 0 0 2rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.small { font-size: 0.875rem; color: var(--muted); margin-top: 1rem; }

.receipt {
  justify-self: center; width: min(100%, 21rem);
  background: var(--card); padding: 1.5rem 1.5rem 2rem;
  font-variant-numeric: tabular-nums; font-size: 0.9375rem;
  box-shadow: 0 1px 0 var(--line), 0 18px 40px -24px rgba(20, 20, 15, 0.35);
  /* The torn edge of a paper strip. */
  -webkit-mask: radial-gradient(circle at 6px 100%, transparent 5px, #000 5.5px) 0 0 / 12px 100% repeat-x;
          mask: radial-gradient(circle at 6px 100%, transparent 5px, #000 5.5px) 0 0 / 12px 100% repeat-x;
}
.receipt .shop { text-align: center; font-weight: 700; margin-bottom: 0.15rem; }
.receipt .meta { text-align: center; color: var(--muted); font-size: 0.8125rem; margin-bottom: 1rem; }
.receipt ol { list-style: none; margin: 0; padding: 0; border-top: 1px dashed var(--line); }
.receipt li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.45rem 0; border-bottom: 1px dashed var(--line); }
.receipt .total { display: flex; justify-content: space-between; font-weight: 800; font-size: 1.375rem; margin-top: 0.9rem; }
.receipt .total span:last-child { background: var(--tag); padding: 0 0.35rem; border-radius: 4px; }
.receipt .stamp { margin-top: 1rem; display: flex; gap: 0.5rem; align-items: center; color: var(--good); font-weight: 600; font-size: 0.875rem; }

/* The one moment of motion: the receipt prints, line by line. */
@media (prefers-reduced-motion: no-preference) {
  .js .receipt li, .js .receipt .total, .js .receipt .stamp { opacity: 0; transform: translateY(-4px); }
  .js .receipt.printed li, .js .receipt.printed .total, .js .receipt.printed .stamp {
    opacity: 1; transform: none; transition: opacity 260ms ease, transform 260ms ease;
  }
  .js .receipt.printed li:nth-child(2) { transition-delay: 260ms; }
  .js .receipt.printed li:nth-child(3) { transition-delay: 520ms; }
  .js .receipt.printed li:nth-child(4) { transition-delay: 780ms; }
  .js .receipt.printed .total { transition-delay: 1100ms; }
  .js .receipt.printed .stamp { transition-delay: 1500ms; }
}

section { padding: 4rem 0; border-top: 1px solid var(--line); }
h2 { font-size: clamp(1.75rem, 3vw, 2.375rem); letter-spacing: -0.025em; line-height: 1.12; margin: 0 0 0.75rem; font-weight: 750; max-width: 22ch; }
.intro { color: var(--muted); max-width: var(--measure); margin: 0 0 2.5rem; }

/* What it does: plain statements in two columns, no boxes. */
.does { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem 3.5rem; margin: 0; }
.does dt { font-weight: 700; font-size: 1.1875rem; margin-bottom: 0.3rem; }
.does dd { margin: 0; color: var(--muted); max-width: var(--measure); }

/* The way to the first sale: a real sequence, so numbered. */
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.5rem; }
.steps li { counter-increment: step; border-top: 3px solid var(--ink); padding-top: 1rem; }
.steps li::before { content: counter(step); display: block; font-weight: 800; font-size: 2.5rem; line-height: 1; margin-bottom: 0.75rem; font-variant-numeric: tabular-nums; }
.steps strong { display: block; margin-bottom: 0.25rem; }
.steps span { color: var(--muted); font-size: 0.9375rem; }

/* Prices: three shelf tags, hung by a hole. */
.tags { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; align-items: start; }
.tag {
  position: relative; background: var(--tag); color: var(--ink);
  padding: 1.75rem 1.5rem 1.5rem; border-radius: 0.5rem 0.5rem 0.5rem 0.5rem;
}
.tag::before { content: ""; position: absolute; top: 0.8rem; right: 1rem; width: 0.7rem; height: 0.7rem; border-radius: 50%; background: var(--paper); box-shadow: inset 0 1px 2px rgba(20, 20, 15, 0.35); }
.tag h3 { margin: 0 0 0.75rem; font-size: 1.0625rem; font-weight: 700; }
.tag .price { font-size: 2.75rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.tag .per { font-size: 0.9375rem; margin-top: 0.35rem; }
.tag ul { margin: 1.25rem 0 0; padding: 1rem 0 0; list-style: none; border-top: 1.5px solid rgba(20, 20, 15, 0.85); font-size: 0.9375rem; }
.tag li { padding: 0.2rem 0; }
.terms { margin-top: 1.5rem; color: var(--muted); max-width: 46rem; }

/* Questions. */
details { border-bottom: 1px solid var(--line); padding: 1.1rem 0; max-width: 46rem; }
summary { cursor: pointer; font-weight: 650; font-size: 1.125rem; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-weight: 400; font-size: 1.5rem; line-height: 1; }
details[open] summary::after { content: "−"; }
details p { color: var(--muted); margin: 0.6rem 0 0; max-width: var(--measure); }

.closing { text-align: left; }
.closing h2 { max-width: 18ch; }

footer { border-top: 1px solid var(--line); padding: 2rem 0 3rem; color: var(--muted); font-size: 0.875rem; display: flex; flex-wrap: wrap; gap: 1rem 2rem; }
footer span { flex: 1 1 18rem; }
footer a { color: var(--muted); }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 2.5rem; padding-top: 1.5rem; }
  .does { grid-template-columns: 1fr; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tags { grid-template-columns: 1fr; max-width: 24rem; }
  .top nav .hide-sm { display: none; }
}
@media (max-width: 480px) {
  .steps { grid-template-columns: 1fr; }
  .actions .button { width: 100%; }
}
