/* ============================================================
   JonnXor — shared components (consumes tokens.css)
   Buttons, chips, badges, cards, tabs, grids, code blocks, doc content,
   the rune divider, reveal-on-scroll, the lightbox, and the theme and
   language toggles. A site's own chrome (nav, dock, footer, search) is
   not here: every site owns its chrome.
   ============================================================ */

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* Theme toggle — signature element: sun / moon / dragon */
.theme-toggle {
  display: flex;
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  padding: 3px;
  gap: 2px;
  background: var(--surface);
}
.theme-toggle button {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--ink-faint);
  width: 30px;
  height: 26px;
  border-radius: 99px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.25s var(--ease-out);
}
.theme-toggle button:hover {
  color: var(--ink);
}
.theme-toggle button.active {
  color: var(--on-gold);
  background: var(--gold);
  box-shadow: 0 0 calc(var(--glow-r) * 0.6) var(--glow-gold);
}
.theme-toggle button[data-set="neon"].active {
  color: var(--on-tq);
  background: var(--tq);
  box-shadow: 0 0 calc(var(--glow-r) * 0.6) var(--glow-tq);
}
.theme-toggle svg {
  width: 15px;
  height: 15px;
}

/* Language toggle — visual element */
.lang-toggle {
  display: flex;
  gap: 1px;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  overflow: hidden;
  background: var(--surface);
}
.lang-toggle button {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--ink-faint);
  padding: 6px 8px;
  cursor: pointer;
  font: inherit;
}
.lang-toggle button:hover {
  color: var(--ink);
}
.lang-toggle button.active {
  color: var(--tq-ink);
  background: var(--tq-soft);
}

/* ---------------- Rune divider ---------------- */
.rune-divider {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: var(--space-7) 0;
  color: var(--ink-faint);
}
.rune-divider::before,
.rune-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--line-strong));
}
.rune-divider::after {
  background: linear-gradient(to left, transparent, var(--line-strong));
}
.rune-divider .runes {
  width: 132px;
  height: 16px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 132 16'%3E%3Cpath d='M8 2 V14 M8 4 L15 1.5 M8 8 L15 5.5 M60 2 V14 M72 2 V14 M60 2 L72 14 M60 14 L72 2 M122 2 V14 M122 5 L128 8 L122 11' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 132 16'%3E%3Cpath d='M8 2 V14 M8 4 L15 1.5 M8 8 L15 5.5 M60 2 V14 M72 2 V14 M60 2 L72 14 M60 14 L72 2 M122 2 V14 M122 5 L128 8 L122 11' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    center / contain no-repeat;
}

/* ---------------- Typography helpers ---------------- */
.kicker {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--tq-ink);
  margin: 0 0 12px;
}
.kicker.gold {
  color: var(--gold-ink);
}

.page-head {
  padding: 64px 0 8px;
  background: var(--aurora);
}
.page-head h1 {
  font-size: clamp(30px, 4.5vw, 44px);
  font-weight: 800;
}
.page-head .lede {
  font-size: 17px;
  color: var(--ink-soft);
  max-width: 62ch;
}

.glow-tq {
  text-shadow: 0 0 var(--glow-r) var(--glow-tq);
}
.glow-gold {
  text-shadow: 0 0 var(--glow-r) var(--glow-gold);
}

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 12px 22px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s var(--ease-out);
}
.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-gold {
  background: var(--gold);
  color: var(--on-gold);
  box-shadow: 0 0 calc(var(--glow-r) * 0.8) var(--glow-gold);
}
.btn-gold:hover {
  box-shadow:
    0 0 calc(var(--glow-r) * 1.3) var(--glow-gold),
    var(--shadow);
}

.btn-tq {
  background: var(--tq);
  color: var(--on-tq);
  box-shadow: 0 0 calc(var(--glow-r) * 0.8) var(--glow-tq);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn-ghost:hover {
  border-color: var(--tq);
  color: var(--tq-ink);
}

/* ---------------- Chips & badges ---------------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 4px 10px;
  white-space: nowrap;
}
.chip.tq {
  color: var(--tq-ink);
  background: var(--tq-soft);
  border-color: transparent;
}
.chip.gold {
  color: var(--gold-ink);
  background: var(--gold-soft);
  border-color: transparent;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 5px 11px;
  border-radius: var(--r-sm);
  background: var(--gold);
  color: var(--on-gold);
  box-shadow: 0 0 calc(var(--glow-r) * 0.5) var(--glow-gold);
}
.badge.tq {
  background: var(--tq);
  color: var(--on-tq);
  box-shadow: 0 0 calc(var(--glow-r) * 0.5) var(--glow-tq);
}
.badge.quiet {
  background: var(--surface-2);
  color: var(--ink-soft);
  box-shadow: none;
  border: 1px solid var(--line);
}

/* ---------------- Cards ---------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--ambient-card, none);
  transition:
    transform 0.25s var(--ease-out),
    border-color 0.25s,
    box-shadow 0.25s;
}
.card.lift:hover {
  transform: translateY(-3px);
  border-color: var(--tq-deep);
  box-shadow:
    0 0 calc(var(--glow-r)) var(--glow-tq),
    var(--shadow);
}

.card-pad {
  padding: 22px;
}

/* gradient placeholder art block */
.art {
  border-radius: var(--r-md) var(--r-md) 0 0;
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.85);
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.1em;
}
.art .rune-mark {
  font-size: 34px;
  opacity: 0.9;
}

/* ---------------- Tabs ---------------- */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar {
  display: none;
}
.tab {
  appearance: none;
  background: transparent;
  border: none;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}
.tab:hover {
  color: var(--ink);
}
.tab.active {
  color: var(--gold-ink);
  border-bottom-color: var(--gold);
  text-shadow: 0 0 calc(var(--glow-r) * 0.8) var(--glow-gold);
}

/* ---------------- Grids ---------------- */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}
@media (max-width: 920px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 600px) {
  .grid-3,
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

/* ---------------- Code blocks ---------------- */
pre.code {
  background: var(--code-bg);
  border: 1px solid var(--code-line);
  border-radius: var(--r-md);
  padding: 18px 20px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.7;
  color: #d7dce5;
  margin: 0 0 1.4em;
}
pre.code .cm {
  color: #6b7587;
  font-style: italic;
}
pre.code .kw {
  color: #f2c94c;
}
pre.code .st {
  color: #3fe0cb;
}
pre.code .fn {
  color: #8fb8ff;
}
pre.code .nu {
  color: #f0975e;
}
code.inline {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--tq-soft);
  color: var(--tq-ink);
  padding: 2px 6px;
  border-radius: var(--r-sm);
}

/* ---------------- Doc content components ---------------- */
.table-scroll {
  overflow-x: auto;
  margin: 0 0 1.4em;
}
.table-scroll > table.doc-table {
  margin: 0;
}

table.doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin: 0 0 1.4em;
}
table.doc-table th {
  font-family: var(--font-display);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line-strong);
}
table.doc-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
}
table.doc-table td:first-child {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--tq-ink);
  white-space: nowrap;
}

kbd {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: var(--r-sm);
  padding: 2px 7px;
  color: var(--ink);
  white-space: normal;
}

.tip {
  border-left: 3px solid var(--gold);
  background: var(--gold-soft);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: 12px 18px;
  margin: 1.4em 0;
  font-size: 14px;
  color: var(--ink-soft);
}
.tip b {
  color: var(--gold-ink);
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 4px;
}

/* ---------------- Reveal on scroll ---------------- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 0.6s var(--ease-out),
    transform 0.6s var(--ease-out);
}
.reveal.in {
  opacity: 1;
  transform: none;
}

/* ---------------- Lightbox ---------------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 5000;
  background: rgba(4, 6, 10, 0.88);
  backdrop-filter: blur(6px);
  display: none;
  place-items: center;
  padding: 32px;
}
.lightbox.open {
  display: grid;
}
.lightbox .lb-frame {
  max-width: 880px;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow:
    var(--shadow),
    0 0 60px var(--glow-tq);
}
.lightbox .lb-art {
  aspect-ratio: 16 / 9;
}
.lightbox .lb-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
}
.lightbox .lb-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.06em;
  margin-right: auto;
}
/* Neon "lights on": glow the chrome without waiting for hover */

[data-theme="neon"] .chip.tq {
  box-shadow: 0 0 12px rgba(255, 61, 174, 0.25);
}
[data-theme="neon"] .chip.gold {
  box-shadow: 0 0 12px rgba(255, 225, 77, 0.22);
}
[data-theme="neon"] .rune-divider .runes {
  filter: drop-shadow(0 0 8px var(--glow-tq));
}
