@font-face {
  font-family: "Jacquard 12";
  src: url("fonts/Jacquard12-Regular.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "VT323";
  src: url("fonts/VT323-Regular.ttf") format("truetype");
  font-display: swap;
}

:root {
  --ink: #080912;
  --ink-soft: #111426;
  --ink-raised: #171b31;
  --bone: #f3e8c8;
  --bone-dim: #c8b78e;
  --ruby: #d22d4f;
  --ruby-deep: #75152c;
  --cobalt: #2c65d4;
  --cobalt-deep: #102d73;
  --gold: #f1c86a;
  --gold-hot: #ffe5a0;
  --green: #5df59d;
  --green-deep: #123f2b;
  --line: rgba(241, 200, 106, 0.35);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.52);
  --rail: 116px;
  --gutter: clamp(18px, 4vw, 56px);
  --display: "Jacquard 12", "Songti SC", "STSong", serif;
  --body: "VT323", "PingFang SC", "Microsoft YaHei", monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scrollbar-color: var(--ruby) var(--ink);
}

body {
  margin: 0;
  color: var(--bone);
  background:
    radial-gradient(circle at 62% 8%, rgba(44, 101, 212, 0.18), transparent 28rem),
    radial-gradient(circle at 20% 48%, rgba(117, 21, 44, 0.18), transparent 34rem),
    linear-gradient(180deg, #090a14 0%, #05060c 100%);
  font-family: var(--body);
  font-size: 20px;
  line-height: 1.45;
  overflow-x: hidden;
}

body[data-lang="zh"] {
  --display: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  --body: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  font-size: 17px;
  line-height: 1.75;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  content: "";
  background-image:
    linear-gradient(rgba(241, 200, 106, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(241, 200, 106, 0.025) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, black, transparent 84%);
  pointer-events: none;
}

::selection {
  color: var(--ink);
  background: var(--gold);
}

img {
  display: block;
  max-width: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: var(--gold-hot);
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--green);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.glass-noise {
  position: fixed;
  inset: 0;
  z-index: 20;
  opacity: 0.08;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.28'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.skip-to-nave {
  position: fixed;
  top: 10px;
  left: 50%;
  z-index: 100;
  padding: 10px 14px;
  color: var(--ink);
  background: var(--green);
  border: 2px solid var(--bone);
  transform: translate(-50%, -180%);
}

.skip-to-nave:focus {
  transform: translate(-50%, 0);
}

/* The left rail is the clergy processional: compact, icon-led, always in reach. */
.side-clergy {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  display: flex;
  width: var(--rail);
  flex-direction: column;
  align-items: center;
  padding: 20px 11px 16px;
  background:
    linear-gradient(90deg, rgba(8, 9, 18, 0.98), rgba(11, 13, 25, 0.9)),
    repeating-linear-gradient(0deg, transparent 0 8px, rgba(241, 200, 106, 0.035) 8px 9px);
  border-right: 1px solid var(--line);
  box-shadow: 12px 0 42px rgba(0, 0, 0, 0.28);
}

.sigil-mark {
  position: relative;
  display: grid;
  width: 82px;
  place-items: center;
  color: var(--bone);
  text-align: center;
  text-decoration: none;
}

.sigil-halo {
  position: absolute;
  top: 0;
  left: 50%;
  width: 66px;
  height: 22px;
  border: 4px solid var(--gold);
  border-radius: 50%;
  box-shadow: 0 0 18px rgba(241, 200, 106, 0.6);
  transform: translateX(-50%);
}

.sigil-screen {
  display: grid;
  width: 42px;
  height: 42px;
  margin-top: 17px;
  place-items: center;
  color: var(--green);
  background: var(--ink);
  border: 5px solid var(--bone-dim);
  box-shadow: inset 0 0 0 3px var(--cobalt-deep);
  font-family: var(--body);
  font-size: 29px;
  line-height: 1;
}

.sigil-word {
  margin-top: 8px;
  color: var(--gold);
  font-family: var(--body);
  font-size: 16px;
  line-height: 0.9;
  letter-spacing: 0.08em;
}

.rail-liturgy {
  display: grid;
  width: 100%;
  gap: 7px;
  margin-top: auto;
  margin-bottom: auto;
}

.rail-liturgy a {
  display: grid;
  min-height: 55px;
  place-items: center;
  padding: 4px 2px;
  color: var(--bone-dim);
  border: 1px solid transparent;
  font-size: 16px;
  line-height: 1;
  text-align: center;
  text-decoration: none;
}

.rail-liturgy a:hover {
  color: var(--gold-hot);
  background: rgba(241, 200, 106, 0.07);
  border-color: var(--line);
}

.rail-icon {
  display: block;
  color: var(--gold);
  font-size: 21px;
  line-height: 1;
}

.rail-foot {
  display: grid;
  justify-items: center;
  gap: 11px;
}

.language-choir {
  display: flex;
  gap: 4px;
  align-items: center;
  color: var(--bone-dim);
  font-size: 17px;
}

.language-prayer {
  padding: 2px 3px;
  color: var(--bone-dim);
  background: transparent;
  border: 0;
  cursor: pointer;
}

.language-prayer.is-active {
  color: var(--green);
  text-shadow: 0 0 10px rgba(93, 245, 157, 0.55);
}

.rail-chain {
  color: var(--bone-dim);
  font-size: 16px;
  text-decoration: none;
}

/* One centered nave. Every chapter is part of the same architectural scan. */
.cathedral-nave {
  width: min(1120px, calc(100% - var(--rail) - var(--gutter) - var(--gutter)));
  margin-left: calc(var(--rail) + var(--gutter));
  padding-right: var(--gutter);
}

.nave-chapter {
  position: relative;
  padding: clamp(76px, 10vw, 144px) 0;
  scroll-margin-top: 24px;
}

.threshold-chapter {
  display: grid;
  min-height: 100svh;
  align-content: center;
  justify-items: center;
  padding-top: clamp(30px, 5vw, 68px);
  text-align: center;
}

.threshold-aura {
  position: absolute;
  top: 8%;
  left: 50%;
  width: min(72vw, 780px);
  height: min(72vw, 780px);
  background:
    radial-gradient(circle, rgba(241, 200, 106, 0.16) 0 2px, transparent 3px) 0 0 / 17px 17px,
    radial-gradient(circle, rgba(241, 200, 106, 0.13), transparent 62%);
  border-radius: 50%;
  mask-image: radial-gradient(circle, black 0 45%, transparent 72%);
  transform: translateX(-50%);
  animation: halo-breathe 7s ease-in-out infinite alternate;
  pointer-events: none;
}

.gothic-window {
  position: relative;
  z-index: 1;
  width: min(760px, 83vw);
  aspect-ratio: 1.6 / 1;
  padding: 9px;
  background:
    linear-gradient(135deg, var(--gold-hot), var(--ruby) 28%, var(--cobalt) 55%, var(--gold) 82%, var(--ruby-deep));
  clip-path: polygon(50% 0, 61% 3%, 73% 10%, 84% 21%, 93% 37%, 100% 100%, 0 100%, 7% 37%, 16% 21%, 27% 10%, 39% 3%);
  filter: drop-shadow(0 28px 38px rgba(0, 0, 0, 0.64));
}

.gothic-window::after {
  position: absolute;
  inset: 9px;
  content: "";
  background: linear-gradient(180deg, transparent 62%, rgba(8, 9, 18, 0.74));
  clip-path: polygon(50% 0, 61% 3%, 73% 10%, 84% 21%, 93% 37%, 100% 100%, 0 100%, 7% 37%, 16% 21%, 27% 10%, 39% 3%);
  pointer-events: none;
}

.gothic-window img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--ink-soft);
  clip-path: polygon(50% 0, 60.5% 3.8%, 72% 10.5%, 82.5% 21%, 91.6% 37%, 98.8% 100%, 1.2% 100%, 8.4% 37%, 17.5% 21%, 28% 10.5%, 39.5% 3.8%);
}

.window-spine {
  position: absolute;
  top: 7%;
  left: 50%;
  z-index: 2;
  width: 3px;
  height: 93%;
  background: linear-gradient(var(--gold), rgba(241, 200, 106, 0.16));
  box-shadow: 0 0 0 1px rgba(8, 9, 18, 0.5), 0 0 14px rgba(241, 200, 106, 0.32);
}

.window-caption {
  position: absolute;
  right: 12%;
  bottom: 8%;
  left: 12%;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  padding-top: 8px;
  color: var(--bone);
  border-top: 1px solid rgba(241, 200, 106, 0.6);
  font-size: 16px;
  letter-spacing: 0.08em;
}

.window-caption b {
  color: var(--gold-hot);
  font-weight: 400;
}

.hero-inscription {
  position: relative;
  z-index: 2;
  width: min(780px, 100%);
  padding-top: clamp(22px, 3vw, 34px);
}

.eyebrow,
.chapter-number,
.liturgy-label,
.micro-label {
  color: var(--gold);
  font-size: 16px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.eyebrow {
  margin: 0 0 5px;
}

.hero-inscription h1 {
  margin: 0;
  color: var(--bone);
  font-family: var(--display);
  font-size: clamp(72px, 11.5vw, 158px);
  font-weight: 400;
  line-height: 0.74;
  letter-spacing: 0.015em;
  text-shadow:
    0 0 2px var(--gold),
    0 8px 0 var(--ruby-deep),
    0 9px 0 var(--gold),
    0 24px 34px rgba(0, 0, 0, 0.75);
}

body[data-lang="zh"] .hero-inscription h1 {
  font-size: clamp(60px, 10vw, 130px);
  letter-spacing: 0.04em;
}

.hero-cn {
  margin: 16px 0 0;
  color: var(--gold-hot);
  font-family: var(--display);
  font-size: clamp(28px, 4vw, 48px);
  letter-spacing: 0.22em;
}

.hero-creed {
  max-width: 620px;
  margin: 15px auto 0;
  color: var(--bone-dim);
  font-size: clamp(20px, 2.3vw, 27px);
}

body[data-lang="zh"] .hero-creed {
  font-size: 18px;
}

.hero-commands {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
}

.bone-button,
.ghost-button,
.small-bone,
.small-ghost,
.ritual-button {
  display: inline-flex;
  min-height: 47px;
  align-items: center;
  justify-content: center;
  padding: 9px 21px;
  border: 2px solid var(--gold);
  border-radius: 0;
  box-shadow: 5px 5px 0 rgba(117, 21, 44, 0.8);
  font-family: var(--body);
  font-size: 19px;
  line-height: 1;
  letter-spacing: 0.035em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, color 120ms ease, background 120ms ease;
}

body[data-lang="zh"] .bone-button,
body[data-lang="zh"] .ghost-button,
body[data-lang="zh"] .small-bone,
body[data-lang="zh"] .small-ghost,
body[data-lang="zh"] .ritual-button {
  font-size: 16px;
}

.bone-button,
.small-bone,
.ritual-button {
  color: var(--ink);
  background: var(--gold);
}

.ghost-button,
.small-ghost {
  color: var(--bone);
  background: rgba(8, 9, 18, 0.72);
}

.bone-button:hover,
.ghost-button:hover,
.small-bone:hover,
.small-ghost:hover,
.ritual-button:hover:not(:disabled) {
  color: var(--ink);
  background: var(--green);
  border-color: var(--green);
  box-shadow: 2px 2px 0 var(--ruby-deep);
  transform: translate(3px, 3px);
}

.hero-marginalia {
  position: absolute;
  right: 0;
  bottom: 12%;
  display: grid;
  gap: 24px;
  color: rgba(241, 200, 106, 0.32);
  font-size: 15px;
  letter-spacing: 0.24em;
  writing-mode: vertical-rl;
}

/* Literal colored-square grids make the section breaks feel like windows. */
.stained-divider {
  display: grid;
  width: min(880px, 100%);
  height: 34px;
  grid-template-columns: repeat(12, 1fr);
  gap: 3px;
  margin: 0 auto;
  padding: 4px;
  background: rgba(8, 9, 18, 0.8);
  border-top: 2px solid var(--ruby-deep);
  border-bottom: 2px solid var(--cobalt-deep);
  box-shadow: 0 0 28px rgba(44, 101, 212, 0.16);
}

.stained-divider i {
  display: block;
  min-width: 0;
  background: var(--gold);
}

.stained-divider i:nth-child(3n + 1) {
  background: var(--ruby);
}

.stained-divider i:nth-child(3n + 2) {
  background: var(--cobalt);
}

.stained-divider i:nth-child(4n) {
  background: var(--gold);
}

.stained-divider i:nth-child(5n) {
  background: var(--green);
}

.divider-office i:nth-child(odd) {
  background: var(--cobalt);
}

.divider-canon i:nth-child(even) {
  background: var(--gold);
}

.divider-scripture i:nth-child(3n) {
  background: var(--ruby);
}

.chapter-heading {
  max-width: 760px;
  margin: 0 auto clamp(34px, 6vw, 64px);
  text-align: center;
}

.chapter-heading.side-heading {
  display: grid;
  max-width: none;
  grid-template-columns: minmax(0, 1.08fr) minmax(250px, 0.92fr);
  gap: clamp(30px, 7vw, 88px);
  align-items: end;
  margin-right: 0;
  margin-left: 0;
  text-align: left;
}

.chapter-number {
  margin: 0 0 8px;
}

.chapter-heading h2 {
  margin: 0;
  color: var(--bone);
  font-family: var(--display);
  font-size: clamp(44px, 6.3vw, 78px);
  font-weight: 400;
  line-height: 0.96;
  letter-spacing: 0.015em;
}

body[data-lang="zh"] .chapter-heading h2 {
  font-size: clamp(34px, 5vw, 60px);
  line-height: 1.18;
}

.chapter-heading > p:not(.chapter-number),
.side-heading > p {
  max-width: 620px;
  margin: 17px auto 0;
  color: var(--bone-dim);
}

.side-heading > p {
  margin: 0;
}

.wallet-lectern {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 18px;
  background: rgba(23, 27, 49, 0.74);
  border: 1px solid var(--line);
  border-left: 5px solid var(--green);
}

.wallet-lectern > div:first-child {
  display: grid;
  gap: 2px;
}

.lectern-label {
  color: var(--bone-dim);
  font-size: 15px;
  letter-spacing: 0.13em;
}

#walletAddress {
  min-width: 0;
  color: var(--green);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0.04em;
  overflow-wrap: anywhere;
}

.lectern-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chain-badge {
  padding: 5px 8px;
  color: var(--gold);
  border: 1px solid var(--line);
  font-size: 16px;
}

.small-bone,
.small-ghost {
  min-height: 38px;
  padding: 6px 13px;
  box-shadow: 3px 3px 0 rgba(117, 21, 44, 0.72);
  font-size: 17px;
}

.small-bone:disabled,
.small-ghost:disabled,
.ritual-button:disabled,
.bone-button.is-disabled {
  color: #807c72;
  background: #242433;
  border-color: #4a4752;
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.68;
}

.altar-card {
  position: relative;
  margin-top: 18px;
  overflow: hidden;
  background:
    linear-gradient(120deg, rgba(23, 27, 49, 0.98), rgba(9, 11, 22, 0.98)),
    repeating-linear-gradient(90deg, transparent 0 12px, rgba(241, 200, 106, 0.04) 12px 13px);
  border: 2px solid var(--gold);
  box-shadow: var(--shadow), inset 0 0 0 6px var(--ink), inset 0 0 0 7px rgba(210, 45, 79, 0.58);
}

.altar-card::before,
.altar-card::after {
  position: absolute;
  z-index: 2;
  width: 52px;
  height: 52px;
  content: "";
  pointer-events: none;
}

.altar-card::before {
  top: 6px;
  left: 6px;
  border-top: 3px solid var(--ruby);
  border-left: 3px solid var(--ruby);
}

.altar-card::after {
  right: 6px;
  bottom: 6px;
  border-right: 3px solid var(--cobalt);
  border-bottom: 3px solid var(--cobalt);
}

.altar-card-glow {
  position: absolute;
  top: -48%;
  left: 50%;
  width: 78%;
  height: 120%;
  background: radial-gradient(ellipse, rgba(241, 200, 106, 0.13), transparent 68%);
  transform: translateX(-50%);
  pointer-events: none;
}

.altar-card-top {
  position: relative;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
  padding: 26px 30px 18px;
  border-bottom: 1px solid var(--line);
}

.liturgy-label {
  margin: 0 0 4px;
}

.altar-card h3,
.x-confession h3,
.three-offerings h3,
.agent-decree h3,
.halo-mint-drawer h3,
.empty-reliquary h3 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(31px, 4vw, 45px);
  font-weight: 400;
  line-height: 1;
}

.mint-status {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  color: var(--bone-dim);
  border: 1px solid var(--line);
  font-size: 16px;
}

.status-dot {
  width: 9px;
  height: 9px;
  background: var(--gold);
  box-shadow: 0 0 9px currentColor;
}

.mint-status[data-state="open"] {
  color: var(--green);
  border-color: var(--green);
}

.mint-status[data-state="open"] .status-dot {
  background: var(--green);
}

.mint-status[data-state="closed"] {
  color: var(--ruby);
  border-color: var(--ruby);
}

.mint-status[data-state="closed"] .status-dot {
  background: var(--ruby);
}

.altar-body {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(240px, 0.7fr);
}

.offering-config {
  display: grid;
  gap: 18px;
  padding: clamp(22px, 4vw, 38px);
}

.quantity-line {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.micro-label {
  display: block;
  margin-bottom: 5px;
  color: var(--bone-dim);
  font-size: 15px;
}

.stepper {
  display: grid;
  width: 178px;
  grid-template-columns: 48px 1fr 48px;
  align-items: stretch;
  border: 2px solid var(--gold);
}

.stepper button {
  min-height: 47px;
  color: var(--gold);
  background: var(--ink);
  border: 0;
  font-size: 28px;
  cursor: pointer;
}

.stepper button:hover:not(:disabled) {
  color: var(--ink);
  background: var(--gold);
}

.stepper output {
  display: grid;
  min-height: 47px;
  place-items: center;
  color: var(--bone);
  background: rgba(44, 101, 212, 0.13);
  border-right: 1px solid var(--line);
  border-left: 1px solid var(--line);
  font-size: 27px;
}

.wallet-allowance {
  text-align: right;
}

.wallet-allowance strong {
  color: var(--gold-hot);
  font-size: 24px;
  font-weight: 400;
}

.quote-script {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.quote-script div {
  min-width: 0;
  padding: 12px 14px;
}

.quote-script div + div {
  border-left: 1px solid var(--line);
}

.quote-script dt {
  color: var(--bone-dim);
  font-size: 15px;
}

.quote-script dd {
  margin: 3px 0 0;
  color: var(--gold-hot);
  font-size: 20px;
  overflow-wrap: anywhere;
}

.agent-state {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 13px;
  background: rgba(210, 45, 79, 0.08);
  border: 1px solid rgba(210, 45, 79, 0.44);
}

.agent-state[data-state="valid"] {
  background: rgba(93, 245, 157, 0.06);
  border-color: rgba(93, 245, 157, 0.45);
}

.agent-state strong {
  color: var(--bone);
  font-size: 18px;
  font-weight: 400;
}

.agent-state a {
  flex-shrink: 0;
  font-size: 16px;
}

.ritual-button {
  width: 100%;
  min-height: 54px;
  box-shadow: 6px 6px 0 var(--ruby-deep);
  font-size: 22px;
}

.ritual-button.compact {
  min-height: 44px;
  font-size: 18px;
}

.ritual-button.is-ghost {
  color: var(--bone);
  background: var(--ink-soft);
  border-color: var(--cobalt);
}

.action-note,
.inline-message {
  margin: 0;
  color: var(--bone-dim);
  font-size: 16px;
  line-height: 1.4;
}

.action-note.is-error,
.inline-message.is-error {
  color: #ff8ca2;
}

.action-note.is-ok,
.inline-message.is-ok {
  color: var(--green);
}

.altar-side {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 25px;
  background:
    linear-gradient(180deg, rgba(44, 101, 212, 0.22), rgba(117, 21, 44, 0.14)),
    var(--ink-soft);
  border-left: 1px solid var(--line);
}

.window-saint {
  width: 100%;
  max-width: 210px;
  margin: 0 auto;
  padding: 5px;
  background: linear-gradient(135deg, var(--ruby), var(--gold), var(--cobalt));
  clip-path: polygon(50% 0, 94% 16%, 100% 100%, 0 100%, 6% 16%);
}

.window-saint img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  clip-path: polygon(50% 0, 91% 15%, 97% 100%, 3% 100%, 9% 15%);
}

.altar-decrees {
  display: grid;
  gap: 7px;
  margin-top: 17px;
}

.altar-decrees p {
  display: flex;
  justify-content: space-between;
  margin: 0;
  padding-bottom: 5px;
  color: var(--bone-dim);
  border-bottom: 1px dashed rgba(241, 200, 106, 0.22);
  font-size: 15px;
}

.altar-decrees b {
  color: var(--gold-hot);
  font-weight: 400;
}

.halo-balance {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: auto 0 0;
  padding-top: 16px;
  color: var(--bone-dim);
  font-size: 16px;
}

.halo-balance strong {
  color: var(--green);
  font-weight: 400;
}

.chain-stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin-top: 18px;
  border: 1px solid var(--line);
}

.chain-stats div {
  min-width: 0;
  padding: 13px 12px;
  text-align: center;
}

.chain-stats div + div {
  border-left: 1px solid var(--line);
}

.chain-stats span {
  display: block;
  color: var(--bone-dim);
  font-size: 14px;
  line-height: 1.15;
}

.chain-stats strong {
  display: block;
  margin-top: 5px;
  color: var(--gold-hot);
  font-size: 20px;
  font-weight: 400;
  overflow-wrap: anywhere;
}

.x-confession {
  margin-top: 24px;
  padding: clamp(21px, 4vw, 34px);
  background:
    linear-gradient(110deg, rgba(117, 21, 44, 0.32), rgba(17, 20, 38, 0.96) 55%),
    var(--ink-soft);
  border: 1px solid var(--ruby);
}

.x-confession-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.x-status {
  flex-shrink: 0;
  padding: 6px 9px;
  color: var(--gold);
  border: 1px solid var(--line);
  font-size: 16px;
}

.x-status[data-state="open"] {
  color: var(--green);
  border-color: var(--green);
}

.x-copy {
  max-width: 750px;
  margin: 12px 0 17px;
  color: var(--bone-dim);
}

.x-steps {
  display: grid;
  grid-template-columns: auto minmax(160px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.url-confession {
  display: grid;
  gap: 4px;
}

.url-confession span {
  color: var(--bone-dim);
  font-size: 15px;
}

.url-confession input {
  width: 100%;
  min-height: 45px;
  padding: 8px 11px;
  color: var(--bone);
  background: var(--ink);
  border: 1px solid var(--gold);
  border-radius: 0;
  font-size: 18px;
}

.x-steps .ghost-button {
  min-height: 45px;
}

.x-steps .ghost-button.is-disabled {
  pointer-events: none;
}

.x-confession .inline-message {
  margin-top: 12px;
}

/* Price ladder uses a staircase silhouette instead of generic cards. */
.ladder-rungs {
  position: relative;
  display: grid;
  gap: 12px;
  margin-left: clamp(0px, 9vw, 110px);
  padding-left: 27px;
  border-left: 3px solid var(--gold);
}

.ladder-rungs::before {
  position: absolute;
  top: 0;
  left: -3px;
  width: 3px;
  height: 22%;
  content: "";
  background: var(--green);
  box-shadow: 0 0 14px rgba(93, 245, 157, 0.6);
}

.ladder-rung {
  display: grid;
  grid-template-columns: 52px 1fr minmax(220px, 0.65fr);
  align-items: center;
  gap: 18px;
  min-height: 105px;
  padding: 16px 22px;
  background: rgba(23, 27, 49, 0.68);
  border: 1px solid var(--line);
  transform-origin: left center;
  transition: transform 160ms ease, background 160ms ease;
}

.ladder-rung:hover {
  background: rgba(44, 101, 212, 0.14);
  transform: translateX(6px);
}

.rung-index {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: var(--gold);
  border: 2px solid var(--gold);
  font-size: 17px;
}

.rung-range {
  margin: 0 0 2px;
  color: var(--green);
  font-size: 15px;
  letter-spacing: 0.13em;
}

.ladder-rung h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 32px;
  font-weight: 400;
  line-height: 1;
}

.ladder-rung dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 0;
}

.ladder-rung dl div {
  padding-left: 14px;
  border-left: 1px solid var(--line);
}

.ladder-rung dt {
  color: var(--bone-dim);
  font-size: 14px;
}

.ladder-rung dd {
  margin: 1px 0 0;
  color: var(--gold-hot);
  font-size: 21px;
}

.rung-zero {
  border-color: var(--green);
  box-shadow: inset 5px 0 0 var(--green);
}

.rung-one {
  margin-left: 2.5%;
  border-left-color: var(--cobalt);
}

.rung-two {
  margin-left: 5%;
  border-left-color: var(--ruby);
}

.rung-three {
  margin-left: 7.5%;
  border-left-color: var(--gold);
}

.three-offerings {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-top: clamp(38px, 6vw, 64px);
}

.three-offerings article {
  position: relative;
  min-width: 0;
  padding: 27px 23px;
  background: var(--ink-soft);
  border-top: 4px solid var(--cobalt);
}

.three-offerings article:nth-child(2) {
  border-top-color: var(--ruby);
}

.three-offerings article:nth-child(3) {
  border-top-color: var(--gold);
}

.offering-glyph {
  display: block;
  margin-bottom: 11px;
  color: rgba(241, 200, 106, 0.38);
  font-size: 32px;
}

.three-offerings h3 {
  font-size: 30px;
}

.three-offerings p {
  margin: 9px 0 0;
  color: var(--bone-dim);
  font-size: 18px;
}

.agent-decree {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 21px;
  align-items: center;
  margin-top: 28px;
  padding: 20px 24px;
  background:
    repeating-linear-gradient(135deg, rgba(241, 200, 106, 0.035) 0 8px, transparent 8px 16px),
    rgba(23, 27, 49, 0.62);
  border: 1px solid var(--gold);
}

.decree-seal {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  color: var(--ink);
  background: var(--gold);
  clip-path: polygon(50% 0, 92% 18%, 100% 100%, 0 100%, 8% 18%);
  font-size: 19px;
}

.agent-decree h3 {
  font-size: 29px;
}

.agent-decree p {
  margin: 4px 0 0;
  color: var(--bone-dim);
  font-size: 17px;
}

.text-link {
  color: var(--gold-hot);
  font-size: 17px;
}

/* Wallet-held saints: the reliquary should feel like an inventory ledger, not a shop. */
.reliquary-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  background: rgba(23, 27, 49, 0.7);
}

.reliquary-summary strong {
  display: block;
  color: var(--green);
  font-size: 24px;
  font-weight: 400;
}

.reliquary-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 9px;
}

.reliquary-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 16px;
  margin-top: 16px;
}

.collection-vault {
  min-height: 260px;
  padding: 14px;
  background:
    linear-gradient(rgba(44, 101, 212, 0.06), rgba(117, 21, 44, 0.06)),
    repeating-linear-gradient(0deg, transparent 0 23px, rgba(241, 200, 106, 0.035) 23px 24px);
  border: 1px solid var(--line);
}

.empty-reliquary {
  display: grid;
  min-height: 230px;
  place-items: center;
  align-content: center;
  text-align: center;
}

.empty-sigil {
  color: var(--gold);
  font-size: 48px;
}

.empty-reliquary h3 {
  font-size: 31px;
}

.empty-reliquary p {
  max-width: 440px;
  margin: 8px auto 0;
  color: var(--bone-dim);
}

.relic-rack {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 11px;
}

.relic-token {
  position: relative;
  min-width: 0;
  padding: 6px;
  color: var(--bone);
  background: var(--ink);
  border: 1px solid rgba(241, 200, 106, 0.28);
  cursor: pointer;
  transition: border-color 130ms ease, transform 130ms ease;
}

.relic-token:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}

.relic-token.is-selected {
  border: 2px solid var(--green);
  box-shadow: 0 0 0 2px var(--ink), 0 0 0 3px var(--green), 0 0 19px rgba(93, 245, 157, 0.22);
}

.relic-token img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--ink-raised);
}

.relic-token-meta {
  padding: 7px 4px 3px;
}

.relic-token-meta strong {
  display: block;
  overflow: hidden;
  color: var(--bone);
  font-size: 17px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.relic-token-meta span {
  color: var(--gold);
  font-size: 15px;
}

.relic-check {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  color: var(--ink);
  background: var(--bone);
  border: 2px solid var(--ink);
  font-size: 17px;
}

.relic-token.is-selected .relic-check {
  background: var(--green);
}

.collection-loading {
  display: grid;
  min-height: 230px;
  place-items: center;
  align-content: center;
  gap: 15px;
  text-align: center;
}

.collection-loading i {
  display: block;
  width: 54px;
  height: 54px;
  background: conic-gradient(var(--gold) 0 25%, var(--ruby) 25% 50%, var(--cobalt) 50% 75%, var(--green) 75%);
  animation: rotate-seal 2.8s steps(12) infinite;
}

.selection-ritual {
  align-self: start;
  padding: 18px;
  background: var(--ink-soft);
  border: 1px solid var(--gold);
}

.selection-list {
  display: grid;
  gap: 6px;
  min-height: 70px;
  margin: 8px 0 14px;
  color: var(--bone-dim);
}

.selection-list p {
  margin: 0;
}

.selection-list button {
  display: flex;
  justify-content: space-between;
  padding: 5px 7px;
  color: var(--bone);
  background: rgba(44, 101, 212, 0.13);
  border: 1px solid rgba(44, 101, 212, 0.52);
  font-size: 16px;
  cursor: pointer;
}

.selection-list button span {
  color: var(--ruby);
}

.selection-effects {
  padding: 10px 0;
  border-top: 1px dashed var(--line);
  border-bottom: 1px dashed var(--line);
}

.selection-effects p {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 4px 0;
  color: var(--bone-dim);
  font-size: 16px;
}

.selection-effects strong {
  color: var(--green);
  font-weight: 400;
}

.selection-ritual .ritual-button {
  margin-top: 10px;
}

.selection-ritual .action-note {
  margin-top: 12px;
}

.halo-mint-drawer {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-top: 16px;
  padding: 22px;
  background:
    linear-gradient(90deg, rgba(93, 245, 157, 0.08), transparent 55%),
    var(--ink-soft);
  border: 1px solid var(--green);
}

.halo-mint-drawer h3 {
  font-size: 30px;
}

.halo-mint-drawer p:not(.liturgy-label) {
  max-width: 660px;
  margin: 5px 0 0;
  color: var(--bone-dim);
  font-size: 17px;
}

.halo-mint-controls {
  display: flex;
  flex-shrink: 0;
  align-items: end;
  gap: 10px;
}

.halo-mint-controls label {
  display: grid;
  gap: 3px;
  color: var(--bone-dim);
  font-size: 15px;
}

.halo-mint-controls select {
  min-height: 44px;
  padding: 5px 25px 5px 10px;
  color: var(--bone);
  background: var(--ink);
  border: 1px solid var(--gold);
  border-radius: 0;
}

/* Rarity gallery: broad painted panels rather than an interchangeable card grid. */
.canon-order {
  position: relative;
  margin-bottom: 22px;
  padding: clamp(20px, 3.5vw, 34px);
  overflow: hidden;
  background: rgba(17, 20, 38, 0.78);
  border: 1px solid var(--line);
}

.canon-order::after {
  position: absolute;
  right: -110px;
  bottom: -130px;
  width: 320px;
  height: 320px;
  content: "";
  border: 1px solid currentColor;
  border-radius: 50%;
  opacity: 0.11;
}

.order-common {
  color: var(--bone-dim);
  border-left: 6px solid #7d8795;
}

.order-rare {
  color: #74a4ff;
  border-left: 6px solid var(--cobalt);
}

.order-epic {
  color: #e184ff;
  border-left: 6px solid #9e43bf;
}

.order-legendary {
  color: var(--gold);
  border: 2px solid var(--gold);
  background:
    linear-gradient(100deg, rgba(241, 200, 106, 0.09), transparent 42%),
    rgba(17, 20, 38, 0.86);
}

.order-divine {
  color: var(--green);
  border: 2px solid var(--green);
  background:
    radial-gradient(circle at 75% 15%, rgba(93, 245, 157, 0.13), transparent 30%),
    rgba(8, 9, 18, 0.94);
}

.order-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.order-head > div {
  display: flex;
  align-items: center;
  gap: 13px;
}

.rarity-code {
  color: currentColor;
  font-size: 18px;
  opacity: 0.65;
}

.order-head h3 {
  margin: 0;
  color: var(--bone);
  font-family: var(--display);
  font-size: clamp(31px, 4.2vw, 48px);
  font-weight: 400;
  line-height: 1;
}

.order-head > p {
  margin: 0;
  text-align: right;
}

.order-head > p b {
  display: block;
  color: currentColor;
  font-size: 27px;
  font-weight: 400;
}

.order-head > p span {
  color: var(--bone-dim);
  font-size: 14px;
}

.order-blurb {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: -4px 0 20px;
  color: var(--bone-dim);
  font-size: 18px;
  line-height: 1.45;
}

body[data-lang="zh"] .order-blurb {
  font-size: 16px;
  line-height: 1.7;
}

.portrait-psalter {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.divine-psalter {
  grid-template-columns: repeat(7, 1fr);
}

.portrait-psalter figure {
  min-width: 0;
  margin: 0;
  padding: 5px;
  background: var(--ink);
  border: 1px solid rgba(243, 232, 200, 0.18);
}

.portrait-psalter img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  transition: filter 150ms ease, transform 150ms ease;
}

.portrait-psalter figure:hover img {
  filter: saturate(1.28) contrast(1.04);
  transform: scale(1.018);
}

.portrait-psalter figcaption {
  display: grid;
  gap: 5px;
  padding: 8px 3px 3px;
  color: var(--bone);
  font-size: 16px;
  text-align: left;
}

.saint-name {
  color: var(--bone);
  font-size: 17px;
  line-height: 1.08;
}

.saint-bio {
  color: var(--bone-dim);
  font-size: 16px;
  line-height: 1.25;
}

body[data-lang="zh"] .saint-bio {
  line-height: 1.55;
}

.order-economy {
  position: relative;
  z-index: 1;
  margin: 16px 0 0;
  color: var(--bone-dim);
  font-size: 16px;
}

.order-economy b {
  color: currentColor;
  font-weight: 400;
}

/* Story is set as an illuminated broadsheet. */
.scripture-chapter {
  max-width: 930px;
  margin: 0 auto;
}

.scripture-text {
  padding: clamp(23px, 4vw, 44px);
  background:
    linear-gradient(90deg, rgba(241, 200, 106, 0.025) 1px, transparent 1px) 0 0 / 33px 100%,
    rgba(244, 233, 198, 0.94);
  color: #181421;
  box-shadow: 14px 14px 0 rgba(117, 21, 44, 0.66);
}

.scripture-opening {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 26px;
  padding-bottom: 28px;
  border-bottom: 3px double rgba(24, 20, 33, 0.42);
}

.scripture-opening span {
  padding-top: 5px;
  color: var(--ruby-deep);
  font-size: 16px;
  letter-spacing: 0.08em;
  writing-mode: vertical-rl;
}

.scripture-opening p {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(25px, 3.5vw, 35px);
  line-height: 1.18;
}

body[data-lang="zh"] .scripture-opening p {
  font-family: var(--body);
  font-size: 21px;
  line-height: 1.75;
}

.scripture-columns {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 34px;
  padding-top: 28px;
}

.scripture-columns article {
  position: relative;
  padding-top: 28px;
  border-top: 1px solid rgba(24, 20, 33, 0.26);
}

.verse {
  position: absolute;
  top: -20px;
  left: 0;
  color: var(--ruby-deep);
  font-family: var(--display);
  font-size: 39px;
  line-height: 1;
}

.scripture-columns h3 {
  margin: 0 0 9px;
  color: #181421;
  font-family: var(--display);
  font-size: 27px;
  font-weight: 400;
  line-height: 1.03;
}

body[data-lang="zh"] .scripture-columns h3 {
  font-family: var(--body);
  font-size: 19px;
  font-weight: 700;
}

.scripture-columns p {
  margin: 0;
  color: #30293a;
  font-size: 18px;
}

body[data-lang="zh"] .scripture-columns p {
  font-size: 16px;
}

.scripture-chapter blockquote {
  margin: 34px 0 0;
  text-align: center;
}

.scripture-chapter blockquote p {
  margin: 0;
  color: var(--gold-hot);
  font-family: var(--display);
  font-size: clamp(35px, 5vw, 56px);
  line-height: 1.08;
}

body[data-lang="zh"] .scripture-chapter blockquote p {
  font-family: var(--body);
  font-size: clamp(24px, 4vw, 37px);
}

.scripture-chapter cite {
  color: var(--bone-dim);
  font-size: 16px;
  font-style: normal;
}

.question-confessional {
  border-top: 1px solid var(--line);
}

.question-confessional details {
  border-bottom: 1px solid var(--line);
}

.question-confessional summary {
  position: relative;
  padding: 20px 44px 20px 0;
  color: var(--bone);
  font-size: 22px;
  list-style: none;
  cursor: pointer;
}

.question-confessional summary::-webkit-details-marker {
  display: none;
}

.question-confessional summary::after {
  position: absolute;
  top: 17px;
  right: 6px;
  content: "+";
  color: var(--gold);
  font-size: 28px;
}

.question-confessional details[open] summary::after {
  content: "−";
}

.question-confessional details p {
  max-width: 820px;
  margin: -4px 0 21px;
  padding-left: 20px;
  color: var(--bone-dim);
  border-left: 2px solid var(--ruby);
}

.cathedral-foot {
  width: min(1120px, calc(100% - var(--rail) - var(--gutter) - var(--gutter)));
  margin-left: calc(var(--rail) + var(--gutter));
  padding: 42px var(--gutter) 45px;
  color: var(--bone-dim);
  border-top: 1px solid var(--line);
}

.footer-bell {
  width: 70px;
  padding: 4px;
  background: var(--gold);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  transform: rotate(180deg);
}

.footer-bell img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.footer-wordmark {
  display: flex;
  align-items: baseline;
  gap: 17px;
  margin-top: 12px;
}

.footer-wordmark strong {
  color: var(--bone);
  font-family: var(--display);
  font-size: 39px;
  font-weight: 400;
}

.footer-wordmark span {
  color: var(--gold);
  font-size: 16px;
}

.footer-ledger {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  margin-top: 19px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.footer-ledger a {
  font-size: 17px;
}

.cathedral-foot > p {
  max-width: 760px;
  margin: 17px 0 10px;
  font-size: 16px;
}

.cathedral-foot small {
  color: rgba(200, 183, 142, 0.55);
  font-size: 14px;
  letter-spacing: 0.08em;
}

.toast-psalm {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 90;
  width: min(390px, calc(100vw - 40px));
  padding: 14px 16px;
  color: var(--ink);
  background: var(--gold);
  border: 3px solid var(--bone);
  box-shadow: 8px 8px 0 var(--ruby-deep);
  font-size: 17px;
  line-height: 1.35;
}

.toast-psalm.is-error {
  color: var(--bone);
  background: var(--ruby-deep);
  border-color: var(--ruby);
}

.toast-psalm.is-success {
  background: var(--green);
}

.noscript-warning {
  position: fixed;
  inset: auto 12px 12px;
  z-index: 110;
  padding: 12px;
  color: var(--ink);
  background: var(--gold);
  border: 2px solid var(--ink);
}

@keyframes halo-breathe {
  from { opacity: 0.62; transform: translateX(-50%) scale(0.97); }
  to { opacity: 1; transform: translateX(-50%) scale(1.03); }
}

@keyframes rotate-seal {
  to { transform: rotate(360deg); }
}

@keyframes entrance-lift {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: translateY(0); }
}

.nave-chapter {
  animation: entrance-lift 650ms both;
  animation-timeline: view();
  animation-range: entry 2% cover 18%;
}

.threshold-chapter {
  animation: none;
}

@media (max-width: 960px) {
  :root {
    --rail: 0px;
    --gutter: clamp(16px, 4vw, 34px);
  }

  .side-clergy {
    position: sticky;
    inset: 0 0 auto;
    display: grid;
    width: 100%;
    height: auto;
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: 7px 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.38);
  }

  .sigil-mark {
    width: 50px;
  }

  .sigil-halo {
    top: 5px;
    width: 31px;
    height: 10px;
    border-width: 2px;
  }

  .sigil-screen {
    width: 30px;
    height: 30px;
    margin-top: 8px;
    border-width: 3px;
    font-size: 21px;
  }

  .sigil-word,
  .rail-chain {
    display: none;
  }

  .rail-liturgy {
    display: flex;
    min-width: 0;
    gap: 1px;
    margin: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .rail-liturgy::-webkit-scrollbar {
    display: none;
  }

  .rail-liturgy a {
    min-width: 58px;
    min-height: 48px;
    padding: 4px 8px;
    font-size: 14px;
  }

  .rail-icon {
    font-size: 17px;
  }

  .rail-foot {
    display: block;
    margin-left: 7px;
  }

  .language-choir {
    font-size: 16px;
  }

  .cathedral-nave,
  .cathedral-foot {
    width: min(calc(100% - var(--gutter) - var(--gutter)), 940px);
    margin-right: auto;
    margin-left: auto;
  }

  .cathedral-nave {
    padding-right: 0;
  }

  .cathedral-foot {
    padding-right: 0;
    padding-left: 0;
  }

  .nave-chapter {
    padding-top: clamp(65px, 10vw, 105px);
    padding-bottom: clamp(65px, 10vw, 105px);
    scroll-margin-top: 76px;
  }

  .threshold-chapter {
    min-height: calc(100svh - 63px);
  }

  .gothic-window {
    width: min(690px, 92%);
  }

  .hero-marginalia {
    display: none;
  }

  .altar-body {
    grid-template-columns: minmax(0, 1.5fr) minmax(210px, 0.7fr);
  }

  .reliquary-workspace {
    grid-template-columns: minmax(0, 1fr) 245px;
  }

  .divine-psalter {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (max-width: 720px) {
  .rail-liturgy a {
    min-width: 49px;
  }

  .rail-liturgy a span:last-child {
    display: none;
  }

  .chapter-heading.side-heading,
  .scripture-columns,
  .altar-body,
  .reliquary-workspace {
    grid-template-columns: 1fr;
  }

  .chapter-heading.side-heading {
    gap: 17px;
  }

  .altar-card-top {
    padding: 21px 19px 15px;
  }

  .altar-side {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 15px;
    align-items: center;
    padding: 18px;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .window-saint {
    grid-row: span 2;
  }

  .altar-decrees {
    margin-top: 0;
  }

  .halo-balance {
    grid-column: 2;
    margin-top: 0;
    padding-top: 0;
  }

  .chain-stats {
    grid-template-columns: repeat(3, 1fr);
  }

  .chain-stats div:nth-child(4) {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .chain-stats div:nth-child(5) {
    border-top: 1px solid var(--line);
  }

  .x-steps {
    grid-template-columns: 1fr;
  }

  .x-steps .ghost-button {
    width: 100%;
  }

  .ladder-rungs {
    margin-left: 0;
  }

  .ladder-rung {
    grid-template-columns: 43px 1fr;
    gap: 12px;
    padding: 15px;
  }

  .ladder-rung dl {
    grid-column: 2;
  }

  .rung-one,
  .rung-two,
  .rung-three {
    margin-left: 0;
  }

  .three-offerings {
    grid-template-columns: 1fr;
  }

  .agent-decree {
    grid-template-columns: auto 1fr;
  }

  .agent-decree .text-link {
    grid-column: 1 / -1;
  }

  .reliquary-toolbar,
  .halo-mint-drawer {
    align-items: stretch;
    flex-direction: column;
  }

  .reliquary-actions {
    justify-content: start;
  }

  .selection-ritual {
    order: -1;
  }

  .halo-mint-controls {
    justify-content: space-between;
  }

  .portrait-psalter,
  .divine-psalter {
    grid-template-columns: repeat(3, 1fr);
  }

  .scripture-opening {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .scripture-opening span {
    padding: 0;
    writing-mode: horizontal-tb;
  }

  .scripture-text {
    box-shadow: 8px 8px 0 rgba(117, 21, 44, 0.66);
  }

  .scripture-columns {
    gap: 22px;
  }
}

@media (max-width: 430px) {
  :root {
    --gutter: 13px;
  }

  body {
    font-size: 19px;
  }

  body[data-lang="zh"] {
    font-size: 16px;
  }

  .side-clergy {
    grid-template-columns: 42px minmax(0, 1fr) auto;
    padding-right: 5px;
    padding-left: 5px;
  }

  .rail-liturgy a {
    min-width: 43px;
    padding-right: 4px;
    padding-left: 4px;
  }

  .language-choir {
    gap: 1px;
    font-size: 14px;
  }

  .language-prayer {
    padding-right: 1px;
    padding-left: 1px;
  }

  .gothic-window {
    width: 95%;
    padding: 6px;
  }

  .gothic-window::after {
    inset: 6px;
  }

  .window-caption {
    right: 8%;
    left: 8%;
    font-size: 13px;
  }

  .window-caption span {
    display: none;
  }

  .hero-inscription h1 {
    max-width: 100%;
    font-size: clamp(44px, 13.75vw, 56px);
    line-height: 0.8;
    letter-spacing: 0.02em;
    overflow-wrap: anywhere;
  }

  body[data-lang="zh"] .hero-inscription h1 {
    font-size: clamp(42px, 12.4vw, 50px);
  }

  .hero-cn {
    margin-top: 12px;
    font-size: 26px;
  }

  .hero-creed {
    font-size: 18px;
  }

  .hero-commands {
    display: grid;
  }

  .hero-commands a {
    width: 100%;
  }

  .stained-divider {
    height: 28px;
    gap: 2px;
    padding: 3px;
  }

  .wallet-lectern,
  .quantity-line {
    align-items: stretch;
    flex-direction: column;
  }

  .wallet-lectern > div:first-child,
  .altar-card-top > div,
  .x-confession-head > div,
  .order-head > div,
  .agent-decree > div,
  .halo-mint-drawer > div,
  .reliquary-workspace > *,
  .selection-effects p > * {
    min-width: 0;
  }

  .agent-state strong,
  .x-status,
  .mint-status,
  .order-head h3,
  .saint-name,
  .saint-bio,
  .order-economy,
  .scripture-opening p,
  .scripture-columns p,
  .question-confessional summary,
  .question-confessional details p,
  .footer-wordmark strong,
  .footer-wordmark span,
  .footer-ledger a,
  .cathedral-foot p,
  .cathedral-foot small,
  .action-note,
  .inline-message {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .stepper {
    width: 100%;
    max-width: 178px;
  }

  .lectern-actions {
    justify-content: space-between;
  }

  .wallet-allowance {
    text-align: left;
  }

  .quote-script {
    grid-template-columns: 1fr;
  }

  .quote-script div + div {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .agent-state,
  .x-confession-head,
  .order-head {
    align-items: stretch;
    flex-direction: column;
  }

  .agent-state a {
    align-self: flex-start;
  }

  .altar-side {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .chain-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .chain-stats div:nth-child(3),
  .chain-stats div:nth-child(5) {
    border-left: 0;
  }

  .chain-stats div:nth-child(3) {
    border-top: 1px solid var(--line);
  }

  .chain-stats div:nth-child(4) {
    border-left: 1px solid var(--line);
  }

  .chain-stats div:nth-child(5) {
    grid-column: 1 / -1;
  }

  .ladder-rung h3 {
    font-size: 28px;
  }

  .ladder-rung dd {
    font-size: 18px;
  }

  .agent-decree {
    grid-template-columns: 1fr;
  }

  .decree-seal {
    width: 43px;
    height: 43px;
  }

  .reliquary-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .reliquary-actions button {
    width: 100%;
  }

  .relic-rack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .halo-mint-controls {
    display: grid;
    grid-template-columns: minmax(75px, 0.35fr) minmax(0, 1fr);
  }

  .halo-mint-controls select {
    width: 100%;
    min-width: 0;
  }

  .portrait-psalter,
  .divine-psalter {
    grid-template-columns: repeat(2, 1fr);
  }

  .order-head > p {
    text-align: left;
  }

  .footer-wordmark {
    align-items: start;
    flex-direction: column;
    gap: 2px;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
