:root {
  --paper: #fff4d6;
  --ink: #090908;
  --signal: #ff2a10;
  --acid: #d7ff00;
  --blue: #0047ff;
  --violet: #7400ff;
  --ash: #504b3f;
  --line: rgba(9, 9, 8, 0.28);
  --shadow: 0 28px 90px rgba(9, 9, 8, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 78% 12%, rgba(255, 42, 16, 0.35), transparent 28rem),
    radial-gradient(circle at 8% 86%, rgba(0, 71, 255, 0.24), transparent 26rem),
    repeating-linear-gradient(135deg, rgba(9, 9, 8, 0.06) 0 2px, transparent 2px 18px),
    linear-gradient(115deg, rgba(215, 255, 0, 0.26), transparent 42rem),
    var(--paper);
  font-family: "Noto Sans SC", system-ui, sans-serif;
  overflow-x: hidden;
}

html[dir="rtl"] body {
  font-family: "Noto Sans Arabic", "Noto Naskh Arabic", system-ui, sans-serif;
}

button,
a {
  font: inherit;
}

a {
  color: inherit;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0.22;
  background-image:
    linear-gradient(90deg, rgba(16, 16, 14, 0.05) 1px, transparent 1px),
    linear-gradient(rgba(16, 16, 14, 0.05) 1px, transparent 1px);
  background-size: 18px 18px;
  mix-blend-mode: multiply;
}

#tokenCanvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.site-header,
main,
.footer {
  position: relative;
  z-index: 2;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 76px;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 244, 214, 0.82);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.86rem;
  font-weight: 700;
  text-transform: uppercase;
}

.brand-mark {
  width: 22px;
  height: 22px;
  border: 3px solid var(--ink);
  background: conic-gradient(from 25deg, var(--signal), var(--acid), var(--blue), var(--violet), var(--signal));
  transform: rotate(-9deg);
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(0.8rem, 3vw, 2rem);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  text-transform: uppercase;
}

.nav a {
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.nav a:hover {
  border-color: var(--signal);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.language-switcher {
  display: inline-flex;
  border: 2px solid var(--ink);
  background: var(--paper);
  box-shadow: 4px 4px 0 var(--ink);
}

.language-switcher button {
  min-width: 42px;
  height: 38px;
  border: 0;
  border-inline-end: 2px solid var(--ink);
  background: transparent;
  cursor: pointer;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  font-weight: 700;
}

.language-switcher button:last-child {
  border-inline-end: 0;
}

.language-switcher button.is-selected {
  background: var(--blue);
  color: white;
}

.small-action,
.ghost-button,
.ritual-button,
.receipt-button,
.modal-burn,
.model-card,
.modal-pay,
.payment-options button {
  border: 2px solid var(--ink);
  color: var(--ink);
  background: var(--paper);
  cursor: pointer;
  text-decoration: none;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.small-action {
  padding: 0.68rem 0.9rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  background: var(--acid);
  box-shadow: 4px 4px 0 var(--ink);
}

.small-action:hover,
.ritual-button:hover,
.receipt-button:hover,
.modal-pay:hover,
.payment-options button:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--ink);
}

.mobile-ritual-dock {
  display: none;
}

.hero {
  min-height: calc(100vh - 76px);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.72fr);
  align-items: center;
  gap: clamp(1.6rem, 4vw, 4rem);
  padding: clamp(2rem, 5vw, 4rem);
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, transparent 0 58%, rgba(9, 9, 8, 0.92) 58% 59%, transparent 59%),
    repeating-linear-gradient(0deg, transparent 0 24px, rgba(9, 9, 8, 0.04) 24px 25px);
}

.status-line,
.label,
.section-heading span,
.modal-label {
  margin: 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.status-line {
  display: inline-block;
  margin-bottom: 1.25rem;
  padding: 0.35rem 0.5rem;
  color: var(--paper);
  background: var(--ink);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 980px;
  margin-bottom: 1rem;
  font-weight: 900;
  text-transform: uppercase;
}

.title-cn,
.title-en {
  display: block;
}

.title-cn {
  font-family: "Anton", "Noto Sans SC", system-ui, sans-serif;
  font-size: clamp(4.8rem, 10.8vw, 10.8rem);
  line-height: 0.86;
  letter-spacing: 0;
}

.title-en {
  font-family: "Anton", sans-serif;
  font-size: clamp(5.4rem, 11vw, 10.4rem);
  line-height: 0.84;
  display: block;
  color: var(--signal);
  text-shadow: 0.045em 0.045em 0 var(--ink);
}

html[lang="zh-CN"] .title-cn {
  font-family: "Noto Sans SC", system-ui, sans-serif;
  line-height: 0.96;
}

html[dir="rtl"] .title-cn,
html[dir="rtl"] .title-en,
html[dir="rtl"] h2,
html[dir="rtl"] .manifesto-card h3,
html[dir="rtl"] .burn-altar h3,
html[dir="rtl"] .sanctuary-grid h3,
html[dir="rtl"] .model-card strong,
html[dir="rtl"] .modal-card h2,
html[dir="rtl"] .price-lockup strong,
html[dir="rtl"] .burn-readout strong,
html[dir="rtl"] .counter-grid strong,
html[dir="rtl"] .buy-button strong {
  font-family: "Noto Sans Arabic", "Noto Naskh Arabic", system-ui, sans-serif;
  line-height: 1.02;
}

.hero-text {
  max-width: 720px;
  margin-bottom: clamp(1rem, 5vw, 4rem);
  font-size: clamp(1.05rem, 1.8vw, 1.42rem);
  line-height: 1.75;
  font-weight: 600;
}

.hero-panel {
  align-self: center;
  border: 2px solid var(--ink);
  background: rgba(255, 244, 214, 0.9);
  box-shadow: var(--shadow), 12px 12px 0 var(--ink);
}

.counter-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  border-bottom: 2px solid var(--ink);
}

.counter-grid > div {
  min-width: 0;
  min-height: 112px;
  padding: 1rem;
}

.counter-grid > div:first-child {
  border-right: 2px solid var(--ink);
}

.counter-grid strong {
  display: block;
  margin-top: 0.5rem;
  font-family: "Anton", sans-serif;
  font-size: clamp(2rem, 4vw, 3.55rem);
  line-height: 0.9;
  white-space: nowrap;
}

.buy-button {
  width: 100%;
  min-height: 310px;
  padding: clamp(1.2rem, 3vw, 2rem);
  border: 0;
  border-bottom: 2px solid var(--ink);
  color: var(--ink);
  background:
    radial-gradient(circle at 50% 55%, rgba(255, 42, 16, 0.9), transparent 9rem),
    linear-gradient(135deg, transparent 0 42%, rgba(9, 9, 8, 0.24) 42% 58%, transparent 58%),
    var(--acid);
  cursor: pointer;
  text-align: left;
}

.buy-button span,
.buy-button strong {
  display: block;
}

.buy-button span {
  font-family: "IBM Plex Mono", monospace;
  font-size: clamp(1rem, 2vw, 1.5rem);
  font-weight: 700;
}

.buy-button strong {
  margin-top: 0.4rem;
  font-family: "Anton", sans-serif;
  font-size: clamp(4.2rem, 10vw, 8.2rem);
  line-height: 0.82;
  text-transform: uppercase;
}

.buy-button:hover {
  background:
    repeating-linear-gradient(90deg, rgba(9, 9, 8, 0.2) 0 12px, transparent 12px 24px),
    var(--signal);
}

.buy-note {
  margin: 0;
  padding: 1rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.82rem;
  line-height: 1.65;
}

.performance,
.proof,
.altar,
.sanctuary,
.receipt {
  padding: clamp(3rem, 8vw, 7rem) clamp(1rem, 4vw, 3rem);
  border-bottom: 1px solid var(--line);
}

.section-heading {
  max-width: 1120px;
  margin: 0 auto 1.4rem;
}

.section-heading span {
  color: var(--signal);
}

h2 {
  margin-bottom: 0;
  font-family: "Anton", "Noto Sans SC", sans-serif;
  font-size: clamp(3rem, 8vw, 8rem);
  line-height: 0.92;
  text-transform: uppercase;
}

.spill-stage {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(240px, 0.55fr) minmax(0, 1fr);
  gap: 1rem;
}

.burn-column,
.manifesto-card,
.proof-card,
.ledger-panel,
.burn-altar,
.sanctuary-grid article,
.receipt-panel {
  border: 2px solid var(--ink);
  background: rgba(255, 244, 214, 0.92);
}

.burn-column {
  display: grid;
  grid-template-columns: 68px 1fr;
  min-height: 360px;
}

.meter-shell {
  position: relative;
  overflow: hidden;
  border-right: 2px solid var(--ink);
  background: repeating-linear-gradient(0deg, rgba(9, 9, 8, 0.18) 0 10px, transparent 10px 20px);
}

.meter-fill {
  position: absolute;
  inset: auto 0 0;
  height: 6%;
  background: linear-gradient(var(--signal), var(--blue));
  transition: height 400ms ease;
}

.burn-readout {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1rem;
}

.burn-readout span {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.burn-readout strong {
  font-family: "Anton", sans-serif;
  font-size: clamp(3rem, 8vw, 7rem);
  line-height: 0.88;
}

.manifesto-card {
  padding: clamp(1.2rem, 3vw, 2rem);
}

.manifesto-card h3,
.proof-card h3,
.burn-altar h3,
.sanctuary-grid h3 {
  font-family: "Anton", "Noto Sans SC", sans-serif;
  font-size: clamp(2rem, 4vw, 4.4rem);
  line-height: 0.95;
  text-transform: uppercase;
}

.manifesto-card p,
.proof-card p,
.sanctuary-grid p,
.receipt-copy p {
  font-size: 1.05rem;
  line-height: 1.75;
  font-weight: 600;
}

.ritual-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 2rem;
}

.ritual-button,
.ghost-button,
.receipt-button,
.modal-burn,
.modal-pay,
.model-card,
.payment-options button {
  padding: 0.95rem 1.15rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.86rem;
  font-weight: 700;
  text-transform: uppercase;
}

.ritual-button,
.receipt-button,
.modal-burn,
.modal-pay {
  background: var(--signal);
}

.altar-layout {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.72fr);
  gap: 1rem;
  align-items: start;
}

.model-list,
.modal-models {
  display: grid;
  gap: 0.7rem;
}

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

.model-card {
  min-height: 132px;
  padding: 0.9rem;
  text-align: start;
  background: rgba(255, 244, 214, 0.94);
}

.model-card span,
.model-card em,
.model-card small {
  display: block;
  font-family: "IBM Plex Mono", monospace;
  font-style: normal;
  text-transform: uppercase;
}

.model-card span {
  color: var(--signal);
  font-size: 0.72rem;
}

.model-card strong {
  display: block;
  margin: 0.35rem 0 0.55rem;
  font-family: "Anton", sans-serif;
  font-size: clamp(1.7rem, 3vw, 2.7rem);
  line-height: 0.92;
  text-transform: uppercase;
}

.model-card em {
  font-weight: 700;
}

.model-card small {
  margin-top: 0.25rem;
  color: var(--ash);
  font-size: 0.72rem;
}

.model-card.is-selected {
  background: var(--acid);
  box-shadow: 7px 7px 0 var(--ink);
  transform: translate(-2px, -2px);
}

.burn-altar {
  position: sticky;
  top: 96px;
  padding: clamp(1rem, 3vw, 1.5rem);
  box-shadow: 10px 10px 0 var(--ink);
}

.price-lockup {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.8rem;
  align-items: end;
  margin: 1rem 0;
}

.price-lockup strong {
  font-family: "Anton", sans-serif;
  font-size: clamp(4rem, 8vw, 7rem);
  line-height: 0.82;
  color: var(--signal);
  text-shadow: 0.04em 0.04em 0 var(--ink);
}

.price-lockup span {
  max-width: 180px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.ash-tray {
  min-height: 210px;
  display: grid;
  align-content: end;
  gap: 1rem;
  padding: 1rem;
  border: 2px solid var(--ink);
  background:
    radial-gradient(circle at 50% 70%, rgba(255, 42, 16, 0.24), transparent 8rem),
    repeating-linear-gradient(135deg, rgba(9, 9, 8, 0.1) 0 2px, transparent 2px 12px);
  overflow: hidden;
}

.ash-core {
  width: 100%;
  height: 86px;
  background:
    radial-gradient(circle at 50% 100%, var(--signal), transparent 54%),
    linear-gradient(90deg, var(--blue), var(--acid), var(--signal));
  clip-path: polygon(6% 100%, 18% 38%, 28% 100%, 42% 20%, 52% 100%, 68% 34%, 80% 100%, 94% 46%, 100% 100%);
  filter: saturate(1.2);
  transform-origin: bottom;
}

.ash-tray.is-burning .ash-core {
  animation: burnPulse 540ms infinite alternate ease-in-out;
}

.ash-tray p {
  margin: 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.86rem;
  line-height: 1.55;
  font-weight: 700;
}

.ritual-ledger {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 1rem;
  border: 2px solid var(--ink);
}

.ritual-ledger > div {
  min-height: 76px;
  padding: 0.7rem;
}

.ritual-ledger > div + div {
  border-left: 2px solid var(--ink);
}

.ritual-ledger span,
.ritual-ledger strong {
  display: block;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
}

.ritual-ledger strong {
  margin-top: 0.35rem;
  font-size: 0.82rem;
}

@keyframes burnPulse {
  from {
    transform: scaleY(0.84) skewX(-2deg);
    filter: saturate(1.1) brightness(1);
  }
  to {
    transform: scaleY(1.12) skewX(2deg);
    filter: saturate(1.6) brightness(1.2);
  }
}

.ghost-button {
  background: transparent;
}

.proof-layout {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(300px, 0.48fr) minmax(320px, 1fr);
  gap: 1rem;
  align-items: start;
}

.proof-card {
  position: relative;
  overflow: visible;
  padding: 1rem 1rem 1.2rem;
  background:
    linear-gradient(90deg, rgba(9, 9, 8, 0.035) 0 1px, transparent 1px 8px),
    linear-gradient(#fffdf1, #f4ecd7);
  box-shadow: 8px 10px 0 rgba(9, 9, 8, 0.72);
  transform: rotate(-1.5deg);
}

.proof-card::before {
  content: "";
  position: absolute;
  inset: -9px 0 auto;
  height: 14px;
  background:
    linear-gradient(135deg, transparent 0 45%, #fffdf1 45% 55%, transparent 55%) 0 0 / 16px 14px repeat-x;
  pointer-events: none;
}

.proof-card::after {
  content: "";
  position: absolute;
  inset: auto 0 -9px;
  height: 14px;
  background:
    linear-gradient(45deg, transparent 0 45%, #f4ecd7 45% 55%, transparent 55%) 0 0 / 16px 14px repeat-x;
  pointer-events: none;
}

.proof-card > * {
  position: relative;
}

.receipt-logo {
  width: 54px;
  height: 38px;
  margin: 0 auto 0.35rem;
  display: grid;
  place-items: center;
}

.receipt-logo span {
  display: block;
  height: 7px;
  background: var(--ink);
}

.receipt-logo span:nth-child(1) {
  width: 42px;
}

.receipt-logo span:nth-child(2) {
  width: 28px;
}

.receipt-logo span:nth-child(3) {
  width: 36px;
}

.thermal-center {
  display: grid;
  gap: 0.22rem;
  justify-items: center;
  text-align: center;
  margin-bottom: 0.8rem;
}

.thermal-center strong,
.thermal-center span,
.thermal-row,
.thermal-note,
.barcode {
  font-family: "IBM Plex Mono", monospace;
}

.thermal-center strong {
  font-size: 1.05rem;
}

.thermal-center span {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

.thermal-rule {
  height: 2px;
  margin: 0.7rem 0;
  background: repeating-linear-gradient(90deg, var(--ink) 0 16px, transparent 16px 20px);
}

.thermal-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.7rem;
  align-items: baseline;
  min-height: 1.55rem;
  font-size: 0.92rem;
  line-height: 1.25;
}

.thermal-row span,
.thermal-row strong {
  min-width: 0;
}

.thermal-row span {
  overflow-wrap: anywhere;
}

.thermal-row strong {
  text-align: end;
  overflow-wrap: anywhere;
}

.thermal-head {
  font-weight: 700;
  text-transform: uppercase;
}

.thermal-row.total {
  font-size: 1rem;
  font-weight: 700;
}

.thermal-note {
  margin: 0.85rem 0;
  font-size: 0.82rem;
  line-height: 1.5;
  text-align: center;
}

.barcode {
  margin: 0.9rem 0;
  text-align: center;
  font-size: 1.2rem;
  line-height: 1;
  overflow-wrap: anywhere;
  letter-spacing: 0;
}

.proof-card .receipt-button {
  width: 100%;
  margin: 0;
  background: transparent;
  box-shadow: none;
}

.ledger-panel {
  padding: 1rem;
  background: rgba(255, 244, 214, 0.9);
}

.free-proof-panel {
  margin-bottom: 1rem;
  padding: 1rem;
  border: 2px solid var(--ink);
  background:
    repeating-linear-gradient(135deg, rgba(9, 9, 8, 0.08) 0 2px, transparent 2px 14px),
    var(--acid);
}

.free-proof-panel h3 {
  margin: 0.65rem 0;
  font-family: "Anton", "Noto Sans SC", sans-serif;
  font-size: clamp(2rem, 4vw, 3.8rem);
  line-height: 0.92;
  text-transform: uppercase;
}

.free-proof-panel p {
  margin-bottom: 0.9rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.55;
}

.free-proof-panel .receipt-button {
  width: 100%;
  margin: 0.5rem 0 0;
  text-align: center;
}

#freeProofPreview {
  display: block;
  width: 100%;
  margin-top: 0.8rem;
  border: 2px solid var(--ink);
  background: var(--paper);
}

.ledger-total {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: end;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--ink);
}

.ledger-total span,
.ledger-entry span,
.ledger-entry small,
.ledger-stat span,
.ledger-stat em,
.ledger-empty {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
}

.ledger-total strong {
  font-family: "Anton", sans-serif;
  font-size: clamp(3rem, 7vw, 6rem);
  line-height: 0.84;
  color: var(--signal);
}

.ledger-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  margin: 1rem 0;
}

.ledger-stat {
  min-height: 118px;
  padding: 0.75rem;
  border: 2px solid var(--ink);
  background: var(--acid);
}

.ledger-stat strong,
.ledger-stat em {
  display: block;
}

.ledger-stat strong {
  margin: 0.35rem 0;
  font-family: "Anton", sans-serif;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  line-height: 0.92;
  text-transform: uppercase;
}

.ledger-list {
  display: grid;
  gap: 0.55rem;
}

.ledger-entry {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto auto;
  gap: 0.7rem;
  align-items: center;
  padding: 0.7rem;
  border: 2px solid var(--ink);
  background: rgba(255, 244, 214, 0.92);
}

.ledger-entry strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ledger-empty {
  margin: 0;
  padding: 1rem;
  border: 2px solid var(--ink);
}

.sanctuary-grid {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.sanctuary-grid article {
  min-height: 310px;
  padding: 1rem;
}

.card-index {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 1.4rem;
  border: 2px solid var(--ink);
  background: var(--blue);
  color: white;
  font-family: "IBM Plex Mono", monospace;
  font-weight: 700;
}

.receipt {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.72fr);
  gap: clamp(1rem, 4vw, 4rem);
  align-items: start;
}

.receipt .section-heading {
  margin-left: 0;
}

.receipt-copy p {
  max-width: 720px;
}

.receipt-panel {
  box-shadow: 10px 10px 0 var(--ink);
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 2px solid var(--ink);
  font-family: "IBM Plex Mono", monospace;
}

.receipt-row span {
  color: var(--ash);
  font-size: 0.82rem;
  text-transform: uppercase;
}

.receipt-row strong {
  text-align: right;
}

.receipt-button {
  width: calc(100% - 2rem);
  margin: 1rem;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem clamp(1rem, 4vw, 3rem);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  text-transform: uppercase;
}

.footer p {
  margin: 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  justify-content: flex-end;
}

.footer-links a {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.legal-page {
  position: relative;
  z-index: 2;
  max-width: 1060px;
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 5rem) clamp(1rem, 4vw, 3rem);
}

.legal-section {
  display: none;
}

.legal-section.is-active {
  display: block;
}

.legal-section h1 {
  max-width: 960px;
  margin: 1rem 0 2rem;
  font-family: "Anton", "Noto Sans SC", sans-serif;
  font-size: clamp(3.4rem, 10vw, 8rem);
  line-height: 0.9;
  text-transform: uppercase;
}

.legal-section article {
  margin: 1rem 0;
  padding: clamp(1rem, 3vw, 1.6rem);
  border: 2px solid var(--ink);
  background: rgba(255, 244, 214, 0.92);
  box-shadow: 8px 8px 0 rgba(9, 9, 8, 0.78);
}

.legal-section article h2 {
  margin-bottom: 1rem;
  font-size: clamp(2rem, 5vw, 4rem);
}

.legal-section article p {
  max-width: 860px;
  margin-bottom: 0.9rem;
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  font-weight: 700;
  line-height: 1.75;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.burn-ceremony {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 3rem);
  color: var(--paper);
  background:
    repeating-linear-gradient(90deg, rgba(255, 244, 214, 0.07) 0 1px, transparent 1px 18px),
    radial-gradient(circle at 50% 86%, rgba(255, 42, 16, 0.38), transparent 24rem),
    rgba(9, 9, 8, 0.94);
}

.burn-ceremony[aria-hidden="false"] {
  display: flex;
}

body.ceremony-open {
  overflow: hidden;
}

.ceremony-grid {
  width: min(1180px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.68fr);
  gap: 1rem;
  align-items: stretch;
}

.ceremony-panel,
.ceremony-paper {
  border: 2px solid var(--paper);
  background: rgba(9, 9, 8, 0.55);
  box-shadow: 10px 10px 0 var(--signal);
}

.ceremony-control {
  grid-row: span 2;
  padding: clamp(1rem, 4vw, 2rem);
}

.ceremony-control h2 {
  margin: 0.6rem 0 1rem;
  color: var(--acid);
  font-size: clamp(3rem, 9vw, 8rem);
  text-shadow: 0.045em 0.045em 0 var(--signal);
}

.ceremony-token-count {
  font-family: "Anton", sans-serif;
  font-size: clamp(4rem, 12vw, 11rem);
  line-height: 0.82;
  color: var(--paper);
}

.ceremony-progress {
  height: 22px;
  margin: 1.1rem 0;
  border: 2px solid var(--paper);
  background: repeating-linear-gradient(90deg, rgba(255, 244, 214, 0.18) 0 10px, transparent 10px 20px);
}

.ceremony-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--acid), var(--signal));
}

#ceremonyPhase {
  margin: 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: clamp(1rem, 2.2vw, 1.45rem);
  font-weight: 700;
  line-height: 1.55;
}

.ceremony-io {
  display: grid;
  grid-template-columns: 1fr;
}

.ceremony-io > div {
  min-height: 150px;
  padding: 1rem;
}

.ceremony-io > div + div {
  border-top: 2px solid var(--paper);
}

.ceremony-io span,
.paper-feed span,
.paper-feed strong {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.ceremony-io p {
  margin: 0.65rem 0 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.6;
}

.ceremony-paper {
  overflow: hidden;
  padding: 1rem;
  background: var(--paper);
  color: var(--ink);
}

.paper-feed {
  min-height: 290px;
  display: grid;
  align-content: start;
  gap: 0.8rem;
  padding: 1rem;
  background:
    linear-gradient(90deg, rgba(9, 9, 8, 0.04) 0 1px, transparent 1px 8px),
    linear-gradient(#fffdf1, #f4ecd7);
  transform: translateY(-18%);
  animation: paperPrint 900ms steps(6) infinite alternate;
}

.paper-feed strong {
  justify-self: center;
  font-size: 1.1rem;
}

.paper-feed i {
  display: block;
  height: 12px;
  border-top: 2px dashed var(--ink);
  border-bottom: 2px dashed var(--ink);
}

@keyframes paperPrint {
  from {
    transform: translateY(-18%);
  }
  to {
    transform: translateY(0);
  }
}

.modal[aria-hidden="false"] {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 16, 14, 0.72);
}

.modal-card {
  position: relative;
  width: min(880px, 100%);
  max-height: calc(100vh - 2rem);
  overflow: auto;
  padding: clamp(1.2rem, 4vw, 2rem);
  border: 2px solid var(--ink);
  background: var(--paper);
  box-shadow: 14px 14px 0 var(--signal);
}

.modal-close {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  width: 38px;
  height: 38px;
  border: 2px solid var(--ink);
  background: transparent;
  cursor: pointer;
  font-family: "IBM Plex Mono", monospace;
  font-weight: 700;
}

.modal-card h2 {
  margin: 0.6rem 0 1rem;
  font-size: clamp(2.5rem, 8vw, 5.2rem);
}

.modal-card p {
  line-height: 1.7;
}

.modal-selected {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 0;
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  font-family: "IBM Plex Mono", monospace;
  text-transform: uppercase;
}

.modal-selected strong {
  color: var(--signal);
}

.modal-steps {
  display: none;
}

.ritual-io {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.7rem;
  margin: 1rem 0;
}

.io-panel {
  display: grid;
  gap: 0.65rem;
  min-height: 154px;
  padding: 0.9rem;
  border: 2px solid var(--ink);
  background:
    repeating-linear-gradient(0deg, rgba(9, 9, 8, 0.055) 0 1px, transparent 1px 18px),
    #fffdf1;
}

.io-panel span {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.io-panel textarea {
  width: 100%;
  min-height: 92px;
  resize: vertical;
  border: 0;
  outline: 2px solid transparent;
  background: transparent;
  color: var(--ink);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.92rem;
  line-height: 1.45;
}

.io-panel textarea:focus {
  outline-color: var(--signal);
  background: rgba(255, 42, 16, 0.08);
}

.io-output {
  color: var(--paper);
  background:
    repeating-linear-gradient(90deg, rgba(255, 244, 214, 0.1) 0 1px, transparent 1px 11px),
    var(--ink);
}

.io-output p {
  margin: 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.95rem;
  line-height: 1.55;
}

.modal-models {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-height: 280px;
  overflow: auto;
  margin: 1rem 0;
  padding-right: 0.35rem;
}

.modal-models .model-card {
  min-height: 116px;
}

.modal-models .model-card strong {
  font-size: 1.7rem;
}

.modal-pay {
  display: inline-flex;
  margin: 0.4rem 0 1rem;
}

.modal-burn {
  display: inline-flex;
  margin: 0.4rem 0 1rem 0.5rem;
  background: var(--acid);
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: stretch;
}

.payment-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.modal-footnote {
  margin: 1rem 0 0;
  font-size: 0.9rem;
}

.modal-compliance {
  padding: 0.75rem;
  border: 2px solid var(--ink);
  background: rgba(0, 71, 255, 0.1);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.82rem;
  font-weight: 700;
}

.modal-footnote code {
  padding: 0.08rem 0.28rem;
  border: 1px solid var(--line);
  background: rgba(16, 16, 14, 0.08);
}

body.silent * {
  animation-play-state: paused !important;
}

html[dir="rtl"] .hero,
html[dir="rtl"] .receipt,
html[dir="rtl"] .modal-card,
html[dir="rtl"] .burn-altar,
html[dir="rtl"] .manifesto-card,
html[dir="rtl"] .ledger-panel,
html[dir="rtl"] .sanctuary-grid article {
  text-align: right;
}

html[dir="rtl"] .proof-card {
  text-align: initial;
  direction: ltr;
}

html[dir="rtl"] .modal-close {
  right: auto;
  left: 0.8rem;
}

html[dir="rtl"] .counter-grid > div:first-child {
  border-right: 0;
  border-left: 2px solid var(--ink);
}

html[dir="rtl"] .meter-shell {
  border-right: 0;
  border-left: 2px solid var(--ink);
}

html[dir="rtl"] .ritual-ledger > div + div {
  border-left: 0;
  border-right: 2px solid var(--ink);
}

html[dir="rtl"] .modal-burn {
  margin-left: 0;
  margin-right: 0.5rem;
}

@media (max-width: 900px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav {
    width: 100%;
    justify-content: space-between;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
    align-items: flex-start;
  }

  .hero,
  .spill-stage,
  .proof-layout,
  .altar-layout,
  .receipt {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 2rem;
    background: repeating-linear-gradient(0deg, transparent 0 24px, rgba(9, 9, 8, 0.04) 24px 25px);
  }

  .hero-panel {
    align-self: stretch;
  }

  .sanctuary-grid {
    grid-template-columns: 1fr;
  }

  .burn-altar {
    position: static;
  }

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

  .ritual-io {
    grid-template-columns: 1fr;
  }

  .footer {
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  body {
    padding-bottom: 94px;
  }

  .mobile-ritual-dock {
    position: fixed;
    left: 0.7rem;
    right: 0.7rem;
    bottom: calc(0.7rem + env(safe-area-inset-bottom));
    z-index: 18;
    display: grid;
    grid-template-columns: 0.72fr minmax(0, 1.7fr) 0.72fr;
    gap: 0.45rem;
    padding: 0.45rem;
    border: 2px solid var(--ink);
    background: rgba(255, 244, 214, 0.94);
    box-shadow: 7px 7px 0 var(--ink);
    backdrop-filter: blur(12px);
  }

  .mobile-ritual-dock button {
    min-width: 0;
    min-height: 54px;
    border: 2px solid var(--ink);
    background: var(--paper);
    color: var(--ink);
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
  }

  .mobile-ritual-dock .dock-primary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.45rem;
    align-items: center;
    padding: 0.55rem;
    background: var(--acid);
    text-align: left;
  }

  .mobile-ritual-dock .dock-primary span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-ritual-dock .dock-primary strong {
    color: var(--signal);
    font-family: "Anton", sans-serif;
    font-size: 1.35rem;
    line-height: 0.9;
    text-shadow: 0.06em 0.06em 0 var(--ink);
  }

  .nav {
    display: none;
  }

  .header-actions {
    flex-direction: column;
  }

  .language-switcher {
    width: 100%;
  }

  .language-switcher button {
    flex: 1;
  }

  h1 {
    margin-bottom: 1.1rem;
  }

  .title-cn {
    font-size: clamp(3.4rem, 18vw, 5.2rem);
    line-height: 1.02;
  }

  .title-en {
    font-size: clamp(3.7rem, 18vw, 5.9rem);
    line-height: 0.86;
  }

  html[dir="rtl"] .title-cn,
  html[dir="rtl"] .title-en {
    font-size: clamp(3.2rem, 17vw, 5.2rem);
  }

  .counter-grid {
    grid-template-columns: 1fr;
  }

  .counter-grid > div:first-child {
    border-right: 0;
    border-bottom: 2px solid var(--ink);
  }

  .buy-button {
    min-height: 210px;
  }

  .buy-button strong {
    font-size: clamp(3.7rem, 19vw, 5.6rem);
  }

  .buy-note {
    font-size: 0.78rem;
  }

  .burn-column {
    grid-template-columns: 44px 1fr;
    min-height: 260px;
  }

  .model-list,
  .ledger-stats {
    grid-template-columns: 1fr;
  }

  .modal {
    align-items: flex-end;
    padding: 0;
  }

  .modal-card {
    width: 100%;
    max-height: 92dvh;
    padding: 1rem;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    box-shadow: 0 -8px 0 var(--signal);
  }

  .modal-card h2 {
    max-width: calc(100% - 44px);
    font-size: clamp(1.95rem, 9.8vw, 2.75rem);
    line-height: 0.96;
  }

  .modal-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin: 0.2rem 0 0.8rem;
    border: 2px solid var(--ink);
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.7rem;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
  }

  .modal-steps span {
    min-width: 0;
    padding: 0.45rem 0.2rem;
  }

  .modal-steps span + span {
    border-left: 2px solid var(--ink);
  }

  .modal-steps span:first-child {
    background: var(--blue);
    color: white;
  }

  .modal-selected {
    position: sticky;
    top: -1rem;
    z-index: 2;
    margin: 0 -1rem;
    padding: 0.75rem 1rem;
    background: var(--paper);
  }

  .ritual-io {
    margin: 0.8rem 0;
  }

  .io-panel {
    min-height: 108px;
    padding: 0.75rem;
  }

  .io-panel textarea {
    min-height: 58px;
  }

  .io-output p {
    font-size: 0.86rem;
    line-height: 1.45;
  }

  .modal-models {
    display: flex;
    grid-template-columns: none;
    gap: 0.65rem;
    max-height: none;
    overflow-x: auto;
    margin: 0.9rem -1rem 0.9rem;
    padding: 0 1rem 0.45rem;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .modal-models::-webkit-scrollbar {
    display: none;
  }

  .modal-models .model-card {
    flex: 0 0 78%;
    min-height: 96px;
    scroll-snap-align: start;
  }

  .modal-models .model-card strong {
    font-size: 1.28rem;
  }

  .modal-actions {
    position: sticky;
    bottom: -1rem;
    z-index: 3;
    display: grid;
    grid-template-columns: 1fr;
    margin: 0 -1rem;
    padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
    border-top: 2px solid var(--ink);
    background: rgba(255, 244, 214, 0.96);
    backdrop-filter: blur(12px);
  }

  .modal-pay,
  .modal-burn {
    width: 100%;
    justify-content: center;
    margin: 0;
    text-align: center;
  }

  .ledger-entry {
    grid-template-columns: 1fr;
  }

  .price-lockup,
  .ritual-ledger {
    grid-template-columns: 1fr;
  }

  .ritual-ledger > div + div {
    border-left: 0;
    border-top: 2px solid var(--ink);
  }

  html[dir="rtl"] .counter-grid > div:first-child {
    border-left: 0;
  }

  html[dir="rtl"] .ritual-ledger > div + div {
    border-right: 0;
  }

  .modal-burn {
    margin-left: 0;
  }

  .burn-ceremony {
    padding: 0.8rem;
  }

  .ceremony-grid {
    grid-template-columns: 1fr;
    gap: 0.7rem;
  }

  .ceremony-control {
    grid-row: auto;
    padding: 1rem;
  }

  .ceremony-control h2 {
    font-size: clamp(2.4rem, 16vw, 4.6rem);
  }

  .ceremony-token-count {
    font-size: clamp(4rem, 20vw, 6.5rem);
  }

  .ceremony-io {
    grid-template-columns: 1fr 1fr;
  }

  .ceremony-io > div {
    min-height: 118px;
    padding: 0.8rem;
  }

  .ceremony-io > div + div {
    border-top: 0;
    border-left: 2px solid var(--paper);
  }

  .ceremony-io p {
    font-size: 0.8rem;
    line-height: 1.45;
  }

  .ceremony-paper {
    padding: 0.65rem;
  }

  .paper-feed {
    min-height: 150px;
    gap: 0.5rem;
    padding: 0.75rem;
  }

  html[dir="rtl"] .ceremony-io > div + div {
    border-left: 0;
    border-right: 2px solid var(--paper);
  }

  html[dir="rtl"] .modal-steps span + span {
    border-left: 0;
    border-right: 2px solid var(--ink);
  }

  html[dir="rtl"] .mobile-ritual-dock .dock-primary {
    text-align: right;
  }

  .receipt-row {
    display: block;
  }

  .receipt-row strong {
    display: block;
    margin-top: 0.35rem;
    text-align: left;
  }
}

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

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