@font-face {
  font-family: Montserrat;
  src: url("../fonts/Montserrat-Variable.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --page: #100e1a;
  --ink: #f7f3ff;
  --muted: #d3cae4;
  --amethyst: #cbb7ff;
  --line: #b6a3e83d;
  --gutter: clamp(16px, 4.65vw, 112px);
  --space: clamp(28px, 5vw, 100px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 500 clamp(1rem, .91rem + .24vw, 1.25rem)/1.65 Montserrat, system-ui, sans-serif;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
a:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }
h1, h2, h3, p, figure, dl, dd { margin: 0; }
h2, h3 { line-height: 1.12; }
p { color: var(--muted); }
p + p { margin-top: .75em; }
[id] { scroll-margin-block-start: 1rem; }
.skip { position: fixed; z-index: 4; inset: .75rem auto auto .75rem; background: var(--page); padding: .6rem 1rem; transform: translateY(-180%); }
.skip:focus { transform: none; }

.site-header, .site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem 1.5rem;
  padding: .9rem var(--gutter);
}
.brand, .text-link {
  display: inline-flex;
  align-items: center;
  gap: .65em;
  font-size: .9rem;
  font-weight: 700;
  text-decoration: none;
}
.brand img { flex: 0 0 auto; object-fit: contain; }
.text-link { color: var(--amethyst); }
.text-link:hover { color: #fff; text-decoration: underline; text-underline-offset: .25em; }
.site-header { border-bottom: 1px solid var(--line); }
.site-footer { border-top: 1px solid var(--line); flex-wrap: wrap; }

.cover {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: clamp(480px, 46vw, 900px);
  display: grid;
  align-items: center;
  background: linear-gradient(0deg, #100e1a 0%, #17122a 28%);
}
.cover-art { position: absolute; z-index: -1; inset: 0 0 0 25%; }
.cover-art img { width: 100%; height: 100%; object-fit: cover; object-position: center 42%; }
.cover-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, #100e1a 0%, transparent 28%),
              linear-gradient(90deg, #17122a 0%, #17122ae6 18%, #110e23a8 39%, #120f2210 68%);
}
.cover-inner {
  padding: clamp(36px, 5vw, 110px) var(--gutter);
}
.cover-copy { max-width: 66rem; }
.patch-logo { width: clamp(245px, 34vw, 595px); }
.patch-logo img { width: 100%; height: auto; }
.cover-title {
  margin-top: .1em;
  font-size: clamp(2.5rem, 1rem + 4.5vw, 7rem);
  font-weight: 850;
  letter-spacing: -.075em;
  line-height: 1.04;
  color: #fff;
  text-shadow: 0 4px 30px #1a1038;
}
.cover-title span { display: block; color: #d6cbff; font-size: .5em; letter-spacing: .12em; }
.lead { max-width: 33rem; margin-top: 1.2em; color: #f2eafd; }
.button {
  display: inline-flex;
  justify-content: space-between;
  align-items: center;
  gap: .65em 1.2em;
  width: fit-content;
  max-width: 100%;
  margin-top: 1.4rem;
  padding: .74em 1.08em;
  border: 1px solid #d5c4ff70;
  background: #100d22b8;
  color: #fff;
  border-radius: 6px;
  font-size: .94rem;
  font-weight: 750;
  line-height: 1.45;
  text-decoration: none;
}
.button:hover { background: #3a2a57; border-color: #e4d7ff; }
.button-primary { background: linear-gradient(115deg, #e0d1ff, #beddff); border-color: transparent; color: #1c1334; }
.button-primary:hover { background: #fbf5ff; }
.chapter-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  padding: .45rem var(--gutter);
  gap: 0 clamp(.2rem, 3vw, 3rem);
  border-block: 1px solid var(--line);
  background: #1a1529;
}
.chapter-nav a { padding: .65rem .65rem; font-size: .9rem; font-weight: 700; text-decoration: none; color: #eadfff; }
.chapter-nav a:hover { color: #fff; background: #c1a8ff18; }

.chapter, .systems {
  padding: var(--space) var(--gutter);
}
.section-head { margin-bottom: clamp(1.25rem, 3vw, 2.4rem); }
.section-head > p:last-child { max-width: 66ch; margin-top: .9rem; }
.section-head h2, .boss h2 {
  margin-top: .22em;
  font-size: clamp(2rem, 1.35rem + 2.45vw, 4.85rem);
  font-weight: 820;
  letter-spacing: -.055em;
  overflow-wrap: anywhere;
}
.eyebrow {
  color: var(--amethyst);
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.prism-chapter {
  background: radial-gradient(ellipse at 88% 12%, #252047, transparent 53%);
}
.skin-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(8px, 1.35vw, 24px);
}
.skin-grid figure, .roster li {
  overflow: hidden;
  background: #1d172b;
  border: 1px solid var(--line);
  border-radius: 9px;
}
.skin-grid img, .roster img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.skin-grid figcaption { padding: .6rem .9rem; color: #efe7ff; font-weight: 700; }
.pack-panel {
  display: grid;
  grid-template-columns: 1fr .8fr;
  align-items: center;
  gap: 1rem 2rem;
  margin-top: clamp(1rem, 3vw, 2.5rem);
  padding: clamp(1.15rem, 3.2vw, 4rem);
  border: 1px solid var(--line);
  border-radius: 9px;
  background: radial-gradient(ellipse at 75% 48%, #382860, transparent 64%), #21182f;
}
.pack-panel h3 { margin-bottom: .65rem; font-size: clamp(1.45rem, 1rem + 1.5vw, 3rem); }
.pack-art { display: flex; justify-content: center; gap: clamp(8px, 1.5vw, 28px); }
.pack-art img { width: min(44%, 190px); height: auto; object-fit: contain; filter: drop-shadow(0 10px 24px #0e0828aa); }
.pack-art img:first-child { transform: rotate(-6deg); }
.pack-art img:last-child { transform: rotate(5deg); }

.roster-chapter { border-top: 1px solid var(--line); }
.roster {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
  gap: clamp(10px, 1.4vw, 24px);
  padding: 0;
  margin: 0;
}
.roster img { aspect-ratio: 1.63; object-position: center 30%; }
.roster li div { padding: .85rem 1rem; }
.roster h3 { font-size: clamp(1.12rem, 1rem + .6vw, 1.65rem); overflow-wrap: anywhere; }
.roster h3 a { text-decoration-color: #cbb7ff82; text-underline-offset: .15em; }
.roster h3 a:hover { color: var(--amethyst); }
.roster p { margin-top: .3em; font-size: clamp(1rem, .91rem + .24vw, 1.12rem); }
.roster .hero-title { color: var(--amethyst); font-weight: 650; }
.section-link { margin-top: 1.35rem; }

.systems {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(12px, 1.5vw, 26px);
  padding-top: 0;
}
.system-panel {
  padding: clamp(1.15rem, 2.9vw, 3.4rem);
  border: 1px solid var(--line);
  border-radius: 9px;
}
.system-panel h2 { font-size: clamp(1.8rem, 1.2rem + 2.1vw, 4rem); }
.system-panel .section-head { margin-bottom: 1rem; }
.fusion-panel { background: linear-gradient(145deg, #241f3f, #181426 75%); }
.recipes { margin: 1.35rem 0; }
.recipes div { border-top: 1px solid var(--line); padding: .65rem 0; }
.recipes div:last-child { border-bottom: 1px solid var(--line); }
.recipes dt { font-weight: 750; color: #f6edff; }
.recipes dd { color: var(--muted); }
.pouch-panel {
  display: flex;
  flex-direction: column;
  background: radial-gradient(ellipse at 52% 64%, #423054, transparent 54%), #20172b;
}
.pouch-panel .eyebrow { color: #f2cb8c; }
.pouch-art { width: clamp(138px, 17vw, 235px); height: auto; margin: auto; filter: drop-shadow(0 10px 26px #eaa45a33); }

.boss {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  align-items: center;
  min-height: clamp(490px, 40vw, 770px);
  background: #101b16;
}
.boss-art { position: absolute; z-index: -2; inset: 0 0 0 auto; width: 75%; height: 100%; object-fit: cover; object-position: center 42%; }
.boss::before { content: ""; position: absolute; z-index: -1; inset: 0; background: linear-gradient(90deg, #101b16 12%, #101b16f0 30%, #101b1660 61%, #101b1600 85%); }
.boss-copy { padding: var(--space) var(--gutter); }
.boss-copy p { max-width: 34rem; color: #e0ece3; }
.boss-copy .eyebrow { color: #c5f499; }
.boss-copy .boss-title { margin: .35rem 0 1rem; font-size: clamp(1.15rem, .9rem + .8vw, 2rem); font-weight: 750; color: #c5f499; }
.boss .button { border-color: #c5f4998c; background: #132418e8; }
.boss .button:hover { background: #294530; }

@media (min-width: 901px) {
  .roster { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .roster li { grid-column: span 3; }
  .roster li:nth-child(n + 5) { grid-column: span 4; }
  .roster img { aspect-ratio: auto; height: clamp(130px, 14vw, 350px); }
}

@media (max-width: 900px) {
  .cover-art { left: 13%; }
  .roster { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .boss-art { width: 86%; }
}

@media (max-width: 640px) {
  .site-header { align-items: flex-start; }
  .site-header .text-link { text-align: right; align-self: center; }
  .cover { display: block; min-height: 0; background: linear-gradient(180deg, #161129 45%, #100e1a); }
  .cover-art { position: relative; inset: auto; height: clamp(215px, 65vw, 390px); }
  .cover-art img { object-position: center 33%; }
  .cover-art::after { background: linear-gradient(0deg, #161129, transparent 55%); }
  .cover-inner { padding-top: 0; margin-top: -1.7rem; }
  .pack-panel { grid-template-columns: 1fr; }
  .pack-art { grid-row: 1; }
  .pack-art img { width: min(40%, 125px); }
  .skin-grid figcaption { padding: .45rem .35rem; font-size: .875rem; }
  .roster { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .roster li div { padding: .6rem; }
  .systems { grid-template-columns: 1fr; }
  .boss { display: block; min-height: 0; }
  .boss-art { position: relative; width: 100%; height: clamp(210px, 63vw, 390px); object-position: center 34%; }
  .boss::before { inset: 0 0 auto; height: clamp(210px, 63vw, 390px); background: linear-gradient(0deg, #101b16, transparent 48%); }
  .boss-copy { padding-top: 0; }
}

@media (max-width: 480px) {
  .roster { grid-template-columns: 1fr; }
  .roster li div { padding: .8rem 1rem; }
  .roster img { aspect-ratio: 2; }
}

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