/* Grocento — public site
   Served statically by nginx from the repo checkout. No external requests:
   no web fonts, no analytics, no CDN. A privacy policy that phones home to a
   third party is a bad look, and reviewers load these pages on slow links. */

:root {
  --paper: #f3f5ef;
  --card: #ffffff;
  --ink: #16251c;
  --muted: #647268;
  --grocer: #1e6b43;
  --tag: #efbc26;
  --rule: #d7ded2;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --measure: 68ch;
  --gutter: clamp(1.25rem, 5vw, 4rem);
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--grocer); }
a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--grocer);
  outline-offset: 3px;
  border-radius: 2px;
}

.wrap {
  width: 100%;
  max-width: 68rem;
  margin: 0 auto;
  padding-inline: var(--gutter);
}

/* ---------- masthead ---------- */

.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 1rem 2rem;
  padding-block: 1.75rem;
  border-bottom: 1px solid var(--rule);
}

/* The wordmark is the brand's own lettering, so it is set as artwork at a
   fixed height rather than typed out — it must match the app, where the same
   logo appears. width:auto keeps its 4.2:1 ratio from the intrinsic size on
   the <img>, which also reserves the right space before the SVG loads. */
.wordmark {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  line-height: 0;
}

.wordmark img {
  height: 2.1rem;
  width: auto;
  max-width: 100%;
}

.masthead nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  margin-left: auto;
  font-size: 0.95rem;
}

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

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

/* ---------- hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(2rem, 6vw, 4.5rem);
  align-items: center;
  padding-block: clamp(3rem, 8vw, 5.5rem);
}

.hero h1 {
  margin: 0 0 1.25rem;
  font-size: clamp(2.25rem, 5.4vw, 3.6rem);
  line-height: 1.04;
  letter-spacing: -0.035em;
  font-weight: 800;
  text-wrap: balance;
}

.hero p {
  margin: 0 0 1.75rem;
  max-width: 46ch;
  font-size: 1.1rem;
  color: #3a4a40;
}

.store-line {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
}

/* ---------- receipt ---------- */

.receipt {
  position: relative;
  background: var(--card);
  padding: 2rem 1.9rem 2.4rem;
  box-shadow: 0 18px 38px -26px rgba(22, 37, 28, 0.55);
  font-family: var(--mono);
  font-size: 0.92rem;
}

/* torn bottom edge — the panel reads as a till receipt, not a card */
.receipt::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -10px;
  height: 10px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='10'%3E%3Cpolygon points='0,0 16,0 8,10' fill='%23ffffff'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-size: 16px 10px;
}

.receipt-head {
  padding-bottom: 1rem;
  margin-bottom: 1.1rem;
  border-bottom: 1px dashed var(--rule);
}

.receipt-head strong {
  display: block;
  font-family: var(--sans);
  font-size: 1.05rem;
  letter-spacing: -0.015em;
}

.receipt-head span {
  color: var(--muted);
  font-size: 0.85rem;
}

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

.receipt li {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding-block: 0.62rem;
}

.receipt li .name { white-space: nowrap; }

.receipt li .leader {
  flex: 1;
  border-bottom: 1px dotted #b9c4bc;
  transform: translateY(-0.28em);
}

.receipt li .price {
  font-variant-numeric: tabular-nums;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.receipt li.best .name,
.receipt li.best .price {
  color: var(--grocer);
  font-weight: 700;
}

.sticker {
  display: inline-block;
  margin-left: 0.55rem;
  padding: 0.1rem 0.45rem;
  background: var(--tag);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 2px;
  transform: rotate(-3deg);
}

.receipt-foot {
  margin: 1.1rem 0 0;
  padding-top: 1rem;
  border-top: 1px dashed var(--rule);
  font-family: var(--sans);
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--muted);
}

@media (prefers-reduced-motion: no-preference) {
  .receipt li {
    animation: settle 0.5s cubic-bezier(0.2, 0.7, 0.3, 1) backwards;
  }
  .receipt li:nth-child(1) { animation-delay: 0.15s; }
  .receipt li:nth-child(2) { animation-delay: 0.27s; }
  .receipt li:nth-child(3) { animation-delay: 0.39s; }
  .receipt li:nth-child(4) { animation-delay: 0.51s; }

  @keyframes settle {
    from { opacity: 0; transform: translateY(0.5rem); }
    to   { opacity: 1; transform: none; }
  }
}

/* ---------- sections ---------- */

.band {
  padding-block: clamp(2.75rem, 6vw, 4.25rem);
  border-top: 1px solid var(--rule);
}

.band > h2 {
  margin: 0 0 2rem;
  font-size: clamp(1.4rem, 2.6vw, 1.85rem);
  letter-spacing: -0.025em;
  font-weight: 700;
}

/* genuine sequence, so it is numbered */
.steps {
  counter-reset: step;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1.75rem 2rem;
}

.steps li {
  counter-increment: step;
  padding-top: 0.9rem;
  border-top: 2px solid var(--ink);
}

.steps li::before {
  content: counter(step);
  display: block;
  margin-bottom: 0.35rem;
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--grocer);
}

.steps li h3 {
  margin: 0 0 0.3rem;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
}

.steps li p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
}

/* same grid, but this group is not a sequence, so no numbers and no rule weight
   implying order */
.steps.plain li {
  border-top-color: var(--rule);
  border-top-width: 1px;
}

.steps.plain li::before { content: none; }

.faq { display: grid; gap: 0; }

.faq > div {
  padding-block: 1.3rem;
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 0.5rem 2.5rem;
}

.faq > div:first-child { border-top: 0; }

.faq h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.faq p,
.faq-answer {
  margin: 0;
  color: #3a4a40;
  font-size: 0.97rem;
}

/* Answers are admin-authored HTML and usually arrive wrapped in <p>. */
.faq-answer p { margin: 0 0 0.6rem; }
.faq-answer p:last-child { margin-bottom: 0; }

.faq-more {
  margin: 1.75rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  font-size: 0.95rem;
  color: var(--muted);
}

/* ---------- footer ---------- */

.site-foot {
  padding-block: 2.5rem 3.5rem;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
  align-items: baseline;
  font-size: 0.92rem;
  color: var(--muted);
}

.site-foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  margin-left: auto;
}

/* ---------- policy ---------- */

.policy-head { padding-block: clamp(2.5rem, 6vw, 4rem) 2rem; }

.policy-head h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(2rem, 4.6vw, 2.9rem);
  letter-spacing: -0.03em;
  font-weight: 800;
}

.policy-head p {
  margin: 0;
  max-width: 54ch;
  color: var(--muted);
  font-size: 1rem;
}

.dates {
  margin-top: 1.25rem;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--muted);
}

.policy-body {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  gap: 3.5rem;
  padding-bottom: 4rem;
  align-items: start;
}

.toc {
  position: sticky;
  top: 2rem;
  font-size: 0.9rem;
  border-left: 2px solid var(--rule);
  padding-left: 1.1rem;
}

.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: toc;
}

.toc li { counter-increment: toc; margin-bottom: 0.5rem; }

.toc a {
  color: var(--muted);
  text-decoration: none;
  display: block;
}

.toc a::before {
  content: counter(toc) ". ";
  font-variant-numeric: tabular-nums;
  color: #9aa79f;
}

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

.prose {
  font-family: var(--serif);
  font-size: 1.06rem;
  line-height: 1.72;
  max-width: var(--measure);
}

/* Headings are the anchor targets for the contents list, so they need room to
   land below the top of the viewport. */
.prose h2 {
  font-family: var(--sans);
  font-size: 1.22rem;
  letter-spacing: -0.02em;
  font-weight: 700;
  margin: 2.75rem 0 0.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  scroll-margin-top: 1.5rem;
}

/* The body is admin-authored, so the first heading may be a direct child or
   wrapped — cover both rather than assuming a structure an editor can break. */
.prose > h2:first-child,
.prose > section:first-child h2,
.prose > *:first-child > h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.prose h3 {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 700;
  margin: 1.75rem 0 0.4rem;
}

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

.prose ul {
  margin: 0 0 1rem;
  padding-left: 1.2rem;
}

.prose li { margin-bottom: 0.45rem; }

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: 0.92rem;
  margin: 0 0 1.25rem;
}

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

.prose th {
  font-weight: 700;
  border-bottom-color: var(--ink);
  white-space: nowrap;
}

.table-scroll { overflow-x: auto; }

.callout {
  background: var(--card);
  border-left: 3px solid var(--grocer);
  padding: 1.1rem 1.25rem;
  margin: 0 0 1.25rem;
  font-family: var(--sans);
  font-size: 0.95rem;
  line-height: 1.55;
}

.callout p:last-child { margin-bottom: 0; }

.todo {
  background: #fdf4d8;
  border-left-color: var(--tag);
}

.contact {
  font-family: var(--sans);
  font-size: 0.97rem;
  line-height: 1.75;
}

@media (max-width: 62rem) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .policy-body { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
  .toc { position: static; }
  .faq > div { grid-template-columns: minmax(0, 1fr); }
}
