/* ==========================================================================
   Aisle Zero: Living Leftovers - site stylesheet
   --------------------------------------------------------------------------
   Mobile-first, no external requests, no web-font download (system stack) so
   the critical path stays short and Core Web Vitals stay green (PRD 24).

   Visual identity: an abandoned supermarket after closing time. Warning-tape
   yellow, hazard orange, Life Sauce green, shelf-label cards and price-tag
   badges - deliberately not a generic SaaS template (PRD 2).

   Contents
     1.  Tokens
     2.  Reset & base
     3.  Typography
     4.  Layout primitives
     5.  Header & navigation
     6.  Buttons & badges
     7.  Cards & grids
     8.  Hero & marketing sections
     9.  Article & prose
     10. Forms
     11. Forum
     12. Studio (editor tools)
     13. Footer
     14. Utilities
     15. Motion & print
   ========================================================================== */

/* ==========================================================================
   1. Tokens
   ========================================================================== */
:root {
  /* Surfaces - the dark aisle */
  --c-void: #07090c;
  --c-floor: #0d1117;
  --c-shelf: #141b24;
  --c-shelf-2: #1b2531;
  --c-shelf-3: #24313f;
  --c-line: #2c3a4a;
  --c-line-soft: #1f2a36;

  /* Ink */
  --c-ink: #f2f5f8;
  --c-ink-dim: #b6c2cf;
  --c-ink-faint: #7d8b9a;

  /* Brand */
  --c-tape: #ffc021;        /* warning tape yellow */
  --c-tape-deep: #e0a000;
  --c-hazard: #ff6b35;      /* hazard orange */
  --c-sauce: #7bf051;       /* Life Sauce green */
  --c-sauce-deep: #46b32a;
  --c-blood: #e63946;       /* clean-up in aisle 4 */
  --c-cool: #4cc9f0;        /* freezer aisle */
  --c-plum: #9d4edd;

  /* Status */
  --c-ok: #4ade80;
  --c-warn: #fbbf24;
  --c-bad: #f87171;

  /* Type */
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans", sans-serif;
  --font-display: var(--font-body);
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;

  /* Fluid type scale: comfortable on a 320px phone, generous on a desktop */
  --t-xs: clamp(0.72rem, 0.70rem + 0.10vw, 0.78rem);
  --t-sm: clamp(0.83rem, 0.80rem + 0.15vw, 0.92rem);
  --t-base: clamp(1rem, 0.96rem + 0.20vw, 1.08rem);
  --t-md: clamp(1.10rem, 1.03rem + 0.35vw, 1.30rem);
  --t-lg: clamp(1.32rem, 1.18rem + 0.70vw, 1.80rem);
  --t-xl: clamp(1.70rem, 1.40rem + 1.50vw, 2.60rem);
  --t-2xl: clamp(2.10rem, 1.55rem + 2.75vw, 3.80rem);
  --t-3xl: clamp(2.60rem, 1.70rem + 4.50vw, 5.20rem);

  /* Space */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: 4rem;
  --s-9: 6rem;

  /* Shape */
  --r-sm: 4px;
  --r-md: 10px;
  --r-lg: 18px;
  --r-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px -8px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, 0.85);
  --shadow-glow: 0 0 0 1px rgba(255, 192, 33, 0.3), 0 8px 30px -12px rgba(255, 192, 33, 0.4);

  --wrap: 1180px;
  --wrap-narrow: 760px;
  --header-h: 60px;

  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
}

/* ==========================================================================
   2. Reset & base
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--s-4));
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--c-floor);
  /* Aisle lighting: a warm pool of light overhead, cold dark at the edges. */
  background-image:
    radial-gradient(1200px 520px at 50% -8%, rgba(255, 192, 33, 0.10), transparent 65%),
    radial-gradient(900px 500px at 88% 12%, rgba(123, 240, 81, 0.06), transparent 60%),
    linear-gradient(180deg, var(--c-void) 0%, var(--c-floor) 22%, var(--c-floor) 100%);
  background-attachment: fixed;
  color: var(--c-ink);
  font-family: var(--font-body);
  font-size: var(--t-base);
  line-height: 1.65;
  overflow-x: hidden; /* PRD 25: no horizontal overflow, ever */
  -webkit-font-smoothing: antialiased;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--c-tape);
  text-decoration-color: rgba(255, 192, 33, 0.4);
  text-underline-offset: 0.18em;
  transition: color 0.15s var(--ease), text-decoration-color 0.15s var(--ease);
}

a:hover {
  color: #ffd76a;
  text-decoration-color: currentColor;
}

/* Visible focus everywhere (PRD 46, WCAG 2.2) */
:focus-visible {
  outline: 3px solid var(--c-cool);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

::selection {
  background: var(--c-tape);
  color: var(--c-void);
}

hr {
  border: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--c-line), transparent);
  margin: var(--s-6) 0;
}

/* ==========================================================================
   3. Typography
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  line-height: 1.1;
  margin: 0 0 var(--s-3);
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h1 { font-size: var(--t-2xl); font-weight: 900; }
h2 { font-size: var(--t-xl); font-weight: 800; }
h3 { font-size: var(--t-lg); font-weight: 800; }
h4 { font-size: var(--t-md); font-weight: 700; }
h5, h6 { font-size: var(--t-base); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }

p { margin: 0 0 var(--s-4); }

.kicker {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--t-xs);
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--c-tape);
  margin-bottom: var(--s-3);
}

.kicker::before {
  content: "";
  width: 22px;
  height: 3px;
  background: var(--c-tape);
  border-radius: 2px;
}

.lede {
  font-size: var(--t-md);
  color: var(--c-ink-dim);
  max-width: 62ch;
}

.muted { color: var(--c-ink-faint); }
.small { font-size: var(--t-sm); }

code, kbd, samp {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--c-shelf-2);
  padding: 0.12em 0.4em;
  border-radius: var(--r-sm);
  border: 1px solid var(--c-line-soft);
}

/* ==========================================================================
   4. Layout primitives
   ========================================================================== */
.wrap {
  width: min(100% - 2rem, var(--wrap));
  margin-inline: auto;
}

@media (min-width: 768px) {
  .wrap { width: min(100% - 3rem, var(--wrap)); }
}

.wrap-narrow {
  width: min(100% - 2rem, var(--wrap-narrow));
  margin-inline: auto;
}

.section {
  padding-block: var(--s-7);
}

@media (min-width: 900px) {
  .section { padding-block: var(--s-8); }
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-4);
  margin-bottom: var(--s-5);
}

.section-head p { margin: 0; }

.stack > * + * { margin-top: var(--s-4); }
.stack-sm > * + * { margin-top: var(--s-2); }
.stack-lg > * + * { margin-top: var(--s-6); }

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--c-tape);
  color: var(--c-void);
  padding: var(--s-3) var(--s-4);
  font-weight: 800;
  border-radius: 0 0 var(--r-md) 0;
}

.skip-link:focus {
  left: 0;
}

/* ==========================================================================
   5. Header & navigation
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 9, 12, 0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--c-line-soft);
}

/* Warning-tape stripe under the header */
.site-header::after {
  content: "";
  display: block;
  height: 3px;
  background: repeating-linear-gradient(
    -45deg,
    var(--c-tape) 0 12px,
    var(--c-void) 12px 24px
  );
  opacity: 0.85;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
  min-height: var(--header-h);
  /* Without this, flex children refuse to shrink and the row overflows. */
  min-width: 0;
}

@media (min-width: 480px) {
  .header-inner { gap: var(--s-3); }
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-weight: 900;
  font-size: var(--t-sm);
  letter-spacing: -0.01em;
  color: var(--c-ink);
  text-decoration: none;
  min-width: 0;
}

/* The wordmark is the first thing to give way on a narrow phone; the logo and
   the primary CTA both stay. */
@media (max-width: 400px) {
  .brand-text { display: none; }
}

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

.brand img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--c-line);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text b { font-size: var(--t-sm); }
.brand-text span {
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-tape);
  font-weight: 700;
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  background: var(--c-shelf-2);
  color: var(--c-ink);
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  /* PRD 25: comfortable touch target */
  min-height: 44px;
  padding: 0 var(--s-3);
  font-weight: 700;
  font-size: var(--t-sm);
  cursor: pointer;
}

.nav-toggle-bars {
  display: grid;
  gap: 3px;
}

.nav-toggle-bars i {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
}

.site-nav {
  display: none;
}

.site-nav.is-open {
  display: block;
  position: absolute;
  inset-inline: 0;
  top: 100%;
  background: var(--c-void);
  border-bottom: 1px solid var(--c-line);
  padding: var(--s-3) 0 var(--s-5);
  box-shadow: var(--shadow-lg);
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0 1rem;
  display: grid;
  gap: var(--s-1);
}

.site-nav a {
  display: block;
  padding: 0.7rem var(--s-3);
  border-radius: var(--r-md);
  color: var(--c-ink-dim);
  text-decoration: none;
  font-weight: 700;
  font-size: var(--t-sm);
  min-height: 44px;
  display: flex;
  align-items: center;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  background: var(--c-shelf-2);
  color: var(--c-tape);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  flex-shrink: 0;
}

.header-actions .btn { white-space: nowrap; }

/* Below the desktop breakpoint the account links live inside the menu, so the
   header keeps only the brand, the menu toggle and the primary CTA. */
.header-actions .header-account { display: none; }

@media (min-width: 1024px) {
  .header-actions .header-account { display: inline-flex; }
}

/* Account links shown inside the open mobile menu. */
.nav-account {
  margin-top: var(--s-3);
  padding-top: var(--s-3);
  border-top: 1px solid var(--c-line-soft);
}

@media (min-width: 1024px) {
  .nav-account { display: none; }
}

@media (min-width: 1024px) {
  .nav-toggle { display: none; }

  .site-nav,
  .site-nav.is-open {
    display: block;
    position: static;
    background: none;
    border: 0;
    padding: 0;
    box-shadow: none;
    flex: 1;
  }

  .site-nav ul {
    display: flex;
    justify-content: center;
    gap: var(--s-1);
    padding: 0;
  }

  .site-nav a { padding: 0.45rem var(--s-3); min-height: 38px; }
}

/* ==========================================================================
   6. Buttons & badges
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 44px;              /* PRD 25 touch target */
  padding: 0.6rem 1.15rem;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: var(--t-sm);
  font-weight: 800;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s var(--ease), background 0.15s var(--ease),
    box-shadow 0.15s var(--ease);
}

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

.btn-primary {
  background: linear-gradient(180deg, #ffd35c, var(--c-tape));
  color: #201500;
  box-shadow: 0 6px 20px -8px rgba(255, 192, 33, 0.8);
}

.btn-primary:hover {
  background: linear-gradient(180deg, #ffdd7d, #ffc93b);
  color: #201500;
}

.btn-sauce {
  background: linear-gradient(180deg, #9df878, var(--c-sauce));
  color: #06210a;
  box-shadow: 0 6px 20px -8px rgba(123, 240, 81, 0.7);
}

.btn-sauce:hover { color: #06210a; background: linear-gradient(180deg, #b0ff8f, #8bf765); }

.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--c-line);
  color: var(--c-ink);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: var(--c-shelf-3);
  color: var(--c-ink);
}

.btn-danger {
  background: rgba(230, 57, 70, 0.15);
  border-color: rgba(230, 57, 70, 0.5);
  color: #ff9aa2;
}

.btn-sm { min-height: 40px; padding: 0.3rem 0.75rem; font-size: var(--t-xs); }

/* On a touch screen every control gets a full-size target (PRD 25). */
@media (pointer: coarse) {
  .btn-sm { min-height: 44px; }
}
.btn-lg { min-height: 52px; padding: 0.85rem 1.6rem; font-size: var(--t-base); }
.btn-block { width: 100%; }

.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Shelf-label badge: a little price tag stuck on the shelf edge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  padding: 0.22em 0.6em;
  border-radius: var(--r-sm);
  background: var(--c-shelf-3);
  border: 1px solid var(--c-line);
  color: var(--c-ink-dim);
  font-size: var(--t-xs);
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}

.badge-tape { background: rgba(255, 192, 33, 0.15); border-color: rgba(255, 192, 33, 0.45); color: var(--c-tape); }
.badge-sauce { background: rgba(123, 240, 81, 0.14); border-color: rgba(123, 240, 81, 0.4); color: var(--c-sauce); }
.badge-hazard { background: rgba(255, 107, 53, 0.15); border-color: rgba(255, 107, 53, 0.45); color: var(--c-hazard); }
.badge-cool { background: rgba(76, 201, 240, 0.14); border-color: rgba(76, 201, 240, 0.4); color: var(--c-cool); }
.badge-blood { background: rgba(230, 57, 70, 0.15); border-color: rgba(230, 57, 70, 0.45); color: #ff8a92; }
.badge-plum { background: rgba(157, 78, 221, 0.16); border-color: rgba(157, 78, 221, 0.45); color: #c99bf0; }

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

/* ==========================================================================
   7. Cards & grids
   ========================================================================== */
.grid {
  display: grid;
  gap: var(--s-4);
  grid-template-columns: 1fr;
}

/* Small -> medium -> large, the three breakpoints the site is built around */
@media (min-width: 560px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 900px) {
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .grid { gap: var(--s-5); }
}

@media (min-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--c-shelf) 0%, var(--c-shelf-2) 100%);
  border: 1px solid var(--c-line-soft);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: transform 0.18s var(--ease), border-color 0.18s var(--ease),
    box-shadow 0.18s var(--ease);
}

.card:hover {
  transform: translateY(-3px);
  border-color: var(--c-shelf-3);
  box-shadow: var(--shadow-md);
}

.card-media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--c-void);
  overflow: hidden;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-media-square { aspect-ratio: 1 / 1; }
.card-media-tall { aspect-ratio: 4 / 5; }

.card-body {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  padding: var(--s-4);
  flex: 1;
}

.card-title {
  font-size: var(--t-md);
  font-weight: 800;
  margin: 0;
  line-height: 1.2;
}

.card-title a { color: var(--c-ink); text-decoration: none; }
.card-title a:hover { color: var(--c-tape); }

.card-excerpt {
  color: var(--c-ink-dim);
  font-size: var(--t-sm);
  margin: 0;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  align-items: center;
  font-size: var(--t-xs);
  color: var(--c-ink-faint);
  margin-top: auto;
  padding-top: var(--s-2);
}

/* Stretched link keeps the whole card clickable without nesting anchors */
.card-link::after {
  content: "";
  position: absolute;
  inset: 0;
}

/* Entity card: the shelf label look for heroes / weapons / enemies */
.entity-card .card-media {
  aspect-ratio: 1 / 1;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(255, 192, 33, 0.14), transparent 60%),
    repeating-linear-gradient(90deg, var(--c-shelf) 0 22px, var(--c-shelf-2) 22px 44px);
  display: grid;
  place-items: center;
}

.entity-card .card-media img {
  object-fit: contain;
  padding: var(--s-4);
}

/* Perk icons are small, bright and square - give them room to breathe. */
.perk-card .card-media {
  aspect-ratio: 1 / 1;
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(123, 240, 81, 0.12), transparent 65%),
    var(--c-shelf-2);
}

.perk-card .card-media img {
  object-fit: contain;
  padding: var(--s-5);
  image-rendering: pixelated;   /* the source art is small pixel art */
}

.perk-card .card-body { padding: var(--s-3); }
.perk-card .card-title { font-size: var(--t-base); }
.perk-card .card-excerpt { font-size: var(--t-xs); }

/* Hero and weapon art is pixel art too; keep it crisp when scaled up. */
.entity-card .card-media img,
.entity-art img {
  image-rendering: pixelated;
}

/* Placeholder used where no approved art exists yet */
.art-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  background:
    repeating-linear-gradient(-45deg, rgba(255, 192, 33, 0.07) 0 10px, transparent 10px 20px),
    var(--c-shelf-2);
  color: var(--c-ink-faint);
  font-weight: 900;
  font-size: clamp(1.6rem, 6vw, 3rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.art-placeholder span {
  display: grid;
  place-items: center;
  width: 1.9em;
  height: 1.9em;
  border-radius: 50%;
  border: 3px dashed var(--c-line);
  color: var(--c-tape);
}

/* ==========================================================================
   8. Hero & marketing sections
   ========================================================================== */
.hero {
  position: relative;
  padding-block: var(--s-6) var(--s-7);
  overflow: hidden;
}

.hero::before {
  /* Flickering fluorescent glow */
  content: "";
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 60%;
  background: radial-gradient(60% 100% at 50% 0%, rgba(255, 192, 33, 0.16), transparent 70%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  display: grid;
  gap: var(--s-5);
  align-items: center;
}

@media (min-width: 900px) {
  .hero { padding-block: var(--s-8) var(--s-9); }
  .hero-inner {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: var(--s-7);
  }
}

.hero-title {
  font-size: var(--t-3xl);
  font-weight: 900;
  line-height: 0.98;
  letter-spacing: -0.035em;
  margin-bottom: var(--s-4);
  text-transform: uppercase;
}

.hero-title em {
  display: block;
  font-style: normal;
  font-size: 0.44em;
  letter-spacing: 0.1em;
  color: var(--c-sauce);
  margin-top: 0.35em;
  font-weight: 800;
}

.hero-copy { font-size: var(--t-md); color: var(--c-ink-dim); max-width: 56ch; }

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  margin-top: var(--s-5);
}

.hero-art {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--c-line);
  box-shadow: var(--shadow-lg);
  background: var(--c-void);
}

.hero-art img { width: 100%; }

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-4) var(--s-6);
  margin-top: var(--s-5);
  padding-top: var(--s-4);
  border-top: 1px solid var(--c-line-soft);
}

.hero-stat b {
  display: block;
  font-size: var(--t-lg);
  font-weight: 900;
  color: var(--c-tape);
  line-height: 1;
}

.hero-stat span {
  font-size: var(--t-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--c-ink-faint);
}

/* Feature strip - "what is this game" */
.feature {
  display: flex;
  gap: var(--s-3);
  padding: var(--s-4);
  background: var(--c-shelf);
  border: 1px solid var(--c-line-soft);
  border-radius: var(--r-lg);
  border-left: 4px solid var(--c-tape);
}

.feature h3 { font-size: var(--t-base); margin-bottom: var(--s-1); }
.feature p { font-size: var(--t-sm); color: var(--c-ink-dim); margin: 0; }
.feature-icon { font-size: 1.6rem; line-height: 1; flex-shrink: 0; }

/* Store buttons on /play/ */
.store-list { display: grid; gap: var(--s-3); }

@media (min-width: 560px) {
  .store-list { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
}

.store-link {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-4);
  border-radius: var(--r-lg);
  background: var(--c-shelf-2);
  border: 1px solid var(--c-line);
  text-decoration: none;
  color: var(--c-ink);
  min-height: 68px;
}

.store-link:hover { border-color: var(--c-tape); color: var(--c-ink); }
.store-link b { display: block; font-size: var(--t-base); }
.store-link span { font-size: var(--t-xs); color: var(--c-ink-faint); text-transform: uppercase; letter-spacing: 0.08em; }

/* Callout / note box */
.callout {
  padding: var(--s-4) var(--s-5);
  border-radius: var(--r-lg);
  background: var(--c-shelf);
  border: 1px solid var(--c-line-soft);
  border-left: 4px solid var(--c-cool);
}

.callout-tape { border-left-color: var(--c-tape); }
.callout-sauce { border-left-color: var(--c-sauce); }
.callout-danger { border-left-color: var(--c-blood); }
.callout > :last-child { margin-bottom: 0; }

/* ==========================================================================
   9. Article & prose
   ========================================================================== */
.article-header {
  padding-block: var(--s-6) var(--s-5);
  border-bottom: 1px solid var(--c-line-soft);
  margin-bottom: var(--s-6);
}

.article-title { font-size: var(--t-2xl); margin-bottom: var(--s-3); }

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2) var(--s-4);
  font-size: var(--t-sm);
  color: var(--c-ink-faint);
}

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

.article-author img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--c-line);
}

.featured-figure {
  margin: 0 0 var(--s-6);
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--c-line);
  background: var(--c-void);
}

.featured-figure figcaption {
  padding: var(--s-3) var(--s-4);
  font-size: var(--t-sm);
  color: var(--c-ink-faint);
  background: var(--c-shelf);
  border-top: 1px solid var(--c-line-soft);
}

/* Prose: the container uploaded HTML is rendered inside */
.prose {
  font-size: var(--t-base);
  line-height: 1.75;
  color: var(--c-ink-dim);
  max-width: 72ch;
}

.prose > h2 {
  margin-top: var(--s-7);
  margin-bottom: var(--s-3);
  color: var(--c-ink);
  padding-bottom: var(--s-2);
  border-bottom: 1px solid var(--c-line-soft);
}

.prose > h3 { margin-top: var(--s-6); color: var(--c-ink); }
.prose > h4 { margin-top: var(--s-5); color: var(--c-ink); }
.prose > :first-child { margin-top: 0; }

.prose strong { color: var(--c-ink); }

.prose a {
  color: var(--c-tape);
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

.prose ul,
.prose ol {
  padding-left: 1.35em;
  margin: 0 0 var(--s-4);
}

.prose li { margin-bottom: var(--s-2); }
.prose li::marker { color: var(--c-tape); }

.prose blockquote {
  margin: var(--s-5) 0;
  padding: var(--s-4) var(--s-5);
  background: var(--c-shelf);
  border-left: 4px solid var(--c-sauce);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  color: var(--c-ink);
  font-size: var(--t-md);
}

.prose blockquote > :last-child { margin-bottom: 0; }

.prose figure {
  margin: var(--s-5) 0;
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--c-line);
}

.prose figure img { width: 100%; }

.prose figcaption {
  padding: var(--s-3) var(--s-4);
  font-size: var(--t-sm);
  color: var(--c-ink-faint);
  background: var(--c-shelf);
}

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

.prose pre {
  background: var(--c-void);
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  padding: var(--s-4);
  overflow-x: auto;
  font-size: var(--t-sm);
}

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

/* Tables scroll horizontally on small screens (PRD 25) */
.prose table,
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--t-sm);
  margin-bottom: var(--s-4);
}

.prose th,
.prose td,
.table th,
.table td {
  padding: var(--s-3);
  border: 1px solid var(--c-line-soft);
  text-align: left;
}

.prose th,
.table th {
  background: var(--c-shelf-2);
  color: var(--c-ink);
  font-weight: 800;
  font-size: var(--t-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

[data-table-scroll] {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: var(--s-4);
  border-radius: var(--r-md);
}

[data-table-scroll]:focus-visible { outline: 3px solid var(--c-cool); }

/* Responsive video embed */
.video-frame,
.prose figure:has(> iframe) {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--c-void);
  border: 1px solid var(--c-line);
  margin: 0 0 var(--s-5);
}

.video-frame iframe,
.prose figure > iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Article layout with a sidebar on large screens */
.article-layout { display: grid; gap: var(--s-6); }

@media (min-width: 1000px) {
  .article-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: var(--s-7);
    align-items: start;
  }
  .article-sidebar { position: sticky; top: calc(var(--header-h) + var(--s-4)); }
}

.sidebar-block {
  background: var(--c-shelf);
  border: 1px solid var(--c-line-soft);
  border-radius: var(--r-lg);
  padding: var(--s-4);
  margin-bottom: var(--s-4);
}

.sidebar-block h2,
.sidebar-block h3 {
  font-size: var(--t-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--c-tape);
  margin-bottom: var(--s-3);
}

.link-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-2); }
.link-list a { color: var(--c-ink-dim); text-decoration: none; font-size: var(--t-sm); font-weight: 600; }
.link-list a:hover { color: var(--c-tape); }

/* Breadcrumbs */
.breadcrumbs {
  padding-block: var(--s-3);
  font-size: var(--t-xs);
  color: var(--c-ink-faint);
}

.breadcrumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin: 0;
  padding: 0;
}

.breadcrumbs li + li::before {
  content: "/";
  margin-right: var(--s-2);
  color: var(--c-line);
}

.breadcrumbs a { color: var(--c-ink-faint); text-decoration: none; }
.breadcrumbs a:hover { color: var(--c-tape); }

/* Pagination */
.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  align-items: center;
  justify-content: center;
  margin-top: var(--s-6);
}

.pagination .current {
  padding: 0.5rem 0.9rem;
  font-size: var(--t-sm);
  color: var(--c-ink-faint);
}

/* ==========================================================================
   10. Forms
   ========================================================================== */
.form-field { margin-bottom: var(--s-4); }

label,
.form-label {
  display: block;
  font-size: var(--t-sm);
  font-weight: 700;
  color: var(--c-ink);
  margin-bottom: var(--s-2);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="search"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
input[type="file"],
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 0.6rem 0.8rem;
  background: var(--c-void);
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  color: var(--c-ink);
  font-family: inherit;
  font-size: var(--t-base);   /* >=16px avoids iOS zoom-on-focus */
  line-height: 1.5;
}

textarea { min-height: 120px; resize: vertical; font-size: var(--t-sm); }

input:focus,
select:focus,
textarea:focus {
  border-color: var(--c-tape);
  outline: 2px solid rgba(255, 192, 33, 0.35);
  outline-offset: 0;
}

input[type="checkbox"],
input[type="radio"] {
  width: 20px;
  height: 20px;
  min-height: 0;
  accent-color: var(--c-tape);
  vertical-align: middle;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
}

.checkbox-row label { margin: 0; font-weight: 600; }

.help-text {
  display: block;
  font-size: var(--t-xs);
  color: var(--c-ink-faint);
  margin-top: var(--s-1);
}

.errorlist {
  list-style: none;
  margin: var(--s-2) 0 0;
  padding: 0;
  color: #ff9aa2;
  font-size: var(--t-sm);
}

.form-card {
  background: var(--c-shelf);
  border: 1px solid var(--c-line-soft);
  border-radius: var(--r-lg);
  padding: var(--s-5);
}

/* Messages */
.messages { display: grid; gap: var(--s-2); margin-bottom: var(--s-5); }

.message {
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  border: 1px solid var(--c-line);
  background: var(--c-shelf-2);
  font-size: var(--t-sm);
}

.message-success { border-color: rgba(74, 222, 128, 0.5); background: rgba(74, 222, 128, 0.1); }
.message-error { border-color: rgba(248, 113, 113, 0.5); background: rgba(248, 113, 113, 0.1); }
.message-warning { border-color: rgba(251, 191, 36, 0.5); background: rgba(251, 191, 36, 0.1); }
.message-info { border-color: rgba(76, 201, 240, 0.45); background: rgba(76, 201, 240, 0.1); }

/* Search */
.search-form { display: flex; gap: var(--s-2); }
.search-form input { flex: 1; }

/* ==========================================================================
   11. Forum
   ========================================================================== */
.forum-category {
  display: flex;
  gap: var(--s-4);
  align-items: flex-start;
  padding: var(--s-4);
  background: var(--c-shelf);
  border: 1px solid var(--c-line-soft);
  border-radius: var(--r-lg);
  position: relative;
}

.forum-category:hover { border-color: var(--c-shelf-3); }
.forum-category-icon { font-size: 1.8rem; line-height: 1; }
.forum-category h3 { margin-bottom: var(--s-1); font-size: var(--t-md); }
.forum-category h3 a { color: var(--c-ink); text-decoration: none; }
.forum-category p { font-size: var(--t-sm); color: var(--c-ink-dim); margin: 0 0 var(--s-2); }

.forum-stats {
  display: flex;
  gap: var(--s-4);
  font-size: var(--t-xs);
  color: var(--c-ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.thread-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-4);
  align-items: center;
  justify-content: space-between;
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--c-line-soft);
}

.thread-row:hover { background: rgba(255, 255, 255, 0.02); }
.thread-row h3 { font-size: var(--t-base); margin: 0 0 var(--s-1); }
.thread-row h3 a { color: var(--c-ink); text-decoration: none; }
.thread-row h3 a:hover { color: var(--c-tape); }
.thread-row-meta { font-size: var(--t-xs); color: var(--c-ink-faint); }

.post {
  display: grid;
  gap: var(--s-3);
  padding: var(--s-4);
  background: var(--c-shelf);
  border: 1px solid var(--c-line-soft);
  border-radius: var(--r-lg);
  margin-bottom: var(--s-4);
  scroll-margin-top: calc(var(--header-h) + var(--s-4));
}

@media (min-width: 700px) {
  .post { grid-template-columns: 160px minmax(0, 1fr); gap: var(--s-5); }
}

.post-author {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  font-size: var(--t-sm);
}

@media (min-width: 700px) {
  .post-author {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    border-right: 1px solid var(--c-line-soft);
    padding-right: var(--s-4);
  }
}

.post-author img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--c-line);
}

.post-author a { color: var(--c-ink); text-decoration: none; font-weight: 700; }
.post-body { font-size: var(--t-sm); line-height: 1.7; color: var(--c-ink-dim); }
.post-body > :last-child { margin-bottom: 0; }
.post-body a { word-break: break-word; }

.post-footer {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  align-items: center;
  font-size: var(--t-xs);
  color: var(--c-ink-faint);
  padding-top: var(--s-2);
  border-top: 1px solid var(--c-line-soft);
}

.post-pending {
  border-color: rgba(251, 191, 36, 0.4);
  background: rgba(251, 191, 36, 0.06);
}

/* Forum composer stays usable on a phone (PRD 25) */
.composer textarea { min-height: 140px; }

/* ==========================================================================
   12. Studio (editor tools)
   ========================================================================== */
.studio-shell { padding-block: var(--s-5) var(--s-8); }

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

@media (min-width: 1100px) {
  .studio-grid { grid-template-columns: minmax(0, 1fr) 380px; align-items: start; }
  .studio-aside { position: sticky; top: calc(var(--header-h) + var(--s-4)); }
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--s-3);
}

.stat {
  padding: var(--s-4);
  background: var(--c-shelf);
  border: 1px solid var(--c-line-soft);
  border-radius: var(--r-md);
  border-top: 3px solid var(--c-line);
}

.stat b { display: block; font-size: var(--t-xl); font-weight: 900; line-height: 1; }
.stat span { font-size: var(--t-xs); text-transform: uppercase; letter-spacing: 0.08em; color: var(--c-ink-faint); }
.stat-ok { border-top-color: var(--c-ok); }
.stat-warn { border-top-color: var(--c-warn); }
.stat-bad { border-top-color: var(--c-bad); }
.stat-info { border-top-color: var(--c-cool); }

/* SEO validation panel (PRD 14, 32) */
.seo-panel {
  background: var(--c-shelf);
  border: 1px solid var(--c-line);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.seo-panel-head {
  padding: var(--s-4);
  border-bottom: 1px solid var(--c-line-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  flex-wrap: wrap;
}

.seo-status {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 0.3rem 0.8rem;
  border-radius: var(--r-pill);
  font-weight: 900;
  font-size: var(--t-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.seo-status-pass { background: rgba(74, 222, 128, 0.16); color: var(--c-ok); border: 1px solid rgba(74, 222, 128, 0.4); }
.seo-status-warning { background: rgba(251, 191, 36, 0.16); color: var(--c-warn); border: 1px solid rgba(251, 191, 36, 0.4); }
.seo-status-blocked { background: rgba(248, 113, 113, 0.16); color: var(--c-bad); border: 1px solid rgba(248, 113, 113, 0.45); }

.seo-score { font-size: var(--t-xl); font-weight: 900; line-height: 1; }
.seo-score small { font-size: var(--t-sm); color: var(--c-ink-faint); font-weight: 600; }

.seo-check-list { list-style: none; margin: 0; padding: 0; }

.seo-check {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--c-line-soft);
  font-size: var(--t-sm);
}

.seo-check:last-child { border-bottom: 0; }
.seo-check-mark { font-weight: 900; line-height: 1.5; }
.seo-check-pass .seo-check-mark { color: var(--c-ok); }
.seo-check-fail .seo-check-mark { color: var(--c-bad); }
.seo-check-warn .seo-check-mark { color: var(--c-warn); }
.seo-check-skip { opacity: 0.5; }
.seo-check b { display: block; color: var(--c-ink); }
.seo-check p { margin: var(--s-1) 0 0; color: var(--c-ink-dim); }
.seo-check .hint { color: var(--c-ink-faint); font-size: var(--t-xs); }

/* Search-result and social previews (PRD 54) */
.serp-preview {
  background: #fff;
  color: #202124;
  border-radius: var(--r-md);
  padding: var(--s-4);
  font-family: arial, sans-serif;
}

.serp-preview .serp-url { color: #4d5156; font-size: 12px; }
.serp-preview .serp-title { color: #1a0dab; font-size: 18px; line-height: 1.3; margin: 2px 0; }
.serp-preview .serp-desc { color: #4d5156; font-size: 13px; line-height: 1.45; }

.social-preview {
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--c-void);
}

.social-preview img { width: 100%; aspect-ratio: 1.91 / 1; object-fit: cover; }
.social-preview-body { padding: var(--s-3); }
.social-preview-body b { display: block; font-size: var(--t-sm); }
.social-preview-body span { font-size: var(--t-xs); color: var(--c-ink-faint); }

/* Preview device frames */
.preview-frames { display: grid; gap: var(--s-5); }

@media (min-width: 1000px) {
  .preview-frames { grid-template-columns: minmax(0, 1fr) 400px; }
}

.device {
  border: 1px solid var(--c-line);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--c-void);
}

.device-bar {
  padding: var(--s-2) var(--s-3);
  background: var(--c-shelf-2);
  border-bottom: 1px solid var(--c-line);
  font-size: var(--t-xs);
  color: var(--c-ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 800;
}

.device iframe { width: 100%; height: 620px; border: 0; background: var(--c-floor); }
.device-mobile iframe { height: 680px; }

.outline-tree {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  line-height: 1.8;
  color: var(--c-ink-dim);
  margin: 0;
  white-space: pre-wrap;
}

.removed-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-2); }

.removed-list li {
  font-size: var(--t-sm);
  padding: var(--s-2) var(--s-3);
  background: rgba(248, 113, 113, 0.08);
  border-left: 3px solid rgba(248, 113, 113, 0.6);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  color: var(--c-ink-dim);
}

.data-table { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
.data-table th,
.data-table td { padding: var(--s-3); text-align: left; border-bottom: 1px solid var(--c-line-soft); }
.data-table th { font-size: var(--t-xs); text-transform: uppercase; letter-spacing: 0.08em; color: var(--c-ink-faint); }
.data-table tr:hover td { background: rgba(255, 255, 255, 0.02); }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  border-bottom: 1px solid var(--c-line-soft);
  margin-bottom: var(--s-4);
}

.tabs a {
  padding: var(--s-2) var(--s-3);
  font-size: var(--t-sm);
  font-weight: 700;
  color: var(--c-ink-faint);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.tabs a[aria-current="true"] { color: var(--c-tape); border-bottom-color: var(--c-tape); }

details.field-group {
  border: 1px solid var(--c-line-soft);
  border-radius: var(--r-md);
  padding: var(--s-3) var(--s-4);
  margin-bottom: var(--s-4);
  background: rgba(255, 255, 255, 0.015);
}

details.field-group > summary {
  cursor: pointer;
  font-weight: 800;
  font-size: var(--t-sm);
  color: var(--c-tape);
  list-style-position: inside;
}

details.field-group[open] > summary { margin-bottom: var(--s-4); }

/* ==========================================================================
   13. Footer
   ========================================================================== */
.site-footer {
  margin-top: var(--s-9);
  background: var(--c-void);
  border-top: 1px solid var(--c-line-soft);
  padding-block: var(--s-7) var(--s-5);
}

.site-footer::before {
  content: "";
  display: block;
  height: 3px;
  margin-bottom: var(--s-6);
  background: repeating-linear-gradient(-45deg, var(--c-tape) 0 12px, transparent 12px 24px);
  opacity: 0.5;
}

.footer-grid {
  display: grid;
  gap: var(--s-5);
  grid-template-columns: 1fr;
}

@media (min-width: 700px) {
  .footer-grid { grid-template-columns: 1.4fr repeat(3, 1fr); gap: var(--s-6); }
}

.footer-col h2 {
  font-size: var(--t-xs);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--c-tape);
  margin-bottom: var(--s-3);
}

.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-2); }
.footer-col a { color: var(--c-ink-dim); text-decoration: none; font-size: var(--t-sm); }
.footer-col a:hover { color: var(--c-tape); }

.footer-bottom {
  margin-top: var(--s-6);
  padding-top: var(--s-4);
  border-top: 1px solid var(--c-line-soft);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  justify-content: space-between;
  align-items: center;
  font-size: var(--t-xs);
  color: var(--c-ink-faint);
}

.staging-banner {
  background: repeating-linear-gradient(-45deg, #b91c1c 0 14px, #7f1d1d 14px 28px);
  color: #fff;
  text-align: center;
  padding: var(--s-2);
  font-weight: 800;
  font-size: var(--t-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.preview-banner {
  background: rgba(251, 191, 36, 0.15);
  border-bottom: 1px solid rgba(251, 191, 36, 0.5);
  color: var(--c-warn);
  text-align: center;
  padding: var(--s-2) var(--s-4);
  font-weight: 800;
  font-size: var(--t-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ==========================================================================
   14. Utilities
   ========================================================================== */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mb-4 { margin-bottom: var(--s-4); }
.mb-5 { margin-bottom: var(--s-5); }
.mt-4 { margin-top: var(--s-4); }
.mt-5 { margin-top: var(--s-5); }
.mt-6 { margin-top: var(--s-6); }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; }
.full-width { width: 100%; }
.nowrap { white-space: nowrap; }
.center-inline { justify-content: center; }
.mx-auto { margin-inline: auto; }
.justify-center { justify-content: center; }


.empty-state {
  padding: var(--s-7) var(--s-4);
  text-align: center;
  color: var(--c-ink-faint);
  border: 1px dashed var(--c-line);
  border-radius: var(--r-lg);
}

.empty-state p { margin-bottom: 0; }

/* ==========================================================================
   15. Motion & print
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .card:hover { transform: none; }
}

@media (prefers-contrast: more) {
  :root {
    --c-ink-dim: #dde5ec;
    --c-ink-faint: #a9b6c4;
    --c-line: #4a5c6f;
  }
}

@media print {
  body { background: #fff; color: #000; }
  .site-header,
  .site-footer,
  .hero-cta,
  .breadcrumbs,
  .pagination { display: none; }
  .prose { max-width: none; color: #000; }
  a::after { content: " (" attr(href) ")"; font-size: 0.85em; }
}

/* Abilities (PRD 10.3)
   Each ability shows the icon the game itself uses, so a player recognises the
   power on the page before they read its name. The row collapses to a single
   column only in the text - the icon keeps its size at every width, because a
   shrunken 250px sprite reads as a smudge. */
.ability-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--s-3);
}

.ability {
  display: flex;
  align-items: flex-start;
  gap: var(--s-4);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-lg);
  background: var(--c-shelf);
  border: 1px solid var(--c-line-soft);
  border-left: 4px solid var(--c-tape);
}

.ability-icon {
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: var(--r-md);
  background: var(--c-shelf-2);
  overflow: hidden;
}

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

/* Keeps the text aligned when an ability has no approved icon yet. */
.ability-icon-empty {
  border: 2px dashed var(--c-line);
  background: none;
}

.ability-body {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
  min-width: 0;
}

.ability-name {
  color: var(--c-tape);
  font-size: 1.05rem;
}

.ability-text { color: var(--c-ink-dim); }

@media (max-width: 30rem) {
  .ability { gap: var(--s-3); padding: var(--s-3); }
  .ability-icon { width: 56px; height: 56px; }
}

/* Campaign level thumbnails. The column is decorative - the level number and
   name carry the meaning - so it collapses away on a narrow screen rather than
   squeezing the two columns that matter. */
.col-thumb { width: 56px; }

.level-thumb {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: var(--r-sm);
  background: var(--c-shelf-2);
}

@media (max-width: 34rem) {
  .col-thumb { display: none; }
}

/* The Insane Mode badge. Normal has no badge in the game data, so the cards are
   deliberately asymmetric rather than carrying invented art. */
.difficulty-badge {
  display: block;
  width: 64px;
  height: 64px;
}

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

/* Boss cell in the campaign table: portrait beside the name. Wraps to one boss
   per line on a narrow screen rather than squashing the portraits. */
.boss-cell {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-3);
}

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

.boss-portrait {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
}

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

/* "In this article": the entities an article covers, each with its own art. */
.entity-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--s-1);
}

.entity-link {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-2);
  border-radius: var(--r-md);
  text-decoration: none;
  color: var(--c-ink);
}

.entity-link:hover,
.entity-link:focus-visible { background: var(--c-shelf-2); }

.entity-link-art {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
}

.entity-link-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.entity-link-art .art-placeholder { font-size: 0.7rem; }

.entity-link-name { min-width: 0; }

/* Game sprite inside a card.
   `.card-media img` defaults to `object-fit: cover`, which is right for a
   screenshot: fill the frame, crop the edges. It is wrong for a character
   sprite - the art is transparent, portrait-shaped and a different ratio for
   every hero, so `cover` scaled each one up until only its midriff was left.
   `contain` fits the whole sprite and centres it; the square frame suits the
   mix of tall heroes, wide weapons and square perks better than 16:9. */
.card-media-art {
  aspect-ratio: 1 / 1;
  background: var(--c-shelf-2);
}

/* The wrapper is pinned to the frame rather than sized in percentages.
   `picture` is `height: auto` in the reset, and a percentage height against a
   parent whose own height comes from `aspect-ratio` does not resolve - the
   image fell back to its intrinsic ratio and grew taller than the card. `inset`
   gives it a definite box, and doubles as the padding around the sprite.
   `.card-media` is already `position: relative`. */
.card-media-art picture {
  position: absolute;
  inset: var(--s-3);
  display: block;
}

.card-media img.entity-art,
.card-media-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

/* Weapons are wide and short; a square frame leaves them stranded in the
   middle, so give that one archive a shallower box. */
.entity-card-weapon .card-media-art { aspect-ratio: 4 / 3; }
