@font-face {
  font-family: "HQ Display";
  src: url("/fonts/hyperquest/evil-empire.otf") format("opentype");
  font-display: swap;
}

@font-face {
  font-family: "HQ Flourish";
  src: url("/fonts/hyperquest/fantaisie-artistique.ttf") format("truetype");
  font-display: swap;
}

:root {
  --hq-ink: #e8e5ee;
  --hq-paper: #151419;
  --hq-paper-deep: #1c1a22;
  --hq-cyan: #68dcf6;
  --hq-cyan-deep: #1689b5;
  --hq-violet: #8b70ff;
  --hq-violet-deep: #4a348e;
  --hq-night: #111018;
  --hq-night-soft: #1b1925;
  --hq-rule: rgba(200, 180, 255, 0.15);
}

.hq-rulebook {
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 0%, rgba(103, 220, 246, 0.08), transparent 34rem),
    var(--bg);
}

.hq-rulebook img {
  image-rendering: pixelated;
}

.hq-topbar {
  width: min(100% - 3rem, 1120px);
  margin: 0 auto;
  padding: 1.5rem 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.04em;
}

.hq-back {
  transition: color 160ms ease, transform 160ms ease;
}

.hq-back:hover {
  color: var(--hq-cyan);
  transform: translateX(-2px);
}

.hq-edition {
  text-align: right;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.hq-topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.9rem;
}

.hq-store-link {
  padding: 0.38rem 0.62rem;
  border: 1px solid rgba(104, 220, 246, 0.26);
  color: var(--hq-cyan);
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.hq-store-link:hover {
  border-color: var(--hq-cyan);
  background: rgba(104, 220, 246, 0.08);
  color: #fff;
}

.hq-hero {
  position: relative;
  width: min(100% - 3rem, 1120px);
  min-height: 560px;
  margin: 1.5rem auto 0;
  padding: clamp(4.5rem, 10vw, 8rem) clamp(1.5rem, 7vw, 6rem);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(104, 220, 246, 0.28);
  background:
    linear-gradient(135deg, rgba(139, 112, 255, 0.18), transparent 44%),
    linear-gradient(145deg, #111018 5%, #171522 58%, #173447 100%);
  isolation: isolate;
}

.hq-hero::before,
.hq-hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
}

.hq-hero::before {
  inset: 1rem;
  border: 1px solid rgba(104, 220, 246, 0.13);
}

.hq-hero::after {
  top: -14rem;
  right: -10rem;
  width: 38rem;
  height: 38rem;
  border: 1px solid rgba(139, 112, 255, 0.23);
  transform: rotate(45deg);
}

.hq-hero-glow {
  position: absolute;
  right: clamp(1rem, 7vw, 6rem);
  bottom: -2rem;
  z-index: -1;
  width: clamp(12rem, 30vw, 23rem);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(104, 220, 246, 0.28), transparent 66%);
  filter: blur(10px);
}

.hq-hero-mark {
  width: clamp(5rem, 11vw, 8rem);
  height: auto;
  margin-bottom: 2.25rem;
  filter: drop-shadow(0 0 22px rgba(104, 220, 246, 0.35));
}

.hq-kicker {
  margin: 0 0 0.7rem;
  color: var(--hq-cyan);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hq-hero h1 {
  margin: 0;
  color: #fff;
  font-family: "HQ Display", var(--sans);
  font-size: clamp(4.4rem, 13vw, 9.5rem);
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 0.76;
  text-shadow: 4px 4px 0 var(--hq-violet-deep), 0 0 34px rgba(104, 220, 246, 0.18);
}

.hq-hero-line {
  margin: 2rem 0 0;
  color: var(--hq-cyan);
  font-family: "HQ Flourish", var(--serif);
  font-size: clamp(1.4rem, 3.4vw, 2.25rem);
  line-height: 1.1;
}

.hq-hero-copy {
  max-width: 620px;
  margin: 1.3rem 0 0;
  color: #cbc7d5;
  font-size: clamp(1rem, 2vw, 1.15rem);
  line-height: 1.65;
}

.hq-hero-copy strong {
  color: #fff;
  font-weight: 700;
  text-transform: uppercase;
}

.hq-hero-credits {
  margin-top: 3.5rem;
  display: grid;
  gap: 0.2rem;
  color: #7f7a8d;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.hq-paper {
  width: min(100% - 3rem, 1120px);
  margin: 2rem auto 0;
  padding: clamp(2rem, 6vw, 5rem);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(rgba(200, 180, 255, 0.025) 1px, transparent 1px),
    var(--hq-paper);
  background-size: 100% 32px;
  color: var(--hq-ink);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.42);
}

.hq-section {
  min-width: 0;
}

.hq-section p {
  margin: 0.9rem 0 0;
}

.hq-section strong {
  font-weight: 750;
}

.hq-heading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.hq-heading > img {
  width: 2.25rem;
  height: 2.25rem;
  flex: 0 0 auto;
  filter: drop-shadow(0 0 7px rgba(104, 220, 246, 0.18));
}

.hq-heading h2 {
  margin: 0;
  font-family: "HQ Display", var(--sans);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 400;
  letter-spacing: 0.025em;
  line-height: 0.9;
  text-transform: uppercase;
}

.hq-intro {
  padding: 0 0 clamp(2.5rem, 6vw, 4.5rem);
  border-bottom: 1px solid var(--hq-rule);
}

.hq-intro .hq-heading > img {
  width: 3.5rem;
  height: 3.5rem;
}

.hq-intro .hq-heading h2 {
  font-size: clamp(2.8rem, 7vw, 5.4rem);
}

.hq-lede {
  max-width: 850px;
  color: #cbc7d4;
  font-size: clamp(1.2rem, 2.3vw, 1.55rem);
  line-height: 1.55;
}

.hq-grid {
  margin-top: clamp(2.5rem, 6vw, 4.5rem);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.hq-card {
  padding: clamp(1.4rem, 3vw, 2.1rem);
  border: 1px solid var(--hq-rule);
  background: rgba(255, 255, 255, 0.022);
}

.hq-card > p,
.hq-card li,
.hq-scene p {
  color: #c8c4cf;
  font-size: 0.96rem;
  line-height: 1.62;
}

.hq-mechanics,
.hq-outcomes,
.hq-compact-list,
.hq-choice-list {
  margin: 1.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 1.2rem;
  list-style: none;
}

.hq-mechanics li,
.hq-outcomes li,
.hq-compact-list li {
  display: grid;
  grid-template-columns: 1.85rem minmax(0, 1fr);
  align-items: start;
  gap: 0.7rem;
}

.hq-mechanics img,
.hq-outcomes img,
.hq-compact-list img,
.hq-choice-list img {
  width: 1.7rem;
  height: 1.7rem;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.12));
}

.hq-mechanics--tight {
  gap: 0.9rem;
}

.hq-rule-note {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  display: grid;
  grid-template-columns: 1.85rem minmax(0, 1fr);
  gap: 0.7rem;
  border-top: 1px solid var(--hq-rule);
}

.hq-rule-note img {
  width: 1.7rem;
  height: 1.7rem;
}

.hq-rule-note p {
  margin: 0;
}

.hq-table-intro {
  padding-top: 0.5rem;
  font-weight: 700;
}

.hq-difficulty {
  margin-top: 1rem;
  display: grid;
  gap: 0.45rem;
}

.hq-difficulty > div {
  padding: 0.6rem 0;
  display: grid;
  grid-template-columns: 1.8rem 5rem 6rem minmax(0, 1fr);
  align-items: center;
  gap: 0.5rem;
  border-top: 1px solid var(--hq-rule);
}

.hq-difficulty img {
  width: 1.45rem;
  height: 1.45rem;
}

.hq-difficulty strong {
  font-family: "HQ Display", var(--sans);
  font-size: 1.2rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hq-difficulty span {
  font-size: 0.82rem;
  font-weight: 700;
}

.hq-difficulty small {
  color: #8f8998;
  font-size: 0.78rem;
}

.hq-stack {
  display: grid;
  gap: 1.25rem;
}

.hq-range {
  margin-top: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  color: #bba8ff;
  font-family: "HQ Display", var(--sans);
  font-size: clamp(0.92rem, 2vw, 1.2rem);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hq-range b {
  color: #716b7d;
  font-family: var(--sans);
  font-weight: 400;
}

.hq-scene {
  margin-top: 1.25rem;
  padding: clamp(1.75rem, 5vw, 3.5rem);
  border: 1px solid rgba(139, 112, 255, 0.28);
  background:
    linear-gradient(135deg, rgba(139, 112, 255, 0.1), rgba(104, 220, 246, 0.045)),
    #18171e;
}

.hq-scene-setup {
  max-width: 800px;
  font-size: 1.05rem !important;
}

.hq-scene-grid {
  margin-top: 1.4rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 2.5rem;
}

.hq-scene-grid p {
  padding-top: 1rem;
  border-top: 1px solid var(--hq-rule);
}

.hq-scene-result {
  margin-top: 1.5rem !important;
  padding: 1rem 1.2rem;
  border-left: 3px solid var(--hq-violet);
  background: rgba(255, 255, 255, 0.035);
  font-weight: 650;
}

.hq-flourish {
  font-family: "HQ Flourish", var(--serif);
  font-size: 1.18em;
}

.hq-grid--reference {
  align-items: start;
}

.hq-choice-list {
  gap: 0.75rem;
}

.hq-choice-list li {
  display: grid;
  grid-template-columns: 1.8rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.65rem;
}

.hq-choice-list span {
  color: #8d8795;
  font-size: 0.8rem;
}

.hq-character-sheet h3,
.hq-threat-examples h3,
.hq-tag-columns h3 {
  margin: 1.3rem 0 0;
  font-family: "HQ Flourish", var(--serif);
  font-size: 1.35rem;
  font-weight: 400;
}

.hq-character-sheet h3 span {
  color: #8d8795;
  font-size: 0.8em;
}

.hq-statline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.hq-statline > * {
  padding: 0.2rem 0.45rem;
  border: 1px solid var(--hq-rule);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.74rem;
}

.hq-threat-examples {
  display: grid;
}

.hq-threat-examples article + article {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--hq-rule);
}

.hq-threat-examples h3 span {
  display: block;
  color: #8d8795;
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.hq-threat-examples p {
  margin-top: 0.25rem;
}

.hq-tag-columns {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  text-align: center;
}

.hq-tag-columns h3 {
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--hq-rule);
  font-family: "HQ Display", var(--sans);
  font-size: 1.1rem;
  text-transform: uppercase;
}

.hq-tag-columns p {
  margin: 0.18rem 0;
  font-family: "HQ Flourish", var(--serif);
  font-size: 1rem;
  line-height: 1.2;
}

.hq-gm,
.hq-notes {
  position: relative;
  width: min(100% - 3rem, 1120px);
  margin: 2rem auto 0;
  color: #dddaea;
  background: var(--hq-night-soft);
}

.hq-gm {
  padding: clamp(2.5rem, 7vw, 5rem);
  isolation: isolate;
}

.hq-pixel-frame {
  position: absolute;
  inset: 0;
  z-index: -1;
  border: 22px solid transparent;
  border-image: url("/images/hyperquest/icons/frame-blue.png") 8 fill / 22px / 0 stretch;
  image-rendering: pixelated;
  opacity: 0.88;
}

.hq-gm-inner {
  max-width: 850px;
  margin: 0 auto;
}

.hq-heading--neon h2 {
  color: var(--hq-cyan);
  text-shadow: 2px 2px 0 #203e77;
}

.hq-gm-lede {
  margin: 1.5rem 0 0;
  color: #c8c4d4;
  font-size: 1.05rem;
  line-height: 1.7;
}

.hq-gm-lede strong,
.hq-gm-moves,
.hq-gm h3,
.hq-costs strong {
  color: var(--hq-cyan);
}

.hq-gm-moves {
  margin: 1.5rem 0 0;
  padding-left: 1.25rem;
  display: grid;
  gap: 0.4rem;
  font-weight: 700;
  text-transform: uppercase;
}

.hq-gm h3 {
  margin: 2rem 0 0;
  font-family: "HQ Display", var(--sans);
  font-size: 1.6rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.hq-costs {
  margin-top: 0.9rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem 1.75rem;
}

.hq-costs p {
  margin: 0;
  padding-top: 0.7rem;
  border-top: 1px solid rgba(104, 220, 246, 0.16);
  color: #aaa5b8;
  font-size: 0.9rem;
  line-height: 1.5;
}

.hq-notes {
  padding: clamp(2.5rem, 7vw, 5rem);
  border: 1px solid rgba(139, 112, 255, 0.25);
  background:
    linear-gradient(135deg, rgba(139, 112, 255, 0.08), transparent 50%),
    #121119;
}

.hq-notes-grid {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem;
}

.hq-notes-grid > div {
  padding-top: 1.25rem;
  border-top: 1px solid rgba(139, 112, 255, 0.22);
}

.hq-notes-grid img {
  width: 2rem;
  height: 2rem;
}

.hq-notes-grid h3 {
  margin: 0.8rem 0 0;
  color: var(--hq-cyan);
  font-family: "HQ Display", var(--sans);
  font-size: 1.4rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.hq-notes-grid p {
  margin: 0.7rem 0 0;
  color: #aaa5b8;
  font-size: 0.86rem;
  line-height: 1.65;
}

.hq-footer {
  width: min(100% - 3rem, 1120px);
  margin: 0 auto;
  padding: 4.5rem 0 6rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--muted);
  text-align: center;
}

.hq-footer img {
  width: 3.5rem;
  height: 3.5rem;
  margin-bottom: 0.8rem;
}

.hq-footer p {
  margin: 0.15rem 0;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.hq-footer strong {
  color: var(--text);
  font-family: "HQ Display", var(--sans);
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: 0.05em;
}

@media (max-width: 820px) {
  .hq-grid,
  .hq-scene-grid,
  .hq-costs,
  .hq-notes-grid {
    grid-template-columns: 1fr;
  }

  .hq-grid {
    gap: 1rem;
  }

  .hq-stack {
    gap: 1rem;
  }

  .hq-notes-grid {
    gap: 1.4rem;
  }
}

@media (max-width: 600px) {
  .hq-topbar,
  .hq-hero,
  .hq-paper,
  .hq-gm,
  .hq-notes,
  .hq-footer {
    width: min(100% - 1.5rem, 1120px);
  }

  .hq-topbar {
    align-items: flex-start;
  }

  .hq-edition {
    max-width: 9rem;
  }

  .hq-topbar-actions {
    flex-direction: column;
    align-items: flex-end;
    gap: 0.45rem;
  }

  .hq-hero {
    min-height: 490px;
    padding: 4rem 1.5rem;
  }

  .hq-hero::before {
    inset: 0.55rem;
  }

  .hq-hero h1 {
    font-size: clamp(4rem, 22vw, 6.2rem);
  }

  .hq-paper,
  .hq-gm,
  .hq-notes {
    padding: 1.25rem;
  }

  .hq-intro {
    padding: 1rem 0 2.5rem;
  }

  .hq-card,
  .hq-scene {
    padding: 1.2rem;
  }

  .hq-heading {
    align-items: flex-start;
  }

  .hq-heading h2 {
    font-size: 2rem;
  }

  .hq-intro .hq-heading h2 {
    font-size: 2.65rem;
  }

  .hq-difficulty > div {
    grid-template-columns: 1.5rem 4rem 1fr;
  }

  .hq-difficulty small {
    grid-column: 2 / -1;
  }

  .hq-range {
    flex-direction: column;
    justify-content: flex-start;
    gap: 0.1rem;
  }

  .hq-range b {
    line-height: 1;
    transform: rotate(90deg);
  }

  .hq-tag-columns {
    gap: 0.35rem;
  }

  .hq-tag-columns p {
    font-size: 0.9rem;
  }

  .hq-pixel-frame {
    border-width: 14px;
    border-image-width: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hq-hero-glow {
    filter: none;
  }
}
