/* ============================================================
   Continual Harness — project page (Pokémon-themed)
   ============================================================ */

:root {
  --paper:   #f5efde;
  --paper-2: #ebe2c8;
  --ink:     #15131c;
  --ink-2:   #2b283a;
  --dim:     #5a5468;
  --rule:    #d8cdb0;
  --red:     #e63946;
  --red-2:   #b71d2b;
  --yellow:  #ffcc1a;
  --mint:    #2dbe9c;
  --blue:    #4f9bff;

  --font-display: 'Pixelify Sans', ui-monospace, 'Courier New', monospace;
  --font-body:    'Manrope', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono:    'VT323', ui-monospace, monospace;

  --max:     88rem;
  --reading: 50rem;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a { color: var(--red); text-decoration: none; transition: color .12s; }
a:hover { color: var(--red-2); }

::selection { background: var(--yellow); color: var(--ink); }

/* tall-grass dot pattern */
body::before {
  content: "";
  position: fixed; inset: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(45,190,156,0.18) 1px, transparent 1.6px);
  background-size: 12px 12px;
  pointer-events: none;
  z-index: 0;
}

.scanlines {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 1;
  background: repeating-linear-gradient(
    to bottom,
    rgba(21,19,28,0.0) 0,
    rgba(21,19,28,0.0) 2px,
    rgba(21,19,28,0.018) 2px,
    rgba(21,19,28,0.018) 3px
  );
  mix-blend-mode: multiply;
}

main, header.bar, .hero, footer.foot { position: relative; z-index: 2; }

/* ============================================================
   TOP BAR
   ============================================================ */
.bar {
  position: sticky; top: 0; z-index: 20;
  background: var(--ink);
  color: var(--paper);
  border-bottom: 4px solid var(--red);
}
.bar-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.85rem 1.6rem;
  display: flex; align-items: center; gap: 1.5rem;
  flex-wrap: wrap;
}

/* logo — mark only, no text (avoids repeating the hero title) */
.logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  border: none;
  padding: 4px;
}
.pball-art {
  display: inline-block;
  width: 26px; height: 26px;
  position: relative;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: linear-gradient(to bottom, var(--red) 0 50%, var(--paper) 50% 100%);
  flex-shrink: 0;
}
.pball-art::before {
  content: "";
  position: absolute;
  left: -2px; right: -2px;
  top: calc(50% - 2px);
  height: 4px;
  background: var(--paper);
}
.pball-art::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 8px; height: 8px;
  background: var(--ink);
  border: 2px solid var(--paper);
  border-radius: 50%;
}

.nav {
  display: flex; gap: 1.4rem;
  margin-left: auto;
  flex-wrap: wrap;
}
.nav a {
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 1.18rem;
  letter-spacing: 0.06em;
  border-bottom: 2px solid transparent;
  padding-bottom: 2px;
  transition: color .12s, border-color .12s;
}
.nav a:hover { color: var(--yellow); border-color: var(--yellow); }

.hp-pill {
  display: flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--paper);
  border: 1px solid rgba(245,239,222,0.25);
  padding: 0.2rem 0.6rem;
}
.hp-bar {
  width: 70px; height: 8px;
  background: rgba(245,239,222,0.18);
  position: relative;
}
.hp-bar i {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 100%;
  background: linear-gradient(to right, var(--mint), var(--yellow));
}
.hp-pill .hp-num { color: var(--yellow); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: 4.5rem 1.6rem 2rem;
  text-align: center;
}
.hero-text { max-width: 64rem; margin: 0 auto; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  letter-spacing: 0.04em;
  color: var(--red);
  margin: 0 0 1rem;
}

.title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3.5rem, 11vw, 8.5rem);
  line-height: 0.92;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.title .line {
  display: block;
  text-shadow: 4px 4px 0 var(--yellow), 8px 8px 0 var(--red);
}
.title .line:nth-child(2) {
  color: var(--red);
  text-shadow: 4px 4px 0 var(--ink);
}

.subtitle {
  margin: 1.4rem auto 0;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  color: var(--ink-2);
  max-width: 36rem;
}
.subtitle em { color: var(--red); font-style: italic; }

.badges {
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}
.badges li {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.4rem 0.9rem;
  background: var(--paper-2);
  border: 2px solid var(--ink);
  font-family: var(--font-mono);
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
}
.badges li em { color: var(--red); font-style: normal; }
.b-dot { display: inline-block; width: 10px; height: 10px; border: 1.5px solid var(--ink); }
.b-blue   { background: var(--blue); }
.b-yellow { background: var(--yellow); }
.b-cyan   { background: var(--mint); }

/* AUTHORS — trainer-card style */
.authors {
  list-style: none;
  margin: 3.2rem auto 0.4rem;
  padding: 1rem 1.2rem;
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
  font-family: var(--font-mono);
  font-size: 1.18rem;
  line-height: 1.45;
  max-width: 36rem;
  position: relative;
  text-align: left;
}
.authors::before {
  content: "TEAM ROSTER · NO.001";
  position: absolute;
  top: 0; left: -2px; right: -2px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  padding: 0.3rem 0.8rem;
  transform: translateY(-100%);
}
.authors li {
  display: flex; align-items: baseline; gap: 0.6rem;
  border-bottom: 1px dashed rgba(21,19,28,0.18);
  padding: 0.2rem 0;
}
.authors li:last-child { border-bottom: none; }
.authors .name { color: var(--ink); font-weight: normal; }
.authors .lvl {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--red);
  background: var(--paper-2);
  padding: 0.05rem 0.4rem;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.authors .role {
  color: var(--red);
  font-style: normal;
  font-size: 0.95rem;
}
.authors .eq { color: var(--red); font-weight: 600; padding-left: 0.05em; }
.authors .aff { color: var(--dim); font-weight: 600; padding-left: 0.1em; font-size: 0.7em; }

.affil {
  margin: 0.9rem 0 2rem;
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--dim);
}
.affil sup { color: var(--red); }

/* CTA buttons */
.links {
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 1.1rem 0.65rem 0.55rem;
  background: var(--paper);
  border: 2px solid var(--ink);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform .08s ease, box-shadow .08s ease, background-color .15s;
}
.btn:hover { background: var(--yellow); color: var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.btn b {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.6rem; height: 1.6rem;
  background: var(--red);
  color: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 50%;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.8rem;
  font-style: normal;
}

/* ============================================================
   MARQUEE
   ============================================================ */
.ticker {
  margin: 3rem auto 0;
  max-width: var(--max);
  background: var(--ink);
  color: var(--yellow);
  border: 2px solid var(--ink);
  overflow: hidden;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1rem;
  letter-spacing: 0.18em;
  position: relative;
  z-index: 2;
}
.ticker-track {
  display: inline-flex;
  gap: 2.4rem;
  white-space: nowrap;
  padding: 0.85rem 0;
  animation: ticker 36s linear infinite;
  will-change: transform;
}
.ticker-track span:nth-child(2n) { color: var(--red); }
@keyframes ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ============================================================
   SECTIONS
   ============================================================ */
section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 4rem 1.6rem;
  position: relative;
  text-align: center;
  opacity: 0; transform: translateY(8px);
  transition: opacity .7s ease, transform .7s ease;
}
section.in { opacity: 1; transform: none; }
.hero { opacity: 1; transform: none; }

.rail {
  display: flex; gap: 1.2rem; align-items: baseline;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 1.18rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 1.4rem;
}
.section-h {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  letter-spacing: -0.01em;
  line-height: 1.05;
  margin: 0 auto 0.8rem;
  color: var(--ink);
  max-width: 56rem;
}
.section-h em { color: var(--red); font-style: italic; }

.lede {
  max-width: var(--reading);
  font-size: 1.05rem;
  color: var(--dim);
  margin: 0 auto 2rem;
}
.lede code {
  background: var(--paper-2);
  border: 1px solid var(--ink);
  padding: 0 0.35rem;
  font-family: var(--font-mono);
  font-size: 1rem;
}

/* ============================================================
   ABSTRACT
   ============================================================ */
.abstract-body {
  max-width: var(--reading);
  margin: 0 auto;
  border: 3px solid var(--ink);
  background: var(--paper);
  box-shadow: 8px 8px 0 var(--ink);
  padding: 1.6rem 1.8rem;
  position: relative;
  font-family: var(--font-body);
  font-size: 1.06rem;
  line-height: 1.7;
  text-align: left;
}
.abstract-body p { margin: 0 0 1rem; }
.abstract-body p:last-child { margin-bottom: 0; }
.abstract-body::after {
  content: "▼";
  position: absolute;
  bottom: 0.6rem; right: 1rem;
  font-family: var(--font-display);
  color: var(--red);
  font-size: 1rem;
  animation: blink 1.2s steps(2, end) infinite;
}
.abstract-body strong {
  font-weight: 700; color: var(--ink);
  background: linear-gradient(transparent 60%, rgba(255,204,26,0.55) 60%);
  padding: 0 0.1em;
}
.abstract-body em { color: var(--red); font-style: italic; font-weight: 600; }

@keyframes blink { 50% { opacity: 0; } }

/* ============================================================
   VIDEOS
   ============================================================ */
.video-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.8rem;
  max-width: 76rem;
  margin: 0 auto;
}
.video-grid .vc:first-child { grid-column: 1 / -1; }
@media (max-width: 760px) {
  .video-grid { grid-template-columns: 1fr; }
  .video-grid .vc:first-child { grid-column: auto; }
}

.vc {
  margin: 0;
  background: var(--paper);
  border: 3px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
  padding: 0.9rem 0.9rem 1rem;
  opacity: 0; transform: translateY(8px);
  transition: opacity .55s ease, transform .55s ease, box-shadow .15s ease;
  transition-delay: var(--d, 0ms);
}
.vc:nth-child(1) { --d: 0ms; }
.vc:nth-child(2) { --d: 80ms; }
.vc:nth-child(3) { --d: 160ms; }
.vc:nth-child(4) { --d: 240ms; }
.vc:nth-child(5) { --d: 320ms; }
.vc.in { opacity: 1; transform: none; }
.vc:hover {
  box-shadow: 8px 8px 0 var(--accent, var(--ink));
  transform: translate(-2px, -2px);
}

.vc-frame {
  position: relative;
  background: var(--ink);
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 2px solid var(--ink);
}
.vc-frame::before {
  content: "video pending";
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: rgba(245,239,222,0.5);
  font-family: var(--font-mono);
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  pointer-events: none;
  z-index: 0;
}
.vc-frame video {
  position: relative;
  z-index: 1;
  width: 100%; height: 100%;
  display: block;
  object-fit: cover;
  background: #000;
}
.vc-num {
  position: absolute; top: 0.6rem; left: 0.6rem;
  z-index: 2;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  color: var(--paper);
  background: var(--accent, var(--red));
  padding: 0.2rem 0.55rem;
  border: 2px solid var(--ink);
  pointer-events: none;
}
.vc figcaption { padding: 0.85rem 0.2rem 0.1rem; text-align: left; }
.vc figcaption h3 {
  margin: 0 0 0.2rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--ink);
}
.vc figcaption p {
  margin: 0;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--dim);
}

/* ============================================================
   STREAM (GBA chrome)
   ============================================================ */
.gba {
  background: var(--red);
  border: 3px solid var(--ink);
  box-shadow: 10px 10px 0 var(--ink);
  padding: 1.4rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.2rem;
  position: relative;
  max-width: 64rem;
  margin: 0 auto;
}
.gba::before, .gba::after {
  content: ""; position: absolute;
  width: 14px; height: 14px;
  background: var(--ink);
  border-radius: 50%;
}
.gba::before { top: 0.6rem; left: 0.7rem; }
.gba::after  { top: 0.6rem; right: 0.7rem; }

.gba-screen {
  background: #000;
  aspect-ratio: 16 / 9;
  border: 3px solid var(--ink);
  position: relative;
  overflow: hidden;
}
.gba-screen iframe {
  width: 100%; height: 100%; border: 0; display: block;
}

.gba-controls {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1.4rem;
  align-items: center;
  padding: 0.4rem 0.4rem;
  color: var(--ink);
}

.dpad { position: relative; width: 70px; height: 70px; }
.dpad span { position: absolute; background: var(--ink); }
.dpad .up    { top: 0; left: 28%; width: 44%; height: 36%; }
.dpad .down  { bottom: 0; left: 28%; width: 44%; height: 36%; }
.dpad .left  { left: 0; top: 28%; width: 36%; height: 44%; }
.dpad .right { right: 0; top: 28%; width: 36%; height: 44%; }
.dpad .ctr   { top: 28%; left: 28%; width: 44%; height: 44%; background: var(--ink-2); }

.startsel {
  display: flex; gap: 0.5rem; justify-content: center;
  font-family: var(--font-display);
  font-weight: 600; font-size: 0.78rem; letter-spacing: 0.12em;
  color: var(--paper);
}
.startsel span { background: var(--ink); padding: 0.3rem 0.7rem; border-radius: 12px; }

.abxy { display: flex; gap: 0.6rem; }
.ab {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 700; font-size: 0.95rem;
}
.ab.a { transform: translateY(-4px); }
.ab.b { transform: translateY(4px); }

.caption {
  margin: 1.4rem auto 0;
  max-width: 60rem;
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--dim);
}
.caption code {
  background: var(--paper-2);
  padding: 0.1rem 0.4rem;
  border: 1px solid var(--ink);
  font-size: 0.95rem;
}

/* ============================================================
   BIBTEX
   ============================================================ */
.bib-block {
  position: relative;
  background: var(--ink);
  color: var(--yellow);
  border: 3px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
  font-family: var(--font-mono);
  font-size: 1.05rem;
  line-height: 1.55;
  max-width: 64rem;
  margin: 0 auto;
  text-align: left;
}
.bib-block pre {
  margin: 0;
  padding: 1.6rem 1.2rem 1.2rem;
  overflow-x: auto;
  white-space: pre;
}
.bib-block code { font-family: inherit; }

.copy {
  position: absolute;
  top: 0.7rem; right: 0.7rem;
  cursor: pointer;
  background: var(--red);
  color: var(--paper);
  border: 2px solid var(--ink);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  padding: 0.35rem 0.7rem;
  text-transform: uppercase;
  box-shadow: 3px 3px 0 var(--paper-2);
  transition: background-color .15s, color .15s;
}
.copy:hover { background: var(--yellow); color: var(--ink); }
.copy.copied { background: var(--mint); color: var(--ink); }

/* ============================================================
   FOOTER
   ============================================================ */
.foot {
  text-align: center;
  margin-top: 4rem;
  padding: 2.4rem 1.6rem 4rem;
  font-family: var(--font-mono);
  font-size: 1.05rem;
  color: var(--dim);
}
.end-line {
  font-family: var(--font-display);
  color: var(--red);
  font-size: 1.4rem;
  margin: 0 0 0.6rem;
  animation: blink 1.2s steps(2,end) infinite;
}
.foot-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.foot-inner p { margin: 0; }
