/* ============================================================
   JonnXor — this site's chrome: nav, dock, footer, search, dragonfly.
   Tokens, fonts and shared components come from @waaagh/jonnxor-brand
   (assets/brand/), loaded before this file.
   ============================================================ */

main {
  min-height: calc(100vh - var(--nav-h));
}

/* ---------------- Navigation ---------------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: color-mix(in oklab, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.site-nav .nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 14px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: 0.08em;
  color: var(--ink);
  text-decoration: none;
}
.nav-logo:hover {
  text-decoration: none;
}
.nav-logo svg {
  color: var(--gold-ink);
  filter: drop-shadow(0 0 calc(var(--glow-r) * 0.4) var(--glow-gold));
}
.nav-logo .xor {
  color: var(--tq-ink);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.nav-link {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 8px 6px;
  border-radius: var(--r-sm);
  text-decoration: none;
  white-space: nowrap;
}
.nav-link:hover {
  color: var(--ink);
  background: var(--tq-soft);
  text-decoration: none;
}
.nav-link.active {
  color: var(--tq-ink);
}
.nav-link.active {
  box-shadow: inset 0 -2px 0 var(--tq);
  border-radius: var(--r-sm) var(--r-sm) 0 0;
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Search trigger — lives in nav on every page */
.nav-search {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  color: var(--ink-faint);
  height: 32px;
  padding: 0 11px;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.nav-search:hover {
  color: var(--tq-ink);
  border-color: var(--tq-deep);
  box-shadow: 0 0 calc(var(--glow-r) * 0.4) var(--glow-tq);
}
.nav-search svg {
  width: 13px;
  height: 13px;
}
.nav-search .sk {
  font-family: var(--font-mono);
  font-size: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--ink-faint);
}
.nav-search .sk {
  display: none;
}
@media (max-width: 560px) {
  .nav-search {
    padding: 0;
    width: 32px;
    justify-content: center;
  }
}

/* ============ Adaptive primary nav ============
   ≥1920px  — HUD: all 9 numbered links, condensed controls (theme orb)
   1280–1919 — Three Realms: grouped dropdowns
   881–1279  — Seeker: search-first pill + mega menu
   ≤880px   — Quick-slot dock (fixed bottom) + More sheet  */

/* --- A · Three Realms (default desktop) --- */
.nav-realms {
  display: none;
  align-items: center;
  gap: 4px;
  margin: 0 auto 0 8px;
}
.nav-realm {
  position: relative;
}
.nav-rtop {
  appearance: none;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 9px 12px;
  border-radius: var(--r-sm);
}
.nav-rtop:hover {
  color: var(--ink);
  background: var(--tq-soft);
}
.nav-rtop.open {
  color: var(--tq-ink);
  background: var(--tq-soft);
}
.nav-rtop.active {
  box-shadow: inset 0 -2px 0 var(--tq);
  border-radius: var(--r-sm) var(--r-sm) 0 0;
}
.nav-rtop .car {
  font-size: 8px;
  transition: transform 0.2s var(--ease-out);
}
.nav-rtop.open .car {
  transform: rotate(180deg);
}
.nav-rpanel {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  width: 296px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  box-shadow:
    var(--shadow),
    0 0 34px var(--glow-tq);
  padding: 8px;
  z-index: 60;
}
.nav-rpanel::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 26px;
  width: 8px;
  height: 8px;
  background: var(--surface);
  border-left: 1px solid var(--line-strong);
  border-top: 1px solid var(--line-strong);
  transform: rotate(45deg);
}
.nav-ritem {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  color: var(--ink);
  text-decoration: none;
}
.nav-ritem:hover {
  background: var(--tq-soft);
  text-decoration: none;
}
.nav-ritem .t {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.nav-ritem:hover .t {
  color: var(--tq-ink);
}
.nav-ritem .d {
  font-size: 12.5px;
  color: var(--ink-faint);
}
.nav-ritem.here .t {
  color: var(--gold-ink);
}
.nav-ritem.here .t::after {
  content: " ⟡";
}

/* --- B · Seeker (laptop) --- */
.nav-seek {
  display: none;
  flex: 1;
  max-width: 440px;
  margin: 0 auto;
  appearance: none;
  cursor: pointer;
  align-items: center;
  gap: 11px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  padding: 8px 16px;
  color: var(--ink-faint);
  font-family: var(--font-body);
  font-size: 13px;
}
.nav-seek:hover {
  border-color: var(--tq-deep);
  box-shadow: 0 0 16px var(--glow-tq);
  color: var(--ink-soft);
}
.nav-seek svg {
  width: 13px;
  height: 13px;
  flex: none;
}
.nav-seek .sk {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 1px 6px;
}
.nav-menubtn {
  appearance: none;
  cursor: pointer;
  display: none;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  padding: 8px 13px;
}
.nav-menubtn:hover,
.nav-menubtn.open {
  border-color: var(--gold);
  color: var(--gold-ink);
  box-shadow: 0 0 16px var(--glow-gold);
}
.nav-mega {
  position: absolute;
  top: calc(var(--nav-h) + 10px);
  right: 24px;
  width: 560px;
  max-width: calc(100vw - 48px);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  box-shadow:
    var(--shadow),
    0 0 40px var(--glow-gold);
  padding: 12px;
  z-index: 60;
}
.nav-mega[hidden] {
  display: none;
}
.nav-mega .mg-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}
.nav-mega .mg-cell {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  color: var(--ink);
  text-decoration: none;
}
.nav-mega .mg-cell:hover {
  background: var(--tq-soft);
  text-decoration: none;
}
.nav-mega .mg-cell .n {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--gold-ink);
}
.nav-mega .mg-cell .t {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.nav-mega .mg-cell:hover .t {
  color: var(--tq-ink);
}
.nav-mega .mg-cell.here .t {
  color: var(--gold-ink);
}
.nav-mega .mg-cell.here .t::after {
  content: " ⟡";
}

/* --- C · HUD (ultrawide) --- */
.nav-hud {
  display: none;
  gap: 2px;
  margin: 0 auto;
}
.nav-hlink {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 7px 11px 6px;
  border-radius: var(--r-sm);
  text-decoration: none;
}
.nav-hlink:hover {
  background: var(--tq-soft);
  text-decoration: none;
}
.nav-hlink .n {
  font-family: var(--font-mono);
  font-size: 8.5px;
  color: var(--ink-faint);
  letter-spacing: 0.1em;
}
.nav-hlink .t {
  font-family: var(--font-display);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.nav-hlink:hover .t {
  color: var(--ink);
}
.nav-hlink.here .t {
  color: var(--gold-ink);
  text-shadow: 0 0 14px var(--glow-gold);
}
.nav-hlink.here .n {
  color: var(--gold-ink);
}
.nav-hlink.here::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -1px;
  transform: translateX(-50%);
  width: 22px;
  height: 2px;
  background: var(--gold);
  box-shadow: 0 0 10px var(--glow-gold);
}
.nav-orb {
  appearance: none;
  cursor: pointer;
  display: none;
  width: 36px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--gold-ink);
  place-items: center;
  box-shadow: 0 0 14px var(--glow-gold);
}
.nav-orb:hover {
  border-color: var(--gold);
}
.nav-orb svg {
  width: 16px;
  height: 16px;
}

/* --- Mobile · Quick-slot dock + More sheet --- */
.jx-dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1100;
  display: none;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  padding: 8px 8px calc(10px + env(safe-area-inset-bottom, 0px));
  background: color-mix(in oklab, var(--surface) 92%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--line-strong);
}
.jx-slot {
  position: relative;
  appearance: none;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 7px 2px 4px;
  border-radius: var(--r-sm);
  font-family: var(--font-display);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-decoration: none;
}
.jx-slot:hover {
  text-decoration: none;
}
.jx-slot svg {
  width: 20px;
  height: 20px;
}
.jx-slot.here {
  color: var(--tq-ink);
}
.jx-slot.here svg {
  filter: drop-shadow(0 0 9px var(--glow-tq));
}
.jx-slot.here::before {
  content: "";
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 2px;
  background: var(--tq);
  box-shadow: 0 0 10px var(--glow-tq);
}
.jx-sheet {
  position: fixed;
  left: 10px;
  right: 10px;
  bottom: calc(82px + env(safe-area-inset-bottom, 0px));
  z-index: 1090;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  box-shadow:
    var(--shadow),
    0 0 30px var(--glow-tq);
  padding: 10px;
}
.jx-sheet[hidden] {
  display: none;
}
.jx-sheet .sh-hd {
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding: 6px 10px 8px;
}
.jx-sheet .sh-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 11px 10px;
  border-radius: var(--r-sm);
  color: var(--ink);
  text-decoration: none;
}
.jx-sheet .sh-row:hover {
  background: var(--tq-soft);
  text-decoration: none;
}
.jx-sheet .sh-row .t {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.jx-sheet .sh-row .d {
  font-size: 11.5px;
  color: var(--ink-faint);
  margin-left: auto;
}
.jx-sheet .sh-row.here {
  background: var(--tq-soft);
  box-shadow: inset 2px 0 0 var(--tq);
}
.jx-sheet .sh-row.here .t {
  color: var(--tq-ink);
}
.jx-sheet .sh-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  margin-top: 8px;
  padding: 12px 6px 4px;
}

/* --- tier switching --- */
@media (min-width: 1920px) {
  .site-nav .nav-inner {
    max-width: 1440px;
  }
  .nav-hud {
    display: flex;
  }
  .nav-orb {
    display: grid;
  }
  .nav-controls .theme-toggle {
    display: none;
  }
}
@media (min-width: 1280px) and (max-width: 1919.98px) {
  .nav-realms {
    display: flex;
  }
}
@media (min-width: 881px) and (max-width: 1279.98px) {
  .nav-seek {
    display: flex;
  }
  .nav-menubtn {
    display: flex;
  }
  .nav-controls .nav-search {
    display: none;
  }
}
@media (max-width: 880px) {
  .nav-controls {
    margin-left: auto;
  }
  .nav-controls .lang-toggle,
  .nav-controls .theme-toggle {
    display: none;
  }
  .jx-dock {
    display: grid;
  }
  body {
    padding-bottom: 86px;
  }
  .site-footer {
    margin-bottom: 0;
  }
}
@media (max-width: 560px) {
  .site-nav .nav-inner {
    gap: 12px;
  }
}
@media print {
  .jx-dock,
  .jx-sheet {
    display: none !important;
  }
  body {
    padding-bottom: 0;
  }
}

/* ---------------- Footer ---------------- */
.site-footer {
  border-top: 1px solid var(--line);
  margin-top: var(--space-8);
  padding: 48px 0 28px;
  background: var(--bg-2);
}
.site-footer .foot-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr;
  gap: 32px 48px;
  align-items: start;
}
@media (max-width: 880px) {
  .site-footer .foot-inner {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .site-footer .foot-sign {
    order: 3;
  }
}
.site-footer .foot-brand {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}
.site-footer .foot-tag {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0;
}
.site-footer .foot-note {
  font-size: 13.5px;
  color: var(--ink-soft);
  margin: 0;
  max-width: 34ch;
}

.site-footer .foot-sign svg {
  width: 100%;
  max-width: 250px;
  height: auto;
  display: block;
  margin: 0 auto;
}
.site-footer .foot-sign .lines {
  stroke: var(--tq);
  opacity: 0.65;
}
.site-footer .foot-sign .stars {
  fill: var(--gold);
}
.site-footer .foot-sign .alde {
  filter: drop-shadow(0 0 calc(var(--glow-r) * 0.5) var(--glow-gold));
}
.site-footer .foot-sign .caption {
  font-family: var(--font-display);
  font-size: 8px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  fill: var(--ink-faint);
}

.site-footer .foot-hd {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold-ink);
  margin: 0 0 14px;
}
.site-footer .foot-row {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 5px 0;
  font-size: 13.5px;
}
.site-footer .foot-row .k {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-faint);
  min-width: 64px;
}
.site-footer .foot-row a {
  color: var(--ink-soft);
}
.site-footer .foot-row a:hover {
  color: var(--tq-ink);
}
.site-footer .foot-row .chip {
  margin-left: -2px;
}

.site-footer .foot-bottom {
  max-width: var(--maxw);
  margin: 36px auto 0;
  padding: 18px 24px 0;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 28px;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--ink-faint);
}
.site-footer .foot-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.site-footer .foot-links a {
  font-size: 12.5px;
  color: var(--ink-soft);
}
.site-footer .foot-links a:hover {
  color: var(--tq-ink);
}

/* Neon "lights on": glow the chrome without waiting for hover */
[data-theme="neon"] .site-nav {
  border-bottom-color: var(--line-strong);
  box-shadow:
    0 1px 0 rgba(255, 61, 174, 0.25),
    0 8px 30px rgba(255, 61, 174, 0.07);
}
[data-theme="neon"] .nav-link.active {
  text-shadow: 0 0 14px var(--glow-tq);
}

/* ---------------- Site-wide search modal ---------------- */
.search-modal {
  position: fixed;
  inset: 0;
  z-index: 6000;
  background: rgba(4, 6, 10, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  justify-content: center;
  align-items: flex-start;
  padding: 11vh 20px 20px;
}
.search-modal.open {
  display: flex;
}
.search-modal .sm-panel {
  width: 100%;
  max-width: 580px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow:
    var(--shadow),
    0 0 50px var(--glow-tq);
}
.search-modal .sm-input {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-faint);
}
.search-modal .sm-input input {
  appearance: none;
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15.5px;
  min-width: 0;
}
.search-modal .sm-input input::placeholder {
  color: var(--ink-faint);
}
.search-modal .sm-esc {
  font-family: var(--font-mono);
  font-size: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 2px 6px;
  flex: none;
}
.search-modal .sm-results {
  max-height: min(54vh, 460px);
  overflow-y: auto;
  padding: 8px;
}
.search-modal .sm-group {
  font-family: var(--font-display);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding: 10px 12px 4px;
}
.search-modal .sm-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  color: var(--ink);
  text-decoration: none;
}
.search-modal .sm-item:hover,
.search-modal .sm-item.sel {
  background: var(--tq-soft);
  text-decoration: none;
}
.search-modal .sm-item.sel {
  box-shadow: inset 2px 0 0 var(--tq);
}
.search-modal .sm-item .t-row {
  display: flex;
  align-items: center;
  gap: 9px;
}
.search-modal .sm-item .t {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.search-modal .sm-item .where {
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tq-ink);
  background: var(--tq-soft);
  border-radius: 99px;
  padding: 2px 8px;
  flex: none;
}
.search-modal .sm-item .snip {
  font-size: 12.5px;
  color: var(--ink-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-modal .sm-item .snip mark {
  background: var(--gold-soft);
  color: var(--gold-ink);
  border-radius: 2px;
  padding: 0 1px;
}
.search-modal .sm-empty {
  padding: 22px;
  text-align: center;
  color: var(--ink-faint);
  font-size: 13px;
  font-family: var(--font-display);
  letter-spacing: 0.1em;
}

/* ---------------- Dragonfly easter egg ---------------- */
.dragonfly {
  position: fixed;
  z-index: 4000;
  top: 30vh;
  left: -60px;
  pointer-events: none;
  color: var(--tq-ink);
  filter: drop-shadow(0 0 8px var(--glow-tq));
  animation: dfly 14s linear forwards;
}
@keyframes dfly {
  0% {
    transform: translate(0, 0) rotate(8deg);
  }
  20% {
    transform: translate(24vw, -8vh) rotate(-6deg);
  }
  45% {
    transform: translate(48vw, 4vh) rotate(10deg);
  }
  70% {
    transform: translate(74vw, -10vh) rotate(-4deg);
  }
  100% {
    transform: translate(110vw, -4vh) rotate(6deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .dragonfly {
    display: none;
  }
}
