/* ═══════════════════════════════════════════════════════════════
   Bork Services · cave stone, Bork gold, ember light
   ═══════════════════════════════════════════════════════════════ */
:root {
  --cave: #140d09;
  --rock: #1f1611;
  --ledge: #2d2018;
  --seam: #4a3526;
  --gold: #ffc83c;
  --gold-deep: #c8901e;
  --ember: #ff6e14;
  --parch: #eadcc0;
  --muted: #b3a185;
  --green: #5ac85a;
  --red: #e0533f;

  --display: "Cinzel", Georgia, serif;
  --deco: "Cinzel Decorative", "Cinzel", Georgia, serif;
  --body: "Alegreya Sans", "Segoe UI", system-ui, sans-serif;

  --step--1: .875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.6rem;
  --step-3: 2.2rem;
  --step-4: clamp(2.6rem, 6vw, 4.6rem);

  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--cave);
  color: var(--parch);
  font: 400 var(--step-0)/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; }
a { color: var(--gold); }
h1, h2, h3 { font-family: var(--display); font-weight: 700; color: #fff4dc; margin: 0; line-height: 1.15; }
p { margin: 0; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }

.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--gold); color: #000; padding: 8px 14px; border-radius: 6px; }
.skip:focus { left: 8px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

/* pixel-art icons stay crisp when scaled */
.px, .wi { image-rendering: pixelated; }
.svc-icon .wi { image-rendering: auto; }

/* ─────────────────────── buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 48px; padding: 0 1.4rem;
  border-radius: 10px; border: 1px solid transparent;
  font: 700 var(--step-0)/1 var(--body); letter-spacing: .01em;
  text-decoration: none; cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
}
.btn:active { transform: translateY(1px); }
.btn-gold {
  color: #2a1700;
  background: linear-gradient(180deg, #ffe08a 0%, var(--gold) 45%, var(--gold-deep) 100%);
  border-color: #ffe9a8;
  box-shadow: 0 0 0 1px #6b4706, 0 8px 28px -8px rgba(255, 140, 20, .65), inset 0 1px 0 rgba(255,255,255,.6);
}
.btn-gold:hover { box-shadow: 0 0 0 1px #6b4706, 0 10px 36px -6px rgba(255, 140, 20, .9), inset 0 1px 0 rgba(255,255,255,.6); }
.btn-ghost { color: var(--parch); background: rgba(255, 200, 60, .04); border-color: rgba(255, 200, 60, .35); }
.btn-ghost:hover { border-color: var(--gold); background: rgba(255, 200, 60, .1); }
.btn.small { min-height: 38px; padding: 0 1rem; font-size: var(--step--1); }

.link-btn {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--gold); font-weight: 700; text-decoration: underline; text-decoration-color: rgba(255,200,60,.4);
  text-underline-offset: 4px;
}
.link-btn:hover { text-decoration-color: var(--gold); }
.link-btn.inline { font-weight: 500; }

/* ─────────────────────── nav: transparent over the hero, solid once you scroll */
.progress { position: fixed; inset: 0 0 auto; height: 3px; z-index: 70; pointer-events: none; }
.progress span {
  display: block; height: 100%; width: 100%; transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, var(--ember), var(--gold));
  box-shadow: 0 0 12px rgba(255, 150, 40, .7);
}
.nav {
  position: fixed; inset: 0 0 auto; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: calc(14px + env(safe-area-inset-top)) max(var(--gutter), env(safe-area-inset-right)) 14px max(var(--gutter), env(safe-area-inset-left));
  background: linear-gradient(180deg, rgba(14, 8, 5, .7), rgba(14, 8, 5, 0));
  transition: background .35s ease, padding .35s ease, box-shadow .35s ease, backdrop-filter .35s ease;
}
.nav.scrolled {
  padding-top: calc(10px + env(safe-area-inset-top)); padding-bottom: 10px;
  background: rgba(20, 13, 9, .86);
  backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 1px 0 rgba(255, 200, 60, .12), 0 10px 30px -12px rgba(0, 0, 0, .7);
}
.brand { display: flex; align-items: center; gap: .65rem; text-decoration: none; color: #fff4dc; position: relative; z-index: 2; }
.brand img { border-radius: 50%; box-shadow: 0 0 0 1px rgba(255,200,60,.5), 0 0 18px -4px var(--ember); }
.brand span { font: 800 1.15rem/1 var(--display); letter-spacing: .02em; }
.nav ul { display: flex; align-items: center; gap: 1.6rem; list-style: none; margin: 0; padding: 0; }
.nav ul a:not(.btn) { position: relative; color: var(--parch); text-decoration: none; font-weight: 500; padding: .3rem 0; }
.nav ul a:not(.btn)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; border-radius: 2px;
  background: var(--gold); transform: scaleX(0); transition: transform .25s ease;
}
.nav ul a:not(.btn):hover { color: #fff4dc; }
.nav ul a:not(.btn):hover::after, .nav ul a.current::after { transform: scaleX(1); }
.nav ul a.current { color: var(--gold); }
.nav-toggle { display: none; }

@media (max-width: 860px) {
  .nav-toggle {
    position: relative; z-index: 2; display: grid; place-content: center; gap: 5px;
    width: 46px; height: 46px; border-radius: 12px; cursor: pointer;
    background: rgba(20, 13, 9, .6); border: 1px solid var(--seam);
  }
  .nav-toggle span { display: block; width: 20px; height: 2px; border-radius: 2px; background: var(--parch); transition: transform .3s ease, opacity .2s ease; }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .nav ul {
    position: fixed; inset: 0; z-index: 1;
    flex-direction: column; justify-content: center; gap: .4rem;
    padding: 90px 24px calc(40px + env(safe-area-inset-bottom));
    background: radial-gradient(80% 60% at 50% 30%, rgba(255, 110, 20, .16), transparent 70%), #0f0906;
    opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility 0s linear .3s;
  }
  .nav ul.open { opacity: 1; visibility: visible; transition: opacity .3s ease; }
  .nav ul li { width: min(100%, 340px); opacity: 0; transform: translateY(12px); transition: opacity .35s ease, transform .35s ease; }
  .nav ul.open li { opacity: 1; transform: none; }
  .nav ul.open li:nth-child(2) { transition-delay: .04s; } .nav ul.open li:nth-child(3) { transition-delay: .08s; }
  .nav ul.open li:nth-child(4) { transition-delay: .12s; } .nav ul.open li:nth-child(5) { transition-delay: .16s; }
  .nav ul.open li:nth-child(6) { transition-delay: .2s; }
  .nav ul a:not(.btn) { display: block; padding: .7rem 1rem; font: 700 1.6rem/1.2 var(--display); text-align: center; }
  .nav ul a:not(.btn)::after { left: 38%; right: 38%; bottom: 4px; }
  .nav ul .btn { margin-top: 1rem; width: 100%; min-height: 52px; font-size: 1.05rem; }
  body.menu-open { overflow: hidden; }
  /* the blur on the bar would trap the full-screen menu inside it, so drop it while open */
  body.menu-open .chat-launch { opacity: 0; pointer-events: none; }
  body.menu-open .nav { backdrop-filter: none; -webkit-backdrop-filter: none; background: transparent; box-shadow: none; }
}

/* ─────────────────────── hero: layered parallax cave */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  min-height: max(640px, min(100svh, 1000px));
  display: flex; align-items: center;
  background: #120a06;
}
.scene { position: absolute; inset: 0; z-index: -2; }
.layer { position: absolute; inset: -14% 0; will-change: transform; pointer-events: none; }
.l-back { background: url("/img/cave-back.webp") 62% 45% / cover no-repeat; }
.l-mid { background: url("/img/cave-mid.webp") center 60% / cover no-repeat; opacity: .9; animation: drift 26s ease-in-out infinite alternate; }
.l-near { inset: auto 0 -6% 0; height: 70%; background: url("/img/cave-near.webp") center bottom / cover no-repeat; }
@keyframes drift { from { background-position: 46% 60%; } to { background-position: 54% 58%; } }
@media (max-width: 700px) { .l-back { background-image: url("/img/cave-back-sm.webp"); } }
.embers { inset: 0; width: 100%; height: 100%; }

.l-bork { inset: auto 3% 1% auto; width: min(52vw, 760px); aspect-ratio: 760 / 510; }
.l-bork picture, .l-bork img { display: block; width: 100%; height: 100%; object-fit: contain; object-position: bottom center; }
.l-bork img { filter: drop-shadow(0 0 30px rgba(255, 110, 20, .35)) drop-shadow(0 30px 40px rgba(0, 0, 0, .6)); animation: borkIn 1.6s cubic-bezier(.2, .7, .1, 1) both .15s; }
.bork-glow {
  position: absolute; left: 18%; right: 18%; top: 10%; bottom: 0; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 120, 30, .55), transparent);
  filter: blur(30px); animation: breathe 5s ease-in-out infinite;
}
@keyframes borkIn { from { opacity: 0; transform: translateY(40px) scale(.96); filter: brightness(.3) drop-shadow(0 0 0 transparent); } }
@keyframes breathe { 0%, 100% { opacity: .7; transform: scale(1); } 50% { opacity: 1; transform: scale(1.05); } }

/* readable text side + smooth fade into the page */
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(70% 60% at 72% 40%, rgba(14, 8, 5, 0), rgba(14, 8, 5, .35) 100%),
    linear-gradient(90deg, rgba(14, 8, 5, .9) 0%, rgba(14, 8, 5, .6) 36%, rgba(14, 8, 5, 0) 60%),
    linear-gradient(180deg, rgba(20, 13, 9, 0) 58%, rgba(20, 13, 9, .75) 86%, var(--cave) 99%);
}

.floaters { inset: 0; }
.floater {
  position: absolute; left: var(--x); top: var(--y); width: var(--s); height: var(--s);
  display: grid; place-items: center; will-change: transform;
}
.floater img {
  width: 100%; height: 100%; object-fit: contain; rotate: var(--r);
  filter: drop-shadow(0 8px 14px rgba(0,0,0,.6)) drop-shadow(0 0 12px rgba(255, 150, 40, .35));
  animation: float var(--t, 8s) ease-in-out infinite;
}
.floater.far img { opacity: .55; filter: blur(1.2px) drop-shadow(0 0 8px rgba(255, 150, 40, .25)); }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-16px) rotate(6deg); } }

.hero-inner {
  position: relative; width: 100%; max-width: var(--wrap); margin: 0 auto;
  padding: 120px var(--gutter) 110px;
}
.hero-copy { max-width: 560px; }
.hero-wordmark { border-radius: 50%; box-shadow: 0 0 0 2px rgba(255,200,60,.6), 0 0 40px -6px var(--ember); margin-bottom: 1.3rem; }
.hero h1 {
  font-family: var(--deco); font-weight: 900;
  font-size: var(--step-4); line-height: 1.02; letter-spacing: .005em;
  background: linear-gradient(180deg, #fff6d6 0%, #ffd863 40%, var(--gold) 60%, #d08a12 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 0 #3b1d03) drop-shadow(0 14px 34px rgba(255, 110, 20, .4));
}
.lede { margin-top: 1.3rem; font-size: var(--step-1); line-height: 1.55; color: #f3e6cc; max-width: 34ch; text-shadow: 0 2px 12px rgba(0,0,0,.6); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2rem; }
.hero-points { list-style: none; padding: 0; margin: 2.2rem 0 0; display: grid; gap: .6rem; color: #d9c7a6; }
.hero-points li { display: flex; align-items: center; gap: .7rem; }
.hero-points img { width: 22px; height: 22px; object-fit: contain; }

.rise { animation: rise .9s cubic-bezier(.2, .7, .1, 1) both; animation-delay: calc(var(--i, 0) * 90ms + 200ms); }
@keyframes rise { from { opacity: 0; transform: translateY(22px); filter: blur(4px); } }

.scroll-cue {
  position: absolute; left: 50%; bottom: 26px; translate: -50% 0; z-index: 2;
  width: 30px; height: 48px; border-radius: 16px; border: 2px solid rgba(255, 200, 60, .5);
}
.scroll-cue span { position: absolute; left: 50%; top: 9px; width: 4px; height: 9px; margin-left: -2px; border-radius: 2px; background: var(--gold); animation: wheel 1.8s ease-in-out infinite; }
@keyframes wheel { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 80% { opacity: 0; transform: translateY(14px); } 100% { opacity: 0; } }

@media (max-width: 860px) {
  .hero { align-items: flex-end; min-height: max(680px, 100svh); }
  .l-bork { inset: calc(64px + env(safe-area-inset-top)) auto auto 50%; width: min(104vw, 520px); translate: -50% 0; }
  .l-near { height: 46%; }
  .hero::before {
    background: linear-gradient(180deg, rgba(14, 8, 5, .25) 0%, rgba(14, 8, 5, 0) 18%, rgba(14, 8, 5, .55) 40%, rgba(14, 8, 5, .94) 58%, var(--cave) 100%);
  }
  .hero-inner { padding: 0 var(--gutter) calc(80px + env(safe-area-inset-bottom)); }
  .hero-wordmark { display: none; }
  .hero h1 { font-size: clamp(2.3rem, 11vw, 3.2rem); }
  .lede { font-size: 1.08rem; }
  .hero-actions .btn { flex: 1 1 100%; }
  .hero-points { margin-top: 1.6rem; font-size: .98rem; }
  .floater { --s: 34px !important; }
  .floater.far { display: none; }
  .scroll-cue { display: none; }
}

/* ─────────────────────── sections */
.section { padding: clamp(64px, 9vw, 120px) 0; position: relative; }
.section-dark {
  background:
    linear-gradient(180deg, var(--cave) 0%, var(--rock) 14%, var(--rock) 86%, var(--cave) 100%);
}
.section-dark::before {     /* soft ember haze for depth */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(50% 40% at 85% 30%, rgba(255, 110, 20, .07), transparent 70%),
              radial-gradient(40% 40% at 10% 80%, rgba(255, 200, 60, .04), transparent 70%);
}
.section > .wrap { position: relative; }
.section-head { max-width: 640px; margin-bottom: clamp(32px, 5vw, 56px); }
.section-head h2 { font-size: var(--step-3); color: var(--gold); }
.section-head p { margin-top: .8rem; color: var(--muted); font-size: var(--step-1); line-height: 1.5; }

/* ─────────────────────── services */
.services { display: grid; grid-template-columns: repeat(2, 1fr); column-gap: clamp(28px, 5vw, 64px); }
.svc {
  display: grid; grid-template-columns: 104px 1fr; gap: 1.4rem; align-items: start;
  padding: 1.8rem 0; border-top: 1px solid rgba(255, 200, 60, .14);
}
.svc h3 { font-size: var(--step-2); }
.svc p { margin: .5rem 0 .9rem; color: var(--muted); max-width: 46ch; }
.svc-icon {
  position: relative; width: 104px; height: 104px; display: grid; place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, rgba(255, 110, 20, .22), rgba(255, 110, 20, 0) 70%), var(--ledge);
  box-shadow: inset 0 0 0 1px rgba(255, 200, 60, .25), inset 0 -10px 20px rgba(0,0,0,.4);
}
.svc-icon img {
  position: relative; z-index: 1; max-width: 70px; max-height: 70px; object-fit: contain;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,.6)) drop-shadow(0 0 10px rgba(255, 150, 40, .25));
  animation: bob 4.2s ease-in-out infinite;
}
.svc:nth-child(2n) .svc-icon img { animation-delay: -1.4s; }
.svc:nth-child(3n) .svc-icon img { animation-delay: -2.6s; }
.rune-ring {
  position: absolute; inset: 6px; border-radius: 50%;
  border: 1px dashed rgba(255, 200, 60, .35);
  animation: spin 40s linear infinite;
}
.svc:hover .svc-icon img { filter: drop-shadow(0 6px 10px rgba(0,0,0,.6)) drop-shadow(0 0 18px rgba(255, 160, 40, .7)); }
.svc:hover .rune-ring { border-color: rgba(255, 200, 60, .7); animation-duration: 8s; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-7px) rotate(2deg); } }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 820px) {
  .services { grid-template-columns: 1fr; }
  .svc { grid-template-columns: 76px 1fr; gap: 1.1rem; }
  .svc-icon { width: 76px; height: 76px; }
  .svc-icon img { max-width: 52px; max-height: 52px; }
}

.skills-strip { margin-top: clamp(40px, 6vw, 64px); padding-top: 1.6rem; border-top: 1px solid rgba(255, 200, 60, .14); }
.skills-strip p { font: 600 var(--step-1)/1 var(--display); color: #fff4dc; margin-bottom: 1rem; }
.skills-strip ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.skills-strip li {
  width: 46px; height: 46px; display: grid; place-items: center; border-radius: 10px;
  background: var(--ledge); box-shadow: inset 0 0 0 1px rgba(255, 200, 60, .14);
  transition: transform .15s ease, box-shadow .2s ease;
}
.skills-strip li:hover { transform: translateY(-3px); box-shadow: inset 0 0 0 1px var(--gold), 0 6px 18px -6px var(--ember); }
.skills-strip img { width: 25px; height: 25px; object-fit: contain; }

/* ─────────────────────── hiscores */
.hs-layout { display: grid; grid-template-columns: 1fr minmax(300px, 420px); gap: clamp(32px, 5vw, 72px); align-items: start; }
.hs-intro h2 { font-size: var(--step-3); color: var(--gold); }
.hs-intro > p { margin-top: .8rem; color: var(--muted); font-size: var(--step-1); max-width: 40ch; }
.hs-form { margin-top: 2rem; display: grid; gap: .8rem; max-width: 460px; }
.hs-form label { font-weight: 700; color: #fff4dc; }
.hs-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .6rem; }
.hs-form input { min-width: 0; }
.hs-form input, .hs-form select {
  min-height: 50px; padding: 0 1rem; border-radius: 10px;
  background: var(--cave); color: #fff4dc; border: 1px solid var(--seam);
  font: 500 var(--step-0)/1 var(--body);
}
.hs-form input:focus, .hs-form select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(255, 200, 60, .2); }
.hs-form .btn { justify-self: start; }
.hs-msg { min-height: 1.5em; color: var(--muted); }
.hs-msg.error { color: #ff9b85; }
.hs-summary {
  margin-top: 1.6rem; max-width: 460px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--seam); border: 1px solid var(--seam); border-radius: 12px; overflow: hidden;
}
.hs-summary > div { background: var(--cave); padding: .9rem 1rem; }
.hs-summary span { display: block; color: var(--muted); font-size: var(--step--1); }
.hs-summary strong { font: 700 var(--step-2)/1.2 var(--body); color: var(--gold); font-variant-numeric: tabular-nums; }
.hs-summary .btn { grid-column: 1 / -1; border-radius: 0; border: 0; background: var(--ledge); }
.hs-summary .btn:hover { background: #3a2a1f; }

/* the in-game skills tab */
.stats-panel {
  position: relative;
  padding: 10px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.04), rgba(0,0,0,.08)),
    #3e3529;
  border-radius: 6px;
  box-shadow:
    0 0 0 2px #1a1510,
    0 0 0 4px #5b4f3d,
    0 0 0 6px #1a1510,
    0 30px 60px -20px rgba(0,0,0,.9);
}
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.stat {
  position: relative; display: grid; grid-template-columns: 30px minmax(0, 1fr); align-items: center;
  height: 50px; padding: 0 8px 0 6px; border-radius: 3px; cursor: default;
  background: linear-gradient(180deg, #4a4033 0%, #3a3127 100%);
  box-shadow: inset 0 0 0 1px #1d1812, inset 0 1px 0 #5e5241;
  font-family: var(--body);
}
.stat img { width: 25px; height: 25px; object-fit: contain; justify-self: center; }
.stat .lv {
  justify-self: end; font: 800 1.15rem/1 var(--body); color: #ffff00;
  text-shadow: 1px 1px 0 #000; font-variant-numeric: tabular-nums; letter-spacing: .02em;
}
.stat .lv b { font-weight: 800; }
.stat .lv span { color: #ffff00; opacity: .9; }
.stat.max { box-shadow: inset 0 0 0 1px #c8901e, inset 0 1px 0 #5e5241, 0 0 12px -4px var(--gold); }
.stat:hover, .stat:focus-visible { background: linear-gradient(180deg, #5a4e3e 0%, #463b2f 100%); }
.stat.loading .lv { opacity: .25; }
.stats-total {
  margin-top: 4px; height: 46px; display: flex; align-items: center; justify-content: center; gap: .5rem;
  border-radius: 3px; background: #2c251d; box-shadow: inset 0 0 0 1px #1d1812;
  color: #ffff00; text-shadow: 1px 1px 0 #000; font: 700 1.05rem/1 var(--body);
}
.stats-tip {
  position: absolute; z-index: 5; pointer-events: none;
  min-width: 190px; padding: .55rem .7rem;
  background: #ffffa0; color: #000; border: 1px solid #000;
  font: 500 .9rem/1.35 var(--body);
}
.activities { grid-column: 1 / -1; }
.activities h3 { font-size: var(--step-2); color: var(--gold); margin-bottom: 1rem; }
.hs-layout > * { min-width: 0; }
@media (max-width: 900px) {
  .hs-layout { grid-template-columns: minmax(0, 1fr); }
  .stats-panel { max-width: 440px; }
}

/* ─────────────────────── steps (a real sequence, so numbered) */
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(20px, 3vw, 36px); }
.steps li { counter-increment: step; position: relative; padding-top: 4.2rem; }
.steps li::before {
  content: counter(step);
  position: absolute; top: 0; left: 0;
  width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%;
  font: 800 1.4rem/1 var(--display); color: #2a1700;
  background: linear-gradient(180deg, #ffe08a, var(--gold) 50%, var(--gold-deep));
  box-shadow: 0 0 0 4px var(--cave), 0 0 0 5px rgba(255, 200, 60, .4);
}
.steps li:not(:last-child)::after {
  content: ""; position: absolute; top: 26px; left: 64px; right: -12px; height: 1px;
  background: linear-gradient(90deg, rgba(255,200,60,.5), rgba(255,200,60,0));
}
.steps h3 { font-size: var(--step-1); }
.steps p { margin-top: .5rem; color: var(--muted); }
@media (max-width: 900px) { .steps { grid-template-columns: repeat(2, 1fr); } .steps li::after { display: none; } }
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } }

/* ─────────────────────── payments */
.pay-groups { display: grid; gap: 2.2rem; }
.pay-group h3 { font-size: var(--step-1); margin-bottom: .9rem; color: #fff4dc; }
.pay-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.pay-list li {
  display: flex; align-items: center; gap: .65rem;
  padding: .55rem .95rem .55rem .6rem; border-radius: 999px;
  background: var(--cave); box-shadow: inset 0 0 0 1px var(--seam);
  font-weight: 500;
}
.pay-list img { width: 26px; height: 26px; border-radius: 6px; object-fit: contain; background: #fff; padding: 2px; }
.pay-list img.no-bg { background: none; padding: 0; }

/* ─────────────────────── faq */
.faq-wrap { display: grid; grid-template-columns: 1fr 1.4fr; gap: clamp(28px, 5vw, 72px); align-items: start; }
.faq details { border-top: 1px solid rgba(255, 200, 60, .14); }
.faq details:last-child { border-bottom: 1px solid rgba(255, 200, 60, .14); }
.faq summary {
  list-style: none; cursor: pointer; padding: 1.2rem 2.4rem 1.2rem 0; position: relative;
  font: 600 var(--step-1)/1.3 var(--display); color: #fff4dc;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 6px; top: 50%; width: 12px; height: 12px; margin-top: -8px;
  border-right: 2px solid var(--gold); border-bottom: 2px solid var(--gold);
  transform: rotate(45deg); transition: transform .25s ease;
}
.faq details[open] summary::after { transform: rotate(225deg); margin-top: -2px; }
.faq details p { padding: 0 0 1.3rem; color: var(--muted); max-width: 62ch; }
@media (max-width: 860px) { .faq-wrap { grid-template-columns: 1fr; } }

/* ─────────────────────── cta + footer */
.cta { position: relative; overflow: hidden; isolation: isolate; text-align: center; padding: clamp(110px, 16vw, 200px) 0; }
.cta-bg { z-index: -2; background: url("/img/cave-back.webp") center 40% / cover no-repeat; }
.cta::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, var(--cave) 0%, rgba(20,13,9,.35) 30%, rgba(20,13,9,.35) 70%, var(--cave) 100%);
}
.cta h2 { font-family: var(--deco); font-size: var(--step-4); color: var(--gold); text-shadow: 0 2px 0 #3b1d03, 0 0 40px rgba(255,110,20,.5); }
.cta p { margin-top: 1rem; font-size: var(--step-1); }
.cta .hero-actions { justify-content: center; }

.footer { padding: 40px 0 120px; border-top: 1px solid rgba(255, 200, 60, .12); color: var(--muted); font-size: var(--step--1); }
.footer-inner { display: grid; grid-template-columns: auto 1fr auto; gap: 2rem; align-items: center; }
.footer p { max-width: 70ch; }
@media (max-width: 760px) { .footer-inner { grid-template-columns: 1fr; gap: 1rem; } }

/* ─────────────────────── live chat */
.chat-launch {
  position: fixed; right: 20px; bottom: 20px; z-index: 60;
  display: flex; align-items: center; gap: .7rem;
  padding: 6px 18px 6px 6px; border-radius: 999px; cursor: pointer;
  background: linear-gradient(180deg, #2d2018, #1f1611);
  color: #fff4dc; font-weight: 700;
  border: 1px solid rgba(255, 200, 60, .55);
  box-shadow: 0 12px 34px -8px rgba(0,0,0,.8), 0 0 24px -6px var(--ember);
  transition: transform .2s ease, box-shadow .2s ease;
}
.chat-launch:hover { transform: translateY(-2px); box-shadow: 0 16px 40px -8px rgba(0,0,0,.8), 0 0 34px -4px var(--ember); }
.chat-launch img { border-radius: 50%; }
.chat-launch.open { transform: scale(.9); opacity: 0; pointer-events: none; }
.chat-badge {
  position: absolute; top: -4px; left: 34px; min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 999px; background: var(--red); color: #fff; font-size: .8rem; display: grid; place-items: center;
  box-shadow: 0 0 0 2px var(--cave);
}

.chat {
  position: fixed; right: 20px; bottom: 20px; z-index: 61;
  width: min(390px, calc(100vw - 24px)); height: min(620px, calc(100vh - 40px));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--rock);
  border: 1px solid rgba(255, 200, 60, .35); border-radius: 18px;
  box-shadow: 0 30px 80px -10px rgba(0,0,0,.85), 0 0 50px -16px var(--ember);
  transform-origin: bottom right;
}
.chat:not([hidden]) { animation: chatIn .28s cubic-bezier(.2, .8, .2, 1); }
@keyframes chatIn { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
.chat-head {
  display: flex; align-items: center; gap: .8rem; padding: 14px 14px 14px 16px;
  background: radial-gradient(120% 140% at 0% 0%, rgba(255,110,20,.28), transparent 60%), var(--ledge);
  border-bottom: 1px solid rgba(255, 200, 60, .2);
}
.chat-head img { border-radius: 50%; box-shadow: 0 0 0 2px rgba(255,200,60,.5); }
.chat-head h2 { font-size: 1.1rem; color: var(--gold); }
.chat-head p { display: flex; align-items: center; gap: .45rem; font-size: var(--step--1); color: var(--muted); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #776; flex: none; }
.dot.on { background: var(--green); box-shadow: 0 0 0 3px rgba(90,200,90,.2); animation: pulse 2s ease-in-out infinite; }
.dot.off { background: #c9a227; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(90,200,90,0); } }
.chat-close {
  margin-left: auto; width: 38px; height: 38px; border-radius: 10px; border: 0; cursor: pointer;
  background: transparent; color: var(--parch); font-size: 1.6rem; line-height: 1;
}
.chat-close:hover { background: rgba(255,255,255,.06); }

.chat-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; }
.chat-welcome {
  background: var(--cave); border: 1px solid var(--seam); border-radius: 14px; padding: 14px;
  color: var(--parch); font-size: .98rem;
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chip {
  padding: .4rem .75rem; border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--gold); border: 1px solid rgba(255,200,60,.4); font-size: .9rem; font-weight: 500;
}
.chip:hover { background: rgba(255,200,60,.12); }

.msg { max-width: 84%; display: flex; flex-direction: column; gap: 3px; animation: msgIn .22s ease-out; }
@keyframes msgIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.msg .bubble { padding: .6rem .85rem; border-radius: 14px; white-space: pre-wrap; word-wrap: break-word; line-height: 1.45; font-size: .98rem; }
.msg .meta { font-size: .76rem; color: var(--muted); padding: 0 4px; }
.msg.me { align-self: flex-end; align-items: flex-end; }
.msg.me .bubble { background: linear-gradient(180deg, #ffd768, var(--gold) 60%, #e9a826); color: #2a1700; border-bottom-right-radius: 4px; }
.msg.staff { align-self: flex-start; }
.msg.staff .bubble { background: var(--ledge); border: 1px solid var(--seam); border-bottom-left-radius: 4px; }
.msg.system { align-self: center; max-width: 92%; text-align: center; }
.msg.system .bubble { background: transparent; border: 1px dashed var(--seam); color: var(--muted); font-size: .9rem; }
.msg.pending .bubble { opacity: .6; }

.chat-typing { display: flex; align-items: center; gap: 4px; padding: 0 18px 6px; color: var(--muted); font-size: .82rem; }
.chat-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); animation: dots 1.2s infinite ease-in-out; }
.chat-typing span:nth-child(2) { animation-delay: .15s; }
.chat-typing span:nth-child(3) { animation-delay: .3s; }
.chat-typing em { font-style: normal; margin-left: 6px; }
@keyframes dots { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.chat-form { padding: 10px 12px 12px; border-top: 1px solid var(--seam); background: var(--rock); display: grid; gap: 8px; }
.chat-name, .chat-form textarea {
  width: 100%; border-radius: 10px; border: 1px solid var(--seam); background: var(--cave); color: #fff4dc;
  font: 400 .98rem/1.4 var(--body); padding: .6rem .8rem;
}
.chat-name:focus, .chat-form textarea:focus { outline: none; border-color: var(--gold); }
.chat-name[hidden] { display: none; }
.chat-input-row { display: grid; grid-template-columns: 1fr 46px; gap: 8px; align-items: end; }
.chat-form textarea { resize: none; max-height: 120px; }
.chat-send {
  height: 44px; border-radius: 10px; border: 0; cursor: pointer; color: #2a1700;
  background: linear-gradient(180deg, #ffe08a, var(--gold) 50%, var(--gold-deep));
}
.chat-send:disabled { opacity: .5; cursor: not-allowed; }
.chat-note { font-size: .74rem; color: var(--muted); text-align: center; }

@media (max-width: 520px) {
  .chat { right: 0; bottom: 0; width: 100vw; height: 100dvh; border-radius: 0; border: 0; }
  .chat-launch { right: 14px; bottom: 14px; }
  .chat-launch-text { display: none; }
  .chat-launch { padding: 6px; }
}

/* ─────────────────────── scroll reveals (only when JS is on, so nothing can stay hidden) */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s cubic-bezier(.2, .7, .1, 1), transform .8s cubic-bezier(.2, .7, .1, 1); transition-delay: var(--d, 0ms); }
.js .reveal.in { opacity: 1; transform: none; }

/* ─────────────────────── service cards: spotlight follows the cursor */
.svc { position: relative; border-radius: 0 0 18px 18px; padding: 1.8rem 1.2rem 1.8rem .4rem; margin: 0 -.4rem; }
.svc::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s ease;
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 150, 40, .1), transparent 60%);
}
.svc:hover::before { opacity: 1; }
.svc:hover .svc-icon { transform: translateY(-3px); }
.svc-icon { transition: transform .35s cubic-bezier(.2, .7, .1, 1); }

/* ─────────────────────── hiscores extras */
.hs-recent { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; color: var(--muted); font-size: .9rem; }
.hs-recent > div { display: flex; flex-wrap: wrap; gap: 6px; }
.hs-form .btn:disabled { opacity: .7; cursor: progress; }
.stats-panel.loading .stat { overflow: hidden; }
.stats-panel.loading .stat::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 230, 150, .14) 50%, transparent 80%);
  animation: shimmer 1.1s linear infinite;
}
.stats-panel.loading .lv { opacity: .3; }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.stat .lv { transition: color .3s ease; }

.act-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.2rem; }
.act-head h3 { margin: 0; }
.act-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--cave); box-shadow: inset 0 0 0 1px var(--seam); }
.act-tab {
  min-height: 38px; padding: 0 1rem; border-radius: 9px; border: 0; cursor: pointer;
  background: transparent; color: var(--muted); font-weight: 700;
  transition: background .2s ease, color .2s ease;
}
.act-tab { white-space: nowrap; }
.act-tab span { opacity: .65; font-weight: 500; margin-left: .3rem; }
.act-tab.active { background: var(--ledge); color: var(--gold); box-shadow: inset 0 0 0 1px rgba(255, 200, 60, .25); }
.act-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.act {
  display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: .8rem;
  padding: .6rem .9rem .6rem .6rem; border-radius: 14px;
  background: linear-gradient(180deg, #24180f, #1a110b); box-shadow: inset 0 0 0 1px var(--seam);
  animation: actIn .45s cubic-bezier(.2, .7, .1, 1) both; animation-delay: var(--d, 0ms);
  transition: box-shadow .2s ease, transform .2s ease;
}
.act:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px rgba(255, 200, 60, .45), 0 10px 24px -14px var(--ember); }
@keyframes actIn { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.act-icon {
  width: 52px; height: 52px; border-radius: 12px; overflow: hidden; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 35%, rgba(255, 140, 40, .25), transparent 70%), #120b07;
  box-shadow: inset 0 0 0 1px rgba(255, 200, 60, .18);
}
.act-icon img { width: 44px; height: 44px; object-fit: contain; image-rendering: auto; filter: drop-shadow(0 3px 4px rgba(0,0,0,.6)); }
.act-text { min-width: 0; display: grid; }
.act-name { font-weight: 700; color: #fff4dc; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act-text small { color: var(--muted); font-size: .8rem; }
.act strong { font: 800 1.2rem/1 var(--body); color: var(--gold); font-variant-numeric: tabular-nums; }
.activities { margin-top: 1rem; }

/* ─────────────────────── chat extras */
.chat-launch { bottom: calc(20px + env(safe-area-inset-bottom)); right: max(20px, env(safe-area-inset-right)); }
.chat-launch::before {
  content: ""; position: absolute; inset: -4px; border-radius: inherit; pointer-events: none;
  box-shadow: 0 0 0 0 rgba(255, 200, 60, .3); animation: ring 4s ease-out infinite 3s;
}
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(255, 200, 60, .3); } 60%, 100% { box-shadow: 0 0 0 12px rgba(255, 200, 60, 0); } }
.chat-toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 80;
  translate: -50% 20px; opacity: 0; pointer-events: none;
  max-width: calc(100vw - 32px); padding: .75rem 1.1rem; border-radius: 12px;
  background: var(--ledge); color: #fff4dc; border: 1px solid rgba(255, 200, 60, .35);
  box-shadow: 0 16px 40px -10px rgba(0, 0, 0, .8); font-weight: 500;
  transition: opacity .3s ease, translate .3s ease;
}
.chat-toast.show { opacity: 1; translate: -50% 0; }
@media (max-width: 520px) {
  .chat { height: 100dvh; padding-bottom: env(safe-area-inset-bottom); }
  .chat-head { padding-top: calc(14px + env(safe-area-inset-top)); }
}

/* ─────────────────────── small screens: comfortable spacing & tap targets */
@media (max-width: 600px) {
  .section-head h2, .hs-intro h2 { font-size: 1.9rem; }
  .section-head p, .hs-intro > p { font-size: 1.05rem; }
  .svc { padding: 1.4rem .6rem 1.4rem .2rem; }
  .hs-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hs-summary strong { font-size: 1.25rem; }
  .stat { height: 46px; }
  .stat .lv { font-size: 1.02rem; }
  .act-grid { grid-template-columns: 1fr; }
  .act-tabs { width: 100%; }
  .act-tab { flex: 1; padding: 0 .4rem; }
  .pay-list li { font-size: .95rem; }
  .faq summary { font-size: 1.1rem; }
  .footer-inner { text-align: left; }
}

/* ─────────────────────── motion preferences */
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  html { scroll-behavior: auto; }
}
