/* Recusant Crown — shared stylesheet */
:root {
  --bg: #0D0C0B;
  --surface: #1A1714;
  --text: #E8E0D5;
  --crimson: #C23B2A;
  --gold: #B08D57;
  --steel: #4A6B7C;
  --muted: #c9c0b4;
  --dim: #8a8175;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Georgia", "Times New Roman", serif;
  line-height: 1.5;
  min-height: 100vh;
  padding: 1.5rem 1rem 3rem;
}

.card {
  background: var(--surface);
  border: 3px solid var(--gold);
  box-shadow:
    0 0 0 5px var(--bg),
    0 0 0 8px var(--crimson),
    0 18px 40px rgba(0, 0, 0, 0.65);
  border-radius: 14px;
  position: relative;
}

.card::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(176, 141, 87, 0.4);
  border-radius: 9px;
  pointer-events: none;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

/* Header */
header.card {
  padding: 1.1rem 1.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  line-height: 1.05;
}

.brand-words {
  display: flex;
  flex-direction: column;
}

/* The X sigil, painted through its PNG as a mask */
.brand-x {
  flex: none;
  width: 4.2rem;
  aspect-ratio: 1000 / 567;
  background: #ECE6D6;
  -webkit-mask: url("../art/sigil/sigil-x.png") center / contain no-repeat;
  mask: url("../art/sigil/sigil-x.png") center / contain no-repeat;
}

.brand .title {
  font-size: 1.55rem;
  font-weight: bold;
  letter-spacing: 0.12em;
  color: var(--crimson);
  text-transform: uppercase;
}

.brand .subtitle {
  position: relative;
  align-self: flex-end;
  margin-right: -1.6rem;   /* "Crown" sticks out past "Recusant" */
  font-size: 0.95rem;
  letter-spacing: 0.28em;
  color: var(--gold);
  text-transform: uppercase;
  margin-top: 2px;
}

/* The crown hangs on the end of "Crown". The outer span falls in on
   load; the inner span holds the tilt and bounces on hover. */
.brand-crown {
  position: absolute;
  right: -0.425rem;
  bottom: 78%;
  width: 1.8rem;
  pointer-events: none;
  animation: brand-crown-fall 0.9s cubic-bezier(.25, 1.4, .4, 1) 0.25s both;
}

.brand-crown-inner {
  display: block;
  aspect-ratio: 1000 / 608;
  background: #D6B25E;
  transform: rotate(15deg);
  transform-origin: 50% 100%;
  -webkit-mask: url("../art/sigil/sigil-crown.png") center / contain no-repeat;
  mask: url("../art/sigil/sigil-crown.png") center / contain no-repeat;
}

.brand-crown-inner.is-bouncing {
  animation: brand-crown-bounce 0.7s ease-out;
}

@keyframes brand-crown-fall {
  from { opacity: 0; transform: translateY(-160%) rotate(-16deg); }
  to   { opacity: 1; transform: translateY(0) rotate(0); }
}

@keyframes brand-crown-bounce {
  0%   { transform: translateY(0) rotate(15deg); }
  30%  { transform: translateY(-45%) rotate(9deg); }
  55%  { transform: translateY(0) rotate(17deg); }
  75%  { transform: translateY(-15%) rotate(13deg); }
  100% { transform: translateY(0) rotate(15deg); }
}

@media (prefers-reduced-motion: reduce) {
  .brand-crown,
  .brand-crown-inner.is-bouncing { animation: none; }
}

nav {
  display: flex;
  gap: 1.4rem;
  flex-wrap: wrap;
}

nav a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

nav a:hover,
nav a.active {
  color: var(--gold);
}

/* Page title */
.page-title.card {
  padding: 1.5rem 1.75rem;
  text-align: center;
}

.page-title h1 {
  font-size: 1.6rem;
  letter-spacing: 0.12em;
  color: var(--gold);
  text-transform: uppercase;
}

.page-title p {
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.95rem;
}

/* Sections */
.section.card {
  padding: 1.6rem 1.5rem 1.8rem;
}

.section h2 {
  font-size: 1.25rem;
  color: var(--gold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(176, 141, 87, 0.35);
}

.section p {
  color: var(--muted);
  margin-bottom: 0.9rem;
  font-size: 0.98rem;
}

.section ul {
  margin: 0.6rem 0 1rem 1.3rem;
  color: var(--muted);
}

.section li {
  margin-bottom: 0.35rem;
}

.section .section-desc {
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 1.2rem;
}

/* Hero (index) */
.hero.card {
  padding: 2.75rem 1.75rem;
  text-align: center;
}

/* Recusant sigil intro (index hero). The sigil images are masks,
   so these colors repaint the drawings directly. */
.hero.rc-intro {
  --rc-sigil: #ECE6D6;
  --rc-crown: #D6B25E;
  --rc-text: #ECE6D6;
  --rc-crown-width: 30%;
  --rc-crown-left: 71%;
  --rc-crown-top: -33%;
  --rc-crown-tilt: -4deg;

  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1.25rem, 4vh, 2.5rem);
  padding-top: 6.5rem;
  padding-bottom: 3.5rem;
  color: var(--rc-text);
  font-family: "IM Fell English SC", Georgia, "Times New Roman", serif;
}

.rc-mark {
  position: relative;
  width: min(70vw, 440px);
  aspect-ratio: 1000 / 567;
}

.rc-x, .rc-crown {
  position: absolute;
  -webkit-mask-size: contain; mask-size: contain;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center;
}

.rc-x {
  inset: 0;
  background: var(--rc-sigil);
  -webkit-mask-image: url("../art/sigil/sigil-x.png");
  mask-image: url("../art/sigil/sigil-x.png");
}

.rc-crown {
  width: var(--rc-crown-width);
  aspect-ratio: 1000 / 608;
  left: var(--rc-crown-left);
  top: var(--rc-crown-top);
  transform: rotate(var(--rc-crown-tilt));
  background: var(--rc-crown);
  -webkit-mask-image: url("../art/sigil/sigil-crown.png");
  mask-image: url("../art/sigil/sigil-crown.png");
}

.rc-verb {
  height: 1.2em;
  font-size: clamp(2rem, 7vw, 3.4rem);
  line-height: 1.2;
  letter-spacing: 0.04em;
  text-align: center;
  min-width: 6em;
}

.rc-verb span { display: inline-block; }

.rc-title {
  margin: 0;
  font-weight: 400;
  font-size: clamp(1.1rem, 3.2vw, 1.6rem);
  letter-spacing: 0.22em;
  opacity: 0.88;
}

.rc-outro {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.4rem;
  font-family: Georgia, "Times New Roman", serif;
}

.hero .rc-outro p {
  margin: 0 auto;
  font-style: italic;
}

.rc-outro .btn {
  align-self: center;
}

.rc-replay {
  position: absolute;
  right: 1rem;
  bottom: 0.9rem;
  font: inherit;
  font-size: 0.85rem;
  color: var(--rc-text);
  background: transparent;
  border: 1px solid rgba(236, 230, 214, 0.35);
  border-radius: 2px;
  padding: 0.3em 0.8em;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.6s;
}

.rc-replay:focus-visible { outline: 2px solid var(--rc-crown); outline-offset: 3px; }
.rc-done .rc-replay { opacity: 0.6; }
.rc-done .rc-replay:hover { opacity: 1; }

/* Animation (only when it's allowed to play) */
.rc-play .rc-x     { opacity: 0; animation: rc-x-in 1.5s cubic-bezier(.2,.7,.2,1) 0.3s forwards; }
.rc-play .rc-crown { opacity: 0; animation: rc-crown-in 1s cubic-bezier(.25,1.4,.4,1) 1.7s forwards; }
.rc-play .rc-title { opacity: 0; }
.rc-play.rc-titled .rc-title { animation: rc-fade 1.8s ease forwards; }
.rc-play .rc-outro { opacity: 0; visibility: hidden; }
.rc-play.rc-titled .rc-outro { visibility: visible; animation: rc-fade-full 1.8s ease 0.6s forwards; }

@keyframes rc-x-in {
  from { opacity: 0; transform: scale(1.08); filter: blur(10px); }
  to   { opacity: 1; transform: scale(1);    filter: blur(0); }
}

@keyframes rc-crown-in {
  from { opacity: 0; transform: translateY(-60%) rotate(calc(var(--rc-crown-tilt) - 14deg)); }
  to   { opacity: 1; transform: translateY(0)    rotate(var(--rc-crown-tilt)); }
}

@keyframes rc-fade { from { opacity: 0; } to { opacity: 0.88; } }
@keyframes rc-fade-full { from { opacity: 0; } to { opacity: 1; } }

/* each flashing verb: a hard snap in, a shiver, gone */
.rc-flash { animation: rc-flash var(--rc-dur, 260ms) steps(1, end) forwards, rc-shiver var(--rc-dur, 260ms) linear; }

@keyframes rc-flash {
  0%   { opacity: 1; }
  82%  { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes rc-shiver {
  0%   { transform: translateX(var(--rc-jx, 0)) scaleY(1.08); text-shadow: 0 0 14px var(--rc-crown); }
  30%  { transform: translateX(0) scaleY(1); }
  100% { transform: translateX(0); text-shadow: none; }
}

/* the final word settles instead of flashing */
.rc-settle { animation: rc-settle 1.4s ease-out forwards; }

@keyframes rc-settle {
  0%   { opacity: 0; filter: blur(6px); letter-spacing: 0.3em; }
  100% { opacity: 1; filter: blur(0);   letter-spacing: 0.04em; }
}

@media (prefers-reduced-motion: reduce) {
  .rc-play .rc-x, .rc-play .rc-crown, .rc-play .rc-title, .rc-play .rc-outro {
    animation: none !important;
    opacity: 1;
    visibility: visible;
  }
}

.hero p {
  max-width: 28rem;
  margin: 1.1rem auto 0;
  color: var(--muted);
  font-size: 1.02rem;
}

/* Panels (index) */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.panel.card {
  padding: 1.6rem 1.5rem;
  display: flex;
  flex-direction: column;
  min-height: 210px;
}

.panel h2 {
  font-size: 1.25rem;
  color: var(--gold);
  letter-spacing: 0.07em;
  margin-bottom: 0.55rem;
  text-transform: uppercase;
}

.panel p {
  color: var(--muted);
  flex-grow: 1;
  margin-bottom: 1.2rem;
  font-size: 0.95rem;
}

.btn {
  display: inline-block;
  align-self: flex-start;
  padding: 0.5rem 1.2rem;
  border: 2px solid var(--crimson);
  color: var(--text);
  text-decoration: none;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 3px;
  transition: 0.2s ease;
}

.btn:hover {
  background: var(--crimson);
  color: var(--bg);
}

/* Spoiler card gallery (cards.html) */
.spoiler-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1.1rem;
  margin-top: 0.5rem;
}

.spoiler-card {
  background: #141210;
  border: 2px solid var(--gold);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(0,0,0,0.4);
  transition: transform 0.2s ease;
}

.spoiler-card:hover {
  transform: translateY(-3px);
}

/* Spoiler carousel (cards.html) */
.carousel {
  position: relative;
  margin-top: 0.5rem;
}

.carousel-track {
  display: flex;
  gap: 1.1rem;
  margin-top: 0;
  padding: 6px 2px 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.carousel-track::-webkit-scrollbar { display: none; }

.carousel-track:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
  border-radius: 6px;
}

.carousel-track .spoiler-card {
  flex: 0 0 calc((100% - 2 * 1.1rem) / 3);
  scroll-snap-align: start;
}

.carousel-btn {
  position: absolute;
  top: 42%;
  transform: translateY(-50%);
  z-index: 2;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  border: 2px solid var(--gold);
  background: rgba(13, 12, 11, 0.88);
  color: var(--gold);
  font-size: 1.6rem;
  line-height: 1;
  padding-bottom: 0.2rem;
  cursor: pointer;
  transition: 0.2s ease;
}

.carousel-btn:hover:not(:disabled) {
  background: var(--crimson);
  border-color: var(--crimson);
  color: var(--text);
}

.carousel-btn:disabled {
  opacity: 0;
  pointer-events: none;
}

.carousel-prev { left: -0.9rem; }
.carousel-next { right: -0.9rem; }

.carousel-status {
  margin-top: 0.6rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--dim);
  letter-spacing: 0.06em;
}

/* Card game layout: spoilers beside a thin Rules card (cards.html) */
.tcg-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  gap: 1.75rem;
  align-items: start;
}

.rules-card {
  display: flex;
  flex-direction: column;
}

.section .rules-card-lead {
  color: var(--text);
  font-style: italic;
  font-size: 1.05rem;
}

.rules-card .btn {
  align-self: stretch;
  text-align: center;
  margin-top: 0.4rem;
}

@media (max-width: 860px) {
  .tcg-layout { grid-template-columns: minmax(0, 1fr); }
}

/* Rulebook (rules.html) */
.rules-toc {
  display: block;
}

.rules-part h1 { font-size: 1.4rem; }

.rules-toc h3 {
  color: var(--text);
  font-size: 0.85rem;
  font-weight: normal;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 1rem 0 0.3rem;
}

.rules-toc h3:first-child { margin-top: 0; }

.rules-toc h3 a { color: var(--text); }

.rules-toc li a {
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.95rem;
}

.rules-toc ul {
  columns: 2;
  column-gap: 2rem;
  list-style: none;
  margin: 0.4rem 0 0.8rem;
}

.rules-toc li { break-inside: avoid; }

.rules-toc a,
.rules-section a,
.rules-back a {
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px solid rgba(176, 141, 87, 0.35);
}

.rules-toc a:hover,
.rules-section a:hover,
.rules-back a:hover { color: var(--text); border-bottom-color: var(--text); }

.section .rules-back { margin: 0.6rem 0 0; font-size: 0.9rem; }

.rules-section h3 {
  color: var(--text);
  font-size: 1.02rem;
  font-weight: bold;
  margin: 1.4rem 0 0.5rem;
}

.rules-section p,
.rules-section li { line-height: 1.6; }

.rules-section strong { color: var(--text); }

.rules-section ol { margin: 0.6rem 0 1rem 1.3rem; color: var(--muted); }

.rules-section li > p { margin-bottom: 0.4rem; }

.rules-section code {
  font-size: 0.88em;
  color: var(--text);
  background: #141210;
  padding: 0.05em 0.3em;
  border-radius: 3px;
}

.rules-table {
  overflow-x: auto;
  margin: 0.6rem 0 1.2rem;
}

.rules-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  color: var(--muted);
}

.rules-table th,
.rules-table td {
  text-align: left;
  vertical-align: top;
  padding: 0.5rem 0.7rem;
  border-bottom: 1px solid rgba(176, 141, 87, 0.25);
}

.rules-table th {
  color: var(--gold);
  font-weight: normal;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.78rem;
  border-bottom-color: rgba(176, 141, 87, 0.6);
}

.section .back-to-top {
  margin: 1.2rem 0 0;
  text-align: right;
  font-size: 0.85rem;
}

.section .back-to-top a { border-bottom: none; }

.rules-figure {
  margin: 1.2rem 0 1.4rem;
  padding: 0.8rem;
  background: #141210;
  border: 1px solid rgba(176, 141, 87, 0.3);
  border-radius: 8px;
  overflow-x: auto;
}

.rules-diagram {
  --dg-edge: rgba(201, 192, 180, 0.45);
  --dg-accent: var(--gold);
  --dg-anchor: var(--crimson);
  --dg-ink: var(--text);
  --dg-quiet: var(--muted);
  --dg-tint: rgba(176, 141, 87, 0.08);
  display: block;
  width: 100%;
  min-width: 520px;
  height: auto;
  font-family: Georgia, "Times New Roman", serif;
}

.rules-figure figcaption {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--dim);
  text-align: center;
}

@media (max-width: 560px) {
  .rules-toc ul { columns: 1; }
}

@media (max-width: 560px) {
  .carousel-track .spoiler-card { flex-basis: 62%; }
  .carousel-prev { left: -0.5rem; }
  .carousel-next { right: -0.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  .carousel-track { scroll-behavior: auto; }
}

.spoiler-card img {
  width: 100%;
  display: block;
  aspect-ratio: 2.5 / 3.5;
  object-fit: cover;
  border-bottom: 1px solid rgba(176, 141, 87, 0.3);
}

.spoiler-name {
  padding: 0.45rem 0.5rem;
  font-size: 0.78rem;
  color: var(--gold);
  text-align: center;
  letter-spacing: 0.03em;
}

/* Blog entries (cards.html) */
.blog-entry {
  background: #141210;
  border: 1px solid rgba(176, 141, 87, 0.35);
  border-radius: 8px;
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}

.blog-entry:last-child {
  margin-bottom: 0;
}

.blog-date {
  font-size: 0.78rem;
  color: var(--crimson);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.blog-title {
  font-size: 1.05rem;
  color: var(--gold);
  margin-bottom: 0.4rem;
}

.blog-body {
  font-size: 0.92rem;
  color: var(--muted);
}

.section .blog-body p {
  font-size: 0.95rem;
  line-height: 1.65;
  margin-bottom: 0.85rem;
}

.blog-body h4 {
  color: var(--gold);
  font-size: 0.95rem;
  font-weight: normal;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 1.5rem 0 0.6rem;
}

.section .blog-body .blog-pull {
  color: var(--text);
  font-size: 1.15rem;
  font-style: italic;
  text-align: center;
  margin: 1.2rem 0;
}

.section .blog-body .blog-sign {
  color: var(--text);
  font-style: italic;
  margin-bottom: 0;
}

.blog-body a,
.license-page a {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.blog-body a:hover,
.license-page a:hover {
  color: var(--text);
}

/* License page */
.license-page h3 {
  color: var(--text);
  font-size: 1rem;
  font-weight: normal;
  margin: 1.2rem 0 0.5rem;
}

.license-page .credit-line {
  border-left: 3px solid var(--crimson);
  padding: 0.6rem 0.9rem;
  background: #141210;
  color: var(--text);
  font-style: italic;
}

/* Chapter selector (fiction.html) */
.chapter-select {
  margin-top: 1.1rem;
  display: flex;
  justify-content: center;
}

.chapter-select select {
  background: #141210;
  color: var(--text);
  border: 2px solid var(--gold);
  padding: 0.5rem 1rem;
  font-family: Georgia, serif;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  border-radius: 6px;
  min-width: 220px;
  cursor: pointer;
}

.chapter-select select:focus {
  outline: none;
  border-color: var(--crimson);
}

/* Chapter cards (fiction.html) */
.chapters {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

.chapter-card {
  background: var(--surface);
  border: 3px solid var(--gold);
  box-shadow:
    0 0 0 4px var(--bg),
    0 0 0 7px var(--crimson),
    0 12px 28px rgba(0, 0, 0, 0.55);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease;
  scroll-margin-top: 1.5rem;
}

.chapter-card:hover {
  transform: translateY(-4px);
}

.chapter-card a {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.chapter-title {
  background: #141210;
  padding: 0.7rem 0.9rem;
  font-size: 1.05rem;
  color: var(--gold);
  letter-spacing: 0.05em;
  text-align: center;
  border-bottom: 2px solid var(--crimson);
}

.chapter-art {
  aspect-ratio: 3 / 2;
  background: #0f0e0c;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #5c5349;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  border-bottom: 1px solid rgba(176, 141, 87, 0.35);
  overflow: hidden;
}

.chapter-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.chapter-subtype {
  background: #141210;
  padding: 0.35rem 0.9rem;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: var(--crimson);
  text-transform: uppercase;
  border-bottom: 1px solid rgba(176, 141, 87, 0.35);
}

.chapter-text {
  padding: 0.85rem 0.95rem 1.1rem;
  font-size: 0.9rem;
  color: var(--muted);
  flex-grow: 1;
}

/* Gallery (art.html) */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.1rem;
}

.art-piece {
  background: #141210;
  border: 2px solid var(--gold);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(0,0,0,0.4);
  transition: transform 0.2s ease;
}

.art-piece:hover {
  transform: translateY(-4px);
}

.art-piece img {
  width: 100%;
  display: block;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-bottom: 1px solid rgba(176, 141, 87, 0.3);
}

.art-caption {
  padding: 0.5rem 0.6rem 0.65rem;
  font-size: 0.8rem;
  color: var(--gold);
  text-align: center;
  letter-spacing: 0.03em;
}

.art-note {
  font-size: 0.72rem;
  color: var(--dim);
  margin-top: 0.15rem;
}

/* Footer */
footer.card {
  padding: 0.9rem 1.4rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--dim);
  letter-spacing: 0.04em;
}


/* Contact section (index.html) */
.contact.card {
  margin-top: 1.5rem;
  padding: 1.6rem 1.5rem;
}

.contact h2 {
  font-size: 1.25rem;
  color: var(--gold);
  letter-spacing: 0.07em;
  margin-bottom: 0.55rem;
  text-transform: uppercase;
}

.contact p {
  color: var(--muted);
  margin-bottom: 1.2rem;
  font-size: 0.95rem;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.contact-item {
  display: inline-block;
  color: var(--muted);
  font-size: 0.9rem;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border: 1px solid rgba(176, 141, 87, 0.3);
  border-radius: 3px;
  transition: 0.2s ease;
}

a.contact-item:hover {
  border-color: var(--crimson);
  color: var(--crimson);
}

footer.card a {
  color: var(--dim);
  text-decoration: none;
  border-bottom: 1px solid rgba(201, 192, 180, 0.3);
  transition: 0.2s ease;
}

footer.card a:hover {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

footer.card .footer-license {
  margin-top: 0.5rem;
  font-size: 0.74rem;
  line-height: 1.5;
}

/* Responsive */
@media (max-width: 680px) {
  .grid {
    grid-template-columns: 1fr;
  }
  header.card {
    flex-direction: column;
    text-align: center;
  }
  nav {
    justify-content: center;
  }
}

/* Chapter reading page (chapters/) */
.chapter-header.card {
  padding: 1.5rem 1.75rem;
  text-align: center;
}

.chapter-header h1 {
  font-size: 1.6rem;
  letter-spacing: 0.1em;
  color: var(--gold);
  text-transform: uppercase;
}

.chapter-header .chapter-tag {
  margin-top: 0.4rem;
  color: var(--crimson);
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.chapter-hero {
  border-radius: 12px;
  overflow: hidden;
  border: 3px solid var(--gold);
  box-shadow: 0 0 0 5px var(--bg), 0 0 0 8px var(--crimson);
}

.chapter-hero img {
  width: 100%;
  display: block;
  max-height: 60vh;
  object-fit: cover;
}

.chapter-body {
  padding: 2rem 1.75rem;
  font-size: 1.02rem;
  line-height: 1.75;
  color: var(--muted);
}

.chapter-body p {
  margin-bottom: 1.15rem;
}

.chapter-body p:last-child {
  margin-bottom: 0;
}

.chapter-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.chapter-nav .btn {
  align-self: auto;
}

.chapter-nav .btn.disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* Lightbox overlay (shared) */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.92);
  z-index: 1000;
  cursor: zoom-out;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 2rem;
}

.lightbox.open {
  display: flex;
}

.lightbox-caption {
  margin-top: 1rem;
  color: var(--gold);
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  text-align: center;
}

.lightbox-note {
  color: var(--dim);
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

/* Lightbox stage, close, zoom (shared) */
.lightbox-stage {
  max-width: 90vw;
  max-height: 80vh;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.lightbox-stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border: 3px solid var(--gold);
  border-radius: 8px;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
  transition: transform 0.2s ease;
  transform-origin: center center;
  cursor: grab;
}

.lightbox-stage img:active {
  cursor: grabbing;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  background: none;
  border: 2px solid var(--gold);
  color: var(--gold);
  font-size: 1.8rem;
  line-height: 1;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  cursor: pointer;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s ease;
}

.lightbox-close:hover {
  background: var(--crimson);
  border-color: var(--crimson);
  color: var(--bg);
}

.lightbox-zoom-controls {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(20, 18, 16, 0.9);
  border: 2px solid var(--gold);
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
  z-index: 1100;
}

.lightbox-zoom-btn {
  background: none;
  border: 1px solid var(--gold);
  color: var(--gold);
  font-size: 1rem;
  width: 2rem;
  height: 2rem;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s ease;
}

.lightbox-zoom-btn:hover {
  background: var(--gold);
  color: var(--bg);
}

.lightbox-zoom-label {
  color: var(--gold);
  font-size: 0.8rem;
  min-width: 3.2rem;
  text-align: center;
  letter-spacing: 0.04em;
}
