/* ============================================
   CHAIN REACTIONS — Viewer
   Clean, editorial aesthetic
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@300;400;600;700&family=Source+Code+Pro:wght@400;500&display=swap');

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

/* ─── THEME: CREAM (default) ────────────── */

:root,
[data-theme="light"] {
  --bg:         #f8f4e9;
  --fg:         #2a1f12;
  --fg-light:   #6b5840;
  --fg-muted:   #a89478;
  --border:     #b8a37a;
  --accent:     #2a1f12;
  --accent-hover: #4a3a25;
  --sign-bg:    #2a1f12;
  --sign-fg:    #f8f4e9;
  --sign-hover: #4a3a25;
  --admin-bg:   #f1eada;
  --input-bg:   #fffaee;
  --success:    #2d6a4f;
  --error:      #b6322f;
  --radius:     4px;
  --font:       'Source Sans 3', 'Source Sans Pro', -apple-system, sans-serif;
  --mono:       'Source Code Pro', 'Courier New', monospace;
  --artwork-bg: transparent;
  --rule:       rgba(120, 80, 30, 0.10);
  --ink:        #b6322f;
  --btn-bg:     #2f2f2f;
  --btn-fg:     #f8f4e9;
  --btn-hover:  #1a1a1a;
}

/* ─── THEME: POSTAL (warm sepia + red) ───────────── */

[data-theme="grey"] {
  --bg:         #e8d4b8;
  --fg:         #4a1815;
  --fg-light:   #743026;
  --fg-muted:   #a06850;
  --border:     #9c7a5a;
  --accent:     #8a2420;
  --accent-hover: #6a1a18;
  --sign-bg:    #8a2420;
  --sign-fg:    #f7e8d2;
  --sign-hover: #6a1a18;
  --admin-bg:   #dcc3a3;
  --input-bg:   #f0dcc0;
  --success:    #2d6a4f;
  --error:      #6a1a18;
  --artwork-bg: transparent;
  --rule:       rgba(138, 36, 32, 0.10);
  --ink:        #8a2420;
  --btn-bg:     #8a2420;
  --btn-fg:     #f7e8d2;
  --btn-hover:  #6a1a18;
}

/* ─── THEME: BLUEPRINT (deep blue + cyan ink) ───────────── */

[data-theme="dark"] {
  --bg:         #081d33;
  --fg:         #d8e6f0;
  --fg-light:   #92aec8;
  --fg-muted:   #6a8aa8;
  --border:     #3d6090;
  --accent:     #d8e6f0;
  --accent-hover: #b8cce0;
  --sign-bg:    #d8e6f0;
  --sign-fg:    #0e2740;
  --sign-hover: #b8cce0;
  --admin-bg:   #143052;
  --input-bg:   #143052;
  --success:    #6ad2a8;
  --error:      #ff7a6a;
  --artwork-bg: transparent;
  --rule:       rgba(180, 210, 240, 0.05);
  --ink:        #6ec0e8;
  --btn-bg:     #b8cce0;
  --btn-fg:     #081d33;
  --btn-hover:  #9bb8d0;
}
html, body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--fg);
  background-color: var(--bg);
  background-image: url('../textures/white-paper-texture-with-flecks-770688698.jpg');
  background-repeat: no-repeat;
  background-size: cover;
  background-attachment: fixed;
  background-blend-mode: multiply;
  min-height: 100vh;
  transition: background-color 0.2s ease, color 0.2s ease;
  position: relative;
}

/* Soften texture intensity ~50% via a translucent bg-color wash on top */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: var(--bg);
  opacity: 0.1;
  pointer-events: none;
  z-index: 0;
}

[data-theme="dark"] body { background-blend-mode: soft-light; }
[data-theme="dark"] body::before { opacity: 0.15; }

/* Floating letterforms background — subtle, fixed, behind everything */
/* Floating drifting letterforms — generated by shared.js */
.bg-letters {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.bg-letter {
  position: absolute;
  font-family: 'Georgia', 'Times New Roman', serif;
  color: var(--fg);
  opacity: 0.07;
  user-select: none;
  will-change: transform;
  line-height: 1;
}
[data-theme="dark"] .bg-letter { opacity: 0.05; }
[data-theme="grey"] .bg-letter { opacity: 0.06; }

@keyframes drift-a {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50%      { transform: translate(50px, -38px) rotate(3deg); }
}
@keyframes drift-b {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50%      { transform: translate(-46px, 36px) rotate(-2.5deg); }
}
@keyframes drift-c {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50%      { transform: translate(40px, 50px) rotate(2deg); }
}
@keyframes drift-d {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50%      { transform: translate(-52px, -32px) rotate(-3deg); }
}

@media (prefers-reduced-motion: reduce) {
  .bg-letter { animation: none !important; }
}

/* Ensure all main content sits above the floating layer */
header, main, footer { position: relative; z-index: 1; }

/* ─── ACTIVITY TIMELINE ─────────────────── */

.timeline {
  position: relative;
  height: 70px;
  margin: 0.5rem 0 0.75rem;
}
.timeline-axis {
  position: absolute;
  left: 0; right: 0;
  top: 50%;
  height: 1px;
  background: var(--border);
}
.timeline-events {
  position: absolute;
  inset: 0;
}
.timeline-dot {
  position: absolute;
  top: 50%;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  cursor: help;
  transition: transform 0.15s ease;
}
.timeline-dot:hover { transform: translate(-50%, -50%) scale(1.6); }
.timeline-dot.mint   { background: var(--ink); }
.timeline-dot.sig    { background: var(--fg);  opacity: 0.65; }
.timeline-dot.resale { background: var(--fg-light); border: 1px solid var(--ink); }
.timeline-ticks {
  position: absolute;
  left: 0; right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--fg-muted);
  padding-top: 0.4rem;
}
.timeline-legend {
  display: flex;
  gap: 1.25rem;
  font-size: 0.75rem;
  color: var(--fg-light);
  margin-bottom: 1.5rem;
}
.timeline-legend .dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 0.4rem;
  vertical-align: middle;
}
.timeline-legend .dot-mint   { background: var(--ink); }
.timeline-legend .dot-sig    { background: var(--fg); opacity: 0.65; }
.timeline-legend .dot-resale { background: var(--fg-light); border: 1px solid var(--ink); }
.timeline-empty {
  text-align: center;
  font-size: 0.8rem;
  color: var(--fg-muted);
  font-style: italic;
  padding: 1.5rem 0;
}

/* ─── HEADER ─────────────────────────────── */

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 2rem;
  border-bottom: 1px solid var(--border);
}

h1 {
  font-size: 1.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.subtitle {
  font-size: 0.8rem;
  color: var(--fg-muted);
  font-weight: 300;
  letter-spacing: 0.03em;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.wallet-addr {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--fg-light);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─── THEME SWITCHER ────────────────────── */

.theme-switcher {
  display: flex;
  gap: 0.25rem;
  margin-right: 0.5rem;
}

.theme-btn {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border);
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
  padding: 0;
  outline: none;
}

.theme-btn:hover {
  transform: scale(1.15);
}

.theme-btn.active {
  border-color: var(--fg);
}

.theme-btn[data-set-theme="light"] {
  background: #f8f4e9;
}

.theme-btn[data-set-theme="grey"] {
  background: #6a1a18;
}

.theme-btn[data-set-theme="dark"] {
  background: #0e2740;
}

/* ─── BUTTONS ────────────────────────────── */

.btn {
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.5rem 1.2rem;
  border: 1px solid var(--btn-bg);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s ease;
  background: var(--btn-bg);
  color: var(--btn-fg);
}

.btn:hover { background: var(--btn-hover); border-color: var(--btn-hover); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-outline {
  background: transparent;
  color: var(--btn-bg);
}
.btn-outline:hover {
  background: var(--btn-bg);
  color: var(--btn-fg);
}

.btn-sm {
  font-size: 0.78rem;
  padding: 0.35rem 0.8rem;
}

.btn-sign {
  width: 100%;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  background: var(--btn-bg);
  border-color: var(--btn-bg);
  color: var(--btn-fg);
}
.btn-sign:hover {
  background: var(--btn-hover);
  border-color: var(--btn-hover);
}

.btn-admin {
  font-size: 0.78rem;
  padding: 0.4rem 0.9rem;
  margin-top: 0.5rem;
}

.transfer-note {
  font-size: 0.8rem;
  color: var(--fg-muted);
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.input-addr {
  flex: 1;
  min-width: 0;
}

/* ─── MAIN LAYOUT (viewer page only) ─────── */

main.viewer-main {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 0;
  max-width: 1400px;
  margin: 0 auto;
  min-height: calc(100vh - 130px);
}

/* ─── ARTWORK ────────────────────────────── */

.artwork-section {
  padding: 2rem;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.artwork-frame {
  width: 100%;
  max-width: 600px;
  aspect-ratio: 3 / 4;
  background: var(--artwork-bg);
  border-radius: 0;
  overflow: hidden;
  position: relative;
}

.artwork-frame iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: none;
}

.artwork-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--fg-muted);
  text-align: center;
  padding: 2rem;
  background: var(--admin-bg);
}

.artwork-placeholder p { margin-bottom: 0.5rem; }

/* ─── PANEL ──────────────────────────────── */

.panel {
  border-left: 1px solid var(--border);
  padding: 1rem 1.25rem;
  overflow-y: auto;
  max-height: calc(100vh - 60px);
}

.panel-section {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.panel-section:last-child { border-bottom: none; }

.panel-section label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-muted);
  margin-bottom: 0.3rem;
}

.panel-section h3 {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
}

.input-row {
  display: flex;
  gap: 0.5rem;
}

input[type="number"],
input[type="text"] {
  font-family: var(--mono);
  font-size: 0.85rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--input-bg);
  color: var(--fg);
  width: 100%;
}

input[type="number"]:focus,
input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
}

/* ─── INFO GRID ──────────────────────────── */

.info-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.05rem 0.5rem;
  font-size: 0.75rem;
  line-height: 1.3;
}

.info-grid .label {
  color: var(--fg-muted);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.mono {
  font-family: var(--mono);
  font-size: 0.78rem;
  word-break: break-all;
}

/* ─── SIGN PETITION ──────────────────────── */

.sign-note {
  font-size: 0.7rem;
  color: var(--fg-light);
  margin-top: 0.2rem;
  margin-bottom: 0;
  line-height: 1.25;
}

.status {
  font-size: 0.75rem;
  margin-top: 0.2rem;
  min-height: 1.2em;
}

.status.success { color: var(--success); }
.status.error { color: var(--error); }
.status.pending { color: var(--fg-muted); font-style: italic; }

/* ─── ADMIN ──────────────────────────────── */

.admin-section {
  margin-top: 1rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.admin-section summary {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-muted);
  cursor: pointer;
  user-select: none;
}

.admin-section summary:hover { color: var(--fg); }

.admin-group {
  margin-top: 1.2rem;
  padding: 1rem;
  background: var(--admin-bg);
  border-radius: var(--radius);
}

.admin-group h4 {
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-group label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--fg-muted);
  margin-top: 0.5rem;
  margin-bottom: 0.2rem;
}

.admin-group input {
  font-size: 0.78rem;
  padding: 0.35rem 0.5rem;
}

.small {
  font-size: 0.78rem;
  color: var(--fg-muted);
}

/* ─── FOOTER ─────────────────────────────── */

footer {
  text-align: center;
  padding: 1.5rem 2rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--fg-light);
}

footer .small { margin-top: 0.25rem; }

/* ─── HEADER NAV ────────────────────────── */

.header-nav {
  display: flex;
  gap: 1.5rem;
}

.header-nav a {
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-muted);
  text-decoration: none;
  padding: 0.2rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.header-nav a:hover {
  color: var(--ink);
}

.header-nav a.active {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.title-link {
  color: inherit;
  text-decoration: none;
}

.title-link:hover {
  opacity: 0.8;
}

/* Generic accent link color (skip button-like and nav anchors) */
a:not(.btn):not(.btn-outline):not(.title-link):not(.grid-cell):not(.header-nav a) { color: var(--ink); }
a:not(.btn):not(.btn-outline):not(.title-link):not(.grid-cell):not(.header-nav a):hover { color: color-mix(in srgb, var(--ink) 70%, var(--fg)); }
.splash-headline em { color: var(--ink); }

/* ─── TOKEN NAV (prev/next) ─────────────── */

.token-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.token-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.token-bar .token-nav {
  margin-top: 0;
  margin-left: auto;
  gap: 0.4rem;
}

input[type="number"].input-token,
.input-token {
  width: 4.5rem;
  flex: 0 0 4.5rem;
  text-align: center;
}

.btn-nav {
  font-size: 0.8rem;
  padding: 0.2rem 0.5rem;
  min-width: 2rem;
  text-align: center;
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--border);
}

.btn-nav:hover:not(:disabled) {
  background: var(--accent);
  color: var(--sign-fg);
  border-color: var(--accent);
}

.btn-nav:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.nav-position {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--fg-muted);
  min-width: 2.5rem;
  text-align: center;
}

/* ─── GRID PAGE ─────────────────────────── */

.grid-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.grid-header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.grid-header h2 {
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.grid-count {
  font-size: 0.8rem;
  color: var(--fg-muted);
}

.token-grid {
  display: grid;
  gap: 1.5rem;
  justify-content: center;
}

/* Default: 4 across */
.token-grid { grid-template-columns: repeat(4, 1fr); }

/* Size toggle overrides */
.token-grid.grid-sm { grid-template-columns: repeat(6, 1fr); gap: 1rem; }
.token-grid.grid-md { grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
.token-grid.grid-lg { grid-template-columns: repeat(3, 1fr); gap: 2rem; }

.grid-cell {
  display: block;
  text-decoration: none;
  color: inherit;
}

.grid-thumb {
  aspect-ratio: 3 / 4;
  background: var(--admin-bg);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  transition: transform 0.2s ease;
}

.grid-cell:hover .grid-thumb {
  transform: scale(1.03);
}

.grid-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.grid-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--fg-muted);
}

.grid-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--fg-muted);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.grid-capture-text {
  font-size: 0.75rem;
  color: var(--fg-muted);
}

.grid-token-id {
  font-family: var(--mono);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--fg-muted);
  opacity: 0.4;
}

.grid-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 0.5rem;
  color: var(--fg-light);
  text-align: center;
}

.grid-loading-msg {
  text-align: center;
  color: var(--fg-muted);
  padding: 2rem;
  font-size: 0.9rem;
}

/* Grid size toggle */
.grid-size-toggle {
  display: flex;
  gap: 0.25rem;
  align-items: center;
  margin-left: auto;
}

.grid-size-toggle span {
  font-size: 0.7rem;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 0.35rem;
}

.grid-size-btn {
  width: 26px;
  height: 20px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: transparent;
  cursor: pointer;
  padding: 3px;
  display: flex;
  gap: 1px;
  align-items: stretch;
  transition: border-color 0.15s ease;
}

.grid-size-btn:hover { border-color: var(--fg-muted); }
.grid-size-btn.active { border-color: var(--fg); }

.grid-size-btn .bar {
  flex: 1;
  background: var(--fg-muted);
  border-radius: 1px;
  opacity: 0.4;
}

.grid-size-btn.active .bar { opacity: 1; background: var(--fg); }

/* Hidden capture iframe */
.capture-iframe {
  position: fixed;
  left: -9999px;
  top: -9999px;
  width: 375px;
  height: 500px;
  border: none;
  pointer-events: none;
  opacity: 0;
}

/* ─── ABOUT PAGE ────────────────────────── */

.about-main {
  max-width: 720px;
  margin: 0 auto;
  padding: 3.5rem 2rem 4rem;
}

.about-kicker {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 1rem;
}

.about-content h2 {
  font-family: 'Georgia', 'Times New Roman', serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 500;
  font-style: italic;
  letter-spacing: -0.015em;
  text-transform: none;
  line-height: 1.1;
  color: var(--fg);
  margin-bottom: 2rem;
}

.about-content h3 {
  font-family: 'Georgia', 'Times New Roman', serif;
  font-size: 1.4rem;
  font-weight: 500;
  font-style: italic;
  text-transform: none;
  letter-spacing: -0.005em;
  color: var(--fg);
  margin-top: 2.75rem;
  margin-bottom: 0.85rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.about-content p {
  font-family: 'Georgia', 'Times New Roman', serif;
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--fg);
  margin-bottom: 1.1rem;
}

.about-content > p:first-of-type {
  font-size: 1.25rem;
  line-height: 1.55;
  color: var(--fg);
}

.about-content > p:first-of-type::first-letter {
  font-family: 'Georgia', 'Times New Roman', serif;
  float: left;
  font-size: 4.2rem;
  line-height: 0.9;
  font-weight: 600;
  padding: 0.35rem 0.6rem 0 0;
  color: var(--ink);
  font-style: normal;
}

.about-content strong {
  color: var(--fg);
  font-weight: 600;
}

.about-content em {
  font-style: italic;
}

/* ─── ABOUT — HISTORY TIMELINE ───────────── */

.about-history {
  max-width: 720px;
  margin: 3.5rem auto 4rem;
  padding: 0 2rem;
  position: relative;
  z-index: 1;
  background: transparent;
}

.about-history-head {
  border-top: 1px solid var(--border);
  padding-top: 2.5rem;
  margin-bottom: 2rem;
  position: relative;
  z-index: 1;
}

.about-history-kicker {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 0.75rem;
}

.about-history h3 {
  font-family: 'Georgia', 'Times New Roman', serif;
  font-size: 1.7rem;
  line-height: 1.2;
  margin: 0 0 1rem;
  color: var(--fg);
}

.about-history-lede {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--fg-muted);
  margin: 0;
}

.history-timeline {
  list-style: none;
  padding: 0;
  margin: 2.5rem 0 0;
  position: relative;
}

.history-timeline::before {
  content: '';
  position: absolute;
  left: 6.5rem;
  top: 0.4rem;
  bottom: 0.4rem;
  width: 1px;
  background: var(--border);
}

.history-item {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 1.75rem;
  padding: 1rem 0 1.25rem;
  position: relative;
  z-index: 1;
}

.history-item::before {
  content: '';
  position: absolute;
  left: calc(6.5rem - 5px);
  top: 1.35rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--fg-muted);
  border: 2px solid var(--bg);
  box-sizing: content-box;
}

.history-item.highlight::before {
  background: var(--accent, var(--fg));
  width: 11px;
  height: 11px;
  left: calc(6.5rem - 6px);
  top: 1.3rem;
}

.history-year {
  font-family: 'Georgia', 'Times New Roman', serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--fg);
  padding-top: 1.1rem;
  text-align: right;
  white-space: nowrap;
}

.history-body h4 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.4rem;
  color: var(--fg);
  line-height: 1.35;
}

.history-body p {
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--fg);
  margin: 0 0 0.5rem;
}

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

.history-links {
  font-size: 0.82rem;
  color: var(--fg-muted);
}

.history-links a {
  color: var(--fg);
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 3px;
}

.history-links a:hover {
  text-decoration-color: var(--fg);
}

.history-links .dot {
  margin: 0 0.4rem;
  color: var(--fg-muted);
}

.about-history-coda {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--fg-muted);
  text-align: center;
}

@media (max-width: 600px) {
  .history-timeline::before { left: 4rem; }
  .history-item {
    grid-template-columns: 4rem 1fr;
    gap: 1.25rem;
  }
  .history-item::before { left: calc(4rem - 5px); }
  .history-item.highlight::before { left: calc(4rem - 6px); }
  .history-year { font-size: 0.95rem; }
}

/* ─── MINT PAGE ──────────────────────────── */

.mint-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 2rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 3rem;
  align-items: center;
}

.mint-preview { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; }

.mint-frame {
  width: 100%;
  max-width: 420px;
  aspect-ratio: 3 / 4;
  background: var(--admin-bg);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
}

.mint-caption {
  font-size: 0.75rem;
  color: var(--fg-muted);
  font-style: italic;
}

/* Postmark — circular stamp overlay */
.postmark {
  position: absolute;
  bottom: 0.9rem;
  right: 0.9rem;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 1.5px solid var(--fg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: rgba(250, 249, 247, 0.85);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.06em;
  line-height: 1.35;
  text-transform: uppercase;
  transform: rotate(-6deg);
  opacity: 0.85;
  padding: 0.4rem;
  box-sizing: border-box;
  pointer-events: none;
}

.postmark-top { font-weight: 700; }
.postmark-mid { font-size: 0.6rem; margin: 0.15rem 0; border-top: 1px solid var(--fg); border-bottom: 1px solid var(--fg); padding: 0.1rem 0.3rem; }
.postmark-bot { font-weight: 600; }

[data-theme="dark"] .postmark { background: rgba(17,17,17,0.8); }
[data-theme="grey"] .postmark { background: rgba(136,136,136,0.85); }

/* Right column */
.mint-action { max-width: 480px; }

.mint-headline {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0.5rem 0 0.75rem;
  letter-spacing: -0.01em;
}

.mint-blurb {
  font-size: 0.95rem;
  color: var(--fg-light);
  line-height: 1.55;
  margin-bottom: 1.5rem;
}

.mint-progress-block { margin-bottom: 1.25rem; }
.mint-progress-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.4rem;
}
.mint-progress-count {
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 600;
}
.mint-progress-track {
  height: 6px;
  background: var(--admin-bg);
  border-radius: 3px;
  overflow: hidden;
}
.mint-progress-bar {
  height: 100%;
  background: var(--accent);
  transition: width 0.4s ease;
}

.mint-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
}
.mint-stat { display: flex; flex-direction: column; gap: 0.2rem; }
.mint-stat .label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fg-muted);
}
.mint-stat-value {
  font-family: var(--mono);
  font-size: 0.88rem;
  font-weight: 600;
}

.btn-mint {
  width: 100%;
  padding: 0.9rem;
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s;
}

.btn-mint:hover:not(:disabled) { background: var(--btn-hover); }
.btn-mint:disabled { opacity: 1; cursor: not-allowed; }

.mint-breakdown {
  margin-top: 1.25rem;
  font-size: 0.8rem;
}
.mint-breakdown summary {
  cursor: pointer;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  font-size: 0.72rem;
  padding: 0.4rem 0;
  user-select: none;
}
.mint-breakdown summary:hover { color: var(--fg); }
.mint-split {
  list-style: none;
  padding: 0.5rem 0 0;
  font-family: var(--mono);
  font-size: 0.78rem;
}
.mint-split li {
  display: flex;
  justify-content: space-between;
  padding: 0.3rem 0;
  border-bottom: 1px dashed var(--border);
}
.mint-split li:last-child { border-bottom: none; }

@media (max-width: 800px) {
  .mint-main { grid-template-columns: 1fr; padding: 1.5rem 1rem; gap: 2rem; }
}

/* ─── DATA PAGES (royalties, provenance) ─── */

.data-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem;
}

.data-main h2 {
  font-size: 1.1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.25rem;
}

.data-subtitle {
  font-size: 0.85rem;
  color: var(--fg-muted);
  margin-bottom: 1.5rem;
}

.data-section {
  margin-bottom: 2rem;
}

.data-section h3 {
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.data-note {
  font-size: 0.78rem;
  color: var(--fg-muted);
  margin-bottom: 1rem;
}

/* Summary cards */
.summary-cards {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
}

.summary-card {
  flex: 1;
  padding: 1rem;
  background: var(--admin-bg);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  text-align: center;
}

:root [data-theme="light"] .summary-card,
:root:not([data-theme]) .summary-card,
[data-theme="light"] .summary-card {
  border-color: #2f2f2f;
}

.summary-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fg-muted);
  margin-bottom: 0.3rem;
}

.summary-value {
  display: block;
  font-family: var(--mono);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--fg);
}

.summary-spark {
  display: block;
  width: 100%;
  height: 28px;
  margin-top: 0.5rem;
  overflow: visible;
}

.summary-spark-line {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.5;
  stroke-linejoin: round;
  stroke-linecap: round;
  opacity: 0.85;
}

.summary-spark-area {
  fill: var(--ink);
  opacity: 0.12;
}

.summary-spark-empty {
  display: block;
  width: 100%;
  height: 28px;
  margin-top: 0.5rem;
  border-top: 1px dashed var(--border);
}

/* Data tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.data-table th {
  text-align: left;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--fg-muted);
  padding: 0.5rem 0.6rem;
  border-bottom: 2px solid var(--border);
}

.data-table td {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table .addr-col {
  font-size: 0.72rem;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.data-table a {
  color: var(--fg-light);
  text-decoration: none;
}

.data-table a:hover {
  color: var(--fg);
  text-decoration: underline;
}

.data-table .loading {
  text-align: center;
  color: var(--fg-muted);
  font-style: italic;
  padding: 1.5rem;
}

/* Provenance chain */
.prov-token-select {
  max-width: 400px;
}

.prov-token-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.75rem;
}

.prov-chip {
  font-family: var(--mono);
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--fg-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.prov-chip:hover { border-color: var(--fg-muted); color: var(--fg); }
.prov-chip.active { background: var(--accent); color: var(--sign-fg); border-color: var(--accent); }

.prov-chain {
  padding: 0;
}

.prov-node {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.5rem;
  background: var(--admin-bg);
  border-radius: var(--radius);
}

.prov-number {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--sign-fg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 600;
  flex-shrink: 0;
}

.prov-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.prov-role {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--fg-muted);
}

.prov-addr {
  font-size: 0.7rem;
  word-break: break-all;
}

.prov-connector {
  width: 2px;
  height: 10px;
  background: var(--border);
  margin: 0 0 0 11px;
}

/* Signatures list */
.sig-count {
  font-weight: 400;
  color: var(--fg-muted);
}

.sig-list {
  padding: 0;
}

.sig-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--border);
}

.sig-row:last-child { border-bottom: none; }

.sig-number {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--fg-muted);
  min-width: 1.5rem;
  text-align: right;
}

.sig-addr {
  font-size: 0.7rem;
  word-break: break-all;
  flex: 1;
}

.sig-date {
  font-size: 0.7rem;
  color: var(--fg-muted);
  white-space: nowrap;
}

.empty-state {
  font-size: 0.85rem;
  color: var(--fg-muted);
  font-style: italic;
  padding: 1rem 0;
}

/* ─── SPLASH PAGE ───────────────────────── */

.splash-main {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3.5rem;
  max-width: 1280px;
  margin: 0 auto;
  padding: 3rem 2.5rem;
  align-items: stretch;
  min-height: calc(100vh - 180px);
}

.splash-artwork { display: flex; justify-content: center; align-items: stretch; }

.splash-frame {
  height: 100%;
  max-height: 560px;
  min-height: 360px;
  aspect-ratio: 3 / 4;
  background: var(--admin-bg);
  overflow: hidden;
  border-radius: var(--radius);
  position: relative;
}

.splash-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.splash-thumb.visible { opacity: 1; }

.splash-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  border: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.splash-iframe.ready { opacity: 1; }

.splash-intro {
  max-width: 720px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.splash-kicker-title {
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg);
  line-height: 1.2;
  margin: 0 0 0.5rem;
}

.splash-kicker {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.splash-headline {
  font-family: 'Georgia', 'Times New Roman', serif;
  font-size: clamp(2rem, 3.8vw, 3.4rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--fg);
  margin-bottom: 1.75rem;
}

.splash-headline em {
  font-style: italic;
  font-weight: 500;
}

.splash-body {
  font-size: 1.05rem;
  font-style: italic;
  line-height: 1.65;
  color: var(--fg-light);
  margin-bottom: 2rem;
  max-width: 620px;
}

.splash-body strong { color: var(--fg); font-style: normal; }

.splash-activity {
  margin: -0.5rem 0 1.75rem;
  letter-spacing: 0.01em;
}
.splash-activity-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
  margin-bottom: 0.15rem;
}
.splash-activity-line {
  font-size: 0.82rem;
  font-style: italic;
  color: var(--ink);
  min-height: 1.2em;
}

.splash-ctas {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.splash-ctas .btn {
  padding: 0.7rem 1.2rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.78rem;
  text-decoration: none;
  display: inline-block;
}

@media (max-width: 900px) {
  .splash-main {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 2rem 1.25rem;
  }
  .splash-headline { font-size: 2.2rem; }
  .splash-frame { max-width: 280px; }
}

/* ─── RESPONSIVE ─────────────────────────── */

@media (max-width: 900px) {
  main.viewer-main {
    grid-template-columns: 1fr;
  }
  .panel {
    border-left: none;
    border-top: 1px solid var(--border);
    max-height: none;
  }
  .artwork-frame {
    max-width: 100%;
  }
  header {
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1rem;
  }
  .header-nav {
    order: 3;
    width: 100%;
    justify-content: center;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
  }
  .token-grid,
  .token-grid.grid-sm,
  .token-grid.grid-md,
  .token-grid.grid-lg {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
}

/* ─── LETTER-METAPHOR TOUCHES ─────────────── */

/* Double rule under header (thick + thin) */
header {
  border-bottom: 3px solid var(--fg);
  box-shadow: 0 2px 0 var(--bg), 0 3px 0 var(--border);
}

/* View artwork frame — no border */
.artwork-frame {
  border: none;
  padding: 0;
  background: var(--bg);
}

/* Wax-seal next to signature count */
.sig-count {
  position: relative;
  padding-left: 1.4rem;
}
.sig-count::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--ink) 80%, white) 0%, var(--ink) 70%, color-mix(in srgb, var(--ink) 60%, black) 100%);
  box-shadow: inset 0 0 1px rgba(0,0,0,0.4), 0 0 0 1px rgba(0,0,0,0.15);
}

/* Serif drop-cap removed per user preference */

/* ─── ROYALTY SPLITS (twin bars + envelope) ─── */

/* Color palette for split segments — theme-aware */
:root,
[data-theme="light"] {
  --seg-1: #b6322f;
  --seg-2: #d4774a;
  --seg-3: #e0a05c;
  --seg-4: #c8a878;
  --seg-5: #8a7a5a;
  --seg-6: #5a4a3a;
  --seg-7: #2a2a2a;
}
[data-theme="dark"] {
  --seg-1: #6ec0e8;
  --seg-2: #4a9cc8;
  --seg-3: #94b4ce;
  --seg-4: #c8dceb;
  --seg-5: #3578a8;
  --seg-6: #2a5688;
  --seg-7: #1f3a68;
}
[data-theme="grey"] {
  --seg-1: #6a1a18;
  --seg-2: #8a2420;
  --seg-3: #a64a32;
  --seg-4: #c47850;
  --seg-5: #b89570;
  --seg-6: #8a6848;
  --seg-7: #4a2818;
}

.split-twin {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.split-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.5rem;
}
.split-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.split-meta {
  font-size: 0.7rem;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.split-bar {
  display: flex;
  width: 100%;
  height: 22px;
  border: 1px solid var(--border);
  border-radius: 2px;
  margin-bottom: 0.75rem;
}
.split-seg {
  height: 100%;
  position: relative;
  transition: filter 0.15s ease;
}
.split-seg:hover { filter: brightness(1.15); }
.split-seg[data-tip] { cursor: pointer; }
.split-seg[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  background: var(--fg);
  color: var(--bg);
  padding: 0.3rem 0.55rem;
  border-radius: 4px;
  font-size: 0.75rem;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.1s ease;
  z-index: 10;
}
.split-seg[data-tip]:hover::after { opacity: 1; }

.split-legend {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem 0.75rem;
  font-size: 0.78rem;
  margin: 0;
  padding: 0;
}
.split-legend li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.split-swatch {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
  border: 1px solid rgba(0,0,0,0.1);
}
.split-legend .pct {
  margin-left: auto;
  font-family: var(--mono);
  color: var(--fg-muted);
}

/* Envelope diagram */
.envelope-diagram {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1.5rem;
  margin: 2rem auto 0.5rem;
  max-width: 700px;
  color: var(--fg);
}
.env-side {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.env-right { align-items: flex-start; }
.env-left  { align-items: flex-end; }

.env-label {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.8rem;
  position: relative;
}
.env-left .env-label::after,
.env-right .env-label::before {
  content: "";
  display: inline-block;
  width: 1.5rem;
  border-top: 1px dashed var(--fg-muted);
  height: 0;
  vertical-align: middle;
}
.env-label b {
  font-family: var(--mono);
  font-weight: 600;
  color: var(--fg);
}
.env-label span { color: var(--fg-light); }

.env-svg {
  width: 180px;
  height: auto;
  display: block;
}

.env-caption {
  text-align: center;
  font-size: 0.78rem;
  font-style: italic;
  color: var(--fg-muted);
  margin-top: 0.5rem;
}

@media (max-width: 800px) {
  .split-twin { grid-template-columns: 1fr; gap: 1.5rem; }
  .envelope-diagram { grid-template-columns: 1fr; }
  .env-side { align-items: center; }
}
