/* Rift Anchor Network technical and economy whitepaper. */
.rift-paper {
  --rift-cyan: #65dcff;
  --rift-blue: #488dff;
  --rift-violet: #a878ff;
  --rift-red: #ff667c;
  --rift-green: #5de0a4;
  background: #050711;
  letter-spacing: 0;
}

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

.rift-hero {
  position: relative;
  min-height: 690px;
  max-height: calc(100svh - 92px);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background-image:
    linear-gradient(90deg, rgba(3, 6, 16, 0.99) 0%, rgba(3, 6, 16, 0.9) 37%, rgba(3, 6, 16, 0.3) 67%, rgba(3, 6, 16, 0.06) 100%),
    linear-gradient(0deg, #050711 0%, rgba(5, 7, 17, 0.06) 44%, rgba(5, 7, 17, 0.22) 100%),
    url("../img/rift-anchors/rift-network-gateway-v1.webp");
  background-position: center, center, 82% 50%;
  background-repeat: no-repeat;
  background-size: cover, cover, min(760px, 60vw) min(760px, 60vw);
}

.rift-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 77% 45%, rgba(72, 141, 255, 0.12), transparent 34%),
    linear-gradient(180deg, transparent 74%, #050711 100%);
}

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

.rift-hero-copy > div { width: min(675px, 54%); }
.rift-kicker,
.rift-section-number {
  margin: 0 0 10px;
  color: var(--rift-cyan);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em !important;
}

.rift-hero h1 {
  max-width: 760px;
  color: var(--ink);
  font-size: clamp(44px, 5vw, 72px);
  line-height: 1.02;
  text-wrap: balance;
  text-shadow: 0 10px 38px rgba(0, 0, 0, 0.84);
}

.rift-hero h1 span {
  color: #dbd3ff;
  text-shadow: 0 0 30px rgba(132, 105, 255, 0.3), 0 10px 38px rgba(0, 0, 0, 0.84);
}

.rift-hero-lede {
  max-width: 640px;
  margin: 18px 0 0;
  color: #dce8f7;
  font-size: 19px;
  line-height: 1.57;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.92);
}

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

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

.rift-release-note {
  margin: 18px 0 0;
  color: #8fa2ba;
  font-size: 13px;
}

.rift-release-note code,
.rift-content code {
  padding: 1px 5px;
  color: var(--rift-cyan);
  background: rgba(101, 220, 255, 0.08);
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.88em;
}

.rift-metrics {
  border-bottom: 1px solid var(--line);
  background: rgba(5, 7, 17, 0.96);
}

.rift-metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.rift-metric {
  min-height: 108px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 18px 24px;
  border-left: 1px solid var(--line);
}
.rift-metric:last-child { border-right: 1px solid var(--line); }
.rift-metric b { color: #e9e1ff; font-family: var(--font-display); font-size: 25px; }
.rift-metric span { margin-top: 3px; color: var(--muted); font-size: 13px; text-transform: uppercase; }

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

.rift-toc {
  position: sticky;
  top: 94px;
  padding-left: 16px;
  border-left: 1px solid var(--line);
}
.rift-toc strong {
  display: block;
  margin-bottom: 10px;
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 12px;
  text-transform: uppercase;
}
.rift-toc a { display: block; padding: 6px 0; color: var(--muted); font-size: 14px; line-height: 1.3; }
.rift-toc a:hover { color: var(--ink); }

.rift-content { min-width: 0; max-width: 920px; }
.rift-content section { scroll-margin-top: 96px; padding: 0 0 60px; }
.rift-content section + section { padding-top: 56px; border-top: 1px solid var(--line); }
.rift-content h2 { color: #e8ddff; font-size: 33px; line-height: 1.15; }
.rift-content h3 { margin: 28px 0 8px; color: var(--ink); font-size: 20px; }
.rift-content p { color: var(--ink-dim); }
.rift-content .rift-lead { color: var(--ink); font-size: 19px; }
.rift-caption { margin: 11px 0 0; color: var(--muted) !important; font-size: 13px; }

.rift-status-note,
.rift-note {
  margin: 24px 0;
  padding: 17px 19px;
  border-left: 3px solid var(--rift-cyan);
  background: rgba(39, 124, 164, 0.12);
}
.rift-status-note b { color: var(--ink); }
.rift-status-note p,
.rift-note p { margin: 4px 0 0; }
.rift-note.warning { border-left-color: var(--gold); background: rgba(216, 178, 74, 0.08); }
.rift-note.danger { border-left-color: var(--rift-red); background: rgba(255, 84, 105, 0.08); }

.rift-pillars {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin-top: 28px;
  background: var(--line);
  border: 1px solid var(--line);
}
.rift-pillars article { min-height: 170px; padding: 22px; background: #080c19; }
.rift-pillars span { color: var(--rift-cyan); font-size: 12px; font-weight: 700; }
.rift-pillars h3 { margin: 7px 0 6px; font-size: 18px; }
.rift-pillars p { margin: 0; font-size: 14px; }

.rift-loop {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  margin: 30px 0 0;
  padding: 0;
  list-style: none;
  border-block: 1px solid var(--line);
}
.rift-loop li { min-height: 160px; margin: 0; padding: 18px 13px; border-right: 1px solid var(--line); }
.rift-loop li:last-child { border-right: 0; }
.rift-loop small { color: var(--rift-cyan); font-weight: 700; }
.rift-loop b { display: block; margin-top: 4px; color: var(--ink); font-family: var(--font-display); }
.rift-loop p { margin: 7px 0 0; font-size: 13px; line-height: 1.4; }

.rift-figure { margin: 28px 0 0; }
.rift-figure img { display: block; width: 100%; border: 1px solid var(--line); border-radius: 4px; }
.rift-figure figcaption { margin-top: 8px; color: var(--muted); font-size: 13px; }
.rift-figure-wide { max-width: 720px; }

.rift-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 30px 22px;
  margin-top: 32px;
}
.rift-card { --tier: #65dcff; min-width: 0; margin: 0; text-align: center; }
.rift-card img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.58));
  transition: transform 180ms ease, filter 180ms ease;
}
.rift-card:hover img { transform: translateY(-4px); filter: drop-shadow(0 22px 30px rgba(0, 0, 0, 0.68)); }
.rift-card figcaption { display: flex; flex-direction: column; align-items: center; margin-top: 8px; }
.rift-card figcaption span { color: var(--tier); font-size: 12px; font-weight: 700; text-transform: uppercase; }
.rift-card figcaption b { margin-top: 3px; color: var(--ink); font-family: var(--font-display); }
.rift-card figcaption small { margin-top: 3px; color: var(--muted); line-height: 1.35; }

.tier-common { --tier: #bcc5d2; color: #bcc5d2; }
.tier-uncommon { --tier: #5de0a4; color: #5de0a4; }
.tier-rare { --tier: #65dcff; color: #65dcff; }
.tier-epic { --tier: #b284ff; color: #b284ff; }
.tier-legendary { --tier: #f4c95d; color: #f4c95d; }
.tier-mythic { --tier: #ff667c; color: #ff667c; }
.tier-divine { --tier: #fff1bd; color: #fff1bd; }
.tier-ethereal { --tier: #92f4ef; color: #92f4ef; }
.tier-celestial { --tier: #a7bfff; color: #a7bfff; }

.rift-table-wrap {
  width: 100%;
  margin-top: 28px;
  overflow-x: auto;
  border-block: 1px solid var(--line);
}
.rift-table {
  width: 100%;
  min-width: 750px;
  border-collapse: collapse;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.rift-table th,
.rift-table td { padding: 12px 13px; border-bottom: 1px solid var(--line-soft); text-align: left; white-space: nowrap; }
.rift-table tr:last-child td { border-bottom: 0; }
.rift-table th { color: var(--gold); font-size: 12px; text-transform: uppercase; background: rgba(6, 9, 21, 0.95); }
.rift-table tbody tr:hover { background: rgba(101, 220, 255, 0.035); }
.rift-table .number { text-align: right; }

.rift-fracture-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.75fr) minmax(0, 1.25fr);
  gap: 34px;
  align-items: center;
  margin-top: 30px;
}
.rift-anchor-cutout { margin: 0; text-align: center; }
.rift-anchor-cutout img { display: block; width: 100%; filter: drop-shadow(0 22px 32px rgba(0, 0, 0, 0.62)); }
.rift-anchor-cutout figcaption { color: var(--muted); font-size: 13px; }
.rift-fracture-steps { display: grid; gap: 10px; }
.rift-fracture-steps article { padding: 17px 18px; border: 1px solid var(--line); background: rgba(8, 13, 27, 0.78); }
.rift-fracture-steps span { color: var(--rift-cyan); font-size: 12px; font-weight: 700; text-transform: uppercase; }
.rift-fracture-steps b { display: block; margin-top: 2px; color: var(--ink); }
.rift-fracture-steps p { margin: 4px 0 0; font-size: 14px; }
.rift-fracture-steps .danger { border-color: rgba(255, 102, 124, 0.36); }
.rift-fracture-steps .danger span { color: var(--rift-red); }
.rift-fracture-steps .restored { border-color: rgba(93, 224, 164, 0.3); }
.rift-fracture-steps .restored span { color: var(--rift-green); }

.rift-formula,
.rift-craft-visual {
  display: grid;
  align-items: center;
  gap: 18px;
  margin: 28px 0;
  padding: 22px 0;
  border-block: 1px solid var(--line);
}
.rift-formula { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
.rift-craft-visual { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr); }
.rift-formula b,
.rift-craft-visual b { display: block; color: #e8ddff; font-family: var(--font-display); font-size: 21px; }
.rift-formula span,
.rift-craft-visual span { color: var(--muted); font-size: 13px; }
.rift-formula i,
.rift-craft-visual i { color: var(--rift-cyan); font-family: var(--font-display); font-size: 24px; font-style: normal; }

.rift-rule-grid,
.rift-architecture {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin-top: 28px;
  border: 1px solid var(--line);
  background: var(--line);
}
.rift-rule-grid article,
.rift-architecture article { min-height: 165px; padding: 22px; background: #080c19; }
.rift-rule-grid h3,
.rift-architecture h3 { margin: 0 0 7px; font-size: 18px; }
.rift-rule-grid p,
.rift-architecture p { margin: 0; font-size: 14px; }
.rift-architecture span { color: var(--rift-cyan); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.rift-architecture h3 { margin-top: 4px; }

.rift-mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 28px;
}
.rift-mode-grid article { padding: 23px; border: 1px solid rgba(168, 120, 255, 0.28); background: rgba(22, 13, 44, 0.22); }
.rift-mode-grid article + article { border-color: rgba(101, 220, 255, 0.28); background: rgba(11, 37, 55, 0.22); }
.rift-mode-grid h3 { margin: 5px 0 10px; }
.rift-mode-grid ul { margin: 0; padding-left: 19px; color: var(--ink-dim); }
.rift-mode-grid li { margin: 7px 0; }
.rift-mode-label { margin: 0 !important; color: var(--rift-violet) !important; font-size: 12px; font-weight: 700; text-transform: uppercase; }
.rift-mode-label.production { color: var(--rift-cyan) !important; }

.rift-checklist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 28px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}
.rift-checklist li { position: relative; padding: 12px 0 12px 26px; border-top: 1px solid var(--line-soft); color: var(--ink-dim); }
.rift-checklist li::before { content: "✓"; position: absolute; left: 2px; color: var(--rift-green); font-weight: 700; }

.rift-disclaimer { padding: 25px; border: 1px solid rgba(255, 102, 124, 0.32); background: rgba(87, 18, 37, 0.16); }
.rift-disclaimer p { margin: 0; }
.rift-disclaimer p + p { margin-top: 11px; }
.rift-reference-links { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 22px; }
.rift-reference-links a { color: var(--rift-cyan); font-weight: 700; text-decoration: underline; text-underline-offset: 4px; }

@media (max-width: 1080px) {
  .rift-loop { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .rift-loop li:nth-child(4) { border-right: 0; }
  .rift-loop li:nth-child(-n + 4) { border-bottom: 1px solid var(--line); }
}

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

@media (max-width: 700px) {
  .rift-hero {
    min-height: 650px;
    max-height: none;
    background-image:
      linear-gradient(0deg, rgba(3, 6, 16, 0.99) 0%, rgba(3, 6, 16, 0.78) 50%, rgba(3, 6, 16, 0.1) 88%),
      url("../img/rift-anchors/rift-network-gateway-v1.webp");
    background-position: center, center 8%;
    background-size: cover, 520px 520px;
  }
  .rift-hero-copy { padding-bottom: 34px; }
  .rift-hero-copy > div { width: 100%; }
  .rift-hero h1 { font-size: 41px; }
  .rift-hero-lede { font-size: 17px; }
  .rift-hero-actions { align-items: flex-start; flex-direction: column; gap: 12px; }
  .rift-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rift-metric { min-height: 90px; padding: 14px; border-bottom: 1px solid var(--line); }
  .rift-metric:nth-child(2) { border-right: 1px solid var(--line); }
  .rift-metric:nth-last-child(-n + 2) { border-bottom: 0; }
  .rift-metric b { font-size: 20px; }
  .rift-layout { padding-top: 34px; padding-bottom: 48px; }
  .rift-toc { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rift-content section { padding-bottom: 44px; }
  .rift-content section + section { padding-top: 42px; }
  .rift-content h2 { font-size: 27px; }
  .rift-pillars,
  .rift-rule-grid,
  .rift-architecture,
  .rift-mode-grid,
  .rift-checklist { grid-template-columns: 1fr; }
  .rift-loop { grid-template-columns: 1fr; }
  .rift-loop li { min-height: 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .rift-loop li:nth-child(-n + 4) { border-bottom: 1px solid var(--line); }
  .rift-loop li:last-child { border-bottom: 0; }
  .rift-gallery { grid-template-columns: 1fr; gap: 22px; }
  .rift-card { max-width: 390px; margin-inline: auto; }
  .rift-fracture-grid { grid-template-columns: 1fr; }
  .rift-anchor-cutout { max-width: 390px; margin-inline: auto; }
  .rift-formula,
  .rift-craft-visual { grid-template-columns: 1fr; gap: 8px; }
  .rift-formula i,
  .rift-craft-visual i { transform: rotate(90deg); }
}

@media print {
  .site-header,
  .rift-toc,
  .site-footer,
  .rift-hero-actions,
  .rift-chain-link { display: none; }
  .rift-paper { background: #fff; color: #111; }
  .rift-hero { min-height: 0; padding: 34px 0; background: #fff; border-bottom: 2px solid #222; }
  .rift-hero-copy { padding: 0; }
  .rift-hero-copy > div { width: 100%; }
  .rift-hero h1,
  .rift-hero h1 span,
  .rift-content h2,
  .rift-content h3 { color: #111; text-shadow: none; }
  .rift-hero-lede,
  .rift-content p,
  .rift-mode-grid li,
  .rift-checklist li { color: #333; text-shadow: none; }
  .rift-layout { display: block; padding-top: 24px; }
  .rift-content { max-width: none; }
  .rift-content section { break-inside: avoid; }
  .rift-pillars article,
  .rift-rule-grid article,
  .rift-architecture article,
  .rift-fracture-steps article,
  .rift-mode-grid article,
  .rift-note,
  .rift-status-note,
  .rift-disclaimer { background: #fff; }
  .rift-card img { filter: none; }
}
