/* ───────────────────────────────────────────────────────────
   Majcher Arcana — site styles
   Motif: a tarot spread on a dark cloth. The home page "table"
   is the one loud thing; everything else is quiet paper.
   ─────────────────────────────────────────────────────────── */

:root {
  --paper: #f2f1f5;        /* cool card-stock white */
  --paper-2: #e6e4ee;      /* footer, wells */
  --stock: #fbfaf6;        /* face of a card */
  --ink: #1d1f3b;          /* night indigo: text + the table */
  --ink-soft: #55576f;
  --rule: #cfccdb;
  --gilt: #c99a3a;         /* decoration only on light backgrounds */
  --gilt-text: #8a6516;    /* gilt that passes contrast on paper */
  --blood: #8a2c3a;        /* links + primary buttons */
  --blood-hover: #6e1f2c;
  --felt: #1d1f3b;
  --on-felt: #eeeaf6;

  --display: "IM Fell English", "Iowan Old Style", Georgia, serif;
  --display-sc: "IM Fell English SC", "IM Fell English", Georgia, serif;
  --body: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", system-ui, sans-serif;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3rem;
  --step-2: 1.65rem;
  --step-3: clamp(2rem, 4.2vw, 2.8rem);
  --step-4: clamp(2.3rem, 5.5vw, 3.6rem);

  --wrap: 72rem;
  --gutter: 16px;
  --radius: 6px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #15162a;
    --paper-2: #1c1d36;
    --stock: #f4f1ea;
    --ink: #e9e7f2;
    --ink-soft: #a9a8c0;
    --rule: #34365a;
    --gilt: #d6a94c;
    --gilt-text: #dcb35e;
    --blood: #e79aa6;
    --blood-hover: #f4bcc5;
    --felt: #0d0e1f;
    --on-felt: #eeeaf6;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #15162a; --paper-2: #1c1d36; --stock: #f4f1ea; --ink: #e9e7f2; --ink-soft: #a9a8c0;
  --rule: #34365a; --gilt: #d6a94c; --gilt-text: #dcb35e; --blood: #e79aa6; --blood-hover: #f4bcc5;
  --felt: #0d0e1f; --on-felt: #eeeaf6; color-scheme: dark;
}

/* ── base ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--step-0)/1.6 var(--body);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blood); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--blood-hover); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--gilt); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.12; margin: 0 0 0.5em; text-wrap: balance; }
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); }
p { margin: 0 0 1em; }
.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
@media (min-width: 640px) { :root { --gutter: 28px; } }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -4rem; background: var(--ink); color: var(--paper); padding: .5rem 1rem; z-index: 10; }
.skip:focus { top: 1rem; }
.muted { color: var(--ink-soft); }
ul.plain { list-style: none; padding: 0; margin: 0; }

/* ── header ─────────────────────────────────────────────── */
.site-header { border-bottom: 1px solid var(--rule); background: var(--paper); }
.home .site-header { background: var(--felt); border-bottom-color: transparent; color: var(--on-felt); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-block: 0.9rem; }
.wordmark { display: inline-flex; align-items: center; gap: 0.6rem; color: inherit; text-decoration: none; font-family: var(--display-sc); font-size: 1.45rem; letter-spacing: 0.01em; }
.wordmark:hover { color: inherit; }
.sigil { width: 18px; height: 27px; color: var(--gilt); flex: none; }
.site-header nav { display: flex; gap: 0.25rem 1.25rem; flex-wrap: wrap; }
.site-header nav a { color: inherit; text-decoration: none; font-weight: 600; font-size: 0.98rem; padding-block: 0.25rem; border-bottom: 2px solid transparent; }
.site-header nav a:hover, .site-header nav a[aria-current="page"] { border-bottom-color: var(--gilt); }

/* ── buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font: 600 1rem/1.2 var(--body);
  padding: 0.72rem 1.15rem; border-radius: var(--radius);
  border: 1.5px solid var(--blood); color: var(--blood); background: transparent;
  text-decoration: none; cursor: pointer;
}
.btn:hover { color: var(--paper); background: var(--blood); text-decoration: none; }
.btn-primary { background: var(--blood); color: var(--paper); }
.btn-primary:hover { background: var(--blood-hover); border-color: var(--blood-hover); }
.btn-price { font-weight: 400; opacity: 0.85; }
.btn-light { background: var(--on-felt); border-color: var(--on-felt); color: #1d1f3b; }
.btn-light:hover { background: #fff; border-color: #fff; color: #1d1f3b; }
.btn-ghost { border-color: color-mix(in srgb, var(--on-felt) 45%, transparent); color: var(--on-felt); }
.btn-ghost:hover { background: transparent; border-color: var(--gilt); color: var(--on-felt); }

/* ── the table (home hero) ──────────────────────────────── */
.table {
  background:
    radial-gradient(120% 90% at 75% 40%, color-mix(in srgb, var(--felt) 70%, #3a2f63) 0%, var(--felt) 70%);
  color: var(--on-felt);
  padding-block: clamp(2.5rem, 6vw, 5rem) clamp(3rem, 7vw, 6rem);
  border-bottom: 1px solid color-mix(in srgb, var(--gilt) 55%, transparent);
}
.table-grid { display: grid; gap: clamp(2.5rem, 5vw, 4rem); align-items: center; }
@media (min-width: 900px) { .table-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); } }
.table-copy h1 { font-size: var(--step-3); color: var(--on-felt); max-width: 18ch; }
.table-copy p { max-width: 36rem; color: color-mix(in srgb, var(--on-felt) 82%, transparent); }
.table-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }
.table-actions [hidden] { display: none; }

.spread { display: flex; justify-content: center; align-items: flex-start; padding-block: 1rem 2rem; perspective: 1400px; }
.tarot {
  --w: clamp(118px, 27vw, 205px);
  --tilt: calc((var(--i) - 1) * 7deg);
  --drop: calc((var(--i) - 1) * (var(--i) - 1) * 14px);
  flex: none; width: var(--w); aspect-ratio: 7 / 12;
  margin-left: calc(var(--w) * -0.18);
  transform: translateY(var(--drop)) rotate(var(--tilt));
  transform-origin: 50% 110%;
  transition: transform 220ms ease;
  text-decoration: none; color: #1d1f3b;
  z-index: calc(3 - var(--i));
}
.tarot:first-child { margin-left: 0; }
.tarot:nth-child(2) { z-index: 3; }
.tarot:hover, .tarot:focus-visible { transform: translateY(calc(var(--drop) - 14px)) rotate(var(--tilt)); z-index: 4; color: #1d1f3b; }
.tarot-face {
  display: flex; flex-direction: column; height: 100%;
  background: var(--stock); border-radius: 10px; padding: 7%;
  box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 18px 40px -12px rgba(0,0,0,.65), 0 3px 8px rgba(0,0,0,.35);
  position: relative; transition: transform 200ms ease;
}
.tarot-face::after { content: ""; position: absolute; inset: 4%; border: 1px solid var(--gilt); border-radius: 6px; pointer-events: none; }
.tarot-art { flex: 1; overflow: hidden; border-radius: 3px; background: #2a2b45; }
.tarot-art img { width: 100%; height: 100%; object-fit: cover; }
.tarot-title { display: block; font-family: var(--display); font-size: clamp(0.85rem, 2.4vw, 1.12rem); line-height: 1.15; text-align: center; padding: 0.6em 0.2em 0.1em; min-height: 2.6em; display: grid; place-items: center; }
.spread.flipping .tarot-face { transform: rotateY(90deg); }
@media (prefers-reduced-motion: reduce) {
  .tarot, .tarot-face { transition: none; }
  .spread.flipping .tarot-face { transform: none; opacity: 0; }
}

/* ── bands + shelves ────────────────────────────────────── */
.band { padding-block: clamp(2.5rem, 6vw, 4.5rem) 0; }
.band-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.25rem 1.5rem; margin-bottom: 1.5rem; }
.band-head h2 { margin: 0; }
.band-head p { margin: 0; color: var(--ink-soft); max-width: 40rem; }

.shelf { list-style: none; margin: 0; padding: 0; display: grid; gap: 2.25rem 1.75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); }
@media (min-width: 700px) { .shelf-feature { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1100px) { .shelf-feature { grid-template-columns: repeat(5, 1fr); } }
.shelf-more { margin: 2rem 0 0; font-weight: 600; }
.shelf-small { grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); }
@media (max-width: 639px) {
  .shelf, .shelf-small { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.75rem 1rem; }
  .tile-title { font-size: 1.1rem; }
}
.tile { display: flex; flex-direction: column; gap: 0.75rem; color: inherit; text-decoration: none; height: 100%; }
.tile:hover { color: inherit; }
.tile-cover { display: block; aspect-ratio: 315 / 250; overflow: hidden; border-radius: 4px; background: var(--paper-2); outline: 1px solid color-mix(in srgb, var(--ink) 10%, transparent); outline-offset: -1px; }
.tile-cover img { width: 100%; height: 100%; object-fit: cover; }
.tile-text { display: flex; flex-direction: column; gap: 0.2rem; }
.tile-title { font-family: var(--display); font-size: 1.3rem; line-height: 1.15; }
.tile:hover .tile-title { text-decoration: underline; text-decoration-color: var(--gilt); text-underline-offset: 0.15em; }
.tile-tagline { color: var(--ink-soft); font-size: var(--step--1); line-height: 1.45; }
.tile-meta { display: flex; flex-wrap: wrap; gap: 0.35rem 0.6rem; align-items: center; margin-top: 0.35rem; font-size: var(--step--1); font-weight: 600; }
.badge { font-weight: 600; font-size: 0.78rem; padding: 0.08rem 0.5rem; border: 1px solid var(--gilt); color: var(--gilt-text); border-radius: 999px; }
.badge-dev { border-color: var(--rule); color: var(--ink-soft); }

.band-split { display: grid; gap: 3rem; padding-bottom: clamp(3rem, 7vw, 5rem); }
@media (min-width: 860px) { .band-split { grid-template-columns: 1.6fr 1fr; align-items: start; } }
.shopkeep { border-top: 3px double var(--gilt); padding-top: 1.25rem; }
.shopkeep h2 { font-size: var(--step-1); }
.shopkeep p { color: var(--ink-soft); }

.post-list { list-style: none; padding: 0; margin: 0; }
.post-list li { padding-block: 1rem; border-top: 1px solid var(--rule); display: grid; grid-template-columns: 6.5rem 1fr; column-gap: 1rem; }
.post-list li:last-child { border-bottom: 1px solid var(--rule); }
.post-list time { color: var(--ink-soft); font-size: var(--step--1); padding-top: 0.3rem; font-variant-numeric: tabular-nums; }
.post-list a { font-family: var(--display); font-size: var(--step-1); line-height: 1.2; text-decoration: none; color: var(--ink); }
.post-list a:hover { text-decoration: underline; color: var(--blood); }
.post-list p { grid-column: 2; margin: 0.3rem 0 0; color: var(--ink-soft); font-size: 0.95rem; }
@media (max-width: 520px) { .post-list li { grid-template-columns: 1fr; } .post-list p { grid-column: 1; } }

/* ── page shells ────────────────────────────────────────── */
.page-head { padding-block: clamp(2rem, 5vw, 3.5rem) 1.5rem; max-width: 46rem; }
.page-head h1 { margin-bottom: 0.3em; }
.lede { font-size: var(--step-1); line-height: 1.45; color: var(--ink-soft); }
.prose-page { padding-bottom: 4rem; }
.prose { max-width: 40rem; }
.prose h2 { margin-top: 1.8em; }
.prose blockquote { margin: 1.5em 0; padding: 0.2em 0 0.2em 1.25em; border-left: 3px solid var(--gilt); font-family: var(--display); font-size: 1.2rem; line-height: 1.45; }
.prose small { font-size: var(--step--1); color: var(--ink-soft); display: block; margin-top: 2em; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: 0.35em; }
.prose img { border-radius: 4px; }
.post-date { color: var(--ink-soft); margin-bottom: 0.4rem; font-size: var(--step--1); }
.wikilink-missing { border-bottom: 1px dotted var(--ink-soft); }
.mentioned { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); }
.mentioned h2 { font-size: var(--step-1); }
.post-nav { display: flex; justify-content: space-between; gap: 1.5rem; margin-top: 3rem; flex-wrap: wrap; }
.post-nav a { display: flex; flex-direction: column; text-decoration: none; font-family: var(--display); font-size: 1.15rem; max-width: 22rem; }
.post-nav span { font-family: var(--body); font-size: var(--step--1); color: var(--ink-soft); }
.post-nav .next { margin-left: auto; text-align: right; }

/* ── game page ──────────────────────────────────────────── */
.crumb { padding-top: 1.5rem; margin: 0; font-size: var(--step--1); }
.crumb a { text-decoration: none; }
.crumb a::before { content: "‹ "; }
.game-top { display: grid; gap: 2rem 3.5rem; padding-block: 1.5rem 2.5rem; }
@media (min-width: 860px) { .game-top { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: start; } }
.game-cover { margin: 0; background: var(--stock); padding: 12px; border-radius: 10px; box-shadow: 0 14px 34px -14px rgba(29,31,59,.45); position: relative; }
.game-cover::after { content: ""; position: absolute; inset: 6px; border: 1px solid var(--gilt); border-radius: 7px; pointer-events: none; }
.game-cover img { width: 100%; border-radius: 4px; }
.game-info h1 { margin-bottom: 0.15em; }
.subtitle { display: block; font-size: 0.5em; font-style: italic; color: var(--ink-soft); margin-top: 0.2em; }
.game-tagline { font-family: var(--display); font-style: italic; font-size: var(--step-1); line-height: 1.35; color: var(--ink-soft); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 0.9rem 1.5rem; margin: 1.75rem 0; padding-block: 1.1rem; border-block: 1px solid var(--rule); }
.facts div { min-width: 0; }
.facts dt { font-size: 0.8rem; color: var(--ink-soft); }
.facts dd { margin: 0.1rem 0 0; font-weight: 600; }
.buy { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-start; }
.print-links { flex-basis: 100%; margin-top: 0.75rem; }
.print-links p { margin: 0 0 0.3rem; font-weight: 600; }
.print-links li { margin-bottom: 0.2rem; }
.community { margin-top: 1.5rem; font-size: 0.95rem; color: var(--ink-soft); }

.game-body { display: grid; gap: 2.5rem 4rem; padding-block: 1rem 2rem; border-top: 1px solid var(--rule); padding-top: 2.5rem; }
@media (min-width: 960px) { .game-body { grid-template-columns: minmax(0, 40rem) minmax(0, 20rem); justify-content: space-between; } }
.retail-card { background: var(--paper-2); border-radius: var(--radius); padding: 1.4rem 1.4rem 1rem; align-self: start; }
.retail-card h2 { font-size: var(--step-1); }
.retail-card dl { margin: 0 0 1rem; display: grid; gap: 0.5rem; }
.retail-card dl div { display: grid; grid-template-columns: 6.5rem 1fr; gap: 0.75rem; }
.retail-card dt { color: var(--ink-soft); font-size: var(--step--1); padding-top: 0.15rem; }
.retail-card dd { margin: 0; }
.retail-card .muted { font-size: var(--step--1); margin-top: 1rem; }

.gallery { padding-block: 2rem; }
.gallery ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.gallery a { display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 4px; background: var(--paper-2); }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform 200ms ease; }
.gallery a:hover img { transform: scale(1.03); }
.more-games { padding-block: 2rem 4rem; border-top: 1px solid var(--rule); margin-top: 1rem; }

/* ── games index ────────────────────────────────────────── */
.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 2rem; }
.filters[hidden] { display: none; }
.filters button { font: 600 0.92rem var(--body); padding: 0.45rem 0.95rem; border-radius: 999px; border: 1px solid var(--rule); background: transparent; color: var(--ink); cursor: pointer; }
.filters button:hover { border-color: var(--ink-soft); }
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.empty-note { color: var(--ink-soft); }
.back-catalog { margin-top: 4.5rem; padding-block: 2.5rem 4rem; border-top: 3px double var(--gilt); }
.back-catalog > p { color: var(--ink-soft); max-width: 40rem; }
.bc-cols { display: grid; gap: 2rem 3rem; margin-top: 1.5rem; }
@media (min-width: 820px) { .bc-cols { grid-template-columns: repeat(3, 1fr); } }
.bc-cols h3 { font-size: 1.2rem; }
.bc-list { list-style: none; padding: 0; margin: 0; }
.bc-list li { padding-block: 0.55rem; border-top: 1px solid var(--rule); }
.bc-list a { font-weight: 600; text-decoration: none; }
.bc-list a:hover { text-decoration: underline; }
.bc-tag { display: block; color: var(--ink-soft); font-size: var(--step--1); line-height: 1.4; }

/* ── retailers ──────────────────────────────────────────── */
.table-scroll { overflow-x: auto; margin: 1.25rem 0 2rem; }
.retail-table { border-collapse: collapse; width: 100%; min-width: 34rem; font-size: 0.95rem; }
.retail-table th, .retail-table td { text-align: left; padding: 0.65rem 0.75rem 0.65rem 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.retail-table thead th { font-size: 0.8rem; color: var(--ink-soft); font-weight: 600; }
.retail-table tbody th { font-family: var(--display); font-weight: 400; font-size: 1.1rem; }
.prose .table-scroll { max-width: none; }

/* ── footer ─────────────────────────────────────────────── */
.site-footer { background: var(--paper-2); margin-top: 2rem; padding-block: 3rem 1.5rem; }
.footer-grid { display: grid; gap: 2.5rem; }
@media (min-width: 820px) { .footer-grid { grid-template-columns: 1.2fr 1fr; } }
.site-footer h2 { font-size: var(--step-1); }
.newsletter p { color: var(--ink-soft); max-width: 30rem; }
.nl-form { display: flex; gap: 0.5rem; flex-wrap: wrap; max-width: 30rem; }
.nl-form input { flex: 1 1 14rem; font: inherit; padding: 0.68rem 0.85rem; border-radius: var(--radius); border: 1.5px solid var(--rule); background: var(--paper); color: var(--ink); }
.nl-form button { font: 600 1rem var(--body); padding: 0.7rem 1.1rem; border-radius: var(--radius); border: 0; background: var(--ink); color: var(--paper); cursor: pointer; }
.nl-form button:hover { background: var(--blood); }
.site-footer li { margin-bottom: 0.45rem; color: var(--ink-soft); }
.colophon { margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--rule); font-size: var(--step--1); color: var(--ink-soft); }
.lost { min-height: 50vh; }
@media (max-width: 639px) { .gallery ul { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; } }
