/* Matji & Co. — design system
   Implements the approved "selected synthesis" direction: warm cream paper,
   charcoal-ink framed panels, matcha greens, one rose accent, editorial
   Fraunces + Nunito Sans, generous picture-book composition. */

/* ---------------------------------------------------------------- fonts */
@font-face { font-family: "Fraunces"; src: url("/fonts/fraunces-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("/fonts/fraunces-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("/fonts/fraunces-latin-900-normal.woff2") format("woff2"); font-weight: 900; font-display: swap; }
@font-face { font-family: "Nunito Sans"; src: url("/fonts/nunito-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Nunito Sans"; src: url("/fonts/nunito-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Nunito Sans"; src: url("/fonts/nunito-sans-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Nunito Sans"; src: url("/fonts/nunito-sans-latin-800-normal.woff2") format("woff2"); font-weight: 800; font-display: swap; }

/* ---------------------------------------------------------------- tokens */
:root {
  --paper: #f6efd4;
  --paper-deep: #efe5c0;
  --panel: #fbf6e5;
  --panel-tint: #f3ecce;
  --ink: #2b2519;
  --ink-soft: #6d6450;
  --ink-faint: #a49a80;
  --line: rgba(43, 37, 25, 0.92);
  --matcha: #7a8f35;
  --matcha-deep: #55672a;
  --matcha-bright: #a9bd54;
  --matcha-pale: #e7ebc8;
  --rose: #d9527e;
  --rose-deep: #b93a63;
  --olive: #6e7a33;
  --frame: 2.5px solid var(--line);
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 3px 0 rgba(43, 37, 25, 0.16);
  --shadow-lift: 0 10px 24px rgba(43, 37, 25, 0.16), 0 3px 0 rgba(43, 37, 25, 0.16);
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Nunito Sans", "Segoe UI", system-ui, sans-serif;
  --measure: 64ch;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  position: relative;
}
/* paper grain */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.26 0 0 0 0 0.22 0 0 0 0 0.13 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
}
main, header.site, footer.site { position: relative; z-index: 1; }

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
::selection { background: var(--matcha-bright); color: var(--ink); }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px); }

/* ---------------------------------------------------------------- header */
header.site {
  border-bottom: var(--frame);
  background: color-mix(in srgb, var(--paper) 88%, #fff 12%);
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(3px);
}
.masthead {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px clamp(16px, 4vw, 40px);
  max-width: 1160px;
  margin: 0 auto;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-weight: 900;
  font-size: 1.45rem; letter-spacing: 0.01em;
  text-decoration: none; color: var(--ink);
  white-space: nowrap;
}
.logo img { width: 34px; height: 34px; border: 2px solid var(--line); border-radius: 10px; background: var(--panel); }
nav.primary { margin-left: auto; display: flex; align-items: center; gap: 4px; overflow-x: auto; }
nav.primary a {
  text-decoration: none; font-weight: 700; font-size: 0.98rem;
  color: var(--ink); padding: 7px 13px; border-radius: 999px;
  border: 2px solid transparent; white-space: nowrap;
}
nav.primary a:hover { border-color: var(--line); background: var(--panel); }
nav.primary a[aria-current="page"] { background: var(--matcha-bright); border-color: var(--line); }
.cart-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; margin-left: 8px; flex: none;
  background: var(--rose); border: 2.5px solid var(--line); border-radius: 999px;
  color: #fff; text-decoration: none; box-shadow: var(--shadow);
}
.cart-btn:hover { background: var(--rose-deep); transform: translateY(-1px); }
.cart-btn svg { width: 19px; height: 19px; }
.cart-count {
  position: absolute; top: -7px; right: -7px; min-width: 20px; height: 20px;
  border-radius: 999px; background: var(--ink); color: var(--paper);
  font-size: 0.72rem; font-weight: 800; display: none;
  align-items: center; justify-content: center; padding: 0 5px;
  border: 2px solid var(--paper);
}
.cart-count.show { display: inline-flex; }

/* ---------------------------------------------------------------- panels */
.panel {
  background: var(--panel);
  border: var(--frame);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.panel-pad { padding: clamp(22px, 3.5vw, 40px); }

section.band { padding: clamp(26px, 4.5vw, 54px) 0 0; }
section.band:last-of-type { padding-bottom: clamp(30px, 5vw, 60px); }

.kicker {
  font-size: 0.78rem; font-weight: 800; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--olive); margin: 0 0 8px;
}
h1, h2, h3 { font-family: var(--font-display); line-height: 1.12; margin: 0; }
h1 { font-weight: 900; font-size: clamp(2.3rem, 5.4vw, 3.7rem); letter-spacing: -0.01em; }
h2 { font-weight: 700; font-size: clamp(1.55rem, 3vw, 2.2rem); }
h3 { font-weight: 700; font-size: 1.18rem; }
.lede { font-size: 1.08rem; color: var(--ink-soft); max-width: var(--measure); }
.section-head { margin-bottom: clamp(16px, 2.5vw, 26px); }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-body); font-weight: 800; font-size: 1rem;
  padding: 11px 22px; border-radius: 999px; cursor: pointer;
  border: 2.5px solid var(--line); text-decoration: none;
  box-shadow: var(--shadow); transition: transform 0.12s ease, background 0.12s ease;
}
.btn:active { transform: translateY(2px); box-shadow: none; }
.btn-rose { background: var(--rose); color: #fff; }
.btn-rose:hover { background: var(--rose-deep); }
.btn-ghost { background: var(--panel); color: var(--ink); }
.btn-ghost:hover { background: var(--matcha-pale); }
.btn-matcha { background: var(--matcha-bright); color: var(--ink); }
.btn-matcha:hover { background: var(--matcha); color: #fff; }
.btn-small { padding: 7px 14px; font-size: 0.9rem; }

/* ---------------------------------------------------------------- hero */
.hero { margin-top: clamp(20px, 3.5vw, 42px); }
.hero .panel { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: stretch; }
.hero-copy { padding: clamp(26px, 4vw, 52px); display: flex; flex-direction: column; justify-content: center; gap: 18px; }
.hero-copy h1 { max-width: 11ch; }
.hero-copy .lede { font-size: 1.12rem; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.hero-art { position: relative; border-left: var(--frame); min-height: 300px; }
.hero-art img, .hero-art picture { width: 100%; height: 100%; object-fit: cover; }
.hero-art picture img { height: 100%; }

/* ---------------------------------------------------------------- cards */
.grid { display: grid; gap: clamp(14px, 2vw, 22px); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card { display: flex; flex-direction: column; text-decoration: none; transition: transform 0.15s ease, box-shadow 0.15s ease; }
a.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.card-art { border-bottom: var(--frame); background: var(--panel-tint); }
.card-art img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.card-art.square img { aspect-ratio: 1; }
.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.card-body .kicker { margin: 0; }
.card-body p { margin: 0; color: var(--ink-soft); font-size: 0.95rem; }
.card-title { font-family: var(--font-display); font-weight: 700; font-size: 1.22rem; line-height: 1.2; }

.tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.78rem; font-weight: 800; padding: 3px 10px;
  border: 2px solid var(--line); border-radius: 999px; background: var(--panel);
}
.tag.comic { background: var(--matcha-bright); }
.tag .dot { width: 9px; height: 9px; border-radius: 999px; border: 1.5px solid var(--line); }

/* ---------------------------------------------------------------- lineup */
.lineup { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.lineup .card-art img { aspect-ratio: 1; }
.lineup .card-body { padding: 12px 14px 14px; gap: 3px; }
.lineup .card-title { font-size: 1.08rem; }
.lineup .card-body p { font-size: 0.87rem; }

/* ---------------------------------------------------------------- feature band */
.feature { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.feature.flip { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.feature-art { border-right: var(--frame); }
.feature.flip .feature-art { border-right: none; border-left: var(--frame); order: 2; }
.feature-art img { width: 100%; height: 100%; object-fit: cover; min-height: 240px; }
.feature-copy { padding: clamp(22px, 3.5vw, 44px); display: flex; flex-direction: column; justify-content: center; gap: 14px; align-items: flex-start; }

/* ---------------------------------------------------------------- stories index */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0 26px; }
.filters button {
  font: inherit; font-weight: 800; font-size: 0.9rem;
  padding: 7px 15px; border-radius: 999px; cursor: pointer;
  border: 2px solid var(--line); background: var(--panel); color: var(--ink);
}
.filters button[aria-pressed="true"] { background: var(--matcha-bright); }
.filters button:hover { background: var(--matcha-pale); }
.ep-card .card-body { gap: 6px; }
.ep-number {
  font-family: var(--font-display); font-weight: 900; font-size: 2.4rem;
  color: var(--matcha); line-height: 1; opacity: 0.85;
}
.ep-card[hidden] { display: none; }

/* ---------------------------------------------------------------- episode page */
.progress {
  position: fixed; top: 0; left: 0; height: 4px; width: 0%;
  background: var(--matcha); z-index: 60; transition: width 0.1s linear;
}
.ep-head { margin-top: clamp(20px, 3.5vw, 42px); }
.ep-head .panel-pad { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.ep-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ep-cast { display: flex; align-items: center; gap: 6px; }
.ep-cast img { width: 34px; height: 34px; border-radius: 10px; border: 2px solid var(--line); background: var(--panel-tint); }
.view-toggle { display: inline-flex; border: 2.5px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--panel); box-shadow: var(--shadow); }
.view-toggle button {
  font: inherit; font-weight: 800; font-size: 0.95rem; padding: 9px 20px;
  border: none; background: transparent; cursor: pointer; color: var(--ink);
}
.view-toggle button[aria-pressed="true"] { background: var(--matcha-bright); }
.view-toggle button + button { border-left: 2.5px solid var(--line); }

.comic-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(14px, 2vw, 24px); margin-top: 22px; }
.frame-btn {
  padding: 0; border: var(--frame); border-radius: var(--radius);
  overflow: hidden; cursor: zoom-in; background: var(--panel-tint);
  box-shadow: var(--shadow); transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: block; width: 100%;
}
.frame-btn:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.frame-btn img { width: 100%; display: block; }

.story-flow { margin-top: 22px; display: flex; flex-direction: column; gap: clamp(18px, 3vw, 30px); }
.story-flow .prose { max-width: var(--measure); margin: 0 auto; font-size: 1.14rem; line-height: 1.8; width: 100%; }
.story-flow .prose p { margin: 0; }
.story-flow figure { margin: 0; }
.story-only .prose { max-width: var(--measure); margin: 26px auto 0; font-size: 1.15rem; line-height: 1.85; display: flex; flex-direction: column; gap: 1.1em; }
.story-only .prose p { margin: 0; }
.story-only .prose p:first-child::first-letter {
  font-family: var(--font-display); font-weight: 900; font-size: 3.3em;
  float: left; line-height: 0.85; padding: 0.04em 0.12em 0 0; color: var(--matcha-deep);
}
.brewing {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 26px;
  border: 2px dashed var(--ink-faint); border-radius: var(--radius-sm);
  padding: 10px 18px; color: var(--ink-soft); font-weight: 700; font-size: 0.95rem;
  transform: rotate(-1deg); background: var(--panel);
}

.ep-nav { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(14px, 2vw, 22px); margin-top: clamp(26px, 4vw, 44px); }
.ep-nav .card-body { padding: 14px 16px; }
.ep-nav .next { text-align: right; align-items: flex-end; }

/* ---------------------------------------------------------------- lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 80; display: none;
  background: rgba(32, 28, 18, 0.93); padding: clamp(10px, 3vw, 40px);
  flex-direction: column; align-items: center; justify-content: center; gap: 14px;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: min(1400px, 100%); max-height: 76vh; width: auto;
  border: 3px solid var(--paper); border-radius: 12px; background: var(--paper);
}
.lb-caption { color: var(--paper); font-size: 0.98rem; max-width: 70ch; text-align: center; opacity: 0.9; }
.lb-bar { display: flex; align-items: center; gap: 14px; color: var(--paper); font-weight: 700; }
.lb-bar button {
  font: inherit; font-weight: 800; cursor: pointer; color: var(--ink);
  background: var(--paper); border: 2.5px solid var(--line); border-radius: 999px; padding: 8px 18px;
}
.lb-bar button:hover { background: var(--matcha-bright); }
.lb-close { position: absolute; top: 18px; right: 22px; }

/* ---------------------------------------------------------------- characters */
.char-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
.char-row .card-art { border-bottom: none; border-right: var(--frame); }
.char-row .card-art img { width: 100%; height: 100%; aspect-ratio: auto; object-fit: cover; }
@media (max-width: 620px) {
  .char-row { grid-template-columns: 1fr; }
  .char-row .card-art { border-right: none; border-bottom: var(--frame); }
  .char-row .card-art img { aspect-ratio: 1; }
}
.char-card .card-art { position: relative; }
.char-card .swatch {
  position: absolute; top: 12px; right: 12px; width: 26px; height: 26px;
  border-radius: 999px; border: 2.5px solid var(--line); box-shadow: var(--shadow);
}
.char-card dl { margin: 6px 0 0; display: flex; flex-direction: column; gap: 7px; }
.char-card dt { font-size: 0.74rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--olive); }
.char-card dd { margin: 1px 0 0; font-size: 0.93rem; color: var(--ink-soft); }
.zen { font-style: italic; color: var(--matcha-deep); font-weight: 600; }
.rules-list { margin: 12px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; max-width: 60ch; }
.rules-list li { display: flex; gap: 12px; align-items: baseline; font-size: 1.02rem; }
.rules-list li::before { content: "●"; color: var(--matcha); flex: none; font-size: 0.8em; }

/* ---------------------------------------------------------------- world */
.cast-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cast-card { padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; }
.cast-card .role { font-size: 0.8rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--rose-deep); }
.cast-card p { margin: 0; font-size: 0.93rem; color: var(--ink-soft); }

/* ---------------------------------------------------------------- cafe / menu */
.menu-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.menu-card { position: relative; }
.menu-card .card-art { position: relative; }
.menu-char {
  position: absolute; bottom: 10px; left: 12px;
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--panel); border: 2px solid var(--line); border-radius: 999px;
  padding: 3px 11px 3px 4px; font-size: 0.8rem; font-weight: 800; box-shadow: var(--shadow);
}
.menu-char img { width: 24px; height: 24px; border-radius: 8px; border: 1.5px solid var(--line); }
.menu-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 12px; }
.price { font-family: var(--font-display); font-weight: 700; font-size: 1.18rem; }
.add-btn {
  font: inherit; font-weight: 800; font-size: 0.9rem; cursor: pointer;
  padding: 8px 16px; border-radius: 999px; border: 2.5px solid var(--line);
  background: var(--matcha-bright); color: var(--ink); box-shadow: var(--shadow);
  transition: transform 0.12s ease, background 0.12s ease;
}
.add-btn:hover { background: var(--matcha); color: #fff; }
.add-btn:active { transform: translateY(2px); box-shadow: none; }
.add-btn.added { background: var(--matcha-deep); color: #fff; }

.ritual-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
.ritual-steps .step { border: 2px solid var(--line); border-radius: var(--radius-sm); padding: 16px 18px; background: var(--panel); }
.ritual-steps .step b { font-family: var(--font-display); font-size: 1.05rem; display: block; margin-bottom: 4px; }
.ritual-steps .step span { color: var(--ink-soft); font-size: 0.93rem; }
.step-no {
  display: inline-flex; width: 28px; height: 28px; border-radius: 999px;
  background: var(--matcha-bright); border: 2px solid var(--line);
  align-items: center; justify-content: center; font-weight: 800; font-size: 0.9rem; margin-bottom: 8px;
}

/* order area */
.order-panel { scroll-margin-top: 90px; }
.order-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(16px, 2.5vw, 28px); align-items: start; }
.cart-lines { display: flex; flex-direction: column; gap: 0; }
.cart-line { display: flex; align-items: center; gap: 12px; padding: 13px 2px; border-bottom: 2px dashed var(--ink-faint); }
.cart-line:last-child { border-bottom: none; }
.cart-line .n { font-weight: 800; }
.cart-line .sub { color: var(--ink-soft); font-size: 0.86rem; }
.qty { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }
.qty button {
  width: 28px; height: 28px; border-radius: 999px; border: 2px solid var(--line);
  background: var(--panel); font-weight: 800; cursor: pointer; font-size: 1rem; line-height: 1;
}
.qty button:hover { background: var(--matcha-pale); }
.cart-line .amt { width: 76px; text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.cart-total { display: flex; justify-content: space-between; padding: 16px 2px 2px; font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; }
.cart-empty { color: var(--ink-soft); padding: 10px 2px 4px; }
.order-form { display: flex; flex-direction: column; gap: 13px; }
.order-form label { font-weight: 800; font-size: 0.9rem; display: flex; flex-direction: column; gap: 6px; }
.order-form input, .order-form select, .order-form textarea {
  font: inherit; padding: 10px 14px; border: 2.5px solid var(--line);
  border-radius: var(--radius-sm); background: #fffdf4; color: var(--ink); width: 100%;
}
.order-form input:focus-visible, .order-form select:focus-visible, .order-form textarea:focus-visible { outline: 3px solid var(--matcha-bright); outline-offset: 1px; }
.order-form textarea { resize: vertical; min-height: 70px; }

/* order slip */
.slip { text-align: center; padding: clamp(24px, 4vw, 44px); display: none; flex-direction: column; align-items: center; gap: 12px; }
.slip.show { display: flex; }
.slip .no { font-family: var(--font-display); font-weight: 900; font-size: 2.6rem; }
.slip .stamp {
  font-family: var(--font-display); font-weight: 900; font-size: 1.5rem; color: var(--rose-deep);
  border: 3px solid var(--rose-deep); border-radius: 12px; padding: 6px 20px;
  transform: rotate(-6deg); margin: 8px 0 2px; letter-spacing: 0.06em;
}
@keyframes stamp-in { 0% { transform: rotate(-6deg) scale(2.2); opacity: 0; } 60% { transform: rotate(-6deg) scale(0.94); opacity: 1; } 100% { transform: rotate(-6deg) scale(1); } }
.slip.show .stamp { animation: stamp-in 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.2) both; }
.slip .lines { color: var(--ink-soft); max-width: 46ch; }
.small-print { color: var(--ink-soft); font-size: 0.87rem; max-width: 60ch; }

/* ---------------------------------------------------------------- footer */
footer.site { border-top: var(--frame); margin-top: clamp(34px, 6vw, 70px); background: var(--paper-deep); }
.foot { display: flex; flex-wrap: wrap; gap: 26px; align-items: flex-start; justify-content: space-between; padding: clamp(24px, 4vw, 40px) clamp(16px, 4vw, 40px); max-width: 1160px; margin: 0 auto; }
.foot .brand { font-family: var(--font-display); font-weight: 900; font-size: 1.3rem; }
.foot nav { display: flex; gap: 16px; flex-wrap: wrap; }
.foot nav a { font-weight: 700; text-decoration: none; }
.foot nav a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.foot .quiet { width: 100%; color: var(--ink-soft); font-size: 0.9rem; border-top: 2px dashed var(--ink-faint); padding-top: 16px; display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }

/* ---------------------------------------------------------------- reveal
   Hidden state only applies once JS has stamped html.js — content is never
   lost without scripts. */
html.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.55s ease, transform 0.55s ease; }
html.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .add-btn, .frame-btn, a.card { transition: none; }
  .slip.show .stamp { animation: none; }
}

/* ---------------------------------------------------------------- responsive */
@media (max-width: 980px) {
  .grid-4, .lineup { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3, .menu-grid, .cast-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero .panel { grid-template-columns: 1fr; }
  .hero-art { border-left: none; border-top: var(--frame); order: -1; min-height: 0; }
  .hero-art img { max-height: 46vh; }
  .feature, .feature.flip { grid-template-columns: 1fr; }
  .feature-art, .feature.flip .feature-art { border-right: none; border-left: none; border-bottom: var(--frame); order: -1; }
  .order-grid { grid-template-columns: 1fr; }
  .ritual-steps { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .grid-2, .grid-3, .menu-grid, .cast-grid { grid-template-columns: 1fr; }
  .comic-grid { grid-template-columns: 1fr; }
  .masthead { flex-wrap: wrap; gap: 8px 14px; padding-bottom: 8px; }
  nav.primary { margin-left: 0; width: calc(100% - 50px); }
  .cart-btn { position: absolute; top: 10px; right: clamp(16px, 4vw, 40px); }
  .ep-nav { grid-template-columns: 1fr; }
  .lineup { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body { font-size: 15.5px; }
}
