/* MYTH card catalogue pages (/myth/cards/<ID>/ and /myth/cards/).
   Washi paper ground, ink type, one seal-red accent on the Play link.
   Print-and-material: no panels, borders, shadows, gradients or tracked caps. */

@font-face {
  font-family: "Noto Serif Display";
  src: url("/myth-meta/fonts/NotoSerifDisplay-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Noto Serif";
  src: url("/myth-meta/fonts/NotoSerif-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Noto Serif";
  src: url("/myth-meta/fonts/NotoSerif-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #ede6d6;
  --ink: #1b1814;
  --ink-2: #463e34;
  --seal: #a8261b;
  --serif: "Noto Serif", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --display: "Noto Serif Display", "Noto Serif", Georgia, serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.55;
}

/* Paper grain: the same feTurbulence approach as the pavilion first page. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.16;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.86' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

.top, main, .pager {
  position: relative;
  z-index: 1;
}

a { color: inherit; }
a:focus-visible {
  outline: 2px solid var(--seal);
  outline-offset: 3px;
  border-radius: 1px;
}

/* ---------- top line ---------- */

.top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px 32px 0;
}
.top .brand { display: flex; align-items: center; min-height: 44px; }
.top .brand img { height: 26px; width: auto; display: block; }
.top nav { display: flex; gap: 22px; }
.top nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 18px;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
  text-decoration-color: var(--ink-2);
}
.top nav a:hover { text-decoration-color: var(--ink); }

/* ---------- hero ---------- */

.hero {
  max-width: 1180px;
  margin: 0 auto;
  padding: 40px 32px 8px;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: clamp(32px, 4.5vw, 64px);
  align-items: start;
}

.art { margin: 0; line-height: 0; }
.art picture { display: block; }
.art img {
  display: block;
  width: 100%;
  height: auto;
  mix-blend-mode: multiply;
}

.facts { min-width: 0; padding-top: 6px; }

.facts h1 {
  margin: 0 0 10px;
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.facts h1.nm-xl { font-size: clamp(26px, 2.6vw, 32px); }
.facts h1.nm-l  { font-size: clamp(30px, 3.1vw, 38px); }
.facts h1.nm-m  { font-size: clamp(34px, 3.6vw, 44px); }
.facts h1.nm-s  { font-size: clamp(38px, 4.2vw, 52px); }

.type-line {
  margin: 0 0 14px;
  font-size: 19px;
  color: var(--ink-2);
}

.stats { margin: 0 0 10px; font-size: 19px; }

.kw {
  margin: 0 0 18px;
  font-size: 18px;
  color: var(--ink-2);
}

.rules { margin: 0 0 34px; font-size: 20px; }
.rules p { margin: 0 0 12px; }
.rules p:last-child { margin-bottom: 0; }
.rules .boon-label { font-weight: 700; }

/* ---------- actions ---------- */

.acts { margin: 0 0 40px; padding: 0; list-style: none; }
.acts .act { margin: 0 0 26px; }
.acts .act:last-child { margin-bottom: 0; }
.acts .act-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(24px, 2.3vw, 30px);
  line-height: 1.15;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 7px;
  text-decoration-color: var(--ink);
}
.acts .act-link:hover { text-decoration-color: var(--seal); }
.acts .act-link.play { color: var(--seal); }
.acts .act-s {
  margin: 6px 0 0;
  max-width: 46ch;
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink-2);
}

/* ---------- pager ---------- */

.pager {
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px 32px 56px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.pager a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 18px;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
  text-decoration-color: var(--ink-2);
}
.pager a:hover { text-decoration-color: var(--ink); }
.pager .all { color: var(--ink-2); }
.pager .pg-side { max-width: 34ch; overflow-wrap: anywhere; }
.pager .pg-prev { text-align: left; }
.pager .pg-next { text-align: right; }

/* ---------- index page ---------- */

.index-main {
  max-width: 1320px;
  margin: 0 auto;
  padding: 48px 32px 80px;
}
.index-main > h1 {
  margin: 0 0 12px;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(38px, 5vw, 56px);
  line-height: 1.03;
  letter-spacing: -0.01em;
}
.index-main > .lede { margin: 0; font-size: 20px; color: var(--ink-2); }
.tradition-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  gap: 24px;
  margin: 28px 0 0;
  padding: 8px 0;
  overflow-x: auto;
  background: var(--paper);
  scrollbar-width: thin;
}
.tradition-bar a {
  flex: 0 0 auto;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  font-size: 17px;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
  text-decoration-color: var(--ink-2);
}
.tradition-bar a:hover { text-decoration-color: var(--seal); }
.index-main .culture { margin: 42px 0 0; scroll-margin-top: 76px; }
.index-main h2 {
  margin: 0 0 18px;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1.15;
}
.index-main .culture-count {
  margin-left: 10px;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 400;
  color: var(--ink-2);
}
.art-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.art-grid li { min-width: 0; }
.card-thumb { position: relative; display: block; }
.card-thumb img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  mix-blend-mode: multiply;
}
.card-thumb .thumb-name {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  max-height: 4.2em;
  padding: 7px 8px;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.25;
  opacity: 0;
  transform: translateY(5px);
  transition: opacity 120ms ease, transform 120ms ease;
  pointer-events: none;
}
.card-thumb:hover .thumb-name,
.card-thumb:focus .thumb-name,
.card-thumb:active .thumb-name {
  opacity: 1;
  transform: translateY(0);
}
.card-thumb:focus-visible { outline-offset: -3px; }
.source-index.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- small screens ---------- */

@media (max-width: 760px) {
  .top { padding: 20px 20px 0; }
  .top nav { gap: 16px; }
  .top nav a { font-size: 16px; }
  .hero {
    display: block;
    padding: 26px 20px 0;
  }
  .art { margin: 0 -20px; }
  .art img { width: 100%; }
  .facts { padding: 26px 0 0; }
  .facts h1.nm-xl { font-size: 27px; }
  .facts h1.nm-l  { font-size: 30px; }
  .facts h1.nm-m  { font-size: 34px; }
  .facts h1.nm-s  { font-size: 38px; }
  .rules { font-size: 19px; }
  .acts .act-link { font-size: 25px; }
  .pager { padding: 22px 20px 48px; }
  .index-main { padding: 36px 20px 64px; }
  .tradition-bar { gap: 20px; margin-top: 22px; }
  .index-main .culture { margin-top: 34px; scroll-margin-top: 72px; }
  .art-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .card-thumb .thumb-name { padding: 5px; font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  .card-thumb .thumb-name { transition: none; transform: none; }
}
