@import url('/user-guide/css/guide.css');

/* ============================================================
   ZENITH HANDBOOK — the flight
   A star system you fly through. Reuses the readable guide's
   content styles (.zg-sec and everything under it) so a section
   body renders identically whether it is read in a document or
   in a panel floating in space.
   ============================================================ */

:root { --zf-panel-w: 620px; }

/* the readable guide hides the canvas; here it is the whole point */
.zf-body #zx-sky {
  display: block;
  position: fixed; inset: 0;
  width: 100vw; height: 100vh;
  z-index: 0; pointer-events: none;
}

.zf-body { background: var(--zx-black); }

/* with JS the page is a fixed viewport; without it, an ordinary document */
.zf-js, .zf-js body { height: 100%; overflow: hidden; }

/* the transparent sheet that catches flight gestures */
.zf-layer {
  position: fixed; inset: 0; z-index: 10;
  cursor: none; touch-action: none;
}
html:not(.zf-js) .zf-layer { display: none; }

/* ---------- top bar ---------- */

.zf-topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  display: flex; align-items: center; gap: 14px;
  padding: 14px clamp(14px, 3vw, 26px);
  pointer-events: none;
}
.zf-topbar > * { pointer-events: auto; }
.zf-topbar .zx-brand { gap: 11px; }
.zf-topbar .zx-mark { width: 24px; height: 24px; color: var(--zx-accent);
  filter: drop-shadow(0 0 7px rgba(232, 232, 230, .5)); display: block; }
.zf-topbar .zx-wordmark { font-size: 13px; letter-spacing: .38em; }
.zf-topbar-right {
  margin-left: auto; display: flex; align-items: center;
  gap: clamp(10px, 2vw, 18px);
}
.zf-topbar-right .zx-bracket { padding: 8px 13px; font-size: 11.5px; }
html:not(.zf-js) .zf-topbar { position: static; pointer-events: auto; }
html:not(.zf-js) .zx-themes,
html:not(.zf-js) [data-index] { display: none; }

/* ---------- system hero ---------- */

.zf-hero {
  position: fixed; z-index: 20; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(720px, calc(100vw - 48px));
  text-align: center; pointer-events: none;
  transition: opacity .5s var(--zx-ease);
}
.zf-hero[hidden] { display: none; }
.zf-hero .zx-eyebrow { justify-content: center; letter-spacing: .34em; margin-bottom: 24px; }
.zf-hero h1 {
  font: 100 clamp(46px, 10vw, 110px)/.96 var(--zx-sans);
  letter-spacing: -.03em; margin: 0 0 24px; color: #E8E8E6;
  text-shadow: 0 0 40px rgba(232, 232, 230, .14);
  text-wrap: pretty;
}
.zf-hero p {
  font: 300 clamp(15px, 2vw, 18px)/1.6 var(--zx-sans);
  color: rgba(232, 232, 230, .58);
  max-width: 46ch; margin: 0 auto;
}
.zf-cue {
  margin-top: 26px !important;
  font: 300 12px/1.6 var(--zx-mono) !important;
  letter-spacing: .16em; color: var(--zx-t-38) !important;
  animation: zxCue 2.6s ease-in-out infinite;
}
html:not(.zf-js) .zf-hero { display: none; }

/* ---------- back-to-system ---------- */

.zf-back {
  position: fixed; z-index: 38; left: clamp(14px, 3vw, 26px); top: 64px;
  font: 300 12px/1 var(--zx-mono); letter-spacing: .1em;
  color: var(--zx-t-60); background: rgba(6, 6, 8, .6);
  border: 1px solid rgba(232, 232, 230, .18);
  padding: 9px 14px; border-radius: 3px; cursor: pointer;
  backdrop-filter: blur(6px);
  transition: border-color .3s, color .3s;
}
.zf-back:hover { border-color: rgba(232, 232, 230, .6); color: #E8E8E6; }
.zf-back[hidden] { display: none; }

/* ---------- the glass panel ---------- */

.zf-panel {
  position: fixed; z-index: 20;
  left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(var(--zf-panel-w), calc(100vw - 40px));
  max-height: 80vh; overflow-y: auto; overscroll-behavior: contain;
  background: rgba(6, 6, 8, .66);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(232, 232, 230, .13);
  border-radius: 9px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .6);
  padding: 30px clamp(22px, 3vw, 34px) 28px;
  animation: zfPanelIn .6s var(--zx-ease);
  cursor: auto;
}
.zf-panel[hidden] { display: none; }
.zf-panel::-webkit-scrollbar { width: 6px; }
.zf-panel::-webkit-scrollbar-thumb { background: rgba(232, 232, 230, .16); }

@keyframes zfPanelIn {
  from { opacity: 0; transform: translate(-50%, -46%) scale(.96); filter: blur(6px); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); filter: blur(0); }
}

.zf-panel .zx-eyebrow { margin-bottom: 18px; letter-spacing: .3em; }
.zf-panel h2 {
  font: 200 clamp(26px, 4vw, 42px)/1.06 var(--zx-sans);
  letter-spacing: -.02em; margin: 0 0 16px; color: #E8E8E6;
  text-wrap: pretty;
}
.zf-panel-intro {
  font: 300 15px/1.65 var(--zx-sans);
  color: var(--zx-t-66); margin: 0 0 24px;
}
.zf-moons-label {
  font: 300 11px/1 var(--zx-mono);
  letter-spacing: .2em; color: var(--zx-t-35);
  margin: 26px 0 12px;
}
.zf-moon-row {
  display: flex; align-items: center; gap: 13px; width: 100%;
  background: none; border: none; cursor: pointer; text-align: left;
  padding: 12px 6px 12px 2px;
  border-bottom: 1px solid rgba(232, 232, 230, .07);
  font: 300 16px/1.35 var(--zx-sans); color: var(--zx-t-72);
  transition: padding-left .3s var(--zx-ease), color .3s;
}
.zf-moon-row:last-of-type { border-bottom: none; }
.zf-moon-row:hover, .zf-moon-row:focus-visible { padding-left: 12px; color: #E8E8E6; }
.zf-moon-dot {
  width: 8px; height: 8px; border-radius: 50%; flex: none;
}
.zf-moon-row .zf-chev { margin-left: auto; color: var(--zx-t-30); }
.zf-panel-note {
  font: 300 11.5px/1.7 var(--zx-mono);
  letter-spacing: .04em; color: var(--zx-t-30);
  margin: 22px 0 0;
}

/* a section's body reuses the readable guide's content styles */
.zf-panel .zg-sec {
  border-top: none; padding-top: 0; margin: 0;
}
.zf-panel .zg-sec > *:first-child { margin-top: 0; }
.zf-panel .zg-sec p,
.zf-panel .zg-sec li { font-size: 14.5px; }
.zf-panel .zg-sec p { max-width: none; }
.zf-panel .zg-sec ul, .zf-panel .zg-sec ol { max-width: none; }
.zf-panel .zg-sec h4 { margin-top: 22px; }

.zf-backchip {
  display: inline-flex; align-items: center; gap: 8px;
  font: 300 11.5px/1 var(--zx-mono); letter-spacing: .1em;
  color: var(--zx-t-50); background: none; border: none;
  cursor: pointer; padding: 0 0 16px;
  transition: color .3s;
}
.zf-backchip:hover { color: #E8E8E6; }

.zf-prevnext {
  display: flex; justify-content: space-between; gap: 14px;
  margin-top: 30px; padding-top: 18px;
  border-top: 1px solid rgba(232, 232, 230, .09);
}
.zf-prevnext button {
  font: 300 11.5px/1.5 var(--zx-mono); letter-spacing: .08em;
  color: var(--zx-t-55); background: none; border: none;
  cursor: pointer; padding: 4px 0; max-width: 46%;
  text-align: left; transition: color .3s;
}
.zf-prevnext button:last-child { text-align: right; }
.zf-prevnext button:hover { color: #E8E8E6; }
.zf-prevnext button[disabled] { opacity: 0; pointer-events: none; }

/* ---------- chapter rail ---------- */

.zf-rail {
  position: fixed; z-index: 38; right: 0; top: 50%;
  transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 3px;
  padding: 10px 12px 10px 0;
  max-height: 88vh;
}
html:not(.zf-js) .zf-rail { display: none; }
.zf-rail-row {
  display: flex; align-items: center; justify-content: flex-end; gap: 9px;
  background: none; border: none; cursor: pointer; padding: 2px 0;
}
.zf-rail-label {
  font: 300 10.5px/1 var(--zx-mono); letter-spacing: .1em;
  color: var(--zx-t-50); white-space: nowrap;
  max-width: 0; overflow: hidden; opacity: 0;
  transition: max-width .4s var(--zx-ease), opacity .3s;
}
.zf-rail-row:hover .zf-rail-label,
.zf-rail-row:focus-visible .zf-rail-label,
.zf-rail-row[aria-current="true"] .zf-rail-label {
  max-width: 240px; opacity: 1;
}
.zf-rail-row[aria-current="true"] .zf-rail-label { color: #E8E8E6; }
.zf-rail-dot {
  width: 6px; height: 6px; border-radius: 50%; flex: none;
  background: rgba(232, 232, 230, .4);
  transition: background .3s, box-shadow .3s;
}

/* ---------- index overlay ---------- */

.zf-index {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(2, 2, 4, .86);
  backdrop-filter: blur(10px);
  animation: zfFadeIn .35s ease;
  overflow-y: auto; cursor: auto;
}
.zf-index[hidden] { display: none; }
@keyframes zfFadeIn { from { opacity: 0; } to { opacity: 1; } }

.zf-index-inner {
  max-width: 1180px; margin: 0 auto;
  padding: clamp(28px, 6vh, 64px) clamp(20px, 5vw, 44px) 70px;
}
.zf-index-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; margin-bottom: 38px; flex-wrap: wrap;
}
.zf-index-head .zx-eyebrow { margin: 0; }
.zf-index-cols { columns: auto 260px; column-gap: 34px; }
.zf-index-ch { break-inside: avoid; margin-bottom: 26px; }
.zf-index-ch > button {
  display: flex; gap: 10px; align-items: baseline; width: 100%;
  background: none; border: none; cursor: pointer; text-align: left;
  padding: 0 0 8px;
  font: 300 15px/1.3 var(--zx-sans); color: #E8E8E6;
  transition: color .25s;
}
.zf-index-ch > button:hover { color: var(--zx-accent); }
.zf-index-num {
  font: 300 11px/1 var(--zx-mono); letter-spacing: .1em;
  color: var(--zx-t-35); flex: none;
}
.zf-index-secs { display: flex; flex-direction: column; }
.zf-index-secs button {
  background: none; border: none; cursor: pointer; text-align: left;
  padding: 4px 0 4px 22px;
  font: 300 13px/1.45 var(--zx-sans); color: var(--zx-t-42);
  transition: color .25s;
}
.zf-index-secs button:hover { color: var(--zx-accent); }

/* ---------- the written manual ---------- */

.zf-manual {
  position: relative; z-index: 2;
  max-width: 830px; margin: 0 auto;
  padding: 40px clamp(20px, 5vw, 40px) 90px;
}
/* with JS it stays in the DOM for assistive tech and crawlers, out of sight */
.zf-js .zf-manual {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); border: 0;
}
.zf-noscript {
  max-width: 830px; margin: 0 auto; padding: 30px clamp(20px, 5vw, 40px) 0;
  font: 300 15px/1.7 var(--zx-sans); color: var(--zx-t-66);
}
.zf-noscript b { color: #E8E8E6; font-weight: 400; }

/* ---------- narrow screens ---------- */

@media (max-width: 620px) {
  .zf-topbar .zx-wordmark { display: none; }
  .zf-panel { max-height: 74vh; padding: 24px 18px 22px; }
  .zf-rail { display: none; }
  .zf-back { top: 58px; }
  .zf-hero h1 { font-size: clamp(38px, 13vw, 60px); }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .zf-panel { animation: none; }
  .zf-index { animation: none; }
  .zf-cue { animation: none; }
  .zf-layer { cursor: auto; }
}
