/* Jadefall site: brand tokens, fonts, the bar, store badges and the footer.
   Shared by every page. scrollcraft.css comes first and supplies the floor. */

@font-face {
  font-family: "Cinzel";
  src: url("../fonts/cinzel-latin-700-normal.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Cinzel";
  src: url("../fonts/cinzel-latin-800-normal.woff2") format("woff2");
  font-weight: 800; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Cinzel";
  src: url("../fonts/cinzel-latin-600-normal.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Outfit";
  src: url("../fonts/outfit-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}

:root {
  --sc-canvas:      #07120e;
  --sc-surface:     #0d1d17;
  --sc-ink:         #f3ebd9;
  --sc-ink-soft:    #a9baae;
  --sc-accent:      #e8b64b;
  --sc-accent-ink:  #1b1305;
  --sc-font-display: "Cinzel", "Times New Roman", serif;
  --sc-font-text:    "Outfit", system-ui, sans-serif;
  --sc-shadow-color: 160 60% 2%;

  /* The game's HUD colour. It lives only inside the HUD pill, as it does in the game. */
  --jade: #3dffb0;
  --gold-hi: #ffe4a1;
  --bar-h: 64px;
  --sc-r-md: 14px;
}

html { scroll-behavior: auto; background: var(--sc-canvas); }
body { font-weight: 380; letter-spacing: 0.005em; line-height: 1.62; }
:where(h1, h2, h3, h4) { font-family: var(--sc-font-display); font-weight: 700; letter-spacing: 0.01em; line-height: 1.08; text-wrap: balance; margin: 0; }
:where(p) { margin: 0; text-wrap: pretty; }
strong, b { font-weight: 600; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: fixed; left: 12px; top: -60px; z-index: 100; padding: 10px 16px;
  background: var(--sc-accent); color: var(--sc-accent-ink); border-radius: var(--sc-r-sm);
  font-weight: 600; text-decoration: none; transition: top var(--sc-d-fast) var(--sc-ease-out);
}
.skip:focus { top: 12px; }

/* ------------------------------------------------------------------ bar -- */
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: var(--sc-z-chrome);
  height: var(--bar-h);
  display: flex; align-items: center; gap: var(--sc-5);
  padding-inline: clamp(14px, 3vw, 40px);
  padding-top: env(safe-area-inset-top);
  box-sizing: content-box;
  background: linear-gradient(to bottom, rgb(4 12 9 / 0.86), rgb(4 12 9 / 0.62));
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid rgb(232 182 75 / 0.14);
}
.bar__mark { display: block; flex: none; border-radius: var(--sc-r-sm); }
.bar__mark img { height: 30px; width: auto; }
.bar__nav { display: flex; gap: clamp(14px, 2vw, 30px); margin-inline: auto 0; }
.bar__nav a {
  color: var(--sc-ink-soft); text-decoration: none; font-size: var(--sc-t-sm); font-weight: 500;
  letter-spacing: 0.06em; text-transform: uppercase; padding: 6px 2px;
  transition: color var(--sc-d-fast) var(--sc-ease-out);
}
.bar__nav a:hover, .bar__nav a[aria-current="true"] { color: var(--sc-ink); }
.bar__end { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.bar__nav + .bar__end { margin-left: clamp(16px, 2.4vw, 36px); }

.cta {
  display: inline-flex; align-items: center; gap: 9px; flex: none;
  height: 42px; padding: 0 18px 0 14px; border-radius: 999px;
  background: linear-gradient(180deg, #f7cf6d, var(--sc-accent) 55%, #c8952f);
  color: var(--sc-accent-ink); text-decoration: none; font-weight: 600; font-size: var(--sc-t-sm);
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgb(255 245 210 / 0.65), 0 2px 4px rgb(0 0 0 / 0.3), 0 8px 18px -6px rgb(232 182 75 / 0.35);
  transition: transform 140ms var(--sc-ease-out), filter 140ms var(--sc-ease-out);
}
.cta svg { width: 18px; height: 18px; flex: none; }
.cta:hover { filter: brightness(1.06); }
.cta:active { transform: translateY(1px) scale(0.98); }
.cta__short { display: none; }

/* ------------------------------------------------------------ the HUD -- */
.hud {
  display: inline-flex; align-items: center; gap: 10px; height: 38px; padding: 0 6px 0 14px;
  border-radius: 999px; background: rgb(6 20 15 / 0.82);
  border: 1px solid rgb(232 182 75 / 0.28);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.06);
  font-variant-numeric: tabular-nums; white-space: nowrap; user-select: none;
}
.hud__dist { font-family: var(--sc-font-display); font-weight: 700; font-size: 1.02rem; color: var(--sc-ink); min-width: 4.6ch; text-align: right; }
.hud__dist small { font-family: var(--sc-font-text); font-weight: 500; font-size: 0.72rem; color: var(--sc-ink-soft); margin-left: 3px; }
.hud__place {
  font-size: 0.72rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold-hi);
  max-width: 0; overflow: hidden; opacity: 0;
  transition: max-width 320ms var(--sc-ease-out), opacity 220ms var(--sc-ease-out);
}
.hud__place.is-on { max-width: 13rem; opacity: 1; }
.hud__flow {
  display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border-radius: 999px;
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  color: #bfeedd; background: rgb(61 255 176 / 0.08); border: 1px solid rgb(61 255 176 / 0.25);
  transition: background 220ms var(--sc-ease-out), border-color 220ms var(--sc-ease-out), color 220ms var(--sc-ease-out);
}
.hud__flow b { font-family: var(--sc-font-display); font-size: 0.92rem; letter-spacing: 0; color: #e9fff6; }
.hud__flow.is-hot { background: rgb(61 255 176 / 0.2); border-color: rgb(61 255 176 / 0.7); color: #e9fff6; }
.hud__flow.is-up { animation: flow-up 360ms var(--sc-ease-out); }
@keyframes flow-up { 0% { transform: scale(1); } 40% { transform: scale(1.12); } 100% { transform: scale(1); } }

/* --------------------------------------------------------- store badges -- */
.badges { display: flex; flex-wrap: wrap; gap: 12px; }
.badge {
  display: inline-flex; align-items: center; gap: 11px; height: 56px; padding: 0 20px 0 15px;
  border-radius: 12px; text-decoration: none; color: #fff; background: #0b0d0c;
  border: 1px solid rgb(255 255 255 / 0.32);
  box-shadow: 0 2px 4px rgb(0 0 0 / 0.35), 0 12px 26px -10px rgb(0 0 0 / 0.6);
  transition: transform 140ms var(--sc-ease-out), border-color 140ms var(--sc-ease-out), background 140ms var(--sc-ease-out);
}
.badge svg { width: 28px; height: 28px; flex: none; }
.badge__txt { display: flex; flex-direction: column; line-height: 1.05; }
.badge__txt small { font-size: 0.64rem; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 500; opacity: 0.86; }
.badge__txt b { font-size: 1.3rem; font-weight: 600; letter-spacing: -0.01em; }
a.badge:hover { border-color: rgb(255 255 255 / 0.7); background: #121614; }
a.badge:active { transform: translateY(1px) scale(0.98); }
.badge--soon { color: rgb(255 255 255 / 0.78); border-style: dashed; border-color: rgb(255 255 255 / 0.3); background: rgb(11 13 12 / 0.72); }
.badge--soon svg { opacity: 0.85; }

/* ---------------------------------------------------------------- foot -- */
.foot {
  position: relative; z-index: 2;
  padding: var(--sc-7) var(--sc-gutter) calc(var(--sc-6) + env(safe-area-inset-bottom));
  display: grid; gap: var(--sc-5) var(--sc-7);
  grid-template-columns: auto 1fr;
  align-items: start;
  border-top: 1px solid var(--sc-hairline);
  background: #050d0a;
  font-size: var(--sc-t-sm); color: var(--sc-ink-soft);
}
.foot__brand { display: grid; gap: 10px; }
.foot__brand img { height: 28px; width: auto; }
.foot nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px 26px; }
.foot nav a { color: var(--sc-ink); text-decoration: none; font-weight: 500; }
.foot nav a:hover { text-decoration: underline; }
.foot__legal { grid-column: 1 / -1; font-size: var(--sc-t-xs); line-height: 1.6; max-width: 92ch; opacity: 0.85; }

@media (max-width: 1080px) {
  .bar__nav { display: none; }
}
@media (max-width: 700px) {
  :root { --bar-h: 56px; }
  .bar { gap: 10px; }
  .bar__mark img { height: 24px; }
  .hud { height: 34px; padding: 0 4px 0 10px; gap: 6px; }
  .hud__place { display: none; }
  .hud__dist { font-size: 0.92rem; min-width: 3.6ch; }
  .hud__flow { height: 26px; padding: 0 8px; font-size: 0; gap: 0; }
  .hud__flow b { font-size: 0.84rem; }
  .cta { height: 38px; padding: 0 14px 0 11px; }
  .cta__long { display: none; }
  .cta__short { display: inline; }
  .foot { grid-template-columns: 1fr; }
  .foot nav { justify-content: flex-start; }
}
@media (max-width: 370px) {
  .hud__flow { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .hud__flow.is-up { animation: none; }
}

/* ------------------------------------------------------------- doc pages -- */
.doc { padding: calc(var(--bar-h) + env(safe-area-inset-top) + var(--sc-8)) var(--sc-gutter) var(--sc-9); }
.doc__inner { max-width: 46rem; margin-inline: auto; }
.doc h1 { font-size: var(--sc-t-2xl); line-height: 1.1; color: var(--sc-ink); }
.doc .doc__meta { margin-top: var(--sc-3); color: var(--sc-ink-soft); font-size: var(--sc-t-sm); }
.doc .doc__lede { margin-top: var(--sc-6); font-size: var(--sc-t-lg); line-height: 1.55; color: var(--sc-ink); }
.doc h2 { font-size: var(--sc-t-xl); margin-top: var(--sc-8); margin-bottom: var(--sc-3); color: var(--gold-hi); }
.doc h3 { font-family: var(--sc-font-text); font-size: var(--sc-t-base); font-weight: 600; letter-spacing: 0; margin-top: var(--sc-6); margin-bottom: var(--sc-2); color: var(--sc-ink); }
.doc p, .doc li, .doc td, .doc dd { color: #d3d9cf; }
.doc p + p { margin-top: var(--sc-4); }
.doc ul, .doc ol { padding-left: 1.3em; margin: var(--sc-3) 0 0; }
.doc li + li { margin-top: var(--sc-2); }
.doc a { color: var(--gold-hi); }
.doc table { width: 100%; border-collapse: collapse; margin-top: var(--sc-4); font-size: var(--sc-t-sm); }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 12px 14px 12px 0; border-bottom: 1px solid var(--sc-hairline); }
.doc th { color: var(--sc-ink); font-weight: 600; }
.doc .doc__box {
  margin-top: var(--sc-6); padding: var(--sc-5); border-radius: var(--sc-r-md);
  background: var(--sc-surface); border: 1px solid rgb(232 182 75 / 0.18); box-shadow: var(--sc-edge);
}
.doc .doc__box h2 { margin-top: 0; }
.doc details { border-bottom: 1px solid var(--sc-hairline); padding: var(--sc-4) 0; }
.doc summary { cursor: pointer; font-weight: 600; color: var(--sc-ink); list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.doc summary::-webkit-details-marker { display: none; }
.doc summary::after { content: "+"; color: var(--sc-accent); font-weight: 400; font-size: 1.3em; line-height: 1; }
.doc details[open] summary::after { content: "\2212"; }
.doc details > p, .doc details > ul, .doc details > ol { margin-top: var(--sc-3); }
.doc .toc { margin-top: var(--sc-6); padding: var(--sc-4) var(--sc-5); border-radius: var(--sc-r-md); background: var(--sc-surface); border: 1px solid var(--sc-hairline); }
.doc .toc ol { columns: 2 16rem; margin: 0; }
.doc .toc a { color: var(--sc-ink); text-decoration: none; }
.doc .toc a:hover { text-decoration: underline; }
.page-doc { background: radial-gradient(120% 60% at 50% 0%, #0f2a20 0%, var(--sc-canvas) 60%) no-repeat, var(--sc-canvas); }

/* Big monitors: scale the whole type and spacing system so the page is not a small island. */
@media (min-width: 1900px) and (min-height: 900px) {
  html { font-size: 112.5%; }
  :root { --bar-h: 72px; }
  .bar__mark img { height: 34px; }
}
@media (min-width: 2400px) and (min-height: 1200px) {
  html { font-size: 131.25%; }
  :root { --bar-h: 84px; --sc-maxw: 90rem; }
  .bar__mark img { height: 40px; }
  .hud { height: 44px; }
  .cta { height: 48px; }
}
