/* ─────────────────────────────────────────────────────────────────
   Russell Boyer · The Archive
   Shared styles
   ────────────────────────────────────────────────────────────────── */

:root {
  /* Light, formal, high-tech base */
  --bg:    #f7f5f0;
  --bg-2:  #efece4;
  --bg-3:  #e6e2d8;
  --ink:   #14110c;
  --ink-2: rgba(20,17,12,0.66);
  --ink-3: rgba(20,17,12,0.44);
  --ink-4: rgba(20,17,12,0.22);
  --line:  rgba(20,17,12,0.10);
  --line-2:rgba(20,17,12,0.18);

  /* Light beam — warm amber-gold */
  --beam:    #d97a2c;
  --beam-2:  #f0a050;
  --beam-bg: rgba(217,122,44,0.06);
  --beam-line: rgba(217,122,44,0.35);

  --cool: #2c4a8a;

  --sans:  'Geist', -apple-system, system-ui, sans-serif;
  --mono:  'Geist Mono', 'JetBrains Mono', ui-monospace, monospace;
  --serif: 'Instrument Serif', 'Fraunces', Georgia, serif;
  --body:  'Lora', Georgia, serif;

  /* Layout */
  --nav-h: 56px;
  --gutter: clamp(24px, 4vw, 80px);
  --max-w: 1680px;
  --foot-h: 56px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

/* Hide scrollbars across all browsers but keep scrolling functional */
html, body, * {
  scrollbar-width: none;          /* Firefox */
  -ms-overflow-style: none;       /* old IE/Edge */
}
html::-webkit-scrollbar,
body::-webkit-scrollbar,
*::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;                  /* Chrome / Safari / Webkit */
}
body {
  background: var(--bg);
  font-family: var(--sans);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

a { color: inherit; }
img { display: block; max-width: 100%; }

/* Page mode classes */
body.dark {
  background: #06090f;
  color: #e8e3d8;
}
body.dark .page,
body.dark .ql-page,
body.dark .ap-page,
body.dark .traj-page { background: #06090f; }

/* All page-shell containers are flex children of body so the auto-injected
   footer stays at the bottom of the viewport even when content is short. */
.page, .ql-page, .ap-page, .bp-page, .lib-page, .traj-page {
  flex: 1 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
}

/* ── Nav ─────────────────────────────────────────────────────── */
.topnav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  padding: 0 var(--gutter);
  border-bottom: 1px solid var(--line);
  background: rgba(247,245,240,0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 50;
  animation: hdrEye 0.45s cubic-bezier(0.22,1,0.36,1) 0.05s both;
}
body.dark .topnav {
  background: rgba(6,9,15,0.85);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  color: #e8e3d8;
}
.topnav .brand {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: inherit;
  white-space: nowrap;
  transition: opacity 0.15s;
}
.topnav .brand:hover { opacity: 0.7; }
.topnav .brand .dot { color: var(--beam); }
body.dark .topnav .brand .dot { color: #e8973a; }

.topnav .links {
  margin-left: auto;
  display: flex;
  gap: 22px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.topnav .links a {
  position: relative;
  color: var(--ink-3);
  text-decoration: none;
  transition: color 0.15s;
  padding: 4px 0;
}
.topnav .links a:hover { color: var(--ink-2); }
.topnav .links a.active { color: var(--ink); }
.topnav .links a.active::after {
  content: '';
  position: absolute;
  bottom: -8px; left: 0; right: 0;
  height: 1.5px;
  background: var(--beam);
}
body.dark .topnav .links a { color: rgba(232,227,216,0.40); }
body.dark .topnav .links a:hover { color: rgba(232,227,216,0.85); }
body.dark .topnav .links a.active { color: #e8e3d8; }
body.dark .topnav .links a.active::after { background: #e8973a; }

/* ── Page container ───────────────────────────────────────────── */
.page {
  position: relative;
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  padding-top: var(--nav-h);
  min-height: 100vh;
}
.page-inner {
  position: relative;
  flex: 1 0 auto;
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: clamp(28px, 4vh, 56px) var(--gutter) clamp(24px, 4vh, 56px);
  z-index: 1;
  display: flex;
  flex-direction: column;
}

/* ── Type helpers ─────────────────────────────────────────────── */
.mono { font-family: var(--mono); }
.serif { font-family: var(--serif); }
.body-text { font-family: var(--body); }
.upper { text-transform: uppercase; letter-spacing: 0.16em; }
.ink-2 { color: var(--ink-2); }
.ink-3 { color: var(--ink-3); }

.eyebrow {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--beam);
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

/* ── Buttons ──────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  border: 1px solid var(--ink);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: none;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  white-space: nowrap;
}
.btn:hover {
  background: var(--beam);
  border-color: var(--beam);
  color: #fff8ec;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px -4px rgba(217,122,44,0.45);
}
.btn.ghost {
  background: transparent;
  border-color: var(--line-2);
  color: var(--ink);
}
.btn.ghost:hover {
  background: rgba(20,17,12,0.04);
  border-color: var(--ink);
  color: var(--ink);
  box-shadow: none;
}
.btn.beam {
  background: var(--beam);
  color: #fff8ec;
  border-color: var(--beam);
  box-shadow: 0 6px 18px -8px rgba(217,122,44,0.6);
}
.btn.beam:hover {
  background: #c66a1e;
  border-color: #c66a1e;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px -6px rgba(217,122,44,0.7);
}

/* ── Light beams / halos ──────────────────────────────────────── */
.beam-vert {
  position: absolute;
  top: 0; bottom: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(217,122,44,0.18) 0%, rgba(217,122,44,0.05) 40%, transparent 100%);
  filter: blur(0.5px);
}
.beam-diag {
  position: absolute;
  inset: -50%;
  pointer-events: none;
  background: linear-gradient(105deg,
    transparent 30%,
    rgba(240,160,80,0.10) 38%,
    rgba(240,160,80,0.18) 42%,
    rgba(240,160,80,0.08) 46%,
    transparent 54%);
  filter: blur(0.5px);
}
.halo {
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(240,160,80,0.30) 0%, rgba(240,160,80,0.10) 40%, transparent 70%);
  filter: blur(1px);
}

/* ── Pulse dot ────────────────────────────────────────────────── */
.dot-pulse {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--beam);
  position: relative;
  vertical-align: middle;
  flex-shrink: 0;
}
.dot-pulse::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 7px; height: 7px;
  border-radius: 50%;
  border: 1.5px solid var(--beam);
  opacity: 0.6;
  transform: translate(-50%, -50%) scale(1);
  animation: pulse 1.8s ease-out infinite;
}

/* ── Animations ────────────────────────────────────────────── */
@keyframes wordReveal {
  0%   { opacity: 0; transform: translateY(18px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes hdrEye {
  0%   { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes hdrTitle {
  0%   { opacity: 0; transform: translateY(22px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes hdrFade {
  0%   { opacity: 0; }
  100% { opacity: 1; }
}
@keyframes slideInLeft {
  0%   { opacity: 0; transform: translateX(-18px); }
  100% { opacity: 1; transform: translateX(0); }
}
@keyframes slideInRight {
  0%   { opacity: 0; transform: translateX(18px); }
  100% { opacity: 1; transform: translateX(0); }
}
@keyframes scanSweep {
  0%   { transform: translateY(-100%); opacity: 0.6; }
  100% { transform: translateY(200%); opacity: 0; }
}
@keyframes expandLine {
  0%   { width: 0; }
  100% { width: 100%; }
}
@keyframes bpScan {
  0%   { left: -3px; opacity: 0.8; }
  100% { left: 100%; opacity: 0; }
}
@keyframes compassSpin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
@keyframes slideDown {
  0%   { transform: translateY(-110%); }
  100% { transform: translateY(0); }
}
@keyframes stampReveal {
  0%   { opacity: 0; transform: rotate(-20deg) scale(0.85); }
  100% { opacity: 0.85; transform: rotate(-6deg) scale(1); }
}
@keyframes slideUp {
  0%   { opacity: 0; transform: translateY(16px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%   { transform: translate(-50%, -50%) scale(0.8); opacity: 0.7; }
  100% { transform: translate(-50%, -50%) scale(2.6); opacity: 0; }
}
@keyframes twinkle {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}
@keyframes marquee {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.word-reveal { display: inline-block; opacity: 0; animation: wordReveal 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
.hdr-eye { opacity: 0; animation: hdrEye 0.45s cubic-bezier(0.22,1,0.36,1) 0.05s forwards; }
.hdr-title { opacity: 0; animation: hdrTitle 0.6s cubic-bezier(0.22,1,0.36,1) 0.2s forwards; }
.hdr-fade { opacity: 0; animation: hdrFade 0.5s ease 0.4s forwards; }
.slide-left { opacity: 0; animation: slideInLeft 0.5s cubic-bezier(0.22,1,0.36,1) forwards; }
.slide-right { opacity: 0; animation: slideInRight 0.5s cubic-bezier(0.22,1,0.36,1) forwards; }

/* ── Footer ribbon ───────────────────────────────────────────── */
.site-footer {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 16px var(--gutter) 18px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--ink-3);
  letter-spacing: 0.10em;
  text-transform: uppercase;
  gap: 16px;
  flex-wrap: wrap;
  background: transparent;
}
body.dark .site-footer {
  border-top: 1px solid rgba(232,227,216,0.08);
  color: rgba(232,227,216,0.30);
}
.site-footer .socials {
  display: flex;
  align-items: center;
  gap: 16px;
}
.site-footer a {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  /* Generous hit area so social-icon-only links are easy to click */
  padding: 8px 6px;
  margin: -8px 0;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  /* Make sure clicks always reach the <a>, never get captured by an SVG inside */
  position: relative;
  z-index: 1;
}
.site-footer a:hover { color: var(--ink); background: rgba(20,17,12,0.05); }
body.dark .site-footer a:hover { color: #e8e3d8; background: rgba(255,255,255,0.05); }
.site-footer a, .site-footer a * { pointer-events: auto; }
.site-footer svg { display: block; pointer-events: none; }

/* ── Background art ──────────────────────────────────────────── */
.bg-art {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

/* ── Mobile ──────────────────────────────────────────────────── */
@media (max-width: 720px) {
  :root { --gutter: 20px; }
  .topnav .links { gap: 14px; font-size: 10px; }
  .topnav .brand { font-size: 16px; }
  .site-footer { font-size: 9px; }
  .site-footer .socials { gap: 12px; }
}

@media (max-width: 520px) {
  .topnav .links a:not(.active) { display: none; }
  .topnav .links a.active { color: var(--ink); }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
