:root {
  --bg: #100f0d;
  --bg2: #0a0908;
  --panel: #1a1714;
  --panel2: #221e19;
  --panel3: #2a251f;
  --parch: #e7d6ad;
  --parch2: #dcc99c;
  --parchink: #352a18;
  --fg: #ece0c4;
  --muted: #a89673;
  --faint: #74664f;
  --gold: #c9a45c;
  --goldb: #e9c878;
  --goldd: #7e6633;
  --crimson: #b4413c;
  --emerald: #5fa06b;
  --sapphire: #5e89bd;
  --amethyst: #9a78c0;
  --line: rgba(201, 164, 92, 0.26);
  --line2: rgba(201, 164, 92, 0.5);
  --display: "Cinzel Decorative", serif;
  --head: "Cinzel", serif;
  --body: "EB Garamond", serif;
  --maxw: 1180px;
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
}
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.55' numOctaves='4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  box-shadow: inset 0 0 200px 30px rgba(0, 0, 0, 0.6);
}
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}
a {
  color: inherit;
  text-decoration: none;
}
::selection {
  background: var(--gold);
  color: #14110a;
}

/* corners */
.corners {
  position: relative;
}
.corner {
  position: absolute;
  width: 9px;
  height: 9px;
  border: 1px solid var(--gold);
  background: var(--bg);
  transform: rotate(45deg);
  z-index: 3;
}
.corner.tl {
  top: -5px;
  left: -5px;
}
.corner.tr {
  top: -5px;
  right: -5px;
}
.corner.bl {
  bottom: -5px;
  left: -5px;
}
.corner.br {
  bottom: -5px;
  right: -5px;
}

/* frame */
.frame {
  background: var(--panel);
  border: 1px solid var(--line2);
  box-shadow:
    inset 0 0 0 4px var(--bg2),
    inset 0 0 0 5px var(--line);
}

/* panel header */
.ph {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line2);
  background: var(--panel2);
  font-family: var(--head);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}
.ph .pid {
  color: var(--goldd);
}
.ph .right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--emerald);
}
.ph .right .d {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 8px var(--emerald);
}

/* rule */
.rule {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--gold);
}
.rule::before,
.rule::after {
  content: "";
  height: 1px;
  background: var(--line2);
  flex: 1;
}
.rule .fl {
  font-size: 14px;
}

/* ========== TOP BAR ========== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(14, 12, 7, 0.92);
  border-bottom: 1px solid var(--line2);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.4);
}
.topbar .inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 18px;
  font-family: var(--head);
  font-size: 11.5px;
  letter-spacing: 0.16em;
  font-weight: 600;
}
.tb-status {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--display);
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--gold);
}
.tb-status .sigil {
  color: var(--goldd);
  font-size: 11px;
}
.tb-nav {
  display: flex;
  gap: 22px;
}
.tb-nav a {
  color: var(--faint);
  transition: color 0.2s;
  text-transform: uppercase;
}
.tb-nav a:hover,
.tb-nav a.active {
  color: var(--goldb);
}
@media (max-width: 900px) {
  .tb-nav {
    gap: 13px;
    font-size: 10px;
  }
}
@media (max-width: 560px) {
  .tb-nav {
    display: none;
  }
}

/* ========== HERO ========== */
.hero {
  padding: 60px 0 64px;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.45fr 0.9fr;
}
@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
}
.hero-main {
  padding: 40px 42px;
  border-right: 1px solid var(--line);
}
@media (max-width: 900px) {
  .hero-main {
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
}
.id-row {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.class-line {
  font-family: var(--head);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.lvl {
  border: 1px solid var(--line2);
  color: var(--goldb);
  padding: 2px 9px;
  font-size: 11px;
  letter-spacing: 0.14em;
}
h1.name {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(40px, 7vw, 76px);
  line-height: 1;
  color: var(--goldb);
  letter-spacing: 0.01em;
  text-shadow: 0 2px 18px rgba(201, 164, 92, 0.18);
}
.title-line {
  font-family: var(--head);
  font-weight: 600;
  font-size: clamp(13px, 1.7vw, 16px);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 16px 0 0;
}
.title-line span {
  color: var(--goldd);
}
.pitch {
  font-size: clamp(18px, 2.2vw, 21px);
  font-style: italic;
  color: var(--muted);
  max-width: 48ch;
  margin: 22px 0 30px;
  line-height: 1.55;
}
.pitch b {
  color: var(--fg);
  font-style: normal;
  font-weight: 600;
}
.cta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.btn {
  font-family: var(--head);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.14em;
  padding: 13px 22px;
  border: 1px solid var(--line2);
  background: var(--panel2);
  color: var(--gold);
  display: inline-flex;
  align-items: center;
  gap: 9px;
  transition: 0.18s;
  text-transform: uppercase;
  cursor: pointer;
}
.btn:hover {
  border-color: var(--goldb);
  color: var(--goldb);
  background: var(--panel3);
  transform: translateY(-1px);
}
.btn.primary {
  background: var(--gold);
  color: #1a160d;
  border-color: var(--goldb);
}
.btn.primary:hover {
  background: var(--goldb);
  color: #1a160d;
}

/* vitals */
.vitals {
  display: flex;
  flex-direction: column;
}
.vitals-foot {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line2);
}
.vitals-foot div {
  padding: 14px 16px;
  border-right: 1px solid var(--line);
  text-align: center;
}
.vitals-foot div:last-child {
  border-right: none;
}
.vitals-foot .v {
  font-family: var(--head);
  font-weight: 700;
  font-size: 19px;
  color: var(--emerald);
}
.vitals-foot .v.g {
  color: var(--goldb);
}
.vitals-foot .lbl {
  font-family: var(--head);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  color: var(--faint);
  text-transform: uppercase;
  margin-top: 4px;
}

/* plaques */
.plaques {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
}
@media (max-width: 640px) {
  .plaques {
    grid-template-columns: repeat(2, 1fr);
  }
}
.plaque {
  padding: 18px 20px;
  border-right: 1px solid var(--line);
  text-align: center;
}
.plaque:last-child {
  border-right: none;
}
@media (max-width: 640px) {
  .plaque:nth-child(2) {
    border-right: none;
  }
}
.plaque .n {
  font-family: var(--display);
  font-weight: 700;
  font-size: 30px;
  color: var(--goldb);
  line-height: 1;
}
.plaque .n .u {
  color: var(--gold);
  font-size: 18px;
}
.plaque .k {
  font-family: var(--head);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--faint);
  text-transform: uppercase;
  margin-top: 8px;
}

/* sections */
section {
  padding: 64px 0;
  scroll-margin-top: 70px;
}
.sec-head {
  margin-bottom: 34px;
}
.sec-head .rule {
  margin-bottom: 14px;
}
.sec-titles {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}
.sec-id {
  font-family: var(--head);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.2em;
  color: var(--goldd);
}
.sec-head h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(26px, 3.6vw, 40px);
  color: var(--goldb);
  letter-spacing: 0.01em;
}
.sec-note {
  font-family: var(--body);
  font-style: italic;
  font-size: 17px;
  color: var(--faint);
  margin-left: auto;
}

/* attrs */
.attrs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
@media (max-width: 900px) {
  .attrs {
    grid-template-columns: repeat(2, 1fr);
  }
}
.attr {
  padding: 24px 22px;
  text-align: center;
}
.attr .big {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(36px, 5vw, 50px);
  color: var(--goldb);
  line-height: 1;
}
.attr .big .u {
  color: var(--gold);
  font-size: 0.5em;
}
.attr .nm {
  font-family: var(--head);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 14px 0 8px;
}
.attr .desc {
  font-size: 16px;
  color: var(--muted);
  line-height: 1.45;
}
.attr .desc b {
  color: var(--fg);
  font-weight: 600;
}

/* skill groups (Option A — categorised tags) */
.skill-groups {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
}
@media (max-width: 820px) {
  .skill-groups {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 480px) {
  .skill-groups {
    grid-template-columns: 1fr;
  }
}
.skill-group {
  padding: 22px 24px;
  background: var(--panel);
  transition: background 0.2s;
}
.skill-group:hover {
  background: var(--panel2);
}
.sg-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--head);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}
.sg-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex: none;
}
.sg-dot.g { background: var(--gold);     box-shadow: 0 0 6px var(--gold); }
.sg-dot.e { background: var(--emerald);  box-shadow: 0 0 6px var(--emerald); }
.sg-dot.s { background: var(--sapphire); box-shadow: 0 0 6px var(--sapphire); }
.sg-dot.a { background: var(--amethyst); box-shadow: 0 0 6px var(--amethyst); }
.sg-dot.c { background: var(--crimson);  box-shadow: 0 0 6px var(--crimson); }
.sg-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.sg-tag {
  font-family: var(--head);
  font-size: 11.5px;
  letter-spacing: 0.03em;
  padding: 5px 11px;
  border: 1px solid var(--line2);
  color: var(--muted);
  background: var(--bg2);
  transition: 0.18s;
  cursor: default;
}
.sg-tag:hover {
  color: var(--goldb);
  border-color: var(--gold);
  background: var(--panel3);
}

/* abilities */
.abil {
  display: block;
}
.skills {
  padding: 18px 22px;
}
.skill {
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.skill:last-child {
  border-bottom: none;
}
.skill .top {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}
.skill .nm {
  font-family: var(--head);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.04em;
  color: var(--fg);
}
.skill .tier {
  margin-left: auto;
  font-family: var(--head);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}
.skill .meta {
  font-size: 14px;
  color: var(--faint);
  font-style: italic;
}
.bar {
  height: 13px;
  border: 1px solid var(--line2);
  background: var(--bg2);
  padding: 2px;
}
.bar i {
  display: block;
  height: 100%;
}
.bar i.g {
  background: var(--gold);
}
.bar i.e {
  background: var(--emerald);
}
.bar i.s {
  background: var(--sapphire);
}
.bar i.a {
  background: var(--amethyst);
}
.bar i.c {
  background: var(--crimson);
}
.inv {
  padding: 18px;
}
.inv-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
@media (max-width: 520px) {
  .inv-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
.slot {
  border: 1px solid var(--line2);
  background: var(--bg2);
  box-shadow: inset 0 0 0 3px var(--bg);
  padding: 14px 8px;
  text-align: center;
  font-family: var(--head);
  font-weight: 500;
  font-size: 12.5px;
  letter-spacing: 0.03em;
  color: var(--muted);
  transition: 0.18s;
  cursor: default;
}
.slot:hover {
  color: var(--goldb);
  border-color: var(--goldb);
  box-shadow:
    inset 0 0 0 3px var(--bg),
    0 0 16px -4px var(--gold);
}
.slot.core {
  color: var(--fg);
}

/* quests */
.quests {
  display: grid;
  gap: 20px;
}
.quest-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
}
@media (max-width: 820px) {
  .quest-grid {
    grid-template-columns: 1fr;
  }
}
.quest-main {
  padding: 26px 28px;
}
.quest-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.rar {
  font-family: var(--head);
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  border: 1px solid;
  padding: 4px 10px;
}
.rar.legend {
  color: var(--goldb);
  border-color: var(--gold);
}
.rar.epic {
  color: var(--amethyst);
  border-color: var(--amethyst);
}
.rar.rare {
  color: var(--sapphire);
  border-color: var(--sapphire);
}
.quest-org {
  font-family: var(--head);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--goldd);
}
.quest h3 {
  font-family: var(--head);
  font-weight: 700;
  font-size: 24px;
  color: var(--goldb);
  margin: 4px 0 0;
  letter-spacing: 0.01em;
}
.quest-desc {
  font-size: 18px;
  color: var(--muted);
  margin: 14px 0 18px;
  line-height: 1.55;
}
.quest-desc b {
  color: var(--fg);
  font-weight: 600;
}
.loot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.loot .it {
  font-family: var(--head);
  font-size: 11px;
  letter-spacing: 0.05em;
  padding: 5px 11px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.quest-aside {
  border-left: 1px solid var(--line);
  background: var(--bg2);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
@media (max-width: 820px) {
  .quest-aside {
    border-left: none;
    border-top: 1px solid var(--line);
  }
}
.reward .rv {
  font-family: var(--display);
  font-weight: 700;
  font-size: 26px;
  color: var(--goldb);
  line-height: 1;
}
.reward .rl {
  font-family: var(--head);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}
.flow {
  margin-top: auto;
}
.flow .fl-title {
  font-family: var(--head);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 12px;
}
.flow svg {
  width: 100%;
  height: auto;
  display: block;
}

/* chronicle */
.chron {
  overflow: hidden;
}
.chron-row {
  display: grid;
  grid-template-columns: 150px 110px 1fr;
  gap: 18px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
  align-items: start;
  transition: background 0.2s;
}
.chron-row:last-child {
  border-bottom: none;
}
.chron-row:hover {
  background: var(--panel2);
}
@media (max-width: 680px) {
  .chron-row {
    grid-template-columns: 1fr;
    gap: 7px;
  }
}
.chron-ts {
  font-family: var(--head);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--goldd);
  padding-top: 3px;
}
.chron-stat {
  font-family: var(--head);
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  height: fit-content;
}
.chron-stat.run {
  color: var(--emerald);
}
.chron-stat.ok {
  color: var(--gold);
}
.chron-msg .cm-title {
  font-family: var(--head);
  font-weight: 700;
  font-size: 19px;
  color: var(--goldb);
}
.chron-msg .cm-org {
  font-family: var(--head);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--goldd);
  margin: 5px 0 9px;
}
.chron-msg .cm-body {
  font-size: 17px;
  color: var(--muted);
  line-height: 1.55;
}

/* lore */
.lore-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 18px;
}
@media (max-width: 900px) {
  .lore-grid {
    grid-template-columns: 1fr;
  }
}
.scroll {
  background: var(--parch);
  color: var(--parchink);
  border: 1px solid var(--goldd);
  box-shadow:
    inset 0 0 60px rgba(120, 90, 40, 0.25),
    inset 0 0 0 8px rgba(231, 214, 173, 0.6);
  padding: 36px 38px;
}
.scroll h4 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 20px;
  color: #5c4416;
  margin-bottom: 16px;
  letter-spacing: 0.02em;
}
.scroll p {
  font-size: 19px;
  line-height: 1.65;
  margin-bottom: 16px;
}
.scroll p:last-child {
  margin-bottom: 0;
}
.scroll p b {
  font-weight: 600;
  color: #3c2c0e;
}
.scroll .drop::first-letter {
  font-family: var(--display);
  font-size: 3.2em;
  line-height: 0.8;
  float: left;
  padding: 6px 10px 0 0;
  color: #6b4d18;
}
p.pitch.scroll {
  position: relative;
  overflow: hidden;
  padding: 22px 26px;
  color: var(--parchink);
  font-style: normal;
  margin: 22px 0 30px;
}
p.pitch.scroll::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.65' numOctaves='4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}
p.pitch.scroll b {
  color: #3c2c0e;
  font-style: normal;
}

.sheet-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}
.sheet-row:last-child {
  border-bottom: none;
}
.sheet-row .k {
  font-family: var(--head);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--goldd);
  padding-top: 3px;
}
.sheet-row .v {
  text-align: right;
  color: var(--fg);
}

/* contact */
.hail-top {
  padding: 40px 38px;
  text-align: center;
  border-bottom: 1px solid var(--line2);
}
.hail-top h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(28px, 4.4vw, 46px);
  color: var(--goldb);
  margin: 14px 0 12px;
  letter-spacing: 0.01em;
}
.hail-top p {
  font-size: 19px;
  font-style: italic;
  color: var(--muted);
  max-width: 52ch;
  margin: 0 auto;
}
.channels {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
}
@media (max-width: 640px) {
  .channels {
    grid-template-columns: 1fr;
  }
}
.channel {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 28px;
  border-right: 1px solid var(--line);
  border-top: 1px solid var(--line);
  transition: 0.2s;
}
.channel:nth-child(2n) {
  border-right: none;
}
.channel:hover {
  background: var(--panel2);
}
.channel:hover .ch-arrow {
  color: var(--goldb);
  transform: translateX(5px);
}
.ch-ico {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line2);
  box-shadow: inset 0 0 0 3px var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  flex: none;
  font-size: 18px;
}
.ch-meta .ck {
  font-family: var(--head);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}
.ch-meta .cv {
  font-size: 17px;
  color: var(--fg);
  word-break: break-all;
}
.ch-arrow {
  margin-left: auto;
  color: var(--goldd);
  transition: 0.2s;
  flex: none;
  font-size: 18px;
}

footer {
  border-top: 1px solid var(--line2);
  padding: 30px 0 50px;
  font-family: var(--head);
  font-size: 11.5px;
  color: var(--faint);
  letter-spacing: 0.1em;
}
footer .inner {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  text-transform: uppercase;
  align-items: center;
}
footer .g {
  color: var(--gold);
}

/* reveal */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.8s cubic-bezier(0.22, 0.7, 0.24, 1),
    transform 0.8s cubic-bezier(0.22, 0.7, 0.24, 1);
}
.reveal.in {
  opacity: 1;
  transform: none;
}
[data-stagger] {
  transition-delay: var(--d, 0ms);
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ========================================
   CODEX WHEEL - BIGGER HALF CIRCLE / MOBILE OVAL
   ======================================== */
#codex-wheel {
  position: fixed;
  top: 50%;
  right: -174px; /* desktop: pushed out so only about half is visible */
  transform: translateY(-50%);
  width: 350px;
  z-index: 60;
  pointer-events: none;
  opacity: 0;
  animation: wheelIn 0.9s 0.5s cubic-bezier(0.22, 0.7, 0.24, 1) forwards;
}
@keyframes wheelIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@media (min-width: 901px) {
  .tb-nav {
    display: none;
  }
  body {
    padding-right: 118px;
  }
  #codex-wheel .wbtn {
    margin-left: 43px;
    margin-right: auto;
  }
}
@media (max-width: 900px) {
  body {
    padding-right: 0;
    padding-bottom: 88px;
  }
  #codex-wheel {
    display: block;
    top: auto;
    right: auto;
    left: 50%;
    bottom: -178px; /* mobile: still mostly submerged, but enough top arc is visible for multiple icons */
    transform: translateX(-50%);
    width: min(390px, 104vw);
  }
  #wheel-svg-wrap {
    width: 100%;
    margin: 0 auto;
  }
  #codex-wheel svg {
    width: 100%;
    height: auto;
  }
  #codex-wheel .wbtn {
    display: none !important;
  }
}
@media (max-width: 420px) {
  #codex-wheel {
    width: min(382px, 112vw);
    bottom: -174px;
  }
}
@media (max-width: 360px) {
  #codex-wheel {
    width: 386px;
    bottom: -176px;
  }
}

#codex-wheel svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
#wheel-svg-wrap {
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
}
#codex-wheel.dragging #wheel-svg-wrap {
  cursor: grabbing;
}
#codex-wheel svg {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.wheel-root {
  will-change: transform;
}

.wnode {
  cursor: pointer;
  pointer-events: auto;
  outline: none;
  touch-action: none;
}
.wnode .node-disc,
.wnode .node-ring,
.wnode .node-glow,
.wnode .node-glyph {
  transition:
    fill 0.2s,
    stroke 0.2s,
    stroke-opacity 0.2s,
    fill-opacity 0.2s,
    color 0.2s,
    r 0.25s cubic-bezier(0.22, 0.7, 0.24, 1),
    opacity 0.2s;
}
.wnode .node-glow {
  opacity: 0;
}
.wnode.active .node-glow {
  opacity: 1;
}
.wnode:hover .node-ring,
.wnode:focus-visible .node-ring {
  stroke-opacity: 1 !important;
  stroke: #e9c878 !important;
}
.wnode:hover .node-glyph,
.wnode:focus-visible .node-glyph {
  color: #e9c878 !important;
  opacity: 1 !important;
}

/* Scroll buttons removed from UI; wheel is controlled by clicking the visible icons. */
.wbtn {
  display: none !important;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 24px;
  border: 1px solid rgba(201, 164, 92, 0.35);
  background: rgba(22, 19, 15, 0.85);
  color: #7e6633;
  font-family: "Cinzel", serif;
  font-size: 11px;
  cursor: pointer;
  transition: 0.18s;
  pointer-events: auto;
  user-select: none;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}
.wbtn:hover {
  color: #e9c878;
  border-color: rgba(201, 164, 92, 0.8);
  background: rgba(42, 37, 31, 0.9);
}

/* crystal rune icon in hero */
.rune-icon {
  width: 84px;
  height: 84px;
  flex: none;
}

/* ========================================
   FANTASY SVG ASSET: decorative
   ======================================== */
.fantasy-header-art {
  display: block;
  width: 100%;
  height: auto;
  margin-bottom: -2px;
  pointer-events: none;
}

/* ========================================
   THEME ANIMATIONS + ARCANE SPARKLES
   ======================================== */
.rpg-ambient {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
  mix-blend-mode: screen;
}
.rpg-ambient .spark {
  position: absolute;
  left: var(--x, 50%);
  top: var(--y, 50%);
  width: var(--s, 3px);
  height: var(--s, 3px);
  border-radius: 50%;
  background: radial-gradient(
    circle,
    #fff7c6 0 16%,
    #e9c878 22%,
    rgba(201, 164, 92, 0.35) 54%,
    transparent 72%
  );
  box-shadow:
    0 0 7px rgba(233, 200, 120, 0.8),
    0 0 16px rgba(201, 164, 92, 0.35);
  opacity: 0;
  transform: translate3d(0, 0, 0) scale(0.65);
  animation: ambientSpark var(--dur, 7s) linear infinite;
  animation-delay: var(--delay, 0s);
}
.rpg-ambient .spark.star {
  border-radius: 0;
  clip-path: polygon(
    50% 0,
    62% 36%,
    100% 50%,
    62% 64%,
    50% 100%,
    38% 64%,
    0 50%,
    38% 36%
  );
}
.rpg-ambient .spark.burst {
  left: var(--bx, 50%);
  top: var(--by, 50%);
  animation: burstSpark 0.72s cubic-bezier(0.15, 0.85, 0.25, 1) forwards;
  animation-delay: 0s;
}
@keyframes ambientSpark {
  0% {
    opacity: 0;
    transform: translate3d(0, 36px, 0) scale(0.35) rotate(0deg);
  }
  12% {
    opacity: 0.78;
  }
  58% {
    opacity: 0.45;
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--drift, 24px), -128px, 0) scale(1.08)
      rotate(180deg);
  }
}
@keyframes burstSpark {
  0% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(0.72) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--dx, 0), var(--dy, 0), 0) scale(0.05)
      rotate(220deg);
  }
}

.hero-card {
  position: relative;
  overflow: hidden;
}
.hero-card > * {
  position: relative;
  z-index: 3;
}

.name {
  animation: nameGoldBreath 4.8s ease-in-out infinite;
}
@keyframes nameGoldBreath {
  0%,
  100% {
    text-shadow:
      0 2px 18px rgba(201, 164, 92, 0.18),
      0 0 0 rgba(233, 200, 120, 0);
  }
  50% {
    text-shadow:
      0 2px 18px rgba(201, 164, 92, 0.24),
      0 0 22px rgba(233, 200, 120, 0.22);
  }
}
.rune-icon {
  animation:
    runeFloat 6s ease-in-out infinite,
    runeAura 3.8s ease-in-out infinite;
  filter: drop-shadow(0 0 0 rgba(201, 164, 92, 0));
}
@keyframes runeFloat {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-5px) rotate(-1.4deg);
  }
}
@keyframes runeAura {
  0%,
  100% {
    filter: drop-shadow(0 0 3px rgba(201, 164, 92, 0.22));
  }
  50% {
    filter: drop-shadow(0 0 12px rgba(233, 200, 120, 0.42));
  }
}

.sec-head h2,
.hail-top h2 {
  position: relative;
  width: max-content;
  max-width: 100%;
}
.hail-top h2 {
  margin-left: auto;
  margin-right: auto;
}
.sec-head h2::after,
.hail-top h2::after {
  content: "";
  position: absolute;
  right: -18px;
  top: 0.12em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e9c878;
  box-shadow:
    0 0 10px #e9c878,
    0 0 20px rgba(201, 164, 92, 0.45);
  opacity: 0;
  animation: titleWisp 3.2s ease-in-out infinite;
}
@keyframes titleWisp {
  0%,
  100% {
    opacity: 0;
    transform: translate(0, 8px) scale(0.45);
  }
  34% {
    opacity: 0.95;
    transform: translate(5px, -2px) scale(1);
  }
  70% {
    opacity: 0.18;
    transform: translate(13px, -12px) scale(0.55);
  }
}

.frame.attr,
.quest,
.channel,
.slot,
.btn {
  position: relative;
  overflow: hidden;
}
.frame.attr::after,
.quest::after,
.channel::after,
.slot::after,
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    circle at 50% 50%,
    rgba(233, 200, 120, 0.18),
    rgba(201, 164, 92, 0.07) 24%,
    transparent 58%
  );
  opacity: 0;
  transform: scale(0.78);
  transition:
    opacity 0.35s ease,
    transform 0.45s cubic-bezier(0.22, 0.7, 0.24, 1);
  mix-blend-mode: screen;
}
.frame.attr:hover::after,
.quest:hover::after,
.channel:hover::after,
.slot:hover::after,
.btn:hover::after {
  opacity: 1;
  transform: scale(1.08);
}
.frame.attr:hover,
.quest:hover {
  box-shadow:
    inset 0 0 0 4px var(--bg2),
    inset 0 0 0 5px var(--line),
    0 0 26px -18px var(--goldb);
}
.ph .pid {
  display: inline-block;
  animation: runeBlink 2.6s ease-in-out infinite;
}
@keyframes runeBlink {
  0%,
  100% {
    color: var(--goldd);
    text-shadow: none;
    transform: scale(1);
  }
  50% {
    color: var(--goldb);
    text-shadow: 0 0 10px rgba(233, 200, 120, 0.45);
    transform: scale(1.08);
  }
}
.bar i {
  position: relative;
  overflow: hidden;
}
.bar i::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 246, 190, 0.38),
    transparent
  );
  transform: translateX(-100%);
  animation: barGleam 4.6s ease-in-out infinite;
}
@keyframes barGleam {
  0%,
  50% {
    transform: translateX(-105%);
  }
  66% {
    transform: translateX(105%);
  }
  100% {
    transform: translateX(105%);
  }
}

#codex-wheel {
  isolation: isolate;
}
#codex-wheel::before {
  content: "";
  position: absolute;
  inset: 34px;
  z-index: 0;
  pointer-events: none;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    transparent 48%,
    rgba(201, 164, 92, 0.05) 61%,
    rgba(233, 200, 120, 0.16) 63%,
    transparent 70%
  );
  filter: blur(9px);
  opacity: 0.75;
  animation: wheelAuraPulse 4.8s ease-in-out infinite;
}
#wheel-svg-wrap {
  position: relative;
  z-index: 1;
}
#codex-wheel .wnode.active .node-glow {
  animation: nodeSigilPulse 2.4s ease-in-out infinite;
}
@keyframes wheelAuraPulse {
  0%,
  100% {
    opacity: 0.28;
    transform: scale(0.96);
  }
  50% {
    opacity: 0.86;
    transform: scale(1.02);
  }
}
@keyframes nodeSigilPulse {
  0%,
  100% {
    opacity: 0.65;
  }
  50% {
    opacity: 1;
  }
}
@media (max-width: 900px) {
  #codex-wheel::before {
    inset: 32px 10px;
    transform: scaleX(1.38);
    animation: mobileWheelAuraPulse 4.8s ease-in-out infinite;
  }
  @keyframes mobileWheelAuraPulse {
    0%,
    100% {
      opacity: 0.24;
      transform: scaleX(1.3) scaleY(0.94);
    }
    50% {
      opacity: 0.78;
      transform: scaleX(1.42) scaleY(1.02);
    }
  }
}

.scroll-tex {
  position: relative;
  overflow: hidden;
}
.scroll-tex::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(
      circle at 18% 20%,
      rgba(255, 255, 255, 0.23),
      transparent 2.2%
    ),
    radial-gradient(
      circle at 76% 30%,
      rgba(255, 255, 255, 0.16),
      transparent 2%
    ),
    radial-gradient(
      circle at 42% 86%,
      rgba(255, 255, 255, 0.18),
      transparent 2.4%
    );
  opacity: 0.22;
  animation: parchmentDust 7s ease-in-out infinite;
}
@keyframes parchmentDust {
  0%,
  100% {
    opacity: 0.14;
    transform: translateY(0);
  }
  50% {
    opacity: 0.36;
    transform: translateY(-8px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .rpg-ambient {
    display: none !important;
  }
  .sec-head h2::after,
  .hail-top h2::after,
  .frame.attr::after,
  .quest::after,
  .channel::after,
  .slot::after,
  .btn::after,
  .scroll-tex::after,
  #codex-wheel::before {
    display: none !important;
  }
  .name,
  .rune-icon,
  .ph .pid,
  .bar i::after,
  #codex-wheel .wnode.active .node-glow {
    animation: none !important;
  }
}

/* ========================================
   THEMED CURSOR - RPG RUNE / GOLD POINTER
   ======================================== */
:root {
  --cursor-default:
    url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2232%22%20height%3D%2232%22%20viewBox%3D%220%200%2032%2032%22%3E%3Cfilter%20id%3D%22g%22%3E%3CfeDropShadow%20dx%3D%220%22%20dy%3D%220%22%20stdDeviation%3D%221.2%22%20flood-color%3D%22%23c9a45c%22%20flood-opacity%3D%220.75%22%2F%3E%3C%2Ffilter%3E%3Cpath%20d%3D%22M5%203%20L24%2015%20L15.2%2017.2%20L11.4%2027%20Z%22%20fill%3D%22%23100f0d%22%20stroke%3D%22%23e9c878%22%20stroke-width%3D%221.4%22%20stroke-linejoin%3D%22round%22%20filter%3D%22url%28%23g%29%22%2F%3E%3Cpath%20d%3D%22M8.2%208%20L17.4%2014.2%22%20stroke%3D%22%23c9a45c%22%20stroke-width%3D%221%22%2F%3E%3Ccircle%20cx%3D%228.4%22%20cy%3D%228.2%22%20r%3D%221.7%22%20fill%3D%22%23e9c878%22%2F%3E%3C%2Fsvg%3E")
      5 3,
    auto;
  --cursor-pointer:
    url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2232%22%20height%3D%2232%22%20viewBox%3D%220%200%2032%2032%22%3E%3Cfilter%20id%3D%22g%22%3E%3CfeDropShadow%20dx%3D%220%22%20dy%3D%220%22%20stdDeviation%3D%221.4%22%20flood-color%3D%22%23e9c878%22%20flood-opacity%3D%220.85%22%2F%3E%3C%2Ffilter%3E%3Cpath%20d%3D%22M16%202%20L19.5%208%20L16%2014%20L12.5%208%20Z%22%20fill%3D%22%231a1714%22%20stroke%3D%22%23e9c878%22%20stroke-width%3D%221.3%22%20filter%3D%22url%28%23g%29%22%2F%3E%3Cpath%20d%3D%22M16%2014%20L16%2028%22%20stroke%3D%22%23c9a45c%22%20stroke-width%3D%221.6%22%20stroke-linecap%3D%22round%22%2F%3E%3Cpath%20d%3D%22M9%2020%20L23%2020%22%20stroke%3D%22%237e6633%22%20stroke-width%3D%221.3%22%20stroke-linecap%3D%22round%22%2F%3E%3Ccircle%20cx%3D%2216%22%20cy%3D%2220%22%20r%3D%223%22%20fill%3D%22%23100f0d%22%20stroke%3D%22%23e9c878%22%20stroke-width%3D%221%22%2F%3E%3Cpath%20d%3D%22M13%2023%20L9%2029%20M19%2023%20L23%2029%22%20stroke%3D%22%23c9a45c%22%20stroke-width%3D%221%22%20stroke-linecap%3D%22round%22%2F%3E%3C%2Fsvg%3E")
      16 2,
    pointer;
  --cursor-grab:
    url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2232%22%20height%3D%2232%22%20viewBox%3D%220%200%2032%2032%22%3E%3Cfilter%20id%3D%22g%22%3E%3CfeDropShadow%20dx%3D%220%22%20dy%3D%220%22%20stdDeviation%3D%221.2%22%20flood-color%3D%22%23c9a45c%22%20flood-opacity%3D%220.7%22%2F%3E%3C%2Ffilter%3E%3Ccircle%20cx%3D%2216%22%20cy%3D%2216%22%20r%3D%2212%22%20fill%3D%22%23100f0d%22%20stroke%3D%22%23c9a45c%22%20stroke-width%3D%221.2%22%20filter%3D%22url%28%23g%29%22%2F%3E%3Ccircle%20cx%3D%2216%22%20cy%3D%2216%22%20r%3D%228%22%20fill%3D%22none%22%20stroke%3D%22%237e6633%22%20stroke-width%3D%221%22%20stroke-dasharray%3D%222%202%22%2F%3E%3Cpath%20d%3D%22M16%205%20V10%20M16%2022%20V27%20M5%2016%20H10%20M22%2016%20H27%22%20stroke%3D%22%23e9c878%22%20stroke-width%3D%221.2%22%20stroke-linecap%3D%22round%22%2F%3E%3Cpath%20d%3D%22M16%2012%20L20%2016%20L16%2020%20L12%2016%20Z%22%20fill%3D%22%231a1714%22%20stroke%3D%22%23e9c878%22%20stroke-width%3D%221%22%2F%3E%3C%2Fsvg%3E")
      16 16,
    grab;
  --cursor-grabbing:
    url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2232%22%20height%3D%2232%22%20viewBox%3D%220%200%2032%2032%22%3E%3Cfilter%20id%3D%22g%22%3E%3CfeDropShadow%20dx%3D%220%22%20dy%3D%220%22%20stdDeviation%3D%221.8%22%20flood-color%3D%22%23e9c878%22%20flood-opacity%3D%221%22%2F%3E%3C%2Ffilter%3E%3Ccircle%20cx%3D%2216%22%20cy%3D%2216%22%20r%3D%2212%22%20fill%3D%22%231a1714%22%20stroke%3D%22%23e9c878%22%20stroke-width%3D%221.5%22%20filter%3D%22url%28%23g%29%22%2F%3E%3Ccircle%20cx%3D%2216%22%20cy%3D%2216%22%20r%3D%227%22%20fill%3D%22rgba%28201%2C164%2C92%2C0.18%29%22%20stroke%3D%22%23c9a45c%22%20stroke-width%3D%221%22%2F%3E%3Cpath%20d%3D%22M16%204%20V11%20M16%2021%20V28%20M4%2016%20H11%20M21%2016%20H28%22%20stroke%3D%22%23e9c878%22%20stroke-width%3D%221.4%22%20stroke-linecap%3D%22round%22%2F%3E%3Cpath%20d%3D%22M16%2011%20L21%2016%20L16%2021%20L11%2016%20Z%22%20fill%3D%22%23100f0d%22%20stroke%3D%22%23e9c878%22%20stroke-width%3D%221.2%22%2F%3E%3C%2Fsvg%3E")
      16 16,
    grabbing;
}
*,
*::before,
*::after {
  cursor: var(--cursor-default);
}
html,
body {
  cursor: var(--cursor-default);
}
a,
button,
.btn,
.channel,
.wnode,
.wnode * {
  cursor: var(--cursor-pointer) !important;
}
#wheel-svg-wrap,
#codex-wheel svg,
.wheel-root {
  cursor: var(--cursor-grab) !important;
}
#codex-wheel.dragging,
#codex-wheel.dragging #wheel-svg-wrap,
#codex-wheel.dragging svg,
#codex-wheel.dragging .wheel-root,
#codex-wheel.dragging .wnode,
#codex-wheel.dragging .wnode * {
  cursor: var(--cursor-grabbing) !important;
}
input,
textarea,
[contenteditable="true"] {
  cursor: text;
}
