/* ---------------------------------------------------------------------------
   Fonts (self-hosted, SIL OFL - see /fonts/LICENSE.txt)
--------------------------------------------------------------------------- */
@font-face {
  font-family: 'Bricolage';
  src: url('/fonts/bricolage-grotesque.woff2') format('woff2-variations');
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
}
@font-face {
  font-family: 'Atkinson';
  src: url('/fonts/atkinson-400.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Atkinson';
  src: url('/fonts/atkinson-700.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

/* ---------------------------------------------------------------------------
   Tokens
--------------------------------------------------------------------------- */
:root {
  /* The two brand colours, from the logo: jumpsuit orange and the pale yellow of its highlights */
  --brand: #ff8c00;
  --brand-tint: #fff4b0;
  /* Orange is too light to read as text on a pale page, so text and thin lines use these */
  --brand-ink: #944600;
  --brand-deep: #c46200;
  --brand-hover: #ffa426;
  --on-brand: #2a1803;

  --paper: #fffae6;
  --surface: #ffffff;
  --ink: #2a1803;
  --ink-soft: #6b553a;
  --line: #ecdfb3;
  --stub: #fff4b0;
  --stub-line: #e2c766;
  --link: #944600;
  --focus: #2a1803;
  --good: #2e6b3f;
  --danger: #a8281c;
  --danger-tint: #fbe3df;
  --notice: #2a1803;
  --notice-ink: #fff4b0;
  --receipt-bg: #fffef8;
  --receipt-ink: #2a1803;
  --receipt-soft: #6b553a;
  --receipt-rule: #d9c998;
  --sale: #b42318;
  --sale-tint: #fde7e2;
  --receipt-sale: #b42318;
  --checker: rgba(255, 255, 255, 0.5);
  --modal-shadow: 0 24px 64px rgba(60, 32, 0, 0.32), 0 2px 6px rgba(60, 32, 0, 0.12);
  --lift-shadow: 0 20px 34px -20px rgba(120, 62, 0, 0.5), 0 3px 8px -3px rgba(120, 62, 0, 0.16);
  --rest-shadow: 0 1px 2px rgba(120, 62, 0, 0.07), 0 6px 14px -10px rgba(120, 62, 0, 0.28);
  /* The dark display panels, from the iron bars in the logo */
  --iron: #2a3133;

  --display: 'Bricolage', 'Arial Narrow', system-ui, sans-serif;
  --body: 'Atkinson', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --step--1: 0.875rem;
  --step-0: 1rem;
  --step-1: 1.1875rem;
  --step-2: 1.4375rem;
  --step-3: 1.75rem;
  --step-5: clamp(2.5rem, 7vw, 4.25rem);

  --radius: 10px;
  --radius-card: 16px;
  --shell: 1120px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand-tint: #3b2a10;
    --brand-ink: #ffb04d;
    --brand-deep: #b86200;

    --paper: #17110a;
    --surface: #221a10;
    --ink: #f7eeda;
    --ink-soft: #bbaa8c;
    --line: #3d301c;
    --stub: #1b140b;
    --stub-line: #4d3c20;
    --link: #ffb04d;
    --focus: #fff4b0;
    --good: #7ccb95;
    --danger: #ff9b8a;
    --danger-tint: #3d1f1a;
    --notice: #3b2a10;
    --notice-ink: #fff4b0;
    --sale: #ff9b8a;
    --sale-tint: #3d1f1a;
    --checker: rgba(255, 255, 255, 0.035);
    --modal-shadow: 0 24px 64px rgba(0, 0, 0, 0.6), 0 0 0 1px #3d301c;
    --lift-shadow: 0 18px 32px -18px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 140, 0, 0.22);
    --rest-shadow: 0 6px 14px -10px rgba(0, 0, 0, 0.6);
    --iron: #23292b;
    color-scheme: dark;
  }
}

/* ---------------------------------------------------------------------------
   Base
--------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
html.modal-open {
  overflow: hidden;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.55;
}
h1,
h2,
h3 {
  font-family: var(--display);
  line-height: 1.1;
  margin: 0;
}
p {
  margin: 0;
}
a {
  color: var(--link);
  text-underline-offset: 0.15em;
}
img {
  display: block;
}
button,
input {
  font: inherit;
  color: inherit;
}
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
[hidden] {
  display: none !important;
}

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: 16px;
}
@media (min-width: 720px) {
  .shell {
    padding-inline: 32px;
  }
}

/* ---------------------------------------------------------------------------
   Buttons
--------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  min-height: 44px;
  padding: 0 1.15em;
  border: 2px solid var(--brand);
  border-radius: var(--radius);
  background: var(--brand);
  color: var(--on-brand);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  /* A solid edge underneath, like a block you can press */
  box-shadow: 0 3px 0 var(--brand-deep);
  transition:
    background-color 140ms,
    border-color 140ms,
    box-shadow 100ms,
    transform 100ms;
}
.btn:hover {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
}
.btn:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--brand-deep);
}
.btn-quiet {
  background: var(--surface);
  border-color: var(--brand-deep);
  color: var(--brand-ink);
  box-shadow: 0 3px 0 color-mix(in srgb, var(--brand) 35%, var(--line));
}
.btn-quiet:hover {
  background: var(--brand-tint);
  color: var(--brand-ink);
  border-color: var(--brand-deep);
}
.btn-quiet:active:not(:disabled) {
  box-shadow: 0 1px 0 color-mix(in srgb, var(--brand) 35%, var(--line));
}
.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  background: transparent;
  color: var(--ink-soft);
  border-color: var(--line);
  box-shadow: none;
}

/* ---------------------------------------------------------------------------
   Header / footer
--------------------------------------------------------------------------- */
.test-banner {
  background: var(--notice);
  color: var(--notice-ink);
  text-align: center;
  font-size: var(--step--1);
  padding: 6px 16px;
}
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
  min-height: 68px;
  padding-block: 10px;
}
.brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  color: var(--ink);
  text-decoration: none;
}
.brand-row .logo {
  flex: none;
  width: 32px;
  height: 32px;
}
.brand {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 800;
  font-stretch: 82%;
  letter-spacing: -0.01em;
  line-height: 1;
}
.site-nav {
  display: flex;
  gap: 2px;
}
.site-nav a {
  position: relative;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--ink-soft);
  font-weight: 700;
  text-decoration: none;
  transition:
    color 140ms,
    background-color 140ms;
}
.site-nav a:hover {
  color: var(--ink);
  background: var(--paper);
}
/* The page you're on: a short moss bar under the link */
.site-nav a::after {
  content: '';
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 2px;
  height: 3px;
  border-radius: 3px;
  background: var(--brand);
  transform: scaleX(0);
  transition: transform 200ms ease;
}
.site-nav a[aria-current='page'] {
  color: var(--ink);
}
.site-nav a[aria-current='page']::after,
.site-nav a:hover::after {
  transform: scaleX(1);
}
.site-nav a:hover:not([aria-current='page'])::after {
  background: var(--line);
}
.address {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  cursor: pointer;
  font-size: var(--step--1);
  transition:
    border-color 140ms,
    background-color 140ms;
}
.address-label {
  color: var(--ink-soft);
}
.address strong {
  font-family: var(--display);
  font-size: var(--step-0);
}
.address:hover {
  border-color: var(--brand-deep);
}
.address.is-copied {
  border-color: var(--brand-deep);
  background: var(--brand-tint);
}
.address.is-copied .address-label {
  color: var(--brand-ink);
  font-weight: 700;
}
@media (max-width: 700px) {
  .header-inner {
    gap: 4px 12px;
  }
  .brand-row {
    width: 100%;
  }
  /* Second row: the links on the left (scrolling sideways if there are many), the address on the right */
  .site-nav {
    flex: 1 1 0;
    min-width: 0;
    margin-left: -10px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .site-nav a {
    flex: none;
    padding-inline: 10px;
  }
  .site-nav a::after {
    left: 10px;
    right: 10px;
  }
  .address {
    flex: 0 1 auto;
    min-width: 0;
    min-height: 34px;
    padding: 0 12px;
  }
  .address strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: var(--step--1);
  }
}
@media (max-width: 420px) {
  .address-label {
    display: none;
  }
}

.site-footer {
  margin-top: 80px;
  padding-top: 24px;
  padding-bottom: 48px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: var(--step--1);
  display: grid;
  gap: 10px;
}
.site-footer p {
  max-width: 75ch;
}
.footer-thanks {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
  color: var(--ink);
  font-family: var(--display);
  font-size: var(--step-1);
  font-weight: 700;
}
.footer-thanks img {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
}
.disclaimer {
  font-weight: 700;
  color: var(--ink);
}

/* ---------------------------------------------------------------------------
   Store layout
--------------------------------------------------------------------------- */
.layout {
  display: grid;
  gap: 28px;
  padding-top: 28px;
}
/* Receipt, history, FAQ, privacy and not-found pages */
main.narrow {
  padding-top: 40px;
}
.shop {
  display: grid;
  gap: 24px;
  align-content: start;
  min-width: 0;
}
/* Wide screens: the order sits beside the shop. On the front page the welcome banner runs
   across the top of both. */
@media (min-width: 960px) {
  .layout {
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 24px 48px;
    align-items: start;
  }
  .view-head,
  .shop {
    grid-column: 1;
  }
  .checkout {
    grid-column: 2;
    grid-row: 1 / span 2;
  }
  .layout.is-home .view-head {
    grid-column: 1 / -1;
  }
  .layout.is-home .checkout {
    grid-row: 2;
  }
}

/* Top of each page */
.view-head {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.view-head:empty {
  display: none;
}
.view-head h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 800;
  font-stretch: 80%;
  letter-spacing: -0.015em;
  line-height: 1;
}
.view-head h1:focus {
  outline: none;
}
.view-head > p,
.hero-main p {
  max-width: 58ch;
  color: var(--ink-soft);
  font-size: var(--step-1);
  line-height: 1.45;
  text-wrap: pretty;
}

/* The welcome banner on the front page: the logo, a greeting, where to put your name, and
   how buying works. A sunrise in the two brand colours: pale yellow behind the logo, warming
   to jumpsuit orange. Dark text, because white can't be read on orange. It looks the same in
   light and dark mode. */
.view-head.is-hero {
  position: relative;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px 40px;
  padding: 26px 22px 22px;
  overflow: hidden;
  border-radius: 22px;
  color: #2a1803;
  background:
    radial-gradient(70% 150% at 0% 35%, #fff4b0 0%, rgba(255, 244, 176, 0.7) 28%, rgba(255, 244, 176, 0) 68%),
    linear-gradient(120deg, #ffb238, #ff8c00 62%, #f57f00);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.25),
    0 18px 36px -22px rgba(196, 98, 0, 0.75);
}
/* A faint grid of blocks */
.view-head.is-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(255, 244, 176, 0.2) 2px, transparent 2px) 0 -1px / 44px 44px,
    linear-gradient(90deg, rgba(255, 244, 176, 0.2) 2px, transparent 2px) -1px 0 / 44px 44px;
  -webkit-mask-image: linear-gradient(115deg, transparent 35%, #000 95%);
  mask-image: linear-gradient(115deg, transparent 35%, #000 95%);
  pointer-events: none;
}
.view-head.is-hero > * {
  position: relative;
}
.hero-main {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 6px 16px;
  align-items: center;
}
/* The logo bobs gently, like an item waiting to be picked up */
.hero-logo {
  width: 72px;
  height: 72px;
  image-rendering: pixelated;
  filter: drop-shadow(0 8px 6px rgba(120, 60, 0, 0.4));
  animation: bob 3.6s ease-in-out infinite;
}
@keyframes bob {
  50% {
    transform: translateY(-7px);
    filter: drop-shadow(0 15px 9px rgba(120, 60, 0, 0.28));
  }
}
.view-head.is-hero h1 {
  font-size: clamp(1.9rem, 6.4vw, 3.4rem);
  line-height: 0.98;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.view-head.is-hero .hero-main p {
  grid-column: 1 / -1;
  margin-top: 8px;
  max-width: 54ch;
  color: #3d2405;
}
/* How buying works */
.hero-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  counter-reset: step;
}
.hero-steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  line-height: 1.3;
  font-weight: 700;
  color: #2a1803;
}
.hero-steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #2a1803;
  box-shadow: 0 2px 0 rgba(42, 24, 3, 0.35);
  color: #fff4b0;
  font-family: var(--display);
  font-weight: 800;
}
.hero-who {
  align-self: center;
}
.hero-who .who {
  border: 0;
  box-shadow: 0 14px 30px -16px rgba(90, 44, 0, 0.8);
}
@media (min-width: 620px) {
  .view-head.is-hero {
    padding: 34px 34px 30px;
  }
  .hero-main {
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 4px 26px;
  }
  .hero-logo {
    grid-row: 1 / span 2;
    width: 112px;
    height: 112px;
  }
  .view-head.is-hero .hero-main h1 {
    align-self: end;
  }
  .view-head.is-hero .hero-main p {
    grid-column: 2;
    align-self: start;
    margin-top: 6px;
  }
  .hero-steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    padding-top: 20px;
    border-top: 2px dashed rgba(42, 24, 3, 0.28);
  }
}
@media (min-width: 960px) {
  .view-head.is-hero {
    grid-template-columns: minmax(0, 1fr) 368px;
    padding: 40px 40px 32px;
  }
  .hero-who {
    grid-column: 2;
    grid-row: 1;
  }
  /* Each step takes the room its words need, so none of them wraps */
  .hero-steps {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, auto);
    justify-content: space-between;
  }
}
.crumbs {
  display: flex;
  gap: 8px;
  color: var(--ink-soft);
  font-size: var(--step--1);
}
.crumbs a {
  color: var(--ink-soft);
}
.crumbs a:hover {
  color: var(--brand-ink);
}
.section-title {
  font-size: var(--step-3);
  font-weight: 800;
  font-stretch: 85%;
  letter-spacing: -0.01em;
}
.section-note {
  margin: 4px 0 18px;
  color: var(--ink-soft);
}

/* Sales on now */
.sales {
  display: grid;
  gap: 8px;
}
.sale {
  position: relative;
  padding: 12px 16px 12px 20px;
  background: var(--sale-tint);
  border-radius: 12px;
  color: var(--ink);
}
.sale::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  border-radius: 10px 0 0 10px;
  background: var(--sale);
}
.sale strong {
  font-family: var(--display);
  font-size: var(--step-1);
  color: var(--sale);
}
.sale-ends {
  color: var(--ink-soft);
}

/* Who's this for? */
.who {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 4px 16px;
  align-items: start;
  padding: 18px 20px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--rest-shadow);
}
.who h2 {
  grid-column: 2;
  font-size: var(--step-1);
  font-weight: 700;
}
.head-frame {
  grid-row: 1 / span 3;
  width: 56px;
  height: 56px;
  border-radius: 10px;
  background:
    linear-gradient(45deg, var(--line) 25%, transparent 25%, transparent 75%, var(--line) 75%) 0 0 / 14px 14px,
    linear-gradient(45deg, var(--line) 25%, transparent 25%, transparent 75%, var(--line) 75%) 7px 7px / 14px 14px,
    var(--paper);
  overflow: hidden;
}
.head-frame img {
  width: 56px;
  height: 56px;
  image-rendering: pixelated;
}
.who.is-found .head-frame img {
  animation: pop 420ms cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
@keyframes pop {
  from {
    transform: scale(0.4) rotate(-8deg);
    opacity: 0;
  }
}
.player-form {
  grid-column: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
}
.player-form label {
  font-size: var(--step--1);
  color: var(--ink-soft);
}
.field-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.field-row input {
  flex: 1 1 180px;
  width: 0;
  min-width: 0;
  min-height: 44px;
  padding: 0 12px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  font-size: var(--step-1);
  transition:
    border-color 140ms,
    background-color 140ms;
}
.field-row input:hover {
  border-color: color-mix(in srgb, var(--brand) 40%, var(--line));
}
.field-row input:focus {
  border-color: var(--brand-deep);
  background: var(--surface);
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 35%, transparent);
}
.hint {
  grid-column: 2;
  font-size: var(--step--1);
  color: var(--ink-soft);
}
.hint.is-error {
  color: var(--danger);
}
.hint.is-ok {
  color: var(--good);
  font-weight: 700;
}
/* Until a name is found, checking it is the main thing to do, so the button is solid orange */
.who:not(.is-found) .field-row .btn:not(:disabled) {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--on-brand);
  box-shadow: 0 3px 0 var(--brand-deep);
}
.who:not(.is-found) .field-row .btn:hover:not(:disabled) {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
}
.who:not(.is-found) .field-row .btn:active:not(:disabled) {
  box-shadow: 0 1px 0 var(--brand-deep);
}
/* In the welcome banner the box is narrow, so the button goes under the name */
.hero-who .field-row .btn {
  flex: 1 1 auto;
}
/* Until we know who it's for there's no head to show, so the box is one column */
.who:not(.is-found) {
  grid-template-columns: minmax(0, 1fr);
}
.who:not(.is-found) .head-frame {
  display: none;
}
.who:not(.is-found) h2,
.who:not(.is-found) .player-form,
.who:not(.is-found) .hint {
  grid-column: 1;
}
@media (max-width: 480px) {
  .who.is-found {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 4px 12px;
  }
  .who.is-found .head-frame,
  .who.is-found .head-frame img {
    width: 44px;
    height: 44px;
  }
}

.receipt-logo {
  display: block;
  width: 64px;
  height: 64px;
  margin: 0 auto 6px;
  image-rendering: pixelated;
}

/* Once a name is confirmed, the box shrinks to one line so the items sit higher. */
.who.is-found {
  padding-block: 12px;
}
.who.is-found h2,
.who.is-found .player-form label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.who.is-found .head-frame {
  grid-row: 1 / span 2;
}

.empty,
.loading {
  color: var(--ink-soft);
}

/* ---------------------------------------------------------------------------
   Categories page: each category is a shelf of its items behind cell bars.
   Hover or focus lifts the bars and fans the items out.
--------------------------------------------------------------------------- */
.cat-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}
.cat-tile a {
  display: grid;
  grid-template-rows: auto 1fr;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--rest-shadow);
  transition:
    border-color 200ms,
    box-shadow 260ms,
    transform 260ms cubic-bezier(0.2, 0.8, 0.3, 1);
}
.cat-tile a:hover,
.cat-tile a:focus-visible {
  border-color: var(--brand);
  box-shadow: var(--lift-shadow);
  transform: translateY(-4px);
}
.cat-tile a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
.cat-window {
  position: relative;
  height: 172px;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% 110%, #3a4648 0%, transparent 60%),
    var(--iron);
}
/* The cell door: round bars riveted to a rail at the top and bottom (images/cell-bars.svg,
   repeated so a whole number of bars fits), casting a shadow on what's behind them. */
.cat-bars {
  position: absolute;
  inset: 0;
  background: url('/images/cell-bars.svg') 0 0 / 40px 100% round no-repeat;
  filter: drop-shadow(5px 7px 4px rgba(0, 0, 0, 0.5));
  transition: transform 420ms cubic-bezier(0.65, 0, 0.25, 1);
}
.cat-tile a:hover .cat-bars,
.cat-tile a:focus-visible .cat-bars {
  transform: translateY(-104%);
}
@media (hover: none) {
  .cat-bars {
    display: none;
  }
}
.cat-stack {
  position: absolute;
  inset: 0;
}
.shelf-card {
  --x: 0px;
  --r: 0deg;
  --y: 0px;
  position: absolute;
  left: 50%;
  top: 54%;
  display: grid;
  place-items: center;
  border-radius: 10px;
  box-shadow: 0 10px 18px -8px rgba(0, 0, 0, 0.55);
  transform: translate(-50%, -50%) translateX(var(--x)) translateY(var(--y)) rotate(var(--r));
  transition: transform 420ms cubic-bezier(0.2, 0.9, 0.3, 1.15);
}
/* Name and picture cards are commissary slips: a moss band across the top, warm paper, and
   the price on a tear-off stub. They look the same in light and dark mode, like the window. */
.shelf-card.is-slip {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 124px;
  min-height: 100px;
  overflow: hidden;
  border-radius: 8px;
  color: #2a1803;
  text-align: center;
  line-height: 1.2;
  background:
    linear-gradient(#ffa126, #ff8c00 70%, #e67a00) top / 100% 9px no-repeat,
    radial-gradient(120% 90% at 30% 20%, #fffefa, #fff9dc 60%, #fff4b0);
  box-shadow:
    inset 0 0 0 1px rgba(42, 24, 3, 0.14),
    inset 0 -1px 0 rgba(255, 255, 255, 0.6),
    0 10px 18px -8px rgba(0, 0, 0, 0.55);
}
.slip-face {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 17px 10px 8px;
}
strong.slip-face {
  font-family: var(--display);
  font-size: 0.95rem;
  text-wrap: balance;
}
.slip-stub {
  position: relative;
  padding: 5px 8px 6px;
  background: rgba(255, 140, 0, 0.16);
  border-top: 1.5px dashed rgba(42, 24, 3, 0.3);
  font-family: var(--display);
  font-size: 0.85rem;
  font-weight: 700;
  color: #7a3a00;
}
.shelf-card.is-image .slip-face {
  padding-top: 15px;
}
.shelf-card.is-image img {
  max-width: 52px;
  max-height: 52px;
  object-fit: contain;
  filter: drop-shadow(0 2px 2px rgba(42, 24, 3, 0.25));
}
.shelf-card.is-image img.is-pixel {
  width: 52px;
  height: 52px;
  image-rendering: pixelated;
}
/* Centred with auto margins rather than left: 50%, so a chip can use most of the window's width */
.shelf-card.is-look {
  padding: 7px 11px 9px;
  background: #1d2223;
  border: 1px solid #3a4446;
  font-size: var(--mc-size-small);
  white-space: nowrap;
  left: 0;
  right: 0;
  width: max-content;
  max-width: 88%;
  margin-inline: auto;
  overflow: hidden;
  justify-items: start;
  transform: translateY(-50%) translateX(var(--x)) translateY(var(--y)) rotate(var(--r));
}
.shelf-card.is-look .mc-text {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}
.shelf-card.is-look .mc-line {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Resting: a tidy stack. Hover: fanned out. */
.cat-stack.is-2 .shelf-card:nth-child(1),
.cat-stack.is-3 .shelf-card:nth-child(1) {
  --x: -26px;
  --r: -6deg;
}
.cat-stack.is-2 .shelf-card:nth-child(2),
.cat-stack.is-3 .shelf-card:nth-child(3) {
  --x: 26px;
  --r: 6deg;
}
.cat-stack.is-3 .shelf-card:nth-child(2) {
  --y: -6px;
}
/* With two, the front card stays near the middle and the other peeks out from behind it */
.cat-stack.is-2 .shelf-card:nth-child(1) {
  --x: -22px;
  --r: -7deg;
}
.cat-stack.is-2 .shelf-card:nth-child(2) {
  --x: 10px;
  --r: 2deg;
}
/* The front card (the cheapest item) sits in front of the bars so it can be read */
.cat-stack.is-1 .shelf-card,
.cat-stack.is-2 .shelf-card:nth-child(2),
.cat-stack.is-3 .shelf-card:nth-child(2) {
  z-index: 1;
}
/* Slips behind the front one keep their band and stub but hide their writing, so half-covered
   names and prices don't peek out. Pictures still show. */
.cat-stack.is-2 .shelf-card.is-slip:nth-child(1) .slip-stub,
.cat-stack.is-3 .shelf-card.is-slip:not(:nth-child(2)) .slip-stub,
.cat-stack.is-2 .shelf-card.is-name:nth-child(1) .slip-face,
.cat-stack.is-3 .shelf-card.is-name:not(:nth-child(2)) .slip-face {
  color: transparent;
}
.cat-tile a:hover .cat-stack.is-2 .shelf-card:nth-child(1),
.cat-tile a:hover .cat-stack.is-3 .shelf-card:nth-child(1),
.cat-tile a:focus-visible .cat-stack.is-2 .shelf-card:nth-child(1),
.cat-tile a:focus-visible .cat-stack.is-3 .shelf-card:nth-child(1) {
  --x: -62px;
  --y: 6px;
  --r: -10deg;
}
.cat-tile a:hover .cat-stack.is-3 .shelf-card:nth-child(3),
.cat-tile a:focus-visible .cat-stack.is-3 .shelf-card:nth-child(3) {
  --x: 62px;
  --y: 6px;
  --r: 10deg;
}
.cat-tile a:hover .cat-stack.is-2 .shelf-card:nth-child(2),
.cat-tile a:focus-visible .cat-stack.is-2 .shelf-card:nth-child(2) {
  --x: 34px;
  --y: -6px;
  --r: 4deg;
}
.cat-tile a:hover .cat-stack.is-3 .shelf-card:nth-child(2),
.cat-tile a:focus-visible .cat-stack.is-3 .shelf-card:nth-child(2) {
  --y: -12px;
}
.cat-tile a:hover .cat-stack.is-1 .shelf-card,
.cat-tile a:focus-visible .cat-stack.is-1 .shelf-card {
  --y: -6px;
  --r: -2deg;
}
/* Chat tags sit like lines of chat, and spread apart on hover */
.cat-stack .shelf-card.is-look:nth-child(1) {
  --x: -10px;
  --y: -34px;
  --r: 0deg;
}
.cat-stack .shelf-card.is-look:nth-child(2) {
  --x: 8px;
  --y: 0px;
  --r: 0deg;
}
.cat-stack .shelf-card.is-look:nth-child(3) {
  --x: -4px;
  --y: 34px;
  --r: 0deg;
}
.cat-stack.is-2 .shelf-card.is-look:nth-child(1) {
  --y: -16px;
}
.cat-stack.is-2 .shelf-card.is-look:nth-child(2) {
  --y: 16px;
}
.cat-stack.is-1 .shelf-card.is-look {
  --x: 0px;
  --y: 0px;
}
.cat-tile a:hover .cat-stack .shelf-card.is-look:nth-child(1),
.cat-tile a:focus-visible .cat-stack .shelf-card.is-look:nth-child(1) {
  --x: -8px;
  --y: -46px;
  --r: -1.5deg;
}
.cat-tile a:hover .cat-stack .shelf-card.is-look:nth-child(2),
.cat-tile a:focus-visible .cat-stack .shelf-card.is-look:nth-child(2) {
  --x: 10px;
  --y: 0px;
  --r: 1deg;
}
.cat-tile a:hover .cat-stack .shelf-card.is-look:nth-child(3),
.cat-tile a:focus-visible .cat-stack .shelf-card.is-look:nth-child(3) {
  --x: -2px;
  --y: 46px;
  --r: -0.5deg;
}
.cat-tile a:hover .cat-stack.is-2 .shelf-card.is-look:nth-child(1),
.cat-tile a:focus-visible .cat-stack.is-2 .shelf-card.is-look:nth-child(1) {
  --y: -26px;
}
.cat-tile a:hover .cat-stack.is-2 .shelf-card.is-look:nth-child(2),
.cat-tile a:focus-visible .cat-stack.is-2 .shelf-card.is-look:nth-child(2) {
  --y: 26px;
}
.cat-tile a:hover .cat-stack.is-1 .shelf-card.is-look,
.cat-tile a:focus-visible .cat-stack.is-1 .shelf-card.is-look {
  --y: -6px;
  --r: -1deg;
}
.cat-body {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 6px;
  align-content: start;
  padding: 16px 18px 16px;
}
.cat-body h3 {
  font-size: var(--step-2);
  font-weight: 750;
  font-stretch: 85%;
}
.cat-desc {
  color: var(--ink-soft);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cat-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 2px dashed var(--line);
  font-size: var(--step--1);
  color: var(--ink-soft);
}
.cat-meta strong {
  color: var(--brand-ink);
  font-family: var(--display);
  font-size: var(--step-0);
}
/* "Take a look" slides in when you point at the tile */
.cat-go {
  margin-left: auto;
  color: var(--brand-ink);
  font-weight: 700;
  opacity: 0;
  transform: translateX(-6px);
  transition:
    opacity 200ms,
    transform 260ms cubic-bezier(0.2, 0.8, 0.3, 1);
}
.cat-tile a:hover .cat-go,
.cat-tile a:focus-visible .cat-go {
  opacity: 1;
  transform: none;
}
@media (hover: none) {
  .cat-go {
    opacity: 1;
    transform: none;
  }
}
.cat-meta .sale-tag {
  margin-left: 0;
}

/* Switching category on a category page */
.cat-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.cat-switch a {
  padding: 8px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: var(--step--1);
  font-weight: 700;
  text-decoration: none;
  transition:
    border-color 140ms,
    background-color 140ms,
    color 140ms;
}
.cat-switch a:hover {
  border-color: var(--brand-deep);
  color: var(--brand-ink);
}
.cat-switch a[aria-current='page'] {
  border-color: var(--brand);
  background: var(--brand);
  color: var(--on-brand);
}

/* All items: one section per category */
.cat-section + .cat-section {
  margin-top: 40px;
}
.cat-section > h2 {
  font-size: var(--step-3);
  font-weight: 750;
  font-stretch: 85%;
}
.cat-section > h2 a {
  color: inherit;
  text-decoration: none;
}
.cat-section > h2 a:hover {
  text-decoration: underline;
  text-decoration-color: var(--brand);
  text-decoration-thickness: 2px;
}
.category-note {
  color: var(--ink-soft);
  margin-top: 4px;
  max-width: 62ch;
}
.cat-section .cards {
  margin-top: 16px;
}

/* ---------------------------------------------------------------------------
   Item cards
--------------------------------------------------------------------------- */
.cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 18px;
}
/* Each item is a ticket: what it is on top, and the price and Add button on a tear-off stub. */
.item {
  --edge: var(--line);
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--edge);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--rest-shadow);
  transition:
    border-color 180ms,
    box-shadow 240ms,
    transform 240ms cubic-bezier(0.2, 0.8, 0.3, 1);
}
.item:hover {
  --edge: color-mix(in srgb, var(--brand) 60%, var(--line));
  box-shadow: var(--lift-shadow);
  transform: translateY(-3px);
}
.item-media {
  display: grid;
  place-items: center;
  height: 140px;
  overflow: hidden;
  border-radius: calc(var(--radius-card) - 1px) calc(var(--radius-card) - 1px) 0 0;
}
.item-media.is-image {
  background-color: var(--brand-tint);
  background-image:
    linear-gradient(45deg, var(--checker) 25%, transparent 25%, transparent 75%, var(--checker) 75%),
    linear-gradient(45deg, var(--checker) 25%, transparent 25%, transparent 75%, var(--checker) 75%);
  background-size: 20px 20px;
  background-position:
    0 0,
    10px 10px;
}
.item-media img {
  max-width: 82%;
  max-height: 112px;
  object-fit: contain;
  transition: transform 320ms cubic-bezier(0.2, 0.8, 0.3, 1);
}
.item-media img.is-pixel {
  width: 96px;
  height: 96px;
  image-rendering: pixelated;
}
.item:hover .item-media img {
  transform: scale(1.07) translateY(-2px);
}
.item-media.is-look {
  padding: 16px;
  background:
    radial-gradient(120% 100% at 50% 120%, #3a4648 0%, transparent 65%),
    var(--iron);
}
.item-media .mc-scene.is-compact {
  justify-self: center;
  max-width: 100%;
  transition: transform 320ms cubic-bezier(0.2, 0.8, 0.3, 1);
}
.item:hover .item-media .mc-scene {
  transform: translateY(-3px);
}
.item-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px 0;
}
.item h3 {
  font-size: var(--step-1);
  font-weight: 750;
}
.item-desc {
  display: grid;
  gap: 4px;
  color: var(--ink-soft);
}
.item-desc .mc-scene {
  margin: 2px 0 4px;
}
.item-note {
  font-size: var(--step--1);
  color: var(--ink-soft);
}
.item-links {
  display: grid;
  gap: 2px;
  justify-items: start;
}
.item-buy {
  position: relative;
  margin: auto -18px 0;
  padding: 14px 18px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 78px;
  border-top: 2px dashed var(--stub-line);
  border-radius: 0 0 calc(var(--radius-card) - 1px) calc(var(--radius-card) - 1px);
  background: var(--stub);
}
/* Whatever sits just above the stub keeps a little room */
.item-body > :nth-last-child(2) {
  margin-bottom: 16px;
}
/* The notches where the stub tears off: half circles punched out of each side */
.item-buy::before,
.item-buy::after {
  content: '';
  position: absolute;
  top: -10px;
  width: 18px;
  height: 18px;
  border: 1px solid transparent;
  border-radius: 50%;
  background: var(--paper);
  transition: border-color 180ms;
}
.item-buy::before {
  left: -10px;
  border-top-color: var(--edge);
  border-right-color: var(--edge);
  transform: rotate(45deg);
}
.item-buy::after {
  right: -10px;
  border-bottom-color: var(--edge);
  border-left-color: var(--edge);
  transform: rotate(45deg);
}
.modal-head + .mc-scene {
  margin-top: -4px;
}
.price {
  font-family: var(--display);
  font-size: var(--step-2);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.price.is-sale {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  color: var(--sale);
}
.price .was {
  font-size: var(--step-0);
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration-thickness: 1.5px;
}
.item-buy .btn {
  min-width: 92px;
}
.stepper {
  display: inline-flex;
  align-items: center;
  border: 2px solid var(--brand-deep);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.stepper button {
  width: 40px;
  min-height: 40px;
  border: 0;
  background: transparent;
  color: var(--brand-ink);
  font-size: 1.25rem;
  font-weight: 700;
  cursor: pointer;
}
.stepper button:hover:not(:disabled) {
  background: var(--brand-tint);
}
.stepper button:disabled {
  color: var(--line);
  cursor: not-allowed;
}
.stepper output {
  min-width: 2ch;
  text-align: center;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.sale-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--sale-tint);
  color: var(--sale);
  font-family: var(--body);
  font-size: var(--step--1);
  font-weight: 700;
  vertical-align: 0.15em;
}
.owned {
  font-size: var(--step--1);
  font-weight: 700;
  color: var(--brand-ink);
  padding: 10px 0;
}
/* Cards with more to say: the whole card opens the details window, except the buy controls and links. */
.item-open {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.18em;
  transition: text-decoration-color 140ms;
}
.item-open::after {
  content: '';
  position: absolute;
  inset: 0;
}
.item.has-more .item-buy,
.item.has-more .item-faq {
  position: relative;
  z-index: 1;
}
.item.has-more:hover .item-open {
  text-decoration-color: var(--brand);
}
@supports selector(:has(*)) {
  .item-open:focus-visible {
    outline: none;
  }
  .item.has-more:has(.item-open:focus-visible) {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
  }
}
.item-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--brand-ink);
  font-size: var(--step--1);
  font-weight: 700;
}
.item-more .arrow {
  transition: transform 180ms ease;
}
.item.has-more:hover .item-more .arrow {
  transform: translateX(4px);
}
.item-faq {
  font-size: var(--step--1);
}
.modal-faq {
  justify-self: start;
  font-weight: 700;
}
.pay-terms {
  margin-top: 8px;
  font-size: var(--step--1);
  color: var(--receipt-soft);
  text-align: center;
}
.item.is-linked {
  animation: linked 1.8s ease-out 1;
}
@keyframes linked {
  from {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px var(--brand-tint);
  }
}

/* ---------------------------------------------------------------------------
   The receipt (cart, order confirmation, history)
--------------------------------------------------------------------------- */
.checkout {
  position: relative;
}
@media (min-width: 900px) {
  .checkout {
    position: sticky;
    top: 24px;
  }
}
.receipt {
  --tooth: 9px;
  position: relative;
  background: var(--receipt-bg);
  color: var(--receipt-ink);
  padding: 22px 22px 26px;
  border-radius: 3px 3px 0 0;
  filter: drop-shadow(0 1px 1px rgba(90, 48, 0, 0.2)) drop-shadow(0 8px 18px rgba(90, 48, 0, 0.12));
  margin-bottom: var(--tooth);
}
.receipt::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(var(--tooth) * -1);
  height: var(--tooth);
  background:
    linear-gradient(-45deg, transparent var(--tooth), var(--receipt-bg) 0) 0 0 / calc(var(--tooth) * 2) 100%,
    linear-gradient(45deg, transparent var(--tooth), var(--receipt-bg) 0) 0 0 / calc(var(--tooth) * 2) 100%;
  background-repeat: repeat-x;
}
.receipt a {
  color: #944600;
}
.receipt-head {
  text-align: center;
  padding-bottom: 14px;
  border-bottom: 2px dashed var(--receipt-rule);
}
.receipt-head h2 {
  font-size: var(--step-2);
  font-weight: 800;
  font-stretch: 80%;
}
.receipt-meta {
  font-size: var(--step--1);
  color: var(--receipt-soft);
}
.receipt-for {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
  font-weight: 700;
}
.receipt-for img {
  width: 24px;
  height: 24px;
  image-rendering: pixelated;
  border-radius: 2px;
}
.receipt-for.is-empty {
  font-weight: 400;
  color: var(--receipt-soft);
}
.receipt-lines {
  list-style: none;
  margin: 0;
  padding: 14px 0;
  border-bottom: 2px dashed var(--receipt-rule);
  display: grid;
  gap: 10px;
}
.receipt-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 12px;
  align-items: baseline;
}
.receipt-line .qty {
  color: var(--receipt-soft);
  font-variant-numeric: tabular-nums;
}
.receipt-line .amt {
  font-variant-numeric: tabular-nums;
}
.receipt-line .remove {
  grid-column: 1;
  justify-self: start;
  padding: 0;
  border: 0;
  background: none;
  color: var(--receipt-soft);
  font-size: var(--step--1);
  text-decoration: underline;
  cursor: pointer;
}
.receipt-empty {
  color: var(--receipt-soft);
  text-align: center;
  padding: 8px 0;
}
.receipt-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 14px 0 4px;
}
.receipt-total span {
  color: var(--receipt-soft);
}
.receipt-total strong {
  font-family: var(--display);
  font-size: var(--step-3);
  font-variant-numeric: tabular-nums;
}
.pay {
  margin-top: 16px;
  min-height: 48px;
}
.pay-note {
  font-size: var(--step--1);
  color: var(--receipt-soft);
  text-align: center;
  margin-top: 10px;
}
.pay-note.is-error {
  color: #a8281c;
  font-weight: 700;
}
.receipt-foot {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 2px dashed var(--receipt-rule);
  font-size: var(--step--1);
  color: var(--receipt-soft);
  text-align: center;
  overflow-wrap: anywhere;
}

.stamp {
  position: absolute;
  top: 18px;
  right: 14px;
  transform: rotate(-10deg);
  padding: 2px 10px;
  border: 3px solid currentColor;
  border-radius: 4px;
  color: #2f6b45;
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 800;
  opacity: 0.8;
  pointer-events: none;
}
.stamp.is-problem {
  color: #a8281c;
}
.signoff {
  margin-top: 12px;
  text-align: center;
  font-family: var(--display);
  font-size: var(--step-1);
  font-weight: 650;
  line-height: 1.3;
}
.signoff span {
  font-family: var(--body);
  font-size: var(--step--1);
  font-weight: 400;
  color: var(--receipt-soft);
}

/* Sale price + coupon bits inside the receipt (the receipt stays light in dark mode) */
.line-note {
  grid-column: 1 / -1;
  font-size: var(--step--1);
  color: var(--receipt-sale);
}
.coupon {
  padding: 12px 0;
  border-bottom: 2px dashed var(--receipt-rule);
  display: grid;
  gap: 6px;
}
.link-button {
  justify-self: start;
  padding: 0;
  border: 0;
  background: none;
  color: #944600;
  text-decoration: underline;
  text-underline-offset: 0.15em;
  cursor: pointer;
}
.coupon-form {
  display: flex;
  gap: 8px;
}
.coupon-form input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 40px;
  padding: 0 10px;
  border: 2px solid var(--receipt-rule);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--receipt-ink);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.coupon-form input::placeholder {
  text-transform: none;
  letter-spacing: 0;
}
.coupon-form input:focus {
  border-color: #c46200;
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 140, 0, 0.35);
}
.btn-small {
  min-height: 40px;
  padding: 0 0.9em;
}
.receipt .btn-quiet {
  background: #ffffff;
  color: #944600;
  border-color: #c46200;
}
.receipt .btn-quiet:hover {
  background: #fff4b0;
}
.coupon-applied {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 12px;
  align-items: baseline;
}
.coupon-applied strong {
  letter-spacing: 0.02em;
}
.coupon-applied #coupon-detail {
  color: var(--receipt-soft);
}
.coupon-applied .amt {
  color: #2f6b45;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.coupon-applied .remove {
  grid-column: 1;
  justify-self: start;
  padding: 0;
  border: 0;
  background: none;
  color: var(--receipt-soft);
  font-size: var(--step--1);
  text-decoration: underline;
  cursor: pointer;
}
.coupon-error {
  font-size: var(--step--1);
  color: #a8281c;
  font-weight: 700;
}
.receipt-sub {
  display: flex;
  justify-content: space-between;
  padding-top: 12px;
  color: var(--receipt-soft);
  font-variant-numeric: tabular-nums;
}
.receipt-sub + .receipt-total {
  padding-top: 4px;
}
.btn-claim {
  width: 100%;
  min-height: 48px;
  margin-top: 16px;
  font-size: var(--step-1);
}
.pay[hidden] + .btn-claim {
  margin-top: 16px;
}

/* Mobile cart bar */
.cart-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--line);
  box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.08);
}
.cart-bar strong {
  font-family: var(--display);
  font-size: var(--step-1);
}
@media (min-width: 900px) {
  .cart-bar {
    display: none !important;
  }
}
@media (max-width: 899px) {
  body.has-cart-bar {
    padding-bottom: 76px;
  }
}

/* ---------------------------------------------------------------------------
   Order + history pages
--------------------------------------------------------------------------- */
.narrow {
  max-width: 640px;
}
.status-block {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin: 8px 0 32px;
}
.status-block img {
  width: 72px;
  height: 72px;
  image-rendering: pixelated;
  border-radius: 4px;
}
.status-block h1 {
  font-size: var(--step-3);
  font-weight: 750;
}
.status-block p {
  color: var(--ink-soft);
  margin-top: 6px;
  max-width: 55ch;
}
.status-block.is-problem h1 {
  color: var(--danger);
}
.history-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 2px solid var(--ink);
}
.history-list li {
  border-bottom: 1px solid var(--line);
}
.history-list a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 16px;
  padding: 16px 4px;
  color: inherit;
  text-decoration: none;
}
.history-list a:hover {
  background: var(--brand-tint);
}
.history-list .when {
  color: var(--ink-soft);
  font-size: var(--step--1);
}
.history-list .what {
  font-weight: 700;
}
.history-list .amount {
  grid-row: 1 / span 2;
  grid-column: 2;
  text-align: right;
  font-family: var(--display);
  font-size: var(--step-1);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.history-list .state {
  display: block;
  font-family: var(--body);
  font-size: var(--step--1);
  font-weight: 400;
  color: var(--ink-soft);
}
.prose {
  max-width: 68ch;
}
.prose h1 {
  font-size: var(--step-3);
  margin-bottom: 16px;
}
.prose h2 {
  font-size: var(--step-1);
  margin: 28px 0 8px;
}
.prose p,
.prose ul {
  margin: 0 0 12px;
}
.message {
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--danger-tint);
  color: var(--ink);
}

/* ---------------------------------------------------------------------------
   Item details window
--------------------------------------------------------------------------- */
.item-modal {
  width: min(560px, calc(100% - 32px));
  max-width: none;
  max-height: min(88vh, 820px);
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--modal-shadow);
  overflow: hidden;
}
.item-modal[open] {
  display: flex;
  flex-direction: column;
  animation: modal-in 240ms cubic-bezier(0.2, 0.9, 0.3, 1) both;
}
.item-modal::backdrop {
  /* Literal colours: older browsers don't pass custom properties to ::backdrop */
  background: rgba(42, 24, 3, 0.55);
  backdrop-filter: blur(3px);
  animation: fade-in 200ms ease both;
}
@media (prefers-color-scheme: dark) {
  .item-modal::backdrop {
    background: rgba(8, 5, 0, 0.72);
  }
}
@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
}
@keyframes fade-in {
  from {
    opacity: 0;
  }
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0 0 3px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}
.modal-close:hover {
  background: var(--brand-tint);
  border-color: var(--brand-deep);
}
.modal-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* Picture at the top: small icons sit on a checkerboard, wide screenshots fill the band. */
.modal-hero {
  display: grid;
  place-items: center;
  min-height: 168px;
  padding: 28px 64px;
  background-color: var(--brand-tint);
  background-image:
    linear-gradient(45deg, var(--checker) 25%, transparent 25%, transparent 75%, var(--checker) 75%),
    linear-gradient(45deg, var(--checker) 25%, transparent 25%, transparent 75%, var(--checker) 75%);
  background-size: 24px 24px;
  background-position:
    0 0,
    12px 12px;
}
.modal-hero img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 200px;
  min-height: 96px;
  object-fit: contain;
  border-radius: 6px;
}
.modal-hero img.is-pixel {
  min-height: 128px;
  image-rendering: pixelated;
  border-radius: 0;
  filter: drop-shadow(0 6px 10px rgba(90, 48, 0, 0.25));
}
.modal-hero.is-wide {
  padding: 0;
  min-height: 0;
}
.modal-hero.is-wide img {
  width: 100%;
  height: 230px;
  max-height: none;
  object-fit: cover;
  border-radius: 0;
}

.modal-body {
  display: grid;
  gap: 24px;
  padding: 24px 24px 20px;
}
.modal-body.no-hero .modal-head {
  padding-right: 48px;
}
.modal-head {
  display: grid;
  gap: 8px;
}
.modal-eyebrow {
  color: var(--brand-ink);
  font-size: var(--step--1);
  font-weight: 700;
}
.modal-head h2 {
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  font-weight: 800;
  font-stretch: 80%;
  letter-spacing: -0.015em;
  line-height: 1;
  overflow-wrap: anywhere;
}
.modal-lead {
  color: var(--ink-soft);
  font-size: var(--step-1);
  line-height: 1.45;
}
.modal-section h3 {
  padding-bottom: 8px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
  font-size: var(--step-1);
  font-weight: 700;
}

/* "What you get" with a tick on each line */
.benefits {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.benefits li {
  position: relative;
  padding-left: 36px;
  min-height: 24px;
}
.benefits li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--brand);
}
.benefits li::after {
  content: '';
  position: absolute;
  left: 9px;
  top: 5px;
  width: 6px;
  height: 11px;
  border: solid var(--on-brand);
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}
.benefits strong {
  color: var(--ink);
}
.benefits span {
  color: var(--ink-soft);
}

.details-text {
  display: grid;
  gap: 12px;
  max-width: 62ch;
}
.details-text p {
  white-space: pre-line;
}
.detail-list {
  margin: 0;
  padding-left: 1.25em;
  display: grid;
  gap: 4px;
}
.details-text p + .detail-list {
  margin-top: -6px;
}
.detail-list li::marker {
  color: var(--brand-deep);
}

.modal-facts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.modal-facts li {
  padding: 4px 10px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--ink-soft);
  font-size: var(--step--1);
}
.modal-share {
  justify-self: start;
  padding: 0;
  border: 0;
  background: none;
  color: var(--link);
  font-size: var(--step--1);
  text-decoration: underline;
  text-underline-offset: 0.15em;
  cursor: pointer;
}

/* Price and Add button stay put at the bottom while the details scroll */
.modal-foot {
  flex: none;
  display: grid;
  gap: 8px;
  padding: 14px 24px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 -10px 18px -14px rgba(90, 48, 0, 0.35);
}
.modal-buy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 48px;
}
.modal-buy .price {
  font-size: var(--step-3);
}
.modal-buy .btn {
  min-width: 150px;
  min-height: 48px;
}
.modal-buy .owned {
  padding: 0;
  text-align: right;
}
.modal-status:empty {
  display: none;
}
.modal-status {
  display: grid;
  gap: 4px;
  font-size: var(--step--1);
  color: var(--ink-soft);
}
.modal-sale strong {
  color: var(--sale);
}
.modal-incart {
  color: var(--brand-ink);
  font-weight: 700;
}
.modal-incart .modal-share {
  font-weight: 700;
}
.modal-for {
  display: flex;
  align-items: center;
  gap: 8px;
}
.modal-for img {
  width: 20px;
  height: 20px;
  image-rendering: pixelated;
  border-radius: 2px;
}

/* Phones: a sheet that slides up from the bottom */
@media (max-width: 600px) {
  .item-modal {
    width: 100%;
    max-height: 92vh;
    max-height: 92dvh;
    margin: auto 0 0;
    border-radius: 16px 16px 0 0;
  }
  .item-modal[open] {
    animation: sheet-in 280ms cubic-bezier(0.2, 0.9, 0.3, 1) both;
  }
  .modal-hero {
    min-height: 140px;
    padding: 20px 56px;
  }
  .modal-hero img {
    max-height: 150px;
  }
  .modal-hero.is-wide img {
    height: 190px;
  }
  .modal-body {
    padding: 20px 16px 16px;
  }
  .modal-foot {
    padding-inline: 16px;
  }
  .modal-buy .btn {
    min-width: 0;
    flex: 0 1 auto;
  }
}
@keyframes sheet-in {
  from {
    transform: translateY(100%);
  }
}

/* ---------------------------------------------------------------------------
   FAQ page
--------------------------------------------------------------------------- */
.loading {
  color: var(--ink-soft);
}
.faq h1 {
  font-size: var(--step-3);
  font-weight: 750;
  margin-bottom: 12px;
}
.faq-intro {
  color: var(--ink-soft);
  font-size: var(--step-1);
  line-height: 1.5;
  margin-bottom: 8px;
}
.faq-tools {
  display: flex;
  justify-content: flex-end;
  margin: 18px 0 6px;
}
.link-quiet {
  padding: 0;
  border: 0;
  background: none;
  color: var(--link);
  font-size: var(--step--1);
  text-decoration: underline;
  text-underline-offset: 0.15em;
  cursor: pointer;
}
.faq-list {
  border-top: 2px solid var(--ink);
}
.faq-item {
  border-bottom: 1px solid var(--line);
}
.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 2px;
  font-family: var(--display);
  font-size: var(--step-1);
  font-weight: 650;
  line-height: 1.3;
  cursor: pointer;
  list-style: none;
}
.faq-item summary::-webkit-details-marker {
  display: none;
}
/* A plus that turns into a minus when the answer is open */
.faq-item summary::after {
  content: '';
  flex: none;
  width: 14px;
  height: 14px;
  background:
    linear-gradient(var(--brand-ink), var(--brand-ink)) center / 14px 2.5px no-repeat,
    linear-gradient(var(--brand-ink), var(--brand-ink)) center / 2.5px 14px no-repeat;
  transition: transform 160ms ease;
}
.faq-item[open] summary::after {
  background: linear-gradient(var(--brand-ink), var(--brand-ink)) center / 14px 2.5px no-repeat;
}
.faq-item summary:hover span {
  text-decoration: underline;
  text-decoration-color: var(--brand);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.18em;
}
.faq-item:target summary,
.faq-item[open] summary {
  color: var(--brand-ink);
}
.faq-answer {
  padding: 0 2px 18px;
  max-width: 64ch;
}
.faq-contact {
  margin-top: 40px;
  padding: 20px 22px;
  border-radius: var(--radius);
  background: var(--brand-tint);
  display: grid;
  gap: 8px;
}
.faq-contact h2 {
  font-size: var(--step-1);
  margin: 0;
}
.faq-contact p {
  margin: 0;
}
.faq-contact .btn {
  margin-top: 6px;
}

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