/* Wellspring Sanctum mechanics whitepaper. */
.sanctum-paper {
  --sanctum-cyan: #73dcff;
  --sanctum-violet: #ac83ff;
  --sanctum-green: #61dfa1;
  --sanctum-red: #ff6f7e;
  background-color: #050811;
  background-image: none;
  letter-spacing: 0;
}

.sanctum-paper h1,
.sanctum-paper h2,
.sanctum-paper h3,
.sanctum-paper p,
.sanctum-paper a,
.sanctum-paper th,
.sanctum-paper td {
  letter-spacing: 0;
}

.sanctum-hero {
  position: relative;
  height: 680px;
  max-height: calc(100svh - 92px);
  min-height: 520px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background-image:
    linear-gradient(90deg, rgba(4, 7, 17, 0.98) 0%, rgba(4, 7, 17, 0.78) 42%, rgba(4, 7, 17, 0.12) 72%),
    linear-gradient(0deg, #050811 0%, rgba(5, 8, 17, 0.1) 46%, rgba(5, 8, 17, 0.22) 100%),
    url("../img/aetherwell/sanctum-hero-v1.webp"),
    url("../img/aetherwell/sanctum-space-v1.webp");
  background-position: center, center, 82% 48%, center;
  background-repeat: no-repeat;
  background-size: cover, cover, 760px 760px, cover;
}

.sanctum-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 70%, #050811 100%);
}

.sanctum-hero-copy {
  position: relative;
  z-index: 1;
  width: 100%;
  padding-bottom: 62px;
}

.sanctum-hero-copy > div {
  width: min(650px, 52%);
}

.sanctum-kicker {
  margin: 0 0 12px;
  color: var(--sanctum-cyan);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.sanctum-hero h1 {
  max-width: 760px;
  color: var(--ink);
  font-size: 64px;
  line-height: 1.02;
  text-wrap: balance;
  text-shadow: 0 10px 36px rgba(0, 0, 0, 0.82);
}

.sanctum-hero h1 span { color: var(--gold-bright); }

.sanctum-hero-lede {
  max-width: 610px;
  margin: 18px 0 0;
  color: #d8e4f1;
  font-size: 19px;
  line-height: 1.55;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.9);
}

.sanctum-hero-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 24px;
}

.sanctum-hero-actions .sanctum-chain-link {
  color: var(--sanctum-cyan);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.sanctum-metrics {
  border-bottom: 1px solid var(--line);
  background: rgba(5, 8, 17, 0.94);
}

.sanctum-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.sanctum-metric {
  min-height: 104px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 18px 24px;
  border-left: 1px solid var(--line);
}

.sanctum-metric:last-child { border-right: 1px solid var(--line); }
.sanctum-metric b { color: var(--gold-bright); font-family: var(--font-display); font-size: 25px; }
.sanctum-metric span { margin-top: 3px; color: var(--muted); font-size: 13px; text-transform: uppercase; }

.sanctum-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 52px;
  align-items: start;
  padding-top: 56px;
  padding-bottom: 80px;
}

.sanctum-toc {
  position: sticky;
  top: 94px;
  padding-left: 16px;
  border-left: 1px solid var(--line);
}

.sanctum-toc strong {
  display: block;
  margin-bottom: 10px;
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 12px;
  text-transform: uppercase;
}

.sanctum-toc a {
  display: block;
  padding: 6px 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.3;
}

.sanctum-toc a:hover { color: var(--ink); }

.sanctum-content { min-width: 0; max-width: 900px; }
.sanctum-content section { scroll-margin-top: 96px; padding: 0 0 58px; }
.sanctum-content section + section { padding-top: 54px; border-top: 1px solid var(--line); }

.sanctum-section-number {
  margin: 0 0 4px;
  color: var(--sanctum-cyan);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.sanctum-content h2 { color: var(--gold-bright); font-size: 32px; line-height: 1.15; }
.sanctum-content h3 { margin: 28px 0 8px; color: var(--ink); font-size: 20px; }
.sanctum-content p { color: var(--ink-dim); }
.sanctum-content .sanctum-lead { color: var(--ink); font-size: 19px; }
.sanctum-content code {
  padding: 1px 5px;
  color: var(--sanctum-cyan);
  background: rgba(115, 220, 255, 0.08);
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.88em;
}

.sanctum-loop {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 30px 0 0;
  border-block: 1px solid var(--line);
}

.sanctum-loop-step {
  position: relative;
  min-height: 132px;
  padding: 20px 16px;
  border-right: 1px solid var(--line);
}

.sanctum-loop-step:last-child { border-right: 0; }
.sanctum-loop-step small { color: var(--sanctum-cyan); font-weight: 700; }
.sanctum-loop-step b { display: block; margin-top: 4px; color: var(--ink); font-family: var(--font-display); }
.sanctum-loop-step p { margin: 6px 0 0; font-size: 14px; line-height: 1.4; }

.sanctum-formula {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  margin: 26px 0;
  padding: 22px 0;
  border-block: 1px solid var(--line);
}

.sanctum-formula div { min-width: 0; }
.sanctum-formula b { display: block; color: var(--gold-bright); font-family: var(--font-display); font-size: 24px; }
.sanctum-formula span { color: var(--muted); font-size: 13px; }
.sanctum-formula i { color: var(--sanctum-cyan); font-family: var(--font-display); font-size: 25px; font-style: normal; }

.sanctum-note {
  margin: 22px 0;
  padding: 16px 18px;
  border-left: 3px solid var(--sanctum-cyan);
  background: rgba(34, 112, 145, 0.12);
}

.sanctum-note.warning {
  border-left-color: var(--gold);
  background: rgba(216, 178, 74, 0.08);
}

.sanctum-note.danger {
  border-left-color: var(--sanctum-red);
  background: rgba(255, 84, 105, 0.08);
}

.sanctum-note p { margin: 0; }
.sanctum-note p + p { margin-top: 6px; }
.sanctum-note strong { color: var(--ink); }

.sanctum-table-wrap {
  width: 100%;
  margin-top: 22px;
  overflow-x: auto;
  border-block: 1px solid var(--line);
}

.sanctum-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.sanctum-table th,
.sanctum-table td {
  padding: 12px 13px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  white-space: nowrap;
}

.sanctum-table tr:last-child td { border-bottom: 0; }
.sanctum-table th { color: var(--gold); font-size: 12px; text-transform: uppercase; background: rgba(6, 10, 22, 0.9); }
.sanctum-table tbody tr:hover { background: rgba(115, 220, 255, 0.035); }
.sanctum-table .number { text-align: right; }
.sanctum-table .pending-row { background: rgba(216, 178, 74, 0.055); }

.tier-common { color: #b9c2d2; }
.tier-uncommon { color: #61dfa1; }
.tier-rare { color: #62cfff; }
.tier-epic { color: #b786ff; }
.tier-legendary { color: #f4c95d; }
.tier-mythic { color: #ff6f7e; }
.tier-divine { color: #fff0b8; }
.tier-ethereal { color: #8cf2f4; }
.tier-celestial { color: #87baff; }

.sanctum-rolls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
  margin-top: 24px;
}

.sanctum-roll {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(8, 13, 27, 0.78);
}

.sanctum-roll h3 { margin: 0; color: var(--gold-bright); }
.sanctum-roll > p { margin: 7px 0 0; font-size: 14px; }
.sanctum-roll .sanctum-table { min-width: 0; }
.sanctum-roll .sanctum-table-wrap { margin-top: 16px; }

.sanctum-expected {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 24px 0;
  border-block: 1px solid var(--line);
}

.sanctum-expected div { padding: 17px; border-right: 1px solid var(--line); }
.sanctum-expected div:last-child { border-right: 0; }
.sanctum-expected b { display: block; color: var(--sanctum-cyan); font-size: 22px; }
.sanctum-expected span { color: var(--muted); font-size: 13px; }

.sanctum-figure { margin: 26px 0 0; }
.sanctum-figure img { width: 100%; border: 1px solid var(--line); border-radius: 4px; }
.sanctum-figure figcaption { margin-top: 8px; color: var(--muted); font-size: 13px; }

.sanctum-rules {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 34px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.sanctum-rules li { padding: 14px 0; border-top: 1px solid var(--line-soft); color: var(--ink-dim); }
.sanctum-rules strong { display: block; color: var(--ink); }

.sanctum-status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
  margin-top: 22px;
}

.sanctum-status-grid h3 { margin-top: 0; }
.sanctum-status-grid ul { margin: 0; padding-left: 19px; color: var(--ink-dim); }
.sanctum-status-grid li { margin: 8px 0; }

.sanctum-disclaimer {
  padding: 24px;
  border: 1px solid rgba(255, 111, 126, 0.34);
  background: rgba(86, 18, 32, 0.15);
}

.sanctum-disclaimer p { margin: 0; }
.sanctum-disclaimer p + p { margin-top: 10px; }

@media (max-width: 960px) {
  .sanctum-hero {
    height: 650px;
    background-position: center, center, 112% 46%, center;
    background-size: cover, cover, 650px 650px, cover;
  }
  .sanctum-hero-copy > div { width: 58%; }
  .sanctum-hero h1 { font-size: 52px; }
  .sanctum-layout { grid-template-columns: 1fr; gap: 32px; }
  .sanctum-toc { position: static; display: grid; grid-template-columns: repeat(3, 1fr); padding: 18px 0; border-block: 1px solid var(--line); border-left: 0; }
  .sanctum-toc strong { grid-column: 1 / -1; }
}

@media (max-width: 700px) {
  .sanctum-hero {
    height: 610px;
    min-height: 560px;
    max-height: calc(100svh - 72px);
    background-image:
      linear-gradient(0deg, rgba(4, 7, 17, 0.99) 0%, rgba(4, 7, 17, 0.78) 42%, rgba(4, 7, 17, 0.08) 78%),
      url("../img/aetherwell/sanctum-hero-v1.webp"),
      url("../img/aetherwell/sanctum-space-v1.webp");
    background-position: center, center 20%, center;
    background-size: cover, 520px 520px, cover;
  }
  .sanctum-hero-copy { padding-bottom: 34px; }
  .sanctum-hero-copy > div { width: 100%; }
  .sanctum-hero h1 { font-size: 40px; }
  .sanctum-hero-lede { font-size: 17px; }
  .sanctum-hero-actions { align-items: flex-start; flex-direction: column; gap: 12px; }
  .sanctum-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sanctum-metric { min-height: 88px; padding: 14px; border-bottom: 1px solid var(--line); }
  .sanctum-metric:nth-child(2) { border-right: 1px solid var(--line); }
  .sanctum-metric:nth-last-child(-n + 2) { border-bottom: 0; }
  .sanctum-metric b { font-size: 20px; }
  .sanctum-layout { padding-top: 34px; padding-bottom: 48px; }
  .sanctum-toc { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sanctum-content section { padding-bottom: 42px; }
  .sanctum-content section + section { padding-top: 40px; }
  .sanctum-content h2 { font-size: 27px; }
  .sanctum-loop { grid-template-columns: 1fr; }
  .sanctum-loop-step { min-height: 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .sanctum-loop-step:last-child { border-bottom: 0; }
  .sanctum-formula { grid-template-columns: 1fr; gap: 8px; }
  .sanctum-formula i { transform: rotate(90deg); }
  .sanctum-rolls,
  .sanctum-rules,
  .sanctum-status-grid { grid-template-columns: 1fr; }
  .sanctum-expected { grid-template-columns: 1fr; }
  .sanctum-expected div { border-right: 0; border-bottom: 1px solid var(--line); }
  .sanctum-expected div:last-child { border-bottom: 0; }
}

@media print {
  .site-header,
  .sanctum-toc,
  .site-footer,
  .sanctum-hero-actions { display: none; }
  .sanctum-paper { background: #fff; color: #111; }
  .sanctum-hero { height: auto; min-height: 0; padding: 32px 0; background: #fff; border-bottom: 2px solid #222; }
  .sanctum-hero-copy { padding: 0; }
  .sanctum-hero-copy > div { width: 100%; }
  .sanctum-hero h1,
  .sanctum-hero h1 span,
  .sanctum-content h2,
  .sanctum-content h3 { color: #111; text-shadow: none; }
  .sanctum-hero-lede,
  .sanctum-content p,
  .sanctum-rules li,
  .sanctum-status-grid ul { color: #333; text-shadow: none; }
  .sanctum-layout { display: block; padding-top: 24px; }
  .sanctum-content { max-width: none; }
  .sanctum-content section { break-inside: avoid; }
  .sanctum-roll,
  .sanctum-note,
  .sanctum-disclaimer { background: #fff; }
}
