/* ============================================================
   THE LISTS — a pixel-medieval landing page
   Marton Vincze · hand-written CSS, no framework
   ============================================================ */

:root {
  /* palette — kept in sync with js/joust.js */
  --night:      #17110c;
  --night-2:    #221a12;
  --wood:       #6b4a2a;
  --wood-dark:  #3a2716;
  --wood-light: #8f6538;
  --parch:      #ead6ac;
  --parch-2:    #d9c08c;
  --ink:        #2a1d10;
  --ink-soft:   #4a3620;
  --gold:       #e8b84b;
  --gold-dark:  #a67c22;
  --crimson:    #b4342f;
  --azure:      #4a6fd4;
  --grass:      #3f6b3a;

  --lane: 240px;              /* overwritten by JS to match the canvas */
  --px: 4px;                  /* nominal pixel unit */

  --font-display: 'Press Start 2P', 'Courier New', monospace;
  --font-body: 'VT323', 'Courier New', monospace;
}

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

html {
  scroll-behavior: smooth;
  background: var(--night);
}

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font-body);
  font-size: 21px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--night);
  overflow-x: hidden;
  -webkit-font-smoothing: none;
  text-rendering: geometricPrecision;
}

/* ── the arena canvas ─────────────────────────────────────── */

#lists {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 0;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  pointer-events: none;
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 120% 90% at 50% 50%, transparent 35%, rgba(10,6,3,.55) 100%);
}

/* shake the whole world on impact */
body.is-struck #lists,
body.is-struck .page { animation: worldshake .42s steps(2) 1; }

@keyframes worldshake {
  0%   { transform: translate(0,0); }
  15%  { transform: translate(-6px, 4px); }
  30%  { transform: translate(5px, -5px); }
  45%  { transform: translate(-4px, -3px); }
  60%  { transform: translate(3px, 4px); }
  75%  { transform: translate(-2px, 1px); }
  100% { transform: translate(0,0); }
}

/* ── HUD ──────────────────────────────────────────────────── */

.skip {
  position: fixed;
  left: -9999px;
  top: 0;
  z-index: 60;
  background: var(--gold);
  color: var(--night);
  padding: 10px 16px;
  font-family: var(--font-display);
  font-size: 10px;
}
.skip:focus { left: 12px; top: 12px; }

.hud {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px clamp(12px, 3vw, 28px);
  pointer-events: none;
}
.hud > * { pointer-events: auto; }

.hud__sigil {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  background: var(--crimson);
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 12px;
  box-shadow:
    0 0 0 4px var(--night),
    0 0 0 8px var(--gold-dark);
}
.sigil-mark { transform: translateY(1px); }

.hud__controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

.switch { display: flex; }

.switch__btn {
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: .5px;
  color: var(--parch-2);
  background: var(--night-2);
  border: 0;
  padding: 11px 12px;
  cursor: pointer;
  box-shadow: inset 0 0 0 3px var(--wood-dark);
  transition: color .12s steps(2), background .12s steps(2);
}
.switch__btn + .switch__btn { margin-left: 4px; }
.switch__btn--wide { min-width: 118px; }
.switch__btn:hover { color: var(--gold); background: var(--wood-dark); }
.switch__btn.is-on {
  color: var(--night);
  background: var(--gold);
  box-shadow: inset 0 0 0 3px var(--gold-dark);
}
.switch__btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

/* charge meter */
.meter {
  position: fixed;
  right: clamp(8px, 2vw, 20px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}
.meter__label {
  font-family: var(--font-display);
  font-size: 8px;
  color: var(--gold);
  writing-mode: vertical-rl;
  letter-spacing: 2px;
  text-shadow: 2px 2px 0 var(--night);
}
.meter__track {
  width: 12px;
  height: min(38vh, 300px);
  background: var(--night-2);
  box-shadow: inset 0 0 0 3px var(--wood-dark);
}
.meter__fill {
  width: 100%;
  height: 0%;
  background: repeating-linear-gradient(
    to bottom, var(--gold) 0 6px, var(--gold-dark) 6px 12px);
}

/* impact klaxon */
.klaxon {
  position: fixed;
  left: 50%;
  top: 24%;
  transform: translate(-50%, -50%) scale(.7);
  z-index: 40;
  padding: 18px 26px;
  background: var(--crimson);
  color: var(--parch);
  font-family: var(--font-display);
  font-size: clamp(10px, 2.1vw, 18px);
  text-align: center;
  letter-spacing: 1px;
  opacity: 0;
  pointer-events: none;
  box-shadow:
    0 0 0 4px var(--night),
    0 0 0 9px var(--gold),
    0 0 0 13px var(--night);
}
.klaxon.is-live {
  animation: klaxon 2.6s steps(4) 1 forwards;
}
@keyframes klaxon {
  0%   { opacity: 0; transform: translate(-50%,-50%) scale(.6); }
  12%  { opacity: 1; transform: translate(-50%,-50%) scale(1.08); }
  20%  { transform: translate(-50%,-50%) scale(1); }
  75%  { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%,-60%) scale(1); }
}

/* the victor holds the field — offer the reader a fresh pass */
.verdictbar {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--night-2);
  box-shadow:
    0 0 0 4px var(--night),
    0 0 0 8px var(--gold-dark),
    0 10px 0 8px rgba(0,0,0,.45);
  animation: verdictin .45s steps(4) 1 both;
}
.verdictbar[hidden] { display: none; }
.verdictbar__text {
  margin: 0;
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--gold);
}
.btn--sm { font-size: 9px; padding: 12px 13px; }

@keyframes verdictin {
  from { opacity: 0; transform: translate(-50%, 22px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

@media (max-width: 480px) {
  .verdictbar { flex-direction: column; gap: 10px; bottom: 16px; }
}

/* ── layout ───────────────────────────────────────────────── */

.page { position: relative; z-index: 10; }

.section {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1fr var(--lane) 1fr;
  align-items: center;
  padding: 14vh clamp(16px, 6vw, 110px);
}

.section > .stand { max-width: 480px; width: 100%; }

.section[data-side="left"]  > .stand { grid-column: 1; justify-self: end;   margin-right: clamp(10px, 2vw, 34px); }
.section[data-side="right"] > .stand { grid-column: 3; justify-self: start; margin-left:  clamp(10px, 2vw, 34px); }

.section[data-side="center"] > .stand {
  grid-column: 1 / -1;
  justify-self: center;
  max-width: 760px;
  text-align: center;
}

.section--verdict > .stand--verdict { grid-column: 1; justify-self: end;   margin-right: clamp(10px, 2vw, 34px); }
.section--verdict > .stand--contact { grid-column: 3; justify-self: start; margin-left:  clamp(10px, 2vw, 34px); }

/* ── the stands (parchment panels) ────────────────────────── */

.stand {
  position: relative;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(0,0,0,.035) 0 2px,
      transparent 2px 6px),
    linear-gradient(160deg, var(--parch) 0%, var(--parch-2) 100%);
  padding: clamp(22px, 3vw, 34px);
  color: var(--ink);
  box-shadow:
    0 0 0 5px var(--wood-dark),
    0 0 0 9px var(--wood),
    0 0 0 13px var(--wood-dark),
    12px 14px 0 8px rgba(0,0,0,.45);
}

/* nail heads in the corners */
.stand::before,
.stand::after {
  content: '';
  position: absolute;
  width: 8px; height: 8px;
  background: var(--gold-dark);
  box-shadow: 0 0 0 2px var(--wood-dark);
}
.stand::before { top: 9px;    left: 9px; }
.stand::after  { bottom: 9px; right: 9px; }

.stand--hero {
  background:
    repeating-linear-gradient(to bottom, rgba(0,0,0,.05) 0 2px, transparent 2px 6px),
    linear-gradient(160deg, #2a1e12 0%, #17110c 100%);
  color: var(--parch);
  box-shadow:
    0 0 0 5px var(--gold-dark),
    0 0 0 9px var(--night),
    0 0 0 13px var(--gold-dark),
    12px 14px 0 8px rgba(0,0,0,.55);
}
.stand--hero::before, .stand--hero::after { background: var(--gold); box-shadow: 0 0 0 2px var(--night); }

/* reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .5s steps(6), transform .5s steps(6);
}
.reveal.is-seen { opacity: 1; transform: none; }

/* ── type ─────────────────────────────────────────────────── */

.kicker {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--crimson);
  text-transform: uppercase;
}
.stand--hero .kicker { color: var(--gold); }

.title {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-size: clamp(20px, 5.2vw, 46px);
  line-height: 1.25;
  color: var(--gold);
  letter-spacing: 1px;
  text-shadow:
     4px 4px 0 var(--crimson),
     8px 8px 0 rgba(0,0,0,.6);
}

.h2 {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-size: clamp(13px, 1.7vw, 19px);
  line-height: 1.5;
  color: var(--ink);
  letter-spacing: 1px;
  text-shadow: 3px 3px 0 rgba(180,52,47,.28);
}
.h2--gold { color: var(--gold-dark); text-shadow: 3px 3px 0 rgba(0,0,0,.18); }

.h3 {
  margin: 22px 0 8px;
  font-family: var(--font-display);
  font-size: 11px;
  line-height: 1.6;
  letter-spacing: 1px;
  color: var(--crimson);
}
.quest .h3, .oath .h3 { margin-top: 0; }

.role {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: clamp(9px, 1.2vw, 12px);
  line-height: 1.8;
  letter-spacing: 1px;
  color: var(--parch);
}
.role--dim { color: var(--parch-2); opacity: .72; margin-bottom: 22px; }

.lede { font-size: 1.15em; }

.stand p { margin: 0 0 14px; }
.stand p:last-child { margin-bottom: 0; }

.meta {
  font-family: var(--font-display);
  font-size: 8.5px;
  line-height: 1.9;
  letter-spacing: .5px;
  color: var(--ink-soft);
  margin-bottom: 12px !important;
  opacity: .9;
}

.years {
  font-family: var(--font-display);
  font-size: 9px;
  color: var(--gold-dark);
  margin: 0 0 8px !important;
  letter-spacing: 1px;
}

.scrollhint {
  margin: 30px 0 0 !important;
  font-family: var(--font-display);
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--gold);
}
.chev { display: inline-block; animation: bobbing 1.4s steps(3) infinite; }
@keyframes bobbing { 0%,100% { transform: translateY(0); } 50% { transform: translateY(5px); } }

.victor {
  font-family: var(--font-display);
  font-size: clamp(13px, 2vw, 20px);
  color: var(--crimson);
  letter-spacing: 1px;
  margin: 0 0 16px !important;
  text-shadow: 3px 3px 0 var(--gold);
}

/* ── lists, chips, stats ──────────────────────────────────── */

.chips {
  list-style: none;
  margin: 0 0 4px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.chips li {
  font-family: var(--font-display);
  font-size: 9px;
  line-height: 1.4;
  padding: 8px 9px;
  color: var(--parch);
  background: var(--wood-dark);
  box-shadow: inset 0 0 0 2px var(--wood-light);
}
.chips--sm { margin-top: 12px; }
.chips--sm li { font-size: 8px; padding: 6px 7px; background: var(--ink-soft); }

.stats {
  list-style: none;
  margin: 22px 0 0;
  padding: 0;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.stats li {
  flex: 1 1 92px;
  padding: 12px 10px;
  background: var(--wood-dark);
  color: var(--parch);
  text-align: center;
  box-shadow: inset 0 0 0 3px var(--gold-dark);
}
.stats b {
  display: block;
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--gold);
  margin-bottom: 8px;
}
.stats span { font-size: .92em; line-height: 1.25; display: block; }

.quest { margin-bottom: 30px; }
.quest:last-child { margin-bottom: 0; }
.quest + .quest { padding-top: 26px; border-top: 3px dashed rgba(58,39,22,.35); }

.oath { list-style: none; margin: 0; padding: 0; counter-reset: oath; }
.oath li { position: relative; padding-left: 44px; margin-bottom: 24px; counter-increment: oath; }
.oath li:last-child { margin-bottom: 0; }
.oath li::before {
  content: counter(oath, upper-roman);
  position: absolute;
  left: 0; top: 0;
  width: 30px;
  text-align: center;
  padding: 5px 0;
  font-family: var(--font-display);
  font-size: 10px;
  color: var(--parch);
  background: var(--crimson);
  box-shadow: inset 0 0 0 2px var(--gold);
}

.services { list-style: none; margin: 18px 0; padding: 0; display: grid; gap: 8px; }
.services li {
  padding: 10px 12px 10px 34px;
  position: relative;
  background: rgba(58,39,22,.09);
  box-shadow: inset 0 0 0 2px rgba(58,39,22,.28);
}
.services li::before {
  content: '';
  position: absolute;
  left: 12px; top: 50%;
  width: 10px; height: 10px;
  margin-top: -5px;
  background: var(--crimson);
  box-shadow: 0 0 0 2px var(--gold-dark);
}

/* ── buttons ──────────────────────────────────────────────── */

.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

.btn {
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 1px;
  text-decoration: none;
  padding: 15px 17px;
  color: var(--parch);
  background: var(--wood-dark);
  box-shadow:
    inset 0 0 0 3px var(--wood-light),
    5px 5px 0 0 rgba(0,0,0,.4);
  transition: transform .1s steps(2), box-shadow .1s steps(2);
}
.btn:hover, .btn:focus-visible {
  transform: translate(2px, 2px);
  box-shadow: inset 0 0 0 3px var(--gold), 3px 3px 0 0 rgba(0,0,0,.4);
}
.btn--gold {
  color: var(--night);
  background: var(--gold);
  box-shadow: inset 0 0 0 3px var(--gold-dark), 5px 5px 0 0 rgba(0,0,0,.4);
}
.btn--gold:hover, .btn--gold:focus-visible {
  box-shadow: inset 0 0 0 3px var(--night), 3px 3px 0 0 rgba(0,0,0,.4);
}
.btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }

/* ── footer ───────────────────────────────────────────────── */

.footer {
  position: relative;
  z-index: 10;
  padding: 60px clamp(16px, 6vw, 110px) 70px;
  text-align: center;
  color: var(--parch-2);
  background: linear-gradient(to bottom, transparent, rgba(10,6,3,.9) 45%, var(--night));
}
.footer p { margin: 0 auto 10px; max-width: 620px; }
.footer__small { font-family: var(--font-display); font-size: 9px; color: var(--gold-dark); }

/* ── responsive ───────────────────────────────────────────── */

@media (max-width: 1080px) {
  .section > .stand { max-width: 430px; }
}

@media (max-width: 860px) {
  body { font-size: 20px; }

  /* one column, but every section keeps a full screen to itself so
     the riders stay visible in the gaps between the panels */
  .section {
    grid-template-columns: 1fr;
    padding: 10vh clamp(14px, 5vw, 40px);
    align-content: center;
  }

  /* the two verdict panels are pushed to the edges, leaving a clear
     band across the middle for the knights to actually collide in */
  .section--verdict {
    align-content: space-between;
    row-gap: 14vh;
    padding-block: 7vh;
  }

  .section[data-side="left"]  > .stand,
  .section[data-side="right"] > .stand,
  .section--verdict > .stand--verdict,
  .section--verdict > .stand--contact {
    grid-column: 1;
    justify-self: stretch;
    margin: 0;
    max-width: none;
  }

  .stand {
    /* let the knights show through the gaps between panels */
    background:
      repeating-linear-gradient(to bottom, rgba(0,0,0,.035) 0 2px, transparent 2px 6px),
      linear-gradient(160deg, rgba(234,214,172,.97) 0%, rgba(217,192,140,.97) 100%);
    box-shadow:
      0 0 0 4px var(--wood-dark),
      0 0 0 7px var(--wood),
      0 0 0 10px var(--wood-dark),
      9px 10px 0 6px rgba(0,0,0,.45);
  }

  .meter { display: none; }
  .hud { padding: 10px 12px; }
  .hud__sigil { width: 38px; height: 38px; font-size: 10px; }
}

@media (max-width: 480px) {
  body { font-size: 19px; }
  .switch__btn { font-size: 9px; padding: 9px 9px; }
  .switch__btn--wide { min-width: 104px; }
  .stats li { flex-basis: 100%; }
}

/* ── reduced motion ───────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .chev { animation: none; }
  body.is-struck #lists, body.is-struck .page { animation: none; }
  .klaxon.is-live { animation: none; opacity: 1; transform: translate(-50%,-50%); }
  .verdictbar { animation: none; }
  .btn { transition: none; }
}
