/*
 * One stylesheet, no build step, no external fonts.
 *
 * No `@import`, no CDN, no webfont: every external request from a storefront is a third party that
 * can see the buyer, a mixed-content risk if it is ever served over http, and one more thing that
 * can be down while someone is trying to give you money. System fonts cost nothing and never fail.
 */

:root {
  --bg: #fbfaf8;
  --fg: #1b1a17;
  --muted: #5d5a52;
  --rule: #e2ded6;
  --accent: #1b4d3e;
  --accent-fg: #ffffff;
  --measure: 34rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14150f;
    --fg: #ececdf;
    --muted: #a3a091;
    --rule: #2e3025;
    --accent: #7fb79f;
    --accent-fg: #10120c;
  }
}

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

body {
  margin: 0;
  padding: 0 1.25rem;
  background: var(--bg);
  color: var(--fg);
  font:
    400 clamp(1rem, 0.96rem + 0.2vw, 1.075rem) / 1.65 ui-serif,
    Georgia,
    'Times New Roman',
    serif;
  -webkit-text-size-adjust: 100%;
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 10;
  padding: 0.5rem 0.75rem;
  background: var(--accent);
  color: var(--accent-fg);
}

/* ---------- header ---------- */

.site-header {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: baseline;
  justify-content: space-between;
  max-width: 62rem;
  margin: 0 auto;
  padding: 1.75rem 0 1.25rem;
  border-bottom: 1px solid var(--rule);
}

.wordmark {
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  color: var(--fg);
}

.site-header nav {
  display: flex;
  gap: 1.5rem;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.9rem;
}

/* ---------- main ---------- */

main {
  max-width: 62rem;
  margin: 0 auto;
  padding: 3rem 0 4rem;
}

main.prose {
  max-width: var(--measure);
}

h1 {
  font-size: clamp(1.85rem, 1.4rem + 1.8vw, 2.75rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 1rem;
  text-wrap: balance;
}

h2 {
  font-size: 1.25rem;
  letter-spacing: -0.005em;
  margin: 2.5rem 0 0.75rem;
}

.hero {
  max-width: var(--measure);
}

.lede {
  font-size: 1.15em;
  color: var(--muted);
}

.updated {
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: -0.5rem;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

a:hover {
  text-decoration-thickness: 2px;
}

.button {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.7rem 1.4rem;
  background: var(--accent);
  color: var(--accent-fg);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.95rem;
  text-decoration: none;
  border-radius: 2px;
}

/* ---------- the "how it works" grid ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1.75rem 2.5rem;
  margin: 1.5rem 0 0;
}

.grid dt {
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.grid dd {
  margin: 0;
  color: var(--muted);
  font-size: 0.95em;
}

/* ---------- catalogue ---------- */

.catalogue {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
  padding: 0;
  list-style: none;
}

.product {
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 1.25rem;
}

.product h2 {
  margin: 0 0 0.4rem;
  font-size: 1.1rem;
}

.product .price {
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-weight: 600;
}

.product .delivery {
  font-size: 0.85em;
  color: var(--muted);
}

/*
 * The empty catalogue. Styled as a plain statement rather than a sad grey box with an icon,
 * because it is a true and temporary fact about the shop, not an error the visitor caused.
 */
.empty-catalogue {
  max-width: var(--measure);
  margin-top: 1.5rem;
  padding: 1.5rem;
  border: 1px solid var(--rule);
  border-radius: 3px;
  color: var(--muted);
}

.empty-catalogue p:first-child {
  margin-top: 0;
}

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

/* ---------- the draft banner ---------- */

/*
 * Loud on purpose. A draft build is one that is missing its operator-authored legal text; the one
 * failure mode that matters is a draft reaching production and nobody noticing.
 */
.draft-banner {
  max-width: 62rem;
  margin: 1rem auto 0;
  padding: 0.85rem 1.15rem;
  background: #7a1f1f;
  color: #fff;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.9rem;
  border-radius: 3px;
}

.draft-body {
  padding: 1rem 1.15rem;
  border: 2px dashed var(--rule);
  color: var(--muted);
}

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

.site-footer {
  max-width: 62rem;
  margin: 0 auto;
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--rule);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.85rem;
  color: var(--muted);
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin: 0.9rem 0;
}

.site-footer .seller {
  margin: 0 0 0.35rem;
  color: var(--fg);
}

.site-footer .address,
.site-footer .copyright {
  margin: 0.35rem 0;
}
