/*
 * Public site styles: a maker's workshop catalog.
 * Paper background, ink text, one filament-orange accent, mono for specs.
 *
 * Systems — use only these values:
 *   spacing  4 8 12 16 24 32 48 64        (--s-1 … --s-8)
 *   type     12 14 16 20 28 40            (--t-xs … --t-2xl)
 *   colour   the custom properties on :root. The owner's theme (theme.css,
 *            linked after this file) overrides the palette, radii and fonts
 *            for light and dark; the values here are the "workshop" preset so
 *            the site still renders if theme.css fails to load.
 */

@font-face {
  font-family: "IBM Plex Sans";
  src: url("../fonts/ibm-plex-sans-latin-400-normal.77bc02670657.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Sans";
  src: url("../fonts/ibm-plex-sans-latin-500-normal.f7016cd446d2.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Sans";
  src: url("../fonts/ibm-plex-sans-latin-600-normal.196e3cbc5fee.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/ibm-plex-mono-latin-400-normal.79936b18df9f.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/ibm-plex-mono-latin-500-normal.b1c8a895f5fd.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Serif";
  src: url("../fonts/ibm-plex-serif-latin-400-normal.af1a1dc58b46.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Serif";
  src: url("../fonts/ibm-plex-serif-latin-600-normal.396d53ed9d89.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Light unless the visitor picked dark with the header switch (data-scheme on
     <html>, from their `scheme` cookie). The device setting is not followed. */
  color-scheme: light;

  --paper: #f6f3ee;
  --surface: #fffdf9;
  --backdrop: #ebe8e3;
  --ink: #1d1b18;
  --muted: #5f5a52;
  --rule: #dad7d2;
  --rule-strong: #1d1b18;
  --accent: #e8833a;
  --accent-hover: #eb9456;
  --accent-ink: #a15f2e;
  --on-accent: #1d1b18;
  --focus: #1d1b18;

  /* Read by js/viewer.js for the mesh colour. */
  --viewer-model-color: #e8833a;

  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;

  --t-xs: 0.75rem;
  --t-sm: 0.875rem;
  --t-md: 1rem;
  --t-lg: 1.25rem;
  --t-xl: 1.75rem;
  --t-2xl: 2.5rem;

  --radius: 8px;
  --radius-sm: 4px;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

/*
 * Semantic colours: fixed hues, not part of the theme. Where color-mix is
 * available they lean on the theme's --ink and --paper, so they stay legible on
 * whatever palette is active (derived dark, the owner's own dark colours, or
 * "always light" on a visitor whose system is dark). The plain values are the
 * fallback for browsers without color-mix.
 */
:root {
  --error: #a3260f;
  --error-bg: #fbe9e4;
  --ok: #24613b;
  --ok-bg: #e4f1e7;
}

:root[data-scheme="dark"] {
  color-scheme: dark;
  --error: #ff9d8a;
  --error-bg: #3a1c16;
  --ok: #8fd3a5;
  --ok-bg: #18301f;
}

/* Both selectors, so these also outrank the dark fallback just above. */
@supports (color: color-mix(in oklab, red, blue)) {
  :root,
  :root[data-scheme="dark"] {
    --error: color-mix(in oklab, #d0331a 60%, var(--ink));
    --error-bg: color-mix(in oklab, #d0331a 12%, var(--paper));
    --ok: color-mix(in oklab, #2f8a50 60%, var(--ink));
    --ok-bg: color-mix(in oklab, #2f8a50 14%, var(--paper));
  }
}

/* ---------- base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: var(--s-5);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--t-md);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
dl,
dd,
figure,
fieldset,
legend {
  margin: 0;
  padding: 0;
}

h1,
h2,
h3,
h4 {
  font-family: var(--heading-font, var(--sans));
  font-weight: 600;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

h1 {
  font-size: var(--t-2xl);
  letter-spacing: -0.02em;
}

h2 {
  font-size: var(--t-lg);
  letter-spacing: -0.01em;
}

ul[class],
ol[class] {
  list-style: none;
}

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

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

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

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

[hidden] {
  display: none !important;
}

hr {
  width: 100%;
  height: 1px;
  margin: 0;
  border: 0;
  background: var(--rule);
}

.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

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

.num {
  text-align: right;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.eyebrow {
  color: var(--muted);
  font-family: var(--mono);
  font-size: var(--t-xs);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lede {
  max-width: 60ch;
  color: var(--muted);
  font-size: var(--t-lg);
  line-height: 1.45;
}

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

.skip-link {
  position: absolute;
  top: var(--s-2);
  left: var(--s-2);
  z-index: 10;
  padding: var(--s-2) var(--s-4);
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

/* ---------- owner bar: private context, deliberately unlike the public chrome ---------- */

.ownerbar {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: var(--t-sm);
}

.ownerbar__inner,
.ownerbar__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-1) var(--s-4);
}

.ownerbar__inner {
  justify-content: space-between;
  padding-block: var(--s-2);
}

.ownerbar__tag,
.ownerbar__status {
  padding: 0 var(--s-2);
  border-radius: var(--radius-sm);
  font-weight: 500;
}

.ownerbar__tag {
  margin-right: var(--s-2);
  background: var(--accent);
  color: var(--on-accent);
}

.ownerbar__status {
  border: 1px solid currentColor;
}

.ownerbar a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  color: inherit;
}

.ownerbar :focus-visible {
  outline-color: var(--paper);
}

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

.site-header {
  border-bottom: 1px solid var(--rule-strong);
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3) var(--s-5);
  padding-block: var(--s-4);
}

/* Brand and tagline share the left of the header; the tagline gives way first. */
.site-header__brand {
  display: flex;
  flex: 1 1 auto;
  align-items: baseline;
  gap: var(--s-4);
  min-width: 0;
}

.brand {
  display: inline-flex;
  flex: 0 1 auto;
  align-items: center;
  gap: var(--s-3);
  min-width: 0;
  min-height: 44px;
  color: var(--ink);
  font-family: var(--heading-font, var(--sans));
  font-size: var(--t-lg);
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand__name {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* The owner's logo: any aspect ratio, held to the header's line height. */
.brand__logo {
  flex: none;
  width: auto;
  max-width: 200px;
  height: 32px;
  object-fit: contain;
}

/* Zero base width: the tagline only ever fills space the header has left over,
   so a long one is cut short instead of pushing the search or nav to a new line. */
.brand__tagline {
  flex: 1 1 0;
  width: 0;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: var(--t-sm);
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* A square of filament: the one decorative use of the accent. */
.brand__mark {
  width: 16px;
  height: 16px;
  flex: none;
  border-radius: var(--radius-sm);
  background: var(--accent);
  box-shadow: 4px 4px 0 var(--ink);
}

.search {
  display: flex;
  flex: 0 1 360px;
  min-width: 0;
}

.search__input,
.search__button {
  min-height: 44px;
  border: 1px solid var(--rule-strong);
  font: inherit;
}

.search__input {
  flex: 1;
  min-width: 0;
  padding: 0 var(--s-3);
  border-right: 0;
  border-radius: var(--radius) 0 0 var(--radius);
  background: var(--surface);
  color: var(--ink);
}

.search__input::placeholder {
  color: var(--muted);
  opacity: 1;
}

.search__button {
  padding: 0 var(--s-4);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--ink);
  color: var(--paper);
  font-weight: 500;
  cursor: pointer;
}

.search__button:hover {
  background: var(--muted);
}

.search__input:focus-visible,
.search__button:focus-visible {
  position: relative;
  outline-offset: 1px;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink);
  font-weight: 500;
}

/* Light/dark switch: a form with one button (partials/scheme_switch.html).
   The icon is the scheme you would switch to. */
.scheme-switch {
  display: flex;
  margin: 0;
}

.scheme-switch__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

.scheme-switch__button:hover {
  background: var(--backdrop);
}

/* A mask, so the icon takes the text colour (no inline SVG, no second image). */
.scheme-switch__icon {
  flex: none;
  width: 20px;
  height: 20px;
  background: currentColor;
  -webkit-mask: url("../img/scheme-moon.3028dd0468d3.svg") center / contain no-repeat;
  mask: url("../img/scheme-moon.3028dd0468d3.svg") center / contain no-repeat;
}

:root[data-scheme="dark"] .scheme-switch__icon {
  -webkit-mask-image: url("../img/scheme-sun.1075e5585e91.svg");
  mask-image: url("../img/scheme-sun.1075e5585e91.svg");
}

@media (forced-colors: active) {
  .scheme-switch__icon {
    background: ButtonText;
    forced-color-adjust: none;
  }
}

.site-main {
  flex: 1;
  padding-block: var(--s-7) var(--s-8);
}

.site-main:focus {
  outline: none;
}

.site-footer {
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: var(--t-sm);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2) var(--s-5);
  padding-block: var(--s-5);
}

.site-footer__about {
  display: grid;
  flex: 1 1 240px;
  gap: var(--s-2);
  min-width: 0;
}

.site-footer__name {
  font-family: var(--mono);
}

/* The owner's footer note (markdown). */
.site-footer__text {
  display: grid;
  gap: var(--s-2);
  max-width: 60ch;
  overflow-wrap: anywhere;
}

.site-footer__text a {
  color: inherit;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--s-5);
}

.site-footer__links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: inherit;
}

.site-footer__links--social a {
  color: var(--ink);
  font-weight: 500;
}

/* Newsletter signup: its own row above the footer's links, and the two
   opt-in ticks on the checkout page. */
.newsletter {
  display: grid;
  flex: 1 1 100%;
  gap: var(--s-2);
  margin-bottom: var(--s-3);
  padding-bottom: var(--s-5);
  border-bottom: 1px solid var(--rule);
}

.newsletter__label {
  color: var(--ink);
  font-weight: 600;
}

.newsletter__row {
  display: flex;
  gap: var(--s-3);
  max-width: 480px;
}

.newsletter__row > .input {
  flex: 1 1 0;
  min-width: 0;
}

.newsletter__row > .button {
  flex: 0 0 auto;
  min-height: 48px;
}

.checkout__optins {
  display: grid;
  gap: var(--s-4);
  min-width: 0; /* a fieldset is as wide as its content by default */
  border: 0;
}

/* "This is a gift": the message field appears only while the box is ticked.
   A browser without :has() shows it all the time (the server ignores a
   message sent without the tick). */
.checkout__gift {
  display: grid;
  gap: var(--s-4);
}

@supports selector(:has(*)) {
  .checkout__gift:not(:has(#gift:checked)) .checkout__gift-message {
    display: none;
  }
}

@media (max-width: 560px) {
  .newsletter__row {
    flex-direction: column;
  }
}

/* ---------- page furniture ---------- */

.page-head {
  display: grid;
  gap: var(--s-3);
  margin-bottom: var(--s-6);
}

.page-head__count {
  color: var(--muted);
}

/* Under the home hero the list heading is a section title, count alongside. */
.page-head--section {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--s-2) var(--s-4);
  margin-bottom: var(--s-5);
  padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--rule);
}

/* ---------- home hero: who this is, in the owner's words ---------- */

.hero {
  display: grid;
  gap: var(--s-4);
  max-width: 720px;
  margin-bottom: var(--s-7);
}

.hero__intro {
  max-width: 65ch;
}

.narrow {
  max-width: 560px;
}

.narrow > * + *,
.doc > * + * {
  margin-top: var(--s-5);
}

.doc {
  max-width: 720px;
}

.doc > section:not(.panel) {
  display: grid;
  gap: var(--s-4);
}

.doc__back {
  padding-top: var(--s-5);
  border-top: 1px solid var(--rule);
}

.notice,
.empty {
  display: grid;
  gap: var(--s-4);
  max-width: 560px;
  padding-block: var(--s-7);
}

.notice__code {
  color: var(--accent-ink);
  font-size: var(--t-sm);
  font-weight: 500;
  letter-spacing: 0.08em;
}

.notice__actions,
.form__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3);
}

.empty {
  padding: var(--s-7) var(--s-5);
  border: 1px dashed var(--rule-strong);
  border-radius: var(--radius);
}

.empty h2 {
  font-size: var(--t-xl);
}

/* ---------- buttons ---------- */

.button {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0 var(--s-3);
  min-height: 44px;
  padding: var(--s-2) var(--s-5);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms ease-out, transform 150ms ease-out;
}

.button:hover {
  background: var(--backdrop);
}

.button:active {
  transform: translateY(1px);
}

.button--primary {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 2px 0 var(--rule-strong);
}

.button--primary:hover {
  background: var(--accent-hover);
}

.button--primary:active {
  box-shadow: none;
  transform: translateY(2px);
}

.button--quiet {
  border-color: transparent;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.button--small {
  padding: var(--s-1) var(--s-4);
  font-size: var(--t-sm);
}

.button--block {
  display: flex;
  width: 100%;
}

.button__detail {
  font-size: var(--t-sm);
  font-weight: 400;
}

.button[disabled],
.button[aria-disabled="true"] {
  opacity: 0.6;
  cursor: progress;
  box-shadow: none;
}

/* ---------- tags, chips, flags ---------- */

.tagbar {
  margin-bottom: var(--s-6);
}

.taglist {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 var(--s-3);
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--mono);
  font-size: var(--t-sm);
  text-decoration: none;
}

a.tag:hover {
  border-color: var(--rule-strong);
}

.tag--active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.tag--static {
  color: var(--muted);
}

.chip {
  display: inline-block;
  padding: 0 var(--s-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-family: var(--mono);
  font-size: var(--t-xs);
  line-height: 1.7;
}

.flags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}

.flag {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  padding: 0 var(--s-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: var(--t-xs);
  line-height: 1.9;
}

/* The glyph repeats what the label already says, so colour is never the only cue. */
.flag--yes {
  border-color: var(--ok);
  background: var(--ok-bg);
  color: var(--ok);
}

.flag--yes::before {
  content: "✓";
}

.flag--no::before {
  content: "⊘";
}

/* ---------- catalog cards ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  gap: var(--s-5);
}

.card {
  min-width: 0;
}

.card__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 150ms ease-out, transform 150ms ease-out, box-shadow 150ms ease-out;
}

.card__link:hover {
  border-color: var(--rule-strong);
  box-shadow: 4px 4px 0 var(--rule-strong);
  transform: translate(-2px, -2px);
}

.card__link:focus-visible {
  border-radius: var(--radius);
}

.card__media {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  border-bottom: 1px solid var(--rule);
  background: var(--backdrop);
}

.card__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.card__noimage {
  color: var(--muted);
  font-family: var(--mono);
  font-size: var(--t-sm);
}

.card__body {
  display: grid;
  gap: var(--s-2);
  padding: var(--s-4);
}

.card__title {
  font-size: var(--t-md);
  line-height: 1.3;
}

.card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-1) var(--s-3);
  font-family: var(--mono);
  font-size: var(--t-sm);
}

.price {
  font-weight: 500;
}

.price--free {
  color: var(--ok);
}

.card__license {
  color: var(--muted);
}

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  margin-top: var(--s-7);
  padding-top: var(--s-5);
  border-top: 1px solid var(--rule);
}

.pager__status {
  color: var(--muted);
  font-size: var(--t-sm);
  text-align: center;
}

.pager__gap {
  width: 96px;
}

/* ---------- product detail ---------- */

.detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 368px;
  align-items: start;
  gap: var(--s-7);
}

.detail__main,
.detail__aside,
.detail__body {
  display: grid;
  gap: var(--s-7);
  min-width: 0;
}

.detail__aside {
  gap: var(--s-5);
}

.detail__head {
  display: grid;
  gap: var(--s-3);
}

.detail__head h1 {
  font-size: var(--t-xl);
}

.detail__head .lede {
  font-size: var(--t-md);
}

.detail__media,
.detail__files,
.detail__body > section {
  display: grid;
  gap: var(--s-4);
  min-width: 0;
}

.stage {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--backdrop);
}

.stage__image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
}

.stage__empty {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  padding: var(--s-5);
  color: var(--muted);
  font-family: var(--mono);
  font-size: var(--t-sm);
  text-align: center;
}

.stage__note {
  color: var(--muted);
  font-size: var(--t-sm);
}

.stage .viewer {
  border-radius: 0;
}

.thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}

.thumb {
  display: grid;
  place-items: center;
  width: 80px;
  height: 60px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  background: var(--backdrop);
  color: var(--ink);
  font-family: var(--mono);
  font-size: var(--t-sm);
  font-weight: 500;
  cursor: pointer;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.thumb:hover {
  border-color: var(--rule-strong);
}

.thumb[aria-current="true"],
.thumb[aria-pressed="true"] {
  border-color: var(--rule-strong);
  box-shadow: inset 0 -4px 0 var(--accent);
}

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
}

.files {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--t-sm);
}

.files th,
.files td {
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.files .num {
  text-align: right;
}

.files tbody tr:last-child > * {
  border-bottom: 0;
}

.files thead th {
  color: var(--muted);
  font-family: var(--mono);
  font-size: var(--t-xs);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.files .files__name {
  width: 100%;
  min-width: 160px;
  font-size: var(--t-md);
  font-weight: 500;
  white-space: normal;
  overflow-wrap: anywhere;
}

.files__action {
  text-align: right;
}

.files__locked {
  color: var(--muted);
  font-family: var(--mono);
  font-size: var(--t-xs);
}

.specs {
  border-top: 1px solid var(--rule-strong);
}

.specs__row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 2fr;
  gap: var(--s-4);
  padding-block: var(--s-3);
  border-bottom: 1px solid var(--rule);
}

.specs dt {
  color: var(--muted);
}

.specs dd {
  font-family: var(--mono);
  font-weight: 500;
  overflow-wrap: anywhere;
}

/* ---------- panels ---------- */

.panel {
  display: grid;
  gap: var(--s-3);
  padding: var(--s-5);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
}

.panel--buy {
  border-color: var(--rule-strong);
  box-shadow: 4px 4px 0 var(--rule-strong);
}

.panel--flat {
  background: transparent;
}

.panel__price {
  font-family: var(--mono);
  font-size: var(--t-xl);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.panel__sub,
.panel__note,
.panel__stats {
  color: var(--muted);
  font-size: var(--t-sm);
}

.panel__stats {
  padding-top: var(--s-3);
  border-top: 1px solid var(--rule);
}

.panel__row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-1) var(--s-4);
}

.panel__title {
  font-size: var(--t-lg);
  font-weight: 600;
  line-height: 1.25;
}

.panel__amount {
  font-size: var(--t-lg);
  font-weight: 500;
}

.panel p,
.ticks {
  font-size: var(--t-sm);
}

.panel .panel__title,
.panel .panel__amount {
  font-size: var(--t-lg);
}

.panel .panel__price {
  font-size: var(--t-xl);
}

.panel .eyebrow {
  font-size: var(--t-xs);
}

.ticks {
  display: grid;
  gap: var(--s-1);
}

.ticks li {
  padding-left: var(--s-5);
  background: linear-gradient(var(--accent), var(--accent)) 0 0.6em / 12px 2px no-repeat;
}

.terms {
  border-block: 1px solid var(--rule);
  font-size: var(--t-sm);
}

.terms summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  color: var(--accent-ink);
  font-weight: 500;
  cursor: pointer;
}

.terms summary::before {
  content: "+";
  width: var(--s-5);
  font-family: var(--mono);
}

.terms[open] summary::before {
  content: "−";
}

.terms summary::-webkit-details-marker {
  display: none;
}

.terms .prose {
  max-height: 320px;
  overflow-y: auto;
  padding-bottom: var(--s-4);
}

/* ---------- prose (rendered markdown) ---------- */

.prose {
  max-width: 68ch;
  overflow-wrap: anywhere;
}

.prose > * + * {
  margin-top: var(--s-4);
}

.prose h2,
.prose h3,
.prose h4 {
  margin-top: var(--s-6);
  font-size: var(--t-lg);
}

.prose h3,
.prose h4 {
  font-size: var(--t-md);
}

.prose > :first-child {
  margin-top: 0;
}

.prose ul,
.prose ol {
  padding-left: var(--s-5);
}

.prose li + li {
  margin-top: var(--s-2);
}

.prose code,
.prose pre {
  font-family: var(--mono);
  font-size: var(--t-sm);
}

.prose code {
  padding: 0 var(--s-1);
  border-radius: var(--radius-sm);
  background: var(--backdrop);
}

.prose pre {
  overflow-x: auto;
  padding: var(--s-4);
  border-radius: var(--radius);
  background: var(--backdrop);
}

.prose pre code {
  padding: 0;
  background: none;
}

.prose blockquote {
  margin: var(--s-4) 0 0;
  padding-left: var(--s-4);
  border-left: 4px solid var(--accent);
  color: var(--muted);
}

.prose table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: var(--t-sm);
}

.prose th,
.prose td {
  padding: var(--s-2) var(--s-3);
  border: 1px solid var(--rule);
  text-align: left;
}

.prose img {
  border-radius: var(--radius);
}

.prose--small {
  font-size: var(--t-sm);
}

.prose--small h2,
.prose--small h3 {
  margin-top: var(--s-5);
  font-size: var(--t-md);
}

/* ---------- forms ---------- */

.form {
  display: grid;
  gap: var(--s-5);
}

.form > .button {
  justify-self: start;
}

.field {
  display: grid;
  gap: var(--s-2);
}

.field label,
.choices legend {
  font-weight: 600;
}

.choices legend {
  margin-bottom: var(--s-2);
}

.field__optional {
  color: var(--muted);
  font-weight: 400;
}

.field__hint {
  color: var(--muted);
  font-size: var(--t-sm);
}

.field__error {
  color: var(--error);
  font-size: var(--t-sm);
  font-weight: 500;
}

.field__error::before {
  content: "! ";
  font-family: var(--mono);
  font-weight: 500;
}

.input {
  width: 100%;
  min-height: 48px;
  padding: var(--s-2) var(--s-3);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.input::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

.input:focus-visible {
  outline-offset: 1px;
  border-radius: var(--radius);
}

.field--error .input {
  border-color: var(--error);
  box-shadow: inset 0 0 0 1px var(--error);
}

.input--code {
  font-family: var(--mono);
  font-size: var(--t-lg);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.input--code::placeholder {
  letter-spacing: 0.08em;
}

.input-affix {
  display: flex;
  max-width: 200px;
}

.input-affix__prefix {
  display: grid;
  place-items: center;
  min-width: 44px;
  border: 1px solid var(--rule-strong);
  border-right: 0;
  border-radius: var(--radius) 0 0 var(--radius);
  background: var(--backdrop);
  color: var(--muted);
}

.input-affix__prefix + .input {
  border-radius: 0 var(--radius) var(--radius) 0;
}

.input--amount {
  font-size: var(--t-lg);
}

.choices {
  display: grid;
  gap: var(--s-2);
  border: 0;
}

.choice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: var(--s-3);
  padding: var(--s-4);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
}

.choice:hover {
  border-color: var(--rule-strong);
}

.choice:has(input:checked) {
  border-color: var(--rule-strong);
  box-shadow: inset 4px 0 0 var(--accent);
}

.choice:has(input:focus-visible) {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.choice input {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: var(--ink);
}

.choice input:focus-visible {
  outline: none;
}

.choice__body {
  display: grid;
  gap: var(--s-1);
}

.choice__title {
  font-weight: 600;
}

.choice__desc {
  color: var(--muted);
  font-size: var(--t-sm);
}

.choice__price {
  font-weight: 500;
  white-space: nowrap;
}

.total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-4);
  padding-block: var(--s-4);
  border-block: 1px solid var(--rule-strong);
  font-weight: 600;
}

.total__amount {
  font-size: var(--t-xl);
  font-weight: 500;
}

.alert {
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--rule-strong);
  border-left-width: 4px;
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.alert--error {
  border-color: var(--error);
  background: var(--error-bg);
  color: var(--error);
  font-weight: 500;
}

.alert + .alert,
.alert + .form,
.page-head + .alert {
  margin-top: var(--s-4);
}

.checkout .alert {
  margin-bottom: var(--s-5);
}

ul.steps {
  display: grid;
  gap: var(--s-3);
  padding-left: var(--s-5);
  list-style: square;
}

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

.status {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
  font-weight: 500;
}

.status__dot {
  width: 12px;
  height: 12px;
  flex: none;
  border-radius: 50%;
  background: var(--muted);
  animation: pulse 1.2s ease-in-out infinite;
}

.status[data-state="paid"] {
  border-color: var(--ok);
  background: var(--ok-bg);
  color: var(--ok);
}

.status[data-state="paid"] .status__dot {
  background: var(--ok);
  animation: none;
}

.status[data-state="other"] .status__dot {
  animation: none;
}

@keyframes pulse {
  50% { opacity: 0.25; }
}

/* ---------- checkout ---------- */

.checkout {
  display: grid;
  grid-template-columns: minmax(0, 560px) minmax(0, 320px);
  justify-content: space-between;
  align-items: start;
  gap: var(--s-7);
}

.checkout__form > * + * {
  margin-top: var(--s-5);
}

.summary {
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
}

.summary__media {
  aspect-ratio: 4 / 3;
  border-bottom: 1px solid var(--rule);
  background: var(--backdrop);
}

.summary__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.summary__body {
  display: grid;
  gap: var(--s-2);
  padding: var(--s-4);
  font-size: var(--t-sm);
}

.summary__title {
  font-size: var(--t-md);
  font-weight: 600;
}

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

/* ---------- store: cart link, kind tabs, product options ---------- */

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 var(--s-5);
}

/* Only the word is underlined, not the count beside it. */
.site-nav .cart-link {
  gap: var(--s-2);
  text-decoration: none;
}

.cart-link__label {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.cart-link:hover .cart-link__label {
  text-decoration-thickness: 2px;
}

.cart-link__count {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 var(--s-2);
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: var(--t-xs);
  font-weight: 500;
  line-height: 1;
}

/* A segmented control: one product type at a time. Tags below stay pills. */
.kindtabs {
  margin-bottom: var(--s-5);
  overflow-x: auto;
}

.kindtabs__list {
  display: inline-flex;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  background: var(--surface);
}

.kindtabs__list li + li {
  border-left: 1px solid var(--rule-strong);
}

.kindtabs__tab {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--s-4);
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.kindtabs__list li:first-child .kindtabs__tab {
  border-radius: var(--radius) 0 0 var(--radius);
}

.kindtabs__list li:last-child .kindtabs__tab {
  border-radius: 0 var(--radius) var(--radius) 0;
}

.kindtabs__tab:hover {
  background: var(--backdrop);
}

.kindtabs__tab[aria-current="page"] {
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
}

.kindtabs__tab:focus-visible {
  position: relative;
  outline-offset: -3px;
  outline-color: var(--accent);
}

/* Listing filters: category and product type, one row each. */
.filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s-3);
  margin-bottom: var(--s-5);
}

.filters .kindtabs {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-bottom: 0;
  overflow: visible;
}

.filters .kindtabs__list {
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
}

.filters__label {
  flex: none;
  width: 6rem;
}

.filters__about {
  max-width: 60ch;
  color: var(--muted);
}

.eyebrow__link {
  color: inherit;
}

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

/* Product page: a shipping restriction worth knowing before ordering. */
.shipnote {
  padding-left: var(--s-3);
  border-left: 4px solid var(--rule-strong);
  font-size: var(--t-sm);
  font-weight: 500;
}

.card__chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-1) var(--s-2);
}

.chip--kind {
  border-color: var(--rule-strong);
  color: var(--ink);
}

.price--soldout,
.panel .panel__price--soldout {
  color: var(--muted);
}

/* A one-off message (added to cart, couldn't add) above the page's content. */
.page-alert {
  margin-bottom: var(--s-5);
}

.page-alert + .page-alert {
  margin-top: 0;
}

.input[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

.alert--ok {
  border-color: var(--ok);
  background: var(--ok-bg);
  color: var(--ok);
  font-weight: 500;
}

.buyform {
  display: grid;
  gap: var(--s-4);
}

.buyform--tip {
  padding-top: var(--s-3);
  border-top: 1px solid var(--rule);
}

.buyform .field label,
.buyform legend {
  font-size: var(--t-sm);
}

.buyform__row {
  display: flex;
  align-items: flex-end;
  gap: var(--s-3);
}

.buyform__row > .button {
  flex: 1;
  min-height: 48px;
}

.buyform__row .input-affix {
  flex: 0 1 136px;
  min-width: 0;
}

.field--qty {
  flex: 0 0 88px;
}

.field--qty .input {
  text-align: center;
}

.choices--compact .choice {
  padding: var(--s-3);
}

.optgroup {
  display: grid;
  gap: var(--s-2);
  border: 0;
}

.optgroup legend {
  margin-bottom: var(--s-2);
  font-weight: 600;
}

.optgroup__value {
  color: var(--muted);
  font-weight: 400;
}

.optgroup__values {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}

.pill {
  position: relative;
  display: inline-flex;
}

.pill input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.pill__label {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--s-4);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: var(--t-sm);
  font-weight: 500;
}

.pill:hover .pill__label {
  border-color: var(--rule-strong);
}

.pill input:checked + .pill__label {
  border-color: var(--rule-strong);
  box-shadow: inset 0 -4px 0 var(--accent);
  font-weight: 600;
}

.pill input:focus-visible + .pill__label {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* Struck through and dashed: a value with nothing in stock for the current choice. */
.pill[data-unavailable] .pill__label {
  border-style: dashed;
  color: var(--muted);
  text-decoration: line-through;
}

.panel .stock {
  color: var(--ok);
  font-weight: 500;
}

.panel .stock--low {
  color: var(--accent-ink);
}

.panel .stock--out {
  color: var(--error);
}

.button[data-unavailable] {
  cursor: not-allowed;
}

/* ---------- cart ---------- */

.cart {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 336px;
  align-items: start;
  gap: var(--s-7);
}

.cart__lines {
  display: grid;
  gap: var(--s-5);
  min-width: 0;
}

.lines {
  border-top: 1px solid var(--rule-strong);
}

.line {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto 88px;
  grid-template-areas:
    "thumb body qty total"
    "thumb body qty remove";
  grid-template-rows: auto 1fr;
  align-items: start;
  gap: var(--s-1) var(--s-4);
  padding-block: var(--s-4);
  border-bottom: 1px solid var(--rule);
}

.line__thumb,
.sumline__thumb {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  background: var(--backdrop);
}

.line__thumb {
  grid-area: thumb;
}

.line__thumb img,
.sumline__thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.line__body {
  display: grid;
  grid-area: body;
  justify-items: start;
  gap: var(--s-1);
  min-width: 0;
}

.line__title {
  font-weight: 600;
  overflow-wrap: anywhere;
}

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

.line__detail,
.line__limit {
  color: var(--muted);
  font-size: var(--t-sm);
}

.line__limit {
  font-size: var(--t-xs);
}

.line__qty {
  display: grid;
  grid-area: qty;
  justify-items: end;
  gap: var(--s-1);
}

.line__total {
  grid-area: total;
  font-weight: 500;
  line-height: 44px;
  text-align: right;
}

.line__remove {
  grid-area: remove;
  justify-self: end;
}

.line__remove .button {
  min-height: 44px;
  padding-inline: var(--s-2);
}

.line--unavailable .line__thumb img {
  opacity: 0.5;
}

.line__problem {
  color: var(--error);
  font-size: var(--t-sm);
  font-weight: 500;
}

.line__flag {
  display: inline-block;
  margin-right: var(--s-1);
  padding: 0 var(--s-2);
  border: 1px solid var(--error);
  border-radius: var(--radius-sm);
  background: var(--error-bg);
  font-family: var(--mono);
  font-size: var(--t-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stepper {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  background: var(--surface);
}

.stepper form {
  display: flex;
  align-items: center;
}

.stepper__button {
  width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: var(--t-lg);
  line-height: 1;
  cursor: pointer;
}

.stepper__button:hover:not([disabled]) {
  background: var(--backdrop);
}

.stepper__button[disabled] {
  color: var(--muted);
  opacity: 0.5;
  cursor: not-allowed;
}

.stepper__input {
  width: 48px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-inline: 1px solid var(--rule);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: var(--t-md);
  text-align: center;
  appearance: textfield;
  -moz-appearance: textfield;
}

.stepper__input::-webkit-outer-spin-button,
.stepper__input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.stepper__button:focus-visible,
.stepper__input:focus-visible {
  position: relative;
  outline-offset: 1px;
}

/* Only there without JavaScript; site.js submits the form on change instead. */
.stepper__apply {
  min-height: 36px;
  margin-inline: var(--s-2);
  padding-inline: var(--s-3);
}

.totals {
  position: sticky;
  top: var(--s-5);
  gap: var(--s-4);
}

.totals__rows {
  display: grid;
  gap: var(--s-2);
}

.totals__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-4);
  font-size: var(--t-sm);
}

.totals__row dd {
  text-align: right;
}

.totals__row--total {
  margin-top: var(--s-2);
  padding-top: var(--s-3);
  border-top: 1px solid var(--rule-strong);
  font-size: var(--t-md);
  font-weight: 600;
}

.totals__row--total dd {
  font-size: var(--t-lg);
  font-weight: 500;
}

.totals__row--total .muted {
  font-weight: 400;
}

.sumlines {
  display: grid;
  gap: var(--s-3);
  padding-bottom: var(--s-4);
  border-bottom: 1px solid var(--rule);
}

.sumline {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--s-3);
  font-size: var(--t-sm);
}

.sumline__body {
  display: grid;
  min-width: 0;
}

.sumline__title {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.sumline__detail {
  color: var(--muted);
  font-size: var(--t-xs);
}

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

.receipt {
  display: grid;
  gap: var(--s-6);
  max-width: 760px;
  margin-inline: auto;
  padding: var(--s-7);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: 8px 8px 0 var(--backdrop);
}

.receipt__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-4) var(--s-6);
  padding-bottom: var(--s-5);
  border-bottom: 4px solid var(--accent);
}

.receipt__head > div {
  display: grid;
  gap: var(--s-3);
}

.receipt__meta {
  display: grid;
  gap: var(--s-1);
  min-width: 200px;
  font-size: var(--t-sm);
}

.receipt__meta div {
  display: flex;
  justify-content: space-between;
  gap: var(--s-5);
}

.receipt__meta dt {
  color: var(--muted);
}

.receipt__meta dd {
  font-weight: 500;
  text-align: right;
}

.receipt__parties {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(176px, 1fr));
  gap: var(--s-5);
}

.receipt__parties section {
  display: grid;
  align-content: start;
  gap: var(--s-1);
  font-size: var(--t-sm);
  overflow-wrap: anywhere;
}

.receipt__parties h2 {
  margin-bottom: var(--s-1);
  font-family: var(--mono);
}

.receipt__detail {
  display: block;
  color: var(--muted);
  font-size: var(--t-sm);
  font-weight: 400;
}

.receipt__totals {
  justify-self: end;
  width: 100%;
  max-width: 320px;
}

.receipt__refunded {
  display: grid;
  gap: var(--s-1);
  padding: var(--s-4) var(--s-5);
  border: 1px solid var(--error);
  border-left-width: 4px;
  border-radius: var(--radius-sm);
  background: var(--error-bg);
  color: var(--error);
}

.receipt__refunded-title {
  font-family: var(--mono);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.receipt__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3) var(--s-4);
  padding-top: var(--s-5);
  border-top: 1px solid var(--rule);
  font-size: var(--t-sm);
}

/* ---------- certificate ---------- */

.certificate {
  display: grid;
  gap: var(--s-6);
  max-width: 760px;
  margin-inline: auto;
  padding: var(--s-7);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: 8px 8px 0 var(--backdrop);
}

.certificate__head {
  display: grid;
  gap: var(--s-3);
  padding-bottom: var(--s-5);
  border-bottom: 4px solid var(--accent);
}

.certificate__number {
  font-size: var(--t-xl);
  font-weight: 500;
  letter-spacing: 0.04em;
}

.certificate__revoked {
  display: grid;
  gap: var(--s-2);
  padding: var(--s-4) var(--s-5);
  border: 4px solid var(--error);
  background: var(--error-bg);
  color: var(--error);
}

.certificate__revoked-title {
  font-family: var(--mono);
  font-size: var(--t-xl);
  font-weight: 500;
  letter-spacing: 0.2em;
}

.certificate__terms {
  display: grid;
  gap: var(--s-4);
}

.certificate__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3) var(--s-4);
  padding-top: var(--s-5);
  border-top: 1px solid var(--rule);
  font-size: var(--t-sm);
}

/* ---------- content pages, collections, Ko-fi, discounts ---------- */

/* Owner-only preview of something unpublished. */
.draft-banner {
  border-style: dashed;
}

.draft-banner__tag {
  margin-right: var(--s-2);
  padding: 0 var(--s-2);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: var(--t-xs);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.draft-banner + .page-head {
  margin-top: var(--s-5);
}

.collection__intro {
  max-width: 65ch;
}

/* The contact form's trap for bots: off-screen, never focusable, never read out. */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.input--area {
  min-height: 160px;
  line-height: 1.5;
  resize: vertical;
}

/* Ko-fi: a quiet pill, so it never competes with the page's own action. */
.kofi,
.site-nav a.kofi,
.site-footer__links a.kofi {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  min-height: 44px;
  padding: var(--s-1) var(--s-4);
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  color: var(--ink);
  font-size: var(--t-sm);
  font-weight: 500;
  line-height: 1.25;
  text-decoration: none;
  transition: background-color 150ms ease-out;
}

.kofi::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
}

.kofi:hover {
  background: var(--backdrop);
}

.site-nav a.kofi--header {
  min-height: 36px;
}

.detail__kofi .kofi {
  display: flex;
  justify-content: center;
}

.site-footer__links--policies {
  flex-basis: 100%;
  padding-top: var(--s-2);
  border-top: 1px solid var(--rule);
}

/* Home: a featured collection as one sideways row above the full grid. */
.shelf {
  margin-bottom: var(--s-7);
}

.shelf__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-2) var(--s-4);
  margin-bottom: var(--s-4);
}

.shelf__head h2 a {
  color: inherit;
  text-decoration: none;
}

.shelf__head h2 a:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.18em;
}

.shelf__all {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  min-height: 44px;
  font-weight: 500;
}

.cards--row {
  grid-template-columns: none;
  grid-auto-flow: column;
  grid-auto-columns: 232px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  /* Room for the cards' hover lift and focus ring inside the scroller. */
  margin: calc(-1 * var(--s-2));
  padding: var(--s-2) var(--s-2) var(--s-4);
  scroll-padding-inline: var(--s-2);
}

.cards--row > .card {
  scroll-snap-align: start;
}

.card--more {
  display: grid;
}

.card__morelink {
  display: grid;
  place-content: center;
  gap: var(--s-1);
  height: 100%;
  padding: var(--s-4);
  border: 1px dashed var(--rule-strong);
  border-radius: var(--radius);
  color: var(--ink);
  font-weight: 500;
  text-align: center;
}

.card__morelink:hover {
  background: var(--backdrop);
}

/* Product page: made to order, back in stock, file updates. */
.leadtime {
  padding-left: var(--s-3);
  border-left: 4px solid var(--accent);
  font-weight: 500;
}

.notify {
  display: grid;
  gap: var(--s-3);
  padding-top: var(--s-4);
  border-top: 1px solid var(--rule);
}

.notify .field label {
  font-size: var(--t-sm);
}

.panel .notify__title {
  font-size: var(--t-md);
  font-weight: 600;
}

.notify .buyform__row > .input {
  flex: 1 1 0;
  min-width: 0;
}

.notify .buyform__row > .button {
  flex: 0 0 auto;
}

.detail__fileshead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-1) var(--s-4);
}

.detail__updated {
  color: var(--muted);
  font-size: var(--t-sm);
}

.changelog .prose {
  max-height: 400px;
}

/* Cart: shipping nudge and discount code. */
.nudge {
  display: grid;
  gap: var(--s-2);
  padding: var(--s-3);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  background: var(--paper);
}

.nudge__bar {
  display: block;
  width: 100%;
  height: 8px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: var(--rule);
  color: var(--accent);
  accent-color: var(--accent);
  appearance: none;
}

.nudge__bar::-webkit-progress-bar {
  background: var(--rule);
}

.nudge__bar::-webkit-progress-value {
  background: var(--accent);
}

.nudge__bar::-moz-progress-bar {
  background: var(--accent);
}

.discount {
  display: grid;
  gap: var(--s-2);
  padding-top: var(--s-4);
  border-top: 1px solid var(--rule);
  scroll-margin-top: var(--s-5);
}

.discount__form {
  display: grid;
  gap: var(--s-2);
}

.discount__form label {
  font-size: var(--t-sm);
  font-weight: 600;
}

.discount__row {
  display: flex;
  gap: var(--s-2);
}

.discount__row .input {
  flex: 1 1 0;
  min-width: 0;
  text-transform: uppercase;
}

.discount__row .button {
  min-height: 48px;
  padding-inline: var(--s-4);
}

.discount__applied {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-1) var(--s-3);
}

.panel .discount__code {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.discount__state {
  margin-left: var(--s-1);
  color: var(--muted);
  font-weight: 400;
}

.discount__state--ok {
  color: var(--ok);
  font-weight: 500;
}

.discount__state--ok::before {
  content: "✓ ";
}

.panel .discount__problem {
  color: var(--muted);
}

.totals__row--discount dd {
  color: var(--ok);
}

.line__leadtime {
  color: var(--ink);
}

.checkout__agree {
  font-size: var(--t-sm);
}

.receipt__status {
  font-weight: 600;
}

.receipt__tracking {
  overflow-wrap: anywhere;
}

/* ---------- campaigns ---------- */

/* The panel that takes the buy box's place while a campaign runs, and stays
   (flatter, without the call to action) to say how it ended. */
.campaign {
  gap: var(--s-4);
}

.campaign__progress {
  display: grid;
  gap: var(--s-2);
}

.campaign .campaign__figure {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 var(--s-2);
  color: var(--muted);
  font-size: var(--t-md);
}

.campaign__number {
  color: var(--ink);
  font-size: var(--t-2xl);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.campaign .campaign__goal {
  color: var(--muted);
  font-size: var(--t-sm);
}

/* <progress>: the bar's width comes from its value, so no inline style is needed. */
.meter {
  display: block;
  width: 100%;
  height: var(--s-4);
  overflow: hidden;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-sm);
  background: var(--backdrop);
  color: var(--accent);
  appearance: none;
  -webkit-appearance: none;
}

.meter::-webkit-progress-bar {
  background: var(--backdrop);
}

.meter::-webkit-progress-value {
  background: var(--accent);
}

.meter::-moz-progress-bar {
  background: var(--accent);
}

.meter--met {
  color: var(--ok);
}

.meter--met::-webkit-progress-value {
  background: var(--ok);
}

.meter--met::-moz-progress-bar {
  background: var(--ok);
}

.campaign__stats {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--s-5);
  padding-block: var(--s-3);
  border-block: 1px solid var(--rule);
}

.campaign__stat {
  display: grid;
  gap: var(--s-1);
}

.campaign__stat dt {
  color: var(--muted);
  font-size: var(--t-sm);
}

.campaign__stat dd {
  font-size: var(--t-lg);
  font-weight: 500;
  line-height: 1.25;
}

.campaign__tiers,
.pledge-tiers,
.campaign__terms {
  display: grid;
  gap: var(--s-2);
}

.campaign__subhead {
  color: var(--muted);
  font-family: var(--sans);
  font-size: var(--t-sm);
  font-weight: 600;
  line-height: 1.5;
}

.tiers {
  display: grid;
  gap: var(--s-2);
}

.tier {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-2) var(--s-3);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  font-size: var(--t-sm);
}

.tier__body {
  display: grid;
  min-width: 0;
}

.tier__label {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.tier__note {
  color: var(--muted);
  font-size: var(--t-xs);
}

.tier__price {
  flex: none;
  font-size: var(--t-md);
  font-weight: 500;
}

/* The tier being sold now: heavier frame and an accent edge, and its note says "Current price". */
.tier--current {
  border-color: var(--rule-strong);
  background: var(--paper);
  box-shadow: inset 4px 0 0 var(--accent);
}

.tier--current .tier__note {
  color: var(--ink);
  font-weight: 500;
}

.tier--soldout {
  border-style: dashed;
  color: var(--muted);
}

.tier--soldout .tier__price {
  text-decoration: line-through;
}

.campaign .campaign__closed {
  padding: var(--s-3);
  border: 1px dashed var(--rule-strong);
  border-radius: var(--radius-sm);
  font-size: var(--t-md);
  font-weight: 500;
}

.campaign .campaign__outcome {
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--rule-strong);
  border-left-width: 4px;
  border-radius: var(--radius-sm);
  font-size: var(--t-md);
  font-weight: 600;
  line-height: 1.35;
}

.campaign .campaign__outcome--funded {
  border-color: var(--ok);
  background: var(--ok-bg);
  color: var(--ok);
}

.campaign__outcome--funded::before {
  content: "✓ ";
}

/* Story updates under the product description: newest first, each one dated. */
.updates {
  display: grid;
  gap: var(--s-5);
}

.update {
  display: grid;
  gap: var(--s-2);
  padding-left: var(--s-4);
  border-left: 1px solid var(--rule-strong);
}

.update__title {
  font-size: var(--t-md);
  line-height: 1.3;
}

.update__date {
  color: var(--muted);
  font-family: var(--mono);
  font-size: var(--t-xs);
}

.card__campaign {
  padding-left: var(--s-2);
  border-left: 4px solid var(--accent);
  font-size: var(--t-xs);
  font-weight: 500;
  line-height: 1.4;
}

/* Pledge form: the sum for the chosen quantity sits right under the field. */
.input--qty {
  max-width: 120px;
}

.pledge-math {
  display: grid;
  gap: var(--s-1);
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.pledge-math__formula {
  font-size: var(--t-lg);
  font-weight: 500;
  overflow-wrap: anywhere;
}

.pledge-math__hint {
  color: var(--muted);
  font-size: var(--t-sm);
}

.pledge-tiers {
  padding-top: var(--s-4);
  border-top: 1px solid var(--rule);
}

.receipt__campaign {
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  font-weight: 500;
}

/* The buyer's checkout note and gift message, wherever they are shown back
   (receipt, order page, the studio's order and packing slip). */
.buyer-note {
  display: grid;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
}

.buyer-note__text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ---------- my orders (buyer sign-in) ---------- */

.flash {
  display: grid;
  gap: var(--s-3);
}

.account-email {
  color: var(--ink);
  font-weight: 500;
  overflow-wrap: anywhere;
}

.account-what {
  display: grid;
  gap: var(--s-3);
}

.account__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-4);
  padding-bottom: var(--s-5);
  border-bottom: 1px solid var(--rule);
}

.account__title {
  display: grid;
  gap: var(--s-2);
  min-width: 0;
}

.orders,
.account__downloads {
  display: grid;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
}

.orders__row,
.account__download {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-3) var(--s-4);
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--rule);
}

.orders__row:last-child,
.account__download:last-child {
  border-bottom: 0;
}

.orders__main {
  display: grid;
  gap: var(--s-2);
  min-width: 0;
}

.orders__title {
  font-size: var(--t-md);
  line-height: 1.35;
}

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

.orders__more {
  color: var(--muted);
  font-weight: 400;
}

.orders__meta,
.orders__note {
  color: var(--muted);
  font-size: var(--t-sm);
}

.orders__total {
  font-weight: 500;
  white-space: nowrap;
}

/* Status at a glance. The words carry the meaning; colour only backs them up. */
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0 var(--s-3);
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--ink);
  font-size: var(--t-xs);
  font-weight: 500;
  line-height: 2;
  white-space: nowrap;
}

.badge--ok {
  border-color: var(--ok);
  background: var(--ok-bg);
  color: var(--ok);
}

.badge--muted {
  background: var(--backdrop);
  color: var(--muted);
}

.badge--accent {
  border-color: var(--accent);
  color: var(--accent-ink);
}

.account__delivery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(224px, 1fr));
  gap: var(--s-5);
  padding: var(--s-5);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
}

.account__block {
  display: grid;
  align-content: start;
  justify-items: start;
  gap: var(--s-2);
  min-width: 0;
}

.account__address {
  display: grid;
  font-style: normal;
  overflow-wrap: anywhere;
}

.account__campaign {
  display: grid;
  gap: var(--s-2);
}

.account__download {
  flex-wrap: wrap;
  align-items: center;
}

.account__download-title {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.check {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: var(--s-1) var(--s-3);
}

.check__box {
  width: 24px;
  height: 24px;
  margin: 0;
  accent-color: var(--accent);
}

.check label {
  font-weight: 600;
}

.check__hint {
  grid-column: 2;
}

.form__pair {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  align-items: start;
  gap: var(--s-4);
}

/* Destructive: outlined, never the loudest thing on the page. */
.panel--danger {
  border-color: var(--error);
  scroll-margin-top: var(--s-5);
}

.button--danger {
  border-color: var(--error);
  color: var(--error);
}

.button--danger:hover {
  background: var(--error-bg);
}

.input--confirm {
  max-width: 240px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (max-width: 560px) {
  .orders__row,
  .account__download {
    padding: var(--s-4);
  }

  .account__delivery {
    padding: var(--s-4);
  }

  .account__download .button,
  .account__download form {
    width: 100%;
  }

  .input--confirm {
    max-width: none;
  }

  .form__pair {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---------- returns (my orders) ---------- */

.return-status {
  display: grid;
  gap: var(--s-3);
  padding: var(--s-5);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--rule-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  scroll-margin-top: var(--s-5);
}

.return-status--ok {
  border-left-color: var(--ok);
}

.return-status--muted {
  background: var(--backdrop);
}

.return-status__title {
  font-size: var(--t-lg);
  font-weight: 600;
  line-height: 1.15;
}

.return-status__items {
  display: grid;
  gap: var(--s-1);
  overflow-wrap: anywhere;
}

.return-status__note {
  display: grid;
  gap: var(--s-2);
  padding-top: var(--s-3);
  border-top: 1px solid var(--rule);
  overflow-wrap: anywhere;
}

.return-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--s-2) var(--s-3);
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
}

.return-item:has(.check__box:checked) {
  border-color: var(--rule-strong);
  box-shadow: inset 4px 0 0 var(--accent);
}

.return-item__title {
  padding-block: var(--s-2);
  font-weight: 600;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.return-item__qty {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--t-sm);
}

.return-item__qty .input {
  width: 80px;
}

@media (max-width: 560px) {
  .return-status {
    padding: var(--s-4);
  }

  .return-item__qty {
    grid-column: 2 / -1;
  }
}

/* ---------- catalog: search, filter and sort ---------- */

/* A bar that is always open; on small screens it folds behind a toggle so the
   products come first. The toggle is a <details> holding only its <summary>,
   and the form is its next sibling, so that wide screens can show the form
   without the <details> being open (a closed one cannot reliably be made to
   show its own content). */
.refine {
  margin-bottom: var(--s-5);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
}

.refine__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  min-height: 48px;
  padding: 0 var(--s-4);
  font-weight: 600;
  cursor: pointer;
}

.refine__toggle::-webkit-details-marker {
  display: none;
}

.refine__toggle:focus-visible {
  border-radius: var(--radius);
}

.refine__togglelabel::before {
  content: "+";
  display: inline-block;
  width: var(--s-5);
  font-family: var(--mono);
}

.refine__disclosure[open] .refine__togglelabel::before {
  content: "−";
}

.refine__count {
  color: var(--muted);
  font-size: var(--t-sm);
  font-weight: 400;
}

.refine__form {
  display: grid;
  gap: var(--s-4);
  padding: var(--s-2) var(--s-4) var(--s-4);
}

.refine__form fieldset {
  min-width: 0;
  padding: 0;
  border: 0;
}

.refine__form .field label,
.refine__form legend {
  font-size: var(--t-sm);
  font-weight: 600;
}

.refine__form legend {
  margin-bottom: var(--s-2);
}

.refine__range {
  display: flex;
  align-items: center;
  gap: var(--s-2);
}

.refine__range .input-affix {
  flex: 1;
  min-width: 0;
  max-width: none;
}

.refine__to {
  color: var(--muted);
  font-size: var(--t-sm);
}

.refine__checklist {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2) var(--s-5);
  min-height: 48px;
}

.refine__checklist .check {
  align-items: center;
  gap: var(--s-2);
}

.refine__checklist .check label {
  font-size: var(--t-md);
  font-weight: 400;
}

.refine__actions .button {
  width: 100%;
  min-height: 48px;
}

.activefilters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
  margin-bottom: var(--s-5);
}

.activefilters li {
  min-width: 0;
}

/* A filter in use; the whole chip is the link that removes it. */
.filterchip {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  max-width: 100%;
  min-height: 44px;
  padding: 0 var(--s-3) 0 var(--s-4);
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: var(--t-sm);
  font-weight: 500;
  text-decoration: none;
}

.filterchip__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filterchip__x {
  color: var(--muted);
  font-family: var(--mono);
  font-size: var(--t-lg);
  line-height: 1;
}

.filterchip:hover {
  background: var(--backdrop);
}

.filterchip:hover .filterchip__x {
  color: var(--ink);
}

.filterchip:focus-visible {
  border-radius: 999px;
}

.activefilters__clear {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--s-2);
  color: var(--ink);
  font-size: var(--t-sm);
  font-weight: 500;
}

#products {
  scroll-margin-top: var(--s-5);
}

ul.empty__tips {
  display: grid;
  gap: var(--s-2);
  padding-left: var(--s-5);
  list-style: disc;
}

/* Product page: other products worth a look, under everything else. */
.related {
  display: grid;
  gap: var(--s-5);
  margin-top: var(--s-7);
  padding-top: var(--s-6);
  border-top: 1px solid var(--rule);
}

@media (min-width: 721px) {
  .refine__form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    padding: var(--s-4);
  }

  .refine__search {
    flex: 1 1 200px;
  }

  .refine__range .input-affix {
    flex: none;
    width: 120px;
  }

  .refine__sort {
    flex: 0 0 208px;
  }

  .refine__actions .button {
    width: auto;
  }

  .filterchip,
  .activefilters__clear {
    min-height: 36px;
  }

  .refine__disclosure {
    display: none;
  }
}

@media (max-width: 720px) {
  .refine__disclosure:not([open]) + .refine__form {
    display: none;
  }
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  h1 {
    font-size: var(--t-xl);
  }

  .brand__tagline {
    display: none;
  }

  .site-main {
    padding-block: var(--s-6) var(--s-7);
  }

  /* One column, reordered: title, preview, buy, files, then the reading. */
  .detail {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--s-6);
  }

  .detail__main,
  .detail__aside {
    display: contents;
  }

  .detail__head { order: 1; }
  .detail__media { order: 2; }
  .detail__aside > .panel { order: 3; }
  .detail__kofi { order: 6; }
  .detail__files { order: 4; }
  .detail__body { order: 5; }

  .checkout {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s-6);
  }

  .summary {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    align-items: center;
    order: -1;
  }

  .summary__media {
    margin: var(--s-3) 0 var(--s-3) var(--s-3);
    border: 1px solid var(--rule);
    border-radius: var(--radius-sm);
    overflow: hidden;
  }

  .certificate {
    padding: var(--s-5);
    box-shadow: none;
  }

  .cart {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s-6);
  }

  .totals {
    position: static;
  }

  /* What you're paying for, then the form that pays for it. */
  .checkout > .totals {
    order: -1;
  }

  .receipt {
    padding: var(--s-5);
    box-shadow: none;
  }
}

@media (max-width: 560px) {
  .wrap {
    padding-inline: var(--s-4);
  }

  .brand {
    font-size: var(--t-md);
  }

  .brand__logo {
    max-width: 144px;
  }

  .hero {
    margin-bottom: var(--s-6);
  }

  .search {
    order: 3;
    flex: 1 1 100%;
  }

  .lede {
    font-size: var(--t-md);
  }

  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--s-3);
  }

  /* Two and a bit cards: the cut-off one says the row scrolls. */
  .cards--row {
    grid-template-columns: none;
    grid-auto-columns: 42%;
  }

  .shelf {
    margin-bottom: var(--s-6);
  }

  .card__body {
    padding: var(--s-3);
  }

  .card__meta {
    font-size: var(--t-xs);
  }

  /* Stack each file: name on top, then type, size, and the action in one line,
     so the download button is never scrolled out of view. */
  .files,
  .files tbody {
    display: block;
  }

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

  .files tbody tr {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    align-items: center;
    gap: var(--s-1) var(--s-3);
    padding: var(--s-3);
    border-bottom: 1px solid var(--rule);
  }

  .files tbody tr:last-child {
    border-bottom: 0;
  }

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

  .files .files__name {
    grid-column: 1 / -1;
    min-width: 0;
  }

  .files tbody td {
    color: var(--muted);
  }

  .files tbody .files__action {
    justify-self: end;
  }

  .choice {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .choice__price {
    grid-column: 2;
  }

  .specs__row {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s-1);
  }

  .form__actions .button,
  .notice__actions .button,
  .form > .button {
    width: 100%;
  }

  .site-nav {
    gap: 0 var(--s-4);
  }

  .kindtabs__tab {
    padding: 0 var(--s-3);
    font-size: var(--t-sm);
  }

  .filters .kindtabs {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--s-1);
  }

  .filters__label {
    width: auto;
  }

  .line {
    grid-template-columns: 72px minmax(0, 1fr) auto;
    grid-template-areas:
      "thumb body total"
      "qty qty remove";
    grid-template-rows: auto auto;
    gap: var(--s-3);
  }

  .line__qty {
    justify-items: start;
  }

  .line__total {
    line-height: inherit;
  }

  .line__remove {
    align-self: center;
  }

  /* Each receipt line: the item, then its numbers with their labels. */
  .receipt__items tbody tr {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .receipt__items tbody td {
    text-align: left;
  }

  .receipt__items tbody td:last-child {
    text-align: right;
  }

  .receipt__items tbody td::before {
    content: attr(data-label) " ";
    font-family: var(--sans);
  }

  .receipt__meta {
    width: 100%;
  }

  .receipt__actions .button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------- print: the certificate or receipt is the document, the site is not ---------- */

@media print {
  /* Doubled selector: must beat theme.css, which loads later. */
  :root:root {
    --paper: #fff;
    --surface: #fff;
    --backdrop: #f2f2f2;
    --ink: #000;
    --muted: #333;
    --rule: #999;
    --rule-strong: #000;
    --accent-ink: #000;
    --focus: #000;
    --error: #000;
    --error-bg: #fff;
  }

  .ownerbar,
  .site-header,
  .site-footer,
  .skip-link,
  .no-print {
    display: none !important;
  }

  body {
    display: block;
    font-size: 11pt;
  }

  .wrap,
  .site-main {
    max-width: none;
    padding: 0;
  }

  .certificate,
  .receipt {
    max-width: none;
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  .receipt__refunded {
    border: 4px double var(--ink);
  }

  .receipt__items tr,
  .receipt__totals {
    break-inside: avoid;
  }

  .certificate__revoked {
    border: 4px double var(--ink);
  }

  .prose {
    max-width: none;
  }

  .prose h2,
  .prose h3,
  .specs__row {
    break-inside: avoid;
    break-after: avoid;
  }

  a {
    color: inherit;
    text-decoration: none;
  }
}

/* ---------- reviews: stars, rating summary, review list, review form ---------- */

/* Stars are decoration (aria-hidden); the rating is always in text beside them. */
.stars {
  display: inline-flex;
  gap: 1px;
  font-family: var(--sans);
  font-size: var(--t-md);
  line-height: 1;
  white-space: nowrap;
}

.stars--small {
  font-size: var(--t-sm);
}

.stars--large {
  font-size: var(--t-lg);
}

.star {
  --star-on: var(--accent-ink);
  --star-off: var(--rule);
  color: var(--star-off);
}

@supports (color: color-mix(in oklab, red, blue)) {
  .star {
    --star-off: color-mix(in oklab, var(--muted) 35%, var(--paper));
  }
}

.star--full {
  color: var(--star-on);
}

.star--half {
  background: linear-gradient(90deg, var(--star-on) 50%, var(--star-off) 50%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.rating__link {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-1) var(--s-2);
  min-height: 24px;
  color: var(--ink);
  font-size: var(--t-sm);
  text-decoration: none;
}

.rating__average {
  font-weight: 500;
}

.rating__count {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.rating__link:hover .rating__count {
  color: var(--ink);
}

.card__rating {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
  color: var(--muted);
  font-size: var(--t-xs);
}

.rating-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 320px);
  align-items: center;
  gap: var(--s-4) var(--s-6);
}

.rating-summary__score {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}

.rating-summary__average {
  font-size: var(--t-2xl);
  font-weight: 500;
  line-height: 1;
}

.rating-summary__detail {
  display: grid;
  gap: var(--s-1);
  font-size: var(--t-sm);
}

.histogram {
  display: grid;
  gap: var(--s-1);
  font-size: var(--t-sm);
}

.histogram__row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 32px;
  align-items: center;
  gap: var(--s-3);
}

.histogram__label {
  color: var(--muted);
  white-space: nowrap;
}

.histogram__count {
  color: var(--muted);
  text-align: right;
}

.histogram__bar {
  appearance: none;
  display: block;
  width: 100%;
  height: 8px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: var(--backdrop);
  color: var(--accent);
}

.histogram__bar::-webkit-progress-bar {
  border-radius: 999px;
  background: var(--backdrop);
}

.histogram__bar::-webkit-progress-value {
  border-radius: 999px;
  background: var(--accent);
}

.histogram__bar::-moz-progress-bar {
  border-radius: 999px;
  background: var(--accent);
}

.reviews {
  display: grid;
}

.review {
  display: grid;
  gap: var(--s-2);
  padding-block: var(--s-5);
  border-top: 1px solid var(--rule);
}

.review__title {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.review__body {
  display: grid;
  gap: var(--s-2);
  max-width: 65ch;
  overflow-wrap: anywhere;
}

.review__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-1) var(--s-3);
  color: var(--muted);
  font-size: var(--t-sm);
}

.review__author {
  color: var(--ink);
  font-weight: 500;
  overflow-wrap: anywhere;
}

.review__verified {
  color: var(--ok);
  font-weight: 500;
}

.review__verified::before {
  content: "✓ ";
}

.review__reply {
  display: grid;
  gap: var(--s-2);
  margin-top: var(--s-2);
  padding-left: var(--s-4);
  border-left: 1px solid var(--rule-strong);
}

.reviews-page__listhead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3) var(--s-4);
}

.review-sort {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2) var(--s-3);
}

.review-sort__label {
  color: var(--muted);
  font-size: var(--t-sm);
}

.reviews-page .pager {
  margin-top: 0;
}

.reviews-page .pager > *,
.card__rating > * {
  white-space: nowrap;
}

.account__review {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2) var(--s-3);
}

/* The form's star picker: five radios, each drawn as a star over its label.
   Stars up to the chosen (or pointed-at) one are filled. */
.rating-input__stars {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-1);
}

.rating-input__option {
  display: grid;
  justify-items: center;
  gap: var(--s-1);
  min-width: 56px;
  padding: var(--s-2) var(--s-1);
  border-radius: var(--radius);
  cursor: pointer;
}

.rating-input__radio {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.rating-input__star {
  color: var(--rule-strong);
  font-size: var(--t-2xl);
  line-height: 1;
  opacity: 0.25;
}

.rating-input__text {
  color: var(--muted);
  font-size: var(--t-xs);
  white-space: nowrap;
}

.rating-input__option:has(input:checked) .rating-input__star,
.rating-input__option:has(~ .rating-input__option input:checked) .rating-input__star {
  color: var(--accent-ink);
  opacity: 1;
}

.rating-input__stars:hover .rating-input__star {
  color: var(--rule-strong);
  opacity: 0.25;
}

.rating-input__stars .rating-input__option:hover .rating-input__star,
.rating-input__stars .rating-input__option:has(~ .rating-input__option:hover) .rating-input__star {
  color: var(--accent-ink);
  opacity: 1;
}

.rating-input__option:has(input:checked) .rating-input__text {
  color: var(--ink);
  font-weight: 600;
}

.rating-input__option:has(input:focus-visible) {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.review-counter {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--s-1) var(--s-4);
}

.review-counter [data-full] {
  color: var(--error);
  font-weight: 500;
}

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

  .rating-input__option {
    min-width: 48px;
  }
}


/* ---------- bundles ---------- */

.bundle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 336px;
  align-items: start;
  gap: var(--s-7);
}

.bundle__main {
  display: grid;
  gap: var(--s-6);
  min-width: 0;
}

.bundle__heading {
  margin-bottom: var(--s-3);
  font-size: var(--t-lg);
  font-weight: 600;
  line-height: 1.25;
}

.bundle__items {
  border-top: 1px solid var(--rule-strong);
}

.bundle-item {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  align-items: start;
  gap: var(--s-4);
  padding-block: var(--s-4);
  border-bottom: 1px solid var(--rule);
}

.bundle-item__thumb {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  background: var(--backdrop);
}

.bundle-item__thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.bundle-item__body {
  display: grid;
  justify-items: start;
  gap: var(--s-1);
  min-width: 0;
}

.bundle-item__title {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.bundle-item__title a {
  color: var(--ink);
}

.bundle-item__detail,
.bundle-item__qty {
  color: var(--muted);
  font-size: var(--t-sm);
}

.bundle-item__choice {
  width: min(100%, 320px);
  margin-top: var(--s-2);
}

.bundle__buy {
  position: sticky;
  top: var(--s-5);
}

.bundle__prices {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--s-1) var(--s-3);
}

.panel .bundle__regular {
  order: 1;
  color: var(--muted);
  font-size: var(--t-md);
}

.bundle__from {
  font-family: var(--sans);
  font-size: var(--t-sm);
  font-weight: 400;
  letter-spacing: 0;
  color: var(--muted);
}

.panel .bundle__save {
  color: var(--ok);
  font-size: var(--t-md);
  font-weight: 600;
}

.bundle__percent {
  font-weight: 400;
}

.bundlebox__list {
  display: grid;
  gap: var(--s-2);
}

.bundlebox__item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-1) var(--s-3);
  font-size: var(--t-sm);
}

.bundlebox__title {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.bundlebox__save {
  color: var(--ok);
  font-weight: 500;
}

.totals__what {
  display: block;
  color: var(--muted);
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .bundle {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s-6);
  }

  .bundle__buy {
    position: static;
  }
}

@media (max-width: 560px) {
  .bundle-item {
    grid-template-columns: 72px minmax(0, 1fr) auto;
    gap: var(--s-3);
  }
}

/* ---------- ship or pickup ---------- */

.fulfillment {
  display: grid;
  justify-items: start;
  gap: var(--s-3);
  scroll-margin-top: var(--s-5);
}

.fulfillment .choices {
  width: 100%;
  min-width: 0; /* a fieldset is as wide as its content by default */
}

.fulfillment .choice {
  grid-template-columns: auto minmax(0, 1fr);
}

.fulfillment .choice__title {
  overflow-wrap: anywhere;
}

.fulfillment__free {
  color: var(--muted);
  font-weight: 400;
  white-space: nowrap;
}

.totals .fulfillment {
  padding-bottom: var(--s-4);
  border-bottom: 1px solid var(--rule);
}


/* ---------- digital extras: file versions, earlier versions, license keys ---------- */

.files__version,
.files__note {
  display: block;
  color: var(--muted);
  font-size: var(--t-sm);
  font-weight: 400;
}

.files__version {
  font-family: var(--mono);
  font-size: var(--t-xs);
}

/* The current file's row and its "Earlier versions" row read as one entry. */
.files tbody tr.files__row--has-history > * {
  border-bottom: 0;
}

.files td.files__history {
  padding-top: 0;
  white-space: normal;
}

.file-history {
  border-block: 0;
}

.file-history__list {
  display: grid;
  margin-bottom: var(--s-3);
  border-top: 1px solid var(--rule);
}

.file-history__item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2) var(--s-4);
  padding-block: var(--s-3);
  border-bottom: 1px solid var(--rule);
}

.file-history__item:last-child {
  border-bottom: 0;
}

.file-history__main {
  display: grid;
  gap: var(--s-1);
  min-width: 0;
  overflow-wrap: anywhere;
}

.file-history__meta {
  color: var(--muted);
  font-family: var(--mono);
  font-size: var(--t-xs);
}

.account__files {
  flex-basis: 100%;
  display: grid;
  gap: var(--s-2);
  min-width: 0;
  font-size: var(--t-sm);
}

.account__file {
  overflow-wrap: anywhere;
}

.account__file .files__version {
  display: inline;
}

.license-keys {
  display: grid;
  gap: var(--s-4);
}

.license-key {
  display: grid;
  gap: var(--s-2);
  padding: var(--s-4) var(--s-5);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
}

.license-key__product {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.license-key__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2) var(--s-3);
}

.license-key__value {
  min-width: 0;
  padding: var(--s-2) var(--s-3);
  border: 1px dashed var(--rule-strong);
  border-radius: var(--radius-sm);
  background: var(--paper);
  font-family: var(--mono);
  font-size: var(--t-md);
  font-weight: 500;
  overflow-wrap: anywhere;
  user-select: all;
}

.license-key__status,
.license-key__waiting {
  color: var(--muted);
  font-size: var(--t-sm);
}

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

@media (max-width: 560px) {
  /* Stacked file rows: keep a file and its earlier versions in one block. */
  .files tbody tr.files__row--has-history {
    padding-bottom: 0;
    border-bottom: 0;
  }

  .files tbody tr.files__row--has-history + tr {
    display: block;
    padding-top: 0;
  }

  .files tbody td.files__history {
    color: inherit;
  }
}

/* ---------- backorders and preorders ---------- */

/* Buyable, but it ships later: said in plain ink, apart from in-stock green and low-stock amber. */
.panel .stock--later {
  padding-left: var(--s-3);
  border-left: 4px solid var(--accent);
  color: var(--ink);
}

.line__later {
  color: var(--ink);
  font-weight: 500;
}

/* ---------- responsive images, wishlist, recently viewed ---------- */

/* {% responsive_image %} wraps each <img> in a <picture>: keep the <img> the
   box its container lays out, exactly as when it stood alone. */
.card__media picture,
.stage picture,
.thumb picture,
.bundle-item__thumb picture {
  display: contents;
}

.site-nav .saved-link {
  gap: var(--s-1);
}

/* The heart: a toggle button. Outline when off, filled accent when on, so the
   state shows in shape as well as colour. */
.heart {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  transition: border-color 150ms ease-out, transform 150ms ease-out;
}

.heart:hover {
  border-color: var(--rule-strong);
}

.heart:active {
  transform: scale(0.94);
}

.heart:focus-visible {
  border-radius: 999px;
}

.heart[aria-busy="true"] {
  cursor: progress;
}

.heart__icon {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linejoin: round;
}

.heart[aria-pressed="true"] {
  border-color: var(--rule-strong);
}

.heart[aria-pressed="true"] .heart__icon {
  fill: var(--accent);
}

/* On a card it sits over the photo's corner, beside (not inside) the card's link. */
.card {
  position: relative;
}

.card__save {
  position: absolute;
  top: var(--s-2);
  right: var(--s-2);
  transition: transform 150ms ease-out;
}

/* Rides along with the card's hover lift. */
.card__link:hover + .card__save {
  transform: translate(-2px, -2px);
}

/* Product page: the same toggle with its label showing. */
.save {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2) var(--s-4);
}

.heart--labelled {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  width: auto;
  padding: 0 var(--s-4) 0 var(--s-3);
  font-weight: 500;
}

.save__where {
  color: var(--muted);
  font-size: var(--t-sm);
}

/* Saved list: each card with its Remove button underneath. */
.card--removable {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}

.card--removable .card__link {
  flex: 1;
  height: auto;
}

.card__remove .button {
  min-height: 44px;
}

.wishmail {
  max-width: 560px;
  margin-top: var(--s-7);
}

.wishmail .buyform__row > .button {
  flex: 0 0 auto;
}

@media (max-width: 560px) {
  .wishmail .buyform__row {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Recently viewed: one sideways row, under everything else on the page. */
.recent {
  display: grid;
  gap: var(--s-4);
  margin-top: var(--s-7);
  padding-top: var(--s-6);
  border-top: 1px solid var(--rule);
}

.recent > h2 {
  font-size: var(--t-lg);
}


/* ---------- print service ("No printer? We can print it for you.") ---------- */

/* A colour swatch is an inline SVG (the CSP allows no inline styles). The
   stroke keeps white and near-paper colours visible on any theme. */
.swatch {
  flex: none;
  width: 16px;
  height: 16px;
  vertical-align: -2px;
}

.swatch rect {
  stroke: var(--muted);
  stroke-width: 1;
}

.printcard__colors {
  gap: var(--s-3);
}

.pill--swatch .pill__label {
  gap: var(--s-2);
  padding: 0 var(--s-3);
}

.pill__text {
  overflow-wrap: anywhere;
}

.pill__hint {
  color: var(--muted);
  font-size: var(--t-xs);
  font-weight: 400;
}

/* The text field belongs to "Request another color": shown only with it
   chosen. A browser without :has() drops this rule and always shows it. */
.printcard__colors:not(:has(input[value="custom"]:checked)) .printcard__custom {
  display: none;
}

.line__print,
.sumline__print {
  overflow-wrap: anywhere;
}

.line__print {
  color: var(--ink);
}

.line__print .swatch,
.sumline__print .swatch {
  margin-right: var(--s-1);
}


/* Product questions: answered Q&As and the "Ask a question" form on a product page. */
.qna {
  display: grid;
}

.qna__item {
  display: grid;
  gap: var(--s-2);
  padding-block: var(--s-5);
  border-top: 1px solid var(--rule);
}

.qna__question {
  display: grid;
  gap: var(--s-2);
  max-width: 65ch;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.qna__meta {
  color: var(--muted);
  font-size: var(--t-sm);
  overflow-wrap: anywhere;
}

.qna__asker {
  color: var(--ink);
  font-weight: 500;
}

.qna__answer {
  display: grid;
  gap: var(--s-2);
  margin-top: var(--s-2);
  padding-left: var(--s-4);
  border-left: 1px solid var(--rule-strong);
}

.qna__text {
  display: grid;
  gap: var(--s-2);
  max-width: 65ch;
  overflow-wrap: anywhere;
}

.qna-more > summary {
  padding-block: var(--s-3);
  border-top: 1px solid var(--rule);
  color: var(--accent);
  font-weight: 500;
  cursor: pointer;
}

.qna-form {
  max-width: 65ch;
  padding: var(--s-5);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
}

.qna-form__title {
  font-size: var(--t-lg);
}

.qna-form__row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-5);
  align-items: start;
}

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

/* ---------- news: post list, post page ---------- */

.posts {
  display: grid;
  gap: var(--s-6);
  max-width: 920px;
  list-style: none;
}

.post-card {
  display: grid;
  grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
  gap: var(--s-5);
  align-items: start;
  padding-bottom: var(--s-6);
  border-bottom: 1px solid var(--rule);
}

.post-card:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.post-card--plain {
  grid-template-columns: minmax(0, 1fr);
}

.post-card__media {
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--backdrop);
}

.post-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-card__body {
  display: grid;
  gap: var(--s-2);
  max-width: 60ch;
}

.post-card__date {
  color: var(--muted);
  font-size: var(--t-sm);
}

.post-card__title {
  font-size: var(--t-xl);
  line-height: 1.2;
}

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

.post-card__title a:hover {
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.post-card__summary {
  color: var(--muted);
}

.post-card__more {
  margin-top: var(--s-2);
  font-weight: 500;
}

.post__head .eyebrow a {
  color: inherit;
}

.post__cover {
  margin-inline: 0;
}

.post__cover img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--backdrop);
}

.post__body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
}

.post-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-4);
}

.post-nav__link {
  display: grid;
  gap: var(--s-1);
  padding: var(--s-4);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
}

.post-nav__link:hover {
  border-color: var(--rule-strong);
}

.post-nav__link--older {
  grid-column: 2;
  text-align: right;
}

.post-nav__label {
  color: var(--muted);
  font-family: var(--mono);
  font-size: var(--t-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.post-nav__title {
  font-weight: 500;
  overflow-wrap: anywhere;
}

@media (max-width: 720px) {
  .post-card {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s-4);
  }

  .post-card__title {
    font-size: var(--t-lg);
  }
}

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

  .post-nav__link--older {
    grid-column: 1;
    text-align: left;
  }
}


/* ---------- sale prices ---------- */

/* The price buyers pay, then the regular price crossed out. Each carries a
   visually hidden "Sale price" / "Regular price", since a strike-through is not announced. */
.price__was,
.panel__was,
.line__was {
  color: var(--muted);
  font-weight: 400;
  text-decoration-thickness: 1px;
}

.card__prices {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 var(--s-2);
}

.panel__was {
  margin-left: var(--s-1);
  font-size: var(--t-lg);
  letter-spacing: 0;
}

.salebadge {
  display: inline-block;
  padding: 0 var(--s-2);
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--mono);
  font-size: var(--t-xs);
  font-weight: 600;
  line-height: 1.8;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  vertical-align: middle;
}

.panel__price .salebadge {
  margin-left: var(--s-1);
}

/* On a card the badge sits on the picture, opposite the save button. */
.card__media {
  position: relative;
}

.card__sale {
  position: absolute;
  top: var(--s-2);
  left: var(--s-2);
}

.card__saleends,
.saleends {
  font-size: var(--t-sm);
  font-weight: 500;
}

.card__saleends {
  font-size: var(--t-xs);
}

.line__sale {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 var(--s-2);
}

.line__sale .salebadge {
  align-self: center;
}

/* Checkout: live carrier rates (ZIP, then a rate). */
.live-zip {
  scroll-margin-top: var(--s-5);
}

.live-zip__row {
  display: flex;
  align-items: stretch;
  gap: var(--s-2);
}

.live-zip__row .input {
  flex: 0 1 9rem;
  min-width: 0;
  letter-spacing: 0.08em;
}

.live-zip__row .button {
  flex: none;
}

.live-rates .choices {
  min-width: 0; /* a fieldset is as wide as its content by default */
}

.live-rates .choice__title {
  overflow-wrap: anywhere;
}

.live-rates__empty {
  padding: var(--s-4);
  border: 1px dashed var(--rule-strong);
  border-radius: var(--radius);
  font-size: var(--t-sm);
}
