/* =========================================================
   QUANT — retro pixel terminal meme site
   ========================================================= */

:root {
  --bg: #0d0b08;
  --panel: #15120d;
  --panel-2: #1c1810;
  --well: #0a0806;
  --line: #2e281e;
  --line-2: #40372a;

  --cream: #f3e6c8;
  --gold: #e8b04a;
  --gold-soft: #b8955a;   /* muted gold for list titles */
  --muted: #8a7d64;
  --red: #d42a2a;

  --f-px: 'Silkscreen', ui-monospace, monospace;
  --f-term: 'VT323', ui-monospace, 'Courier New', monospace;

  --nav-h: 56px;
  --r: 4px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--bg);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--cream);
  font-family: var(--f-term);
  font-size: 19px;
  line-height: 1.22;
  letter-spacing: .05em;
  overflow-x: hidden;
}

html.is-loading body { overflow: hidden; }

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, p { margin: 0; }
::selection { background: var(--gold); color: var(--bg); }

/* Custom gold pixel crosshair — desktop only */
@media (hover: hover) and (pointer: fine) {
  html, html * {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' shape-rendering='crispEdges'%3E%3Cg fill='%230d0b08'%3E%3Crect x='8' y='0' width='4' height='8'/%3E%3Crect x='8' y='12' width='4' height='8'/%3E%3Crect x='0' y='8' width='8' height='4'/%3E%3Crect x='12' y='8' width='8' height='4'/%3E%3C/g%3E%3Cg fill='%23e8b04a'%3E%3Crect x='9' y='1' width='2' height='6'/%3E%3Crect x='9' y='13' width='2' height='6'/%3E%3Crect x='1' y='9' width='6' height='2'/%3E%3Crect x='13' y='9' width='6' height='2'/%3E%3Crect x='9' y='9' width='2' height='2'/%3E%3C/g%3E%3C/svg%3E") 10 10, crosshair;
  }
}

/* =========================================================
   Background: drifting math + vignette
   ========================================================= */
.mathbg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.mathbg span {
  position: absolute;
  font-family: Georgia, 'Times New Roman', serif;
  font-style: italic;
  line-height: 1;
  color: #f0c46e;
  text-shadow: 0 0 14px rgba(232, 176, 74, .7);
  opacity: 0;
  will-change: transform, opacity;
  animation: drift 24s linear infinite;
}
@keyframes drift {
  0%   { opacity: 0; transform: translate3d(0, 0, 0); }
  22%  { opacity: var(--o, .08); }
  72%  { opacity: var(--o, .08); }
  100% { opacity: 0; transform: translate3d(var(--dx, 0), -36vh, 0); }
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(110% 70% at 50% -10%, rgba(232, 176, 74, .07), transparent 60%),
    radial-gradient(ellipse at center, transparent 48%, rgba(0, 0, 0, .62) 100%);
}

/* =========================================================
   Loader
   ========================================================= */
.loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
}
.loader.shake { animation: shake .34s steps(1) .2s; }
@keyframes shake {
  0%   { transform: translate(0, 0); }
  15%  { transform: translate(-5px, 3px); }
  30%  { transform: translate(4px, -4px); }
  45%  { transform: translate(-3px, -2px); }
  60%  { transform: translate(3px, 3px); }
  75%  { transform: translate(-2px, 1px); }
  90%  { transform: translate(1px, -1px); }
  100% { transform: translate(0, 0); }
}
.loader.fade-out { opacity: 0; transition: opacity .5s ease; pointer-events: none; }

.loader-panel {
  position: relative;
  width: min(300px, 86vw);
  padding: 22px 18px 16px;
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  box-shadow:
    inset 0 0 0 1px rgba(243, 230, 200, .02),
    inset 0 0 40px rgba(232, 176, 74, .05),
    0 24px 70px rgba(0, 0, 0, .65);
  text-align: center;
  overflow: hidden;
}

.eqs { position: absolute; inset: 0; pointer-events: none; }
.eq {
  position: absolute;
  font-family: var(--f-term);
  font-size: 15px;
  letter-spacing: .04em;
  white-space: nowrap;
  color: var(--gold);
  opacity: .2;
  text-shadow: 0 0 6px rgba(232, 176, 74, .55);
}
.eq1 { top: 12px;  left: 12px; }
.eq2 { top: 40px;  right: 12px; }
.eq3 { top: 74px;  left: 14px; }
.eq4 { top: 104px; right: 14px; }

.loader-cat {
  position: relative;
  z-index: 1;
  width: 110px;
  height: 110px;
  margin: 0 auto 12px;
  animation: bob 2.2s ease-in-out infinite;
}
.loader-cat img {
  width: 110px;
  height: 110px;
  transform-origin: 70% 90%;
  animation: swing 1.7s ease-in-out infinite;
  filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .55));
}
@keyframes bob   { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes swing { 0%, 100% { transform: rotate(-2.5deg); } 50% { transform: rotate(2.5deg); } }

.loader-title {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 14px;
  font-family: var(--f-px);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: .14em;
  color: var(--cream);
}
.cursor-block {
  display: inline-block;
  width: .55em;
  height: 1em;
  background: var(--gold);
  box-shadow: 0 0 8px rgba(232, 176, 74, .6);
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.pbar {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  gap: 2px;
  padding: 3px;
  background: var(--well);
  border: 1px solid var(--line-2);
}
.pb { aspect-ratio: 1; background: #221d15; }
.pb.on { background: var(--c, var(--gold)); box-shadow: 0 0 4px rgba(232, 176, 74, .35); }
.pb.flick { animation: flick .16s steps(1) infinite; animation-delay: var(--d, 0s); }
@keyframes flick { 50% { opacity: .5; } }

.loader-meta {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 9px;
  font-family: var(--f-px);
  font-size: 9.5px;
  letter-spacing: .08em;
  color: var(--muted);
}
#lpct { color: var(--cream); font-variant-numeric: tabular-nums; }

.qed {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 44%;
  padding: 6px 12px 5px;
  font-family: var(--f-px);
  font-weight: 700;
  font-size: 30px;
  letter-spacing: .06em;
  color: var(--gold);
  background: rgba(21, 18, 13, .88);
  border: 2px solid var(--gold);
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  text-shadow: 0 0 12px rgba(232, 176, 74, .7);
  box-shadow: 0 0 30px rgba(232, 176, 74, .25);
  opacity: 0;
  transform: translate(-50%, -50%) rotate(-12deg) scale(2);
  pointer-events: none;
}
.qed.slam { animation: slam .3s cubic-bezier(.55, 0, 1, .45) forwards; }
.qed.stamped { opacity: 1; transform: translate(-50%, -50%) rotate(-12deg) scale(1); }
@keyframes slam {
  0%   { opacity: 0; transform: translate(-50%, -50%) rotate(-12deg) scale(2); }
  65%  { opacity: 1; transform: translate(-50%, -50%) rotate(-12deg) scale(.93); }
  100% { opacity: 1; transform: translate(-50%, -50%) rotate(-12deg) scale(1); }
}

.loader-skip {
  position: absolute;
  left: 0;
  right: 0;
  bottom: max(22px, env(safe-area-inset-bottom));
  text-align: center;
  font-family: var(--f-px);
  font-size: 9px;
  letter-spacing: .22em;
  color: var(--muted);
  opacity: .55;
  transition: opacity .2s;
}

/* split transition */
.loader-clone {
  position: fixed;
  margin: 0;
  transition: transform .75s cubic-bezier(.75, 0, .25, 1);
  will-change: transform;
}
.loader-clone * { animation: none !important; }
.loader-clone.top { clip-path: inset(0 0 50% 0); }
.loader-clone.bot { clip-path: inset(50% 0 0 0); }
.loader.splitting .loader-clone.top { transform: translate3d(0, var(--up), 0); }
.loader.splitting .loader-clone.bot { transform: translate3d(0, var(--down), 0); }
.loader.splitting .loader-skip { opacity: 0; }

.seam {
  position: fixed;
  height: 2px;
  background: var(--gold);
  box-shadow: 0 0 12px 2px rgba(232, 176, 74, .7);
  transform: scaleX(0);
  animation: seam .7s ease-out forwards;
}
@keyframes seam {
  0%   { transform: scaleX(0); opacity: 1; }
  35%  { transform: scaleX(1); opacity: 1; }
  100% { transform: scaleX(1); opacity: 0; }
}

/* =========================================================
   Site wrapper + reveal
   ========================================================= */
#site { position: relative; z-index: 2; }
.js #site:not(.revealed) { opacity: 0; transform: scale(1.03); }
#site.revealed {
  opacity: 1;
  transform: scale(1);
  transform-origin: 50% 30vh;
  transition: opacity .9s ease, transform 1.1s var(--ease);
}
#site.settled { transform: none; transition: none; }

.js .reveal {
  opacity: 0;
  transform: translate3d(0, 18px, 0);
  transition: opacity .7s ease, transform .7s var(--ease);
  transition-delay: calc(var(--i, 0) * 90ms);
}
.js .reveal.in { opacity: 1; transform: none; }

/* =========================================================
   Nav
   ========================================================= */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(20px, env(safe-area-inset-left));
  background: rgba(13, 11, 8, .9);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}

.logo {
  font-family: var(--f-px);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: .04em;
  text-shadow: 0 0 10px rgba(232, 176, 74, .35);
}
.logo .c { color: var(--cream); }
.logo .g { color: var(--gold); }

.nav-links { display: flex; align-items: center; }
.nav-links a {
  position: relative;
  padding: 8px 0;
  font-family: var(--f-px);
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--muted);
  transition: color .2s;
}
.nav-links a + a::before {
  content: '·';
  display: inline-block;
  margin: 0 12px;
  color: var(--line-2);
}
.nav-links a:hover { color: var(--cream); }
.nav-links a.active { color: var(--cream); text-shadow: 0 0 8px rgba(243, 230, 200, .35); }

.menu-btn {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  font-family: var(--f-px);
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--cream);
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  box-shadow: 2px 2px 0 #000;
}
.menu-btn:active { transform: translate(2px, 2px); box-shadow: none; }

/* =========================================================
   Layout + panels
   ========================================================= */
main {
  position: relative;
  padding: 22px 16px 10px;
}

.panel {
  position: relative;
  max-width: 720px;
  margin: 0 auto 22px;
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow:
    inset 0 0 0 1px rgba(243, 230, 200, .02),
    inset 0 0 40px rgba(232, 176, 74, .035),
    0 14px 40px rgba(0, 0, 0, .45);
}
section[id] { scroll-margin-top: calc(var(--nav-h) + 16px); }

.panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  font-family: var(--f-px);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: .08em;
  color: var(--cream);
}
.panel-title::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--gold);
  box-shadow: 0 0 8px rgba(232, 176, 74, .7);
}

/* =========================================================
   Buttons
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 10px 14px;
  font-family: var(--f-px);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .08em;
  line-height: 1;
  white-space: nowrap;
  color: var(--cream);
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  border-radius: 2px;
  box-shadow: 2px 2px 0 #000;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform .06s, box-shadow .06s, border-color .15s, color .15s;
}
.btn.secondary { color: var(--muted); }
.btn:hover { border-color: var(--red); }
.btn.secondary:hover { color: var(--cream); }
.btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 #000; }
.btn:focus-visible,
.arrow:focus-visible,
.dot:focus-visible,
.meme:focus-visible,
.nav-links a:focus-visible,
.logo:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* =========================================================
   Hero
   ========================================================= */
.hero {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  aspect-ratio: 6 / 5;
  min-height: 540px;
  border-color: var(--line-2);
}
.hero-bg {
  position: absolute;
  inset: -16px;
  background: url("assets/hero.png") center 42% / cover no-repeat;
  background-image: image-set(url("assets/hero.webp") type("image/webp"), url("assets/hero.png") type("image/png"));
  will-change: transform;
}
.hero-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(13, 11, 8, .72) 0%,
    rgba(13, 11, 8, .15) 22%,
    rgba(13, 11, 8, 0) 44%,
    rgba(13, 11, 8, .72) 74%,
    rgba(13, 11, 8, .96) 100%);
}
.hero-content {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  padding: 26px 20px 20px;
}

.hero-title {
  text-align: center;
  font-family: var(--f-px);
  font-weight: 700;
  font-size: clamp(48px, 12.5vw, 96px);
  line-height: 1;
  letter-spacing: .04em;
  color: transparent;
  background: linear-gradient(180deg,
    #fffaea 0%, #fffaea 16%,
    #f6dca2 16%, #f6dca2 34%,
    #e8b04a 34%, #e8b04a 54%,
    #b57724 54%, #b57724 70%,
    #f5e2b1 70%, #f5e2b1 78%,
    #8a5a1c 78%, #8a5a1c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  filter:
    drop-shadow(2px 0 0 #120d06)
    drop-shadow(-2px 0 0 #120d06)
    drop-shadow(0 2px 0 #120d06)
    drop-shadow(0 -2px 0 #120d06)
    drop-shadow(0 5px 0 rgba(0, 0, 0, .6))
    drop-shadow(0 0 22px rgba(232, 176, 74, .35));
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 14px;
}
.hero .btn { background: rgba(21, 18, 13, .86); }

/* CA box */
.ca {
  display: flex;
  align-items: stretch;
  gap: 8px;
}
.ca-field {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 12px;
  background: var(--well);
  border: 1px solid var(--line-2);
  border-radius: 2px;
  box-shadow: inset 0 2px 0 rgba(0, 0, 0, .6), inset 0 0 18px rgba(232, 176, 74, .04);
}
.ca-label {
  flex: none;
  padding: 3px 5px 2px;
  font-family: var(--f-px);
  font-weight: 700;
  font-size: 10px;
  color: var(--bg);
  background: var(--gold);
}
.ca-value {
  min-width: 0;
  overflow-x: auto;
  white-space: nowrap;
  font-family: var(--f-term);
  font-size: 19px;
  color: var(--cream);
  user-select: all;
  scrollbar-width: none;
}
.ca-value::-webkit-scrollbar { display: none; }

.copy-wrap { position: relative; flex: none; display: flex; }
.copy-btn { width: 122px; }
.copy-btn.copied { color: var(--gold); border-color: var(--gold); }

.plus-one {
  position: absolute;
  left: 50%;
  top: -2px;
  font-family: var(--f-px);
  font-weight: 700;
  font-size: 15px;
  color: var(--gold);
  text-shadow: 0 0 8px rgba(232, 176, 74, .8);
  pointer-events: none;
  animation: plus .9s ease-out forwards;
}
@keyframes plus {
  0%   { opacity: 0; transform: translate(-50%, 0); }
  15%  { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -36px); }
}

/* =========================================================
   Marquee
   ========================================================= */
.marquee { padding: 12px 0; overflow: hidden; }
.marquee-viewport {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 32s linear infinite;
  will-change: transform;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-group {
  flex: none;
  display: flex;
  align-items: center;
  gap: 22px;
  padding-right: 22px;
}
.m-word {
  font-family: var(--f-px);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .08em;
}
.m-c { color: var(--cream); }
.m-m { color: var(--muted); }
.m-sig { color: var(--gold); font-family: Georgia, serif; font-size: 15px; opacity: .85; }
@keyframes marquee { to { transform: translate3d(-50%, 0, 0); } }

/* =========================================================
   Lore + lists
   ========================================================= */
.lore-card {
  position: relative;
  width: min(260px, 72%);
  aspect-ratio: 1;
  margin: 2px auto 28px;
  overflow: hidden;
  border-radius: var(--r);
  background: radial-gradient(circle at 50% 32%, #f3f1ec 0%, #dedbd4 45%, #bdb9b0 100%);
  box-shadow: 0 22px 36px rgba(0, 0, 0, .55), 0 0 0 1px rgba(0, 0, 0, .5);
  animation: floaty 5s ease-in-out infinite;
}
.lore-card picture {
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: 0;
  display: block;
}
.lore-card img { width: 100%; height: auto; }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

.lore-text {
  display: grid;
  gap: 16px;
  max-width: 62ch;
  margin: 0 auto;
}
.lore-text p {
  font-size: 20px;
  line-height: 1.3;
  color: var(--cream);
  opacity: .92;
  text-wrap: pretty;
}
.lore-text .lore-kicker {
  margin-top: 6px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-family: var(--f-px);
  font-weight: 700;
  font-size: 14px;
  line-height: 1.6;
  letter-spacing: .06em;
  color: var(--gold);
  opacity: 1;
  text-shadow: 0 0 10px rgba(232, 176, 74, .35);
  text-wrap: balance;
}

/* =========================================================
   Memes carousel
   ========================================================= */
.carousel {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 40px;
  align-items: center;
  gap: 12px;
}
.arrow {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: var(--cream);
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  border-radius: 2px;
  box-shadow: 2px 2px 0 #000;
  transition: transform .06s, box-shadow .06s, border-color .15s;
}
.arrow:hover { border-color: var(--red); }
.arrow:active { transform: translate(2px, 2px); box-shadow: none; }

.viewport { overflow: hidden; touch-action: pan-y; }
.track {
  display: flex;
  gap: 12px;
  transition: transform .45s var(--ease);
  will-change: transform;
}
.track.dragging { transition: none; }
.slide { flex: 0 0 calc((100% - 24px) / 3); min-width: 0; }

.meme {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--well);
  border: 1px solid var(--line-2);
  border-radius: 2px;
  transition: border-color .2s;
}
/* blurred copy of the meme fills the tile behind the full, uncropped image */
.meme::before {
  content: '';
  position: absolute;
  inset: -12%;
  background: var(--bg) center / cover no-repeat;
  filter: blur(14px) brightness(.45) saturate(1.1);
}
.meme img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: contain;
  -webkit-user-drag: none;
  user-select: none;
  transition: transform .4s var(--ease);
}
.meme:hover { border-color: var(--gold); }
.meme:hover img { transform: scale(1.04); }

.meme-soon {
  aspect-ratio: 1;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 6px;
  font-family: var(--f-px);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .1em;
  line-height: 1.3;
  color: var(--muted);
  border: 1px dashed var(--line-2);
  border-radius: 2px;
  background:
    repeating-linear-gradient(45deg, rgba(232, 176, 74, .035) 0 6px, transparent 6px 12px),
    #0f0c08;
  user-select: none;
}
.meme-soon i {
  font-style: italic;
  font-family: Georgia, serif;
  font-size: 30px;
  font-weight: 400;
  color: var(--gold);
  opacity: .7;
}

.dots {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 14px;
}
.dot {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
}
.dot::before {
  content: '';
  width: 9px;
  height: 9px;
  border: 1px solid var(--muted);
  transition: background .2s, border-color .2s;
}
.dot.active::before { background: var(--gold); border-color: var(--gold); box-shadow: 0 0 6px rgba(232, 176, 74, .6); }

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(8, 6, 4, .93);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.lightbox.open { opacity: 1; pointer-events: auto; }
.lightbox img {
  max-width: min(92vw, 900px);
  max-height: 84vh;
  border: 1px solid var(--line-2);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .7);
  transform: scale(.96);
  transition: transform .25s var(--ease);
}
.lightbox.open img { transform: none; }
.lb-close { position: absolute; top: 16px; right: 16px; width: 42px; padding: 0; font-family: var(--f-term); font-size: 22px; }

/* =========================================================
   Footer
   ========================================================= */
.footer {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
  padding: 18px 20px 40px;
  text-align: center;
  font-size: 17px;
  color: var(--muted);
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 20px;
}
.footer-links a {
  font-family: var(--f-px);
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--muted);
  transition: color .15s;
}
.footer-links a:hover { color: var(--red); }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 720px) {
  .menu-btn { display: inline-flex; }
  .nav { padding: 0 14px; }
  .logo { font-size: 19px; }

  .nav-links {
    position: absolute;
    top: calc(var(--nav-h) - 1px);
    right: 12px;
    flex-direction: column;
    align-items: stretch;
    min-width: 170px;
    padding: 6px;
    background: var(--panel);
    border: 1px solid var(--line-2);
    box-shadow: 4px 4px 0 #000;
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity .18s, transform .18s;
  }
  .nav-links.open { opacity: 1; transform: none; pointer-events: auto; }
  .nav-links a { padding: 12px 12px; font-size: 13px; }
  .nav-links a + a::before { display: none; }
  .nav-links a + a { border-top: 1px solid var(--line); }
}

@media (max-width: 640px) {
  body { font-size: 18px; }
  main { padding: 14px 10px 6px; }
  .panel { padding: 18px 16px; margin-bottom: 16px; }
  .panel-title { font-size: 19px; margin-bottom: 16px; }

  .hero { aspect-ratio: auto; min-height: min(620px, calc(100svh - var(--nav-h) - 28px)); }
  .hero-content { padding: 22px 14px 16px; }
  .btn-row { gap: 8px; }
  .hero .btn { padding: 10px 11px; font-size: 11px; }
  .copy-btn { width: 104px; font-size: 11px; }
  .ca-field { padding: 0 10px; gap: 8px; }
  .ca-value { font-size: 17px; }

  .carousel { grid-template-columns: 34px minmax(0, 1fr) 34px; gap: 8px; }
  .arrow { width: 34px; height: 34px; }
  .slide { flex-basis: 100%; }

  .lore-text p { font-size: 19px; }
  .lore-text .lore-kicker { font-size: 13px; }
}

/* =========================================================
   Reduced motion
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .mathbg span { animation: none; opacity: var(--o, .08); }
  .loader-cat, .loader-cat img, .lore-card, .marquee-track, .cursor-block, .pb.flick { animation: none; }
  .js #site:not(.revealed), #site.revealed { transform: none; }
  #site.revealed { transition: opacity .6s ease; }
  .js .reveal { transform: none; transition: opacity .5s ease; }
  .track { transition: none; }
}
