/* ============================================================
   EXCLUSIVE (exclusive.html) — Crest Forge
   1. Header (.page-band): the buy path (store CTA, the MEE6 terms right
      under it) beside a crest portal onto the standing stones; the stego
      walks out of the frame onto the ledge.
   2. The ladder: five crest-cut pedestals rising left to right in the
      crystal cave. Each relic stands on its pedestal's top face; the
      spine branches into the lowest step and its trace climbs the step
      tops (motion.js ladder()). Static: every cap lit, every relic shown.
   3. Compare: every paid rank side by side, each column headed by its
      relic.
   4. Closing: how to get a rank, the free Booster rank on its own
      pedestal, the small print; the page settles into mist.
   No red: chat-tag colours are words (data.js accent is never painted).
   ============================================================ */

/* relic art metrics ([data-relic] --sink / --h / --k) live in style.css (the home vault uses them too) */

/* ---------- 1. header ---------- */

.vip-head .lede { max-width: 46ch; margin-bottom: var(--s-6); }
.vip-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3) var(--s-4); }
.vip-actions:empty { display: none; }
#vip-terms {
  max-width: 58ch;
  margin: var(--s-5) 0 0;
  padding-left: var(--s-4);
  box-shadow: inset 1px 0 var(--rule-strong);
  font-size: var(--fs-fine);
  line-height: 1.6;
  color: var(--fg-soft);
}
#vip-terms strong { color: var(--silver); font-weight: 600; }
#vip-terms a { color: var(--silver); }
/* the stage: no creature. The crest window opens on the crystal cave and the Supreme crown stands on the ledge
   inside the frame, centred under the apex; its feet sit on the rock (its art floats in a transparent square,
   so the box drops by --sink), a contact shadow grounds it and the cave's crystals light it from behind */
.vip-stage-art { --cast-x: 27%; --cast-w: 46%; --cast-y: calc(8% - var(--sink) * 46% * 1.12); }
.vip-plate > img { object-position: 74% 38%; }
.vip-crown::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 18%; right: 18%;
  bottom: calc(var(--sink) * 100% - 8px);
  height: 16px;
  background: radial-gradient(closest-side, rgba(1, 3, 12, 0.92), rgba(1, 3, 12, 0));
}
.vip-crown .glint {
  -webkit-mask: url("/assets/img/relics/supreme-512.webp") center / contain no-repeat;
  mask: url("/assets/img/relics/supreme-512.webp") center / contain no-repeat;
}
@media (min-width: 960px) {
  .vip-head .page-band-inner { grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr); }
  .vip-stage-art { width: min(100%, 600px); }
}
@media (max-width: 639.98px) {
  .vip-actions .btn { flex: 1 1 100%; }
}

/* ---------- 2. the ladder ---------- */

.vip-stage { isolation: isolate; overflow: clip; }
.ladder-env { z-index: -1; }
.ladder-cave {
  bottom: 18%;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 22%, #000 70%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 22%, #000 70%, transparent 100%);
}
.ladder-cave > img { object-position: 64% 46%; opacity: 0.8; }
/* stacked: the cave sits behind the heading and the lowest steps at a natural scale (cover over a tall phone
   section would blow the crystals up into grey smears) */
@media (max-width: 1179.98px) { .ladder-cave { bottom: auto; height: min(100%, 760px); } }
.ladder-mist { top: auto; height: 52%; }
.ladder-mist > img { object-position: 50% 100%; opacity: 0.32; }
.ladder-scrim {
  background:
    linear-gradient(180deg, var(--void) 0%, rgba(3, 6, 26, 0.2) 18%, rgba(3, 6, 26, 0.35) 62%, rgba(3, 6, 26, 0.9) 100%),
    linear-gradient(90deg, rgba(3, 6, 26, 0.85) 0%, rgba(3, 6, 26, 0.45) 36%, rgba(3, 6, 26, 0) 70%);
}
html.motion .ladder-env > .env-layer, html.motion .close-env > .env-layer { top: -8%; }
html.motion .ladder-cave { bottom: 10%; }
.ladder-head .sec-note p { color: var(--silver); }
.ladder-terms { max-width: 66ch; margin: var(--s-6) 0 0; }

.vip-ladder { --gap: 14px; position: relative; margin: 0; padding: 0; list-style: none; }

/* a step: the front face is a facet plate (::before keeps focus rings unclipped); the top face is a crest-cut
   trapezoid seen from just above (::after), the surface the relic stands on */
.vip-tier {
  --box: 124px;
  --tr: calc(var(--box) * var(--k));
  position: relative;
  isolation: isolate;
  min-width: 0;
  container-type: inline-size;
  display: flex;
  flex-direction: column;
  padding: 22px 20px 20px;
}
.vip-tier::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(203, 215, 220, 0.22) 0 1px, transparent 1px),
    linear-gradient(90deg, rgba(203, 215, 220, 0.08) 0 1px, transparent 1px calc(100% - 1px), rgba(0, 0, 0, 0.45) calc(100% - 1px)),
    linear-gradient(180deg, rgba(16, 28, 62, 0.94), rgba(10, 18, 48, 0.94) 55%, rgba(8, 14, 38, 0.96));
}
.vip-tier::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: 0; right: 0;
  bottom: 100%;
  height: 12px;
  background: linear-gradient(180deg, #14244A 0%, #2A4462 55%, #5E7A92 92%, #A7B6C1 100%);
  clip-path: polygon(12px 0, calc(100% - 12px) 0, 100% 100%, 0 100%);
}
.vip-tier.highlight::before {
  background:
    linear-gradient(180deg, rgba(245, 248, 248, 0.42) 0 1px, transparent 1px),
    linear-gradient(0deg, var(--violet) 0 1px, transparent 1px),
    linear-gradient(90deg, rgba(203, 215, 220, 0.12) 0 1px, transparent 1px calc(100% - 1px), rgba(0, 0, 0, 0.45) calc(100% - 1px)),
    linear-gradient(180deg, rgba(23, 40, 82, 0.96), rgba(16, 28, 62, 0.96) 55%, rgba(11, 20, 50, 0.97));
}
.vip-tier.highlight::after { background: linear-gradient(180deg, #1B2D55 0%, #3B5878 50%, #8FA6B8 90%, #F5F8F8 100%); }

/* the trace along the step's front top edge; .riser climbs from the step below; the cap pad is the junction */
.vip-tier > .cap {
  position: absolute;
  z-index: 2;
  left: 0; right: 0;
  top: -1px;
  height: 2px;
  background: var(--trace);
  transform-origin: 0 50%;
}
.vip-tier > .riser { display: none; }
.vip-tier > .cap-pad { --pad: 12px; left: calc(var(--pad) / -2); top: calc(var(--pad) / -2 - 0.5px); }
.vip-tier > .step-via { --pad: 12px; left: calc(var(--lane) * -0.5 - var(--pad) / 2); top: calc(var(--pad) / -2 - 0.5px); }
.vip-tier > .stub { top: -0.5px; }

/* the relic stands on the top face; its art floats in a transparent square, so the box drops by --sink */
.vip-tier .relic, .booster-tier .relic {
  position: absolute;
  z-index: 3;
  width: var(--tr);
  aspect-ratio: 1;
  bottom: calc(100% + 6px - var(--sink) * var(--tr));
  pointer-events: none;
}
.relic-art { position: relative; display: block; width: 100%; height: 100%; transition: transform 0.55s var(--ease-press); }
.relic-art > img { width: 100%; height: 100%; }
/* contact shadow on the top face under the object */
.relic::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 24%; right: 24%;
  bottom: calc(var(--sink) * 100% - 7px);
  height: 12px;
  background: radial-gradient(closest-side, rgba(1, 3, 12, 0.85), rgba(1, 3, 12, 0));
}
.vip-tier:hover .relic-art, .booster-tier:hover .relic-art { transform: translateY(-8px); }

.tier-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 var(--s-2); }
.vip-tier h3 { font-size: 1.75rem; line-height: 1.05; }
.tier-pts { margin: var(--s-4) 0 0; }
.num-mask { display: block; overflow-x: visible; overflow-y: clip; padding: 0.06em 0 0.08em; margin: -0.06em 0 -0.08em; } /* vertical clip only (WCAG 1.4.12) */
.tier-num {
  display: block;
  font: 800 3.5rem/0.92 var(--font-display);
  font-stretch: 84%;
  font-variant-numeric: tabular-nums lining-nums;
  white-space: nowrap;
  background-size: 100% 0.92em; /* .chrome: one horizon across the figure */
}
.tier-lbl { display: block; margin-top: 6px; font-size: var(--fs-fine); color: var(--fg-soft); }

.tier-specs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-3) var(--s-4);
  margin: var(--s-4) 0 0;
  padding: var(--s-4) 0 0;
  list-style: none;
  box-shadow: inset 0 1px var(--rule);
  font-size: var(--fs-small);
  line-height: 1.45;
}
.tier-specs > li { min-width: 0; }
.spec { display: flex; flex-direction: column; gap: 2px; }
.spec-num { font: 700 1.5rem/1 var(--font-display); font-stretch: 88%; color: var(--chrome); }
.spec-lbl { font-size: var(--fs-fine); color: var(--fg-soft); }
.spec-tag, .spec-kit { grid-column: 1 / -1; }
.spec-tag { color: var(--silver); }
.spec-kit { color: var(--silver); }
.spec-kit b { display: block; margin-bottom: 2px; color: var(--chrome); font-weight: 600; }
.vip-tier .tier-buy { width: 100%; margin-top: auto; }
.vip-tier .tier-specs + .tier-buy { margin-top: var(--s-5); }

/* stacked (below 1180): steps one above the other, widening tier by tier; the relic stands on the right of the
   step's top face, so each step leaves room above it for its own relic */
@media (max-width: 1179.98px) {
  .vip-ladder { display: grid; gap: 0; }
  .vip-tier { margin: calc(var(--tr) * var(--h) + 22px) calc((1 - var(--t, 1)) * 12%) 0 0; }
  .vip-tier:first-child { margin-top: calc(var(--tr) * var(--h) + 10px); }
  .vip-tier .relic { right: 18px; }
  .vip-tier .tier-num { font-size: min(2.875rem + 1.25rem * var(--t, 1), 19cqi); }
}
@media (min-width: 720px) and (max-width: 1179.98px) {
  .vip-tier { --box: 168px; padding: 24px 26px 24px; }
  .vip-tier {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    grid-template-areas: "head specs" "pts specs" "buy specs";
    grid-template-rows: auto auto 1fr;
    column-gap: var(--s-6);
    align-items: start;
  }
  .vip-tier .tier-head { grid-area: head; }
  .vip-tier .tier-pts { grid-area: pts; }
  .vip-tier .tier-specs { grid-area: specs; margin-top: 0; padding-top: 0; box-shadow: none; }
  .vip-tier .tier-buy, .vip-tier .tier-specs + .tier-buy { grid-area: buy; align-self: end; width: auto; margin-top: var(--s-5); }
  .vip-tier .tier-num { font-size: min(3.25rem + 1.25rem * var(--t, 1), 13cqi); }
}

/* wide: pedestals rising left to right. Each step spans one more --rise row than the step before it, so the
   tops climb by the same amount whatever the content; buttons line up along the floor. The heading sits in the
   free corner above the two lowest steps; the relics (bigger each tier) stand above the steps */
@media (min-width: 1180px) {
  .vip-stage > .container { display: grid; grid-template-columns: minmax(0, 1fr); }
  .vip-stage .ladder-head, .vip-stage .vip-ladder { grid-area: 1 / 1; }
  .vip-stage .ladder-head {
    z-index: 4;
    align-self: start;
    grid-template-columns: minmax(0, 1fr);
    max-width: calc((100% - 4 * 14px) / 5 * 2 + 14px);
    margin: 0;
  }
  .ladder-head .sec-note { max-width: 40ch; }
  .vip-stage .ladder-terms { grid-row: 2; }
  .vip-ladder {
    --rise: clamp(40px, 3.4vw, 50px);
    --col: calc((100% - (var(--n, 5) - 1) * var(--gap)) / var(--n, 5));
    display: grid;
    grid-template-columns: repeat(var(--n, 5), minmax(0, 1fr));
    grid-template-rows: repeat(var(--rises, 4), var(--rise)) auto;
    column-gap: var(--gap);
    padding-top: calc(var(--col) * 0.64 + 24px);
  }
  .vip-ladder::after {
    content: "";
    position: absolute;
    left: 0; right: 0;
    bottom: 0;
    height: 1px;
    background: var(--rule-strong);
  }
  .vip-tier {
    --box: calc((64 + 44 * var(--t, 1)) * 1cqi);
    grid-row: var(--row, 1) / -1;
    padding: 24px 18px 18px;
  }
  .vip-tier .relic { left: 50%; translate: -50% 0; }
  .vip-tier:not(:first-child) > .step-via, .vip-tier:not(:first-child) > .stub { display: none; }
  .vip-tier > .riser {
    display: block;
    position: absolute;
    z-index: 2;
    right: 100%;
    top: -1px;
    width: var(--gap);
    height: calc(var(--rise) + 2px);
    background:
      linear-gradient(var(--trace), var(--trace)) 0 100% / 50% 2px no-repeat,
      linear-gradient(var(--trace), var(--trace)) calc(50% - 1px) 0 / 2px 100% no-repeat,
      linear-gradient(var(--trace), var(--trace)) 100% 0 / 50% 2px no-repeat;
  }
  .vip-tier h3 { font-size: 1.625rem; }
  .vip-tier .tier-num { font-size: calc((23 + 8 * var(--t, 1)) * 1cqi); } /* "+1,000" fills ~94% of the step */
  .vip-tier .tier-buy { min-height: 46px; padding-inline: 12px; }
  .vip-tier .tier-specs + .tier-buy { margin-top: auto; }
  .vip-tier .tier-specs { margin-bottom: var(--s-5); }
}

/* ---------- 3. compare ---------- */

.vip-board .sec-head { margin-bottom: var(--s-6); }
.compare-wrap table { min-width: 52rem; table-layout: fixed; }
.compare-wrap thead th { padding: 0 12px 10px; vertical-align: bottom; }
.compare-wrap th.num, .compare-wrap td.num { text-align: center; }
.th-tier { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; font: 700 1.25rem/1.1 var(--font-display); font-stretch: 92%; color: var(--chrome); }
.th-relic { width: 56px; height: 56px; }
.compare-wrap thead th.hl .th-tier { color: #FFFFFF; }
.compare-wrap th[scope="row"], .compare-wrap thead th:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  width: 15rem;
}
.compare-wrap thead th:first-child { z-index: 2; background: var(--bg); font: 600 var(--fs-fine)/1.3 var(--font-text); color: var(--steel); }
.compare-wrap .note { display: block; margin-top: 2px; font-weight: 400; font-size: var(--fs-fine); color: var(--steel); }
.compare-wrap td { padding-block: 14px; }
.compare-wrap td.hl { --cell: var(--hull-2); }
.compare-wrap tbody tr:hover > td.hl { --cell: #16264D; }
.compare-wrap td.val { font: 800 1.5rem/1 var(--font-display); font-stretch: 86%; color: var(--chrome); }
.compare-wrap td.no { color: var(--steel); }
.compare-wrap .yes { display: inline-flex; align-items: center; gap: 8px; color: var(--chrome); font-size: var(--fs-small); font-weight: 600; }
.compare-wrap .yes::before { content: ""; width: 7px; height: 7px; flex: none; transform: rotate(45deg); background: var(--trace); }
@media (max-width: 719.98px) {
  .compare-wrap table { min-width: 40rem; } /* a third column peeks in, so the table reads as scrollable */
  .compare-wrap th[scope="row"], .compare-wrap thead th:first-child { width: 8.5rem; }
  .compare-wrap th[scope="row"] { font-size: var(--fs-small); }
  .th-relic { width: 44px; height: 44px; }
}

/* ---------- 4. closing: how to get a rank + the free rank ---------- */

.vip-close { isolation: isolate; overflow: clip; padding-bottom: calc(var(--chapter-pad) + 40px); }
.vip-close:not(:has(.vip-close-grid > :not([hidden]))) { display: none; } /* nothing rendered (no JS): no empty band */
.close-env { z-index: -1; }
.close-mist { top: auto; height: 70%; }
.close-mist > img { object-position: 50% 100%; opacity: 0.22; }
.close-env .env-scrim { background: linear-gradient(180deg, var(--void) 0%, rgba(3, 6, 26, 0) 45%); }
.vip-close-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-8) var(--s-8); align-items: start; }
.how-head { margin-bottom: var(--s-6); }
#vip-how .steps { max-width: 56ch; }
.how-note { max-width: 56ch; margin: var(--s-5) 0 0; }
#vip-disclaimer { max-width: 80ch; margin: 0; }

/* the free rank: the same pedestal language as the ladder, its relic standing on the top face */
.vip-booster { --box: 150px; margin-top: calc(var(--box) * 0.86 * 0.92 + 8px); }
.booster-body { position: relative; isolation: isolate; padding: 26px 24px 24px; }
.booster-body::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(203, 215, 220, 0.24) 0 1px, transparent 1px),
    linear-gradient(0deg, var(--violet-deep) 0 1px, transparent 1px),
    linear-gradient(180deg, rgba(16, 28, 62, 0.95), rgba(10, 18, 48, 0.95));
}
.booster-body::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: 0; right: 0;
  bottom: 100%;
  height: 12px;
  background: linear-gradient(180deg, #14244A 0%, #2A4462 55%, #5E7A92 92%, #A7B6C1 100%);
  clip-path: polygon(12px 0, calc(100% - 12px) 0, 100% 100%, 0 100%);
}
.booster-title { max-width: 14ch; margin: 0 0 var(--s-5); font: 800 clamp(1.75rem, 1.4rem + 1vw, 2.25rem)/1.05 var(--font-display); font-stretch: 88%; color: var(--chrome); }
.booster-tier { --tr: calc(var(--box) * var(--k)); }
/* relative to the plate: its feet on the top face, 6px behind the front edge */
.booster-tier .relic { right: 28px; bottom: auto; top: calc(-6px - var(--tr) * (1 - var(--sink))); }
.booster-tier h3 { font-size: 1.75rem; }
.booster-tier ul { margin: var(--s-4) 0 var(--s-5); padding: var(--s-4) 0 0; list-style: none; box-shadow: inset 0 1px var(--rule); font-size: var(--fs-small); line-height: 1.5; color: var(--silver); }
.booster-tier li + li { margin-top: var(--s-2); }
.booster-tier li b { color: var(--chrome); font-weight: 600; }
.booster-tier .tier-buy { width: 100%; }
@media (min-width: 960px) {
  .vip-close-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  #vip-how { grid-column: 1 / span 6; }
  .vip-booster { grid-column: 8 / -1; --box: 210px; }
  #vip-disclaimer { grid-column: 1 / -1; }
}
