/* ============================================================================
   Styles for the Laplace site. Everything is here, one file.
   All the colours are the variables below, so change them there, not inline.
   ========================================================================== */

:root {
  --bg:        #eaeef3;   /* page */
  --bg-1:      #ffffff;   /* panels */
  --bg-2:      #f4f7fa;   /* subtle fill */
  --bg-3:      #e2e8f0;   /* raised strip */
  --line:      #d9e0e8;
  --line-2:    #bcc7d4;
  --ink:       #0f1922;   /* headings */
  --fg:        #333f4b;   /* body */
  --fg-2:      #5d6b7a;   /* muted */
  --fg-3:      #85919f;   /* labels */
  --accent:    #1a6cae;
  --accent-2:  #3d8fd1;
  --accent-3:  #e0eef9;
  --warm:      #9a6410;
  --good:      #2e8b41;
  --bad:       #b83a2f;

  --sky:       #dbeaf7;
  --grass:     #e4ece1;
  --horizon:   #c2d2c9;

  --sans: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --wrap: 1180px;
  --gut: 32px;
  --r: 3px;
  --shadow: 0 1px 2px rgba(15, 25, 34, .05);

  --ease: cubic-bezier(.22, .61, .36, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: #12558a; }

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

/* -------------------------------------------------------------- primitives */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gut);
}

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--accent-2);
  flex: none;
}

h1, h2, h3, h4 {
  font-family: var(--sans);
  font-weight: 600;
  letter-spacing: -.022em;
  line-height: 1.14;
  margin: 0 0 .5em;
  color: var(--ink);
}

h2 { font-size: clamp(27px, 3.3vw, 38px); }
h3 { font-size: 19px; letter-spacing: -.012em; line-height: 1.32; }

p { margin: 0 0 1.1em; }
p.lede {
  font-size: clamp(16.5px, 1.4vw, 18px);
  color: var(--fg-2);
  max-width: 60ch;
  line-height: 1.66;
}
.muted { color: var(--fg-2); }
.max { max-width: 66ch; }

strong { color: var(--ink); font-weight: 600; }

code, .mono { font-family: var(--mono); }
:not(pre) > code {
  font-size: .88em;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 1px 5px;
  color: #17527f;
}

.section {
  padding: clamp(64px, 7.5vw, 104px) 0;
  border-top: 1px solid var(--line);
  position: relative;
}

/* Section headers: heading on the left, the paragraph about it on the right */
.shead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 22px 60px;
  align-items: start;
  margin-bottom: 48px;
}
.shead h2 { margin-bottom: 0; }
.shead p:last-child { margin-bottom: 0; }

@media (max-width: 860px) {
  .shead { grid-template-columns: minmax(0, 1fr); gap: 18px; margin-bottom: 36px; }
}

/* ------------------------------------------------------------------ header */

.top {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(140%) blur(6px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background .3s;
}
.top.is-stuck {
  border-bottom-color: var(--line);
  background: rgba(255, 255, 255, .96);
}
.top-in {
  height: 60px;
  display: flex;
  align-items: center;
  gap: 34px;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gut);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 600;
  letter-spacing: .13em;
  font-size: 13px;
  text-transform: uppercase;
  font-family: var(--mono);
  flex: none;
}
.brand:hover { color: var(--ink); }
.brand img {
  width: 26px;
  height: 26px;
  image-rendering: pixelated;
  transform: translateY(-1px);
}

.nav { display: flex; gap: 26px; margin-left: auto; align-items: center; }
.nav a {
  font-size: 13.5px;
  color: var(--fg-2);
  position: relative;
  padding: 4px 0;
  transition: color .2s;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  opacity: 0;
  transform-origin: left;
  transition: transform .28s var(--ease), opacity .28s var(--ease);
}
.nav a:hover, .nav a.is-active { color: var(--ink); }
.nav a.is-active::after, .nav a:hover::after { transform: scaleX(1); opacity: 1; }

.nav .ghost {
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  padding: 6px 13px;
  color: var(--ink);
  font-size: 13px;
  background: var(--bg-1);
  transition: border-color .2s, background .2s;
}
.nav .ghost::after { display: none; }
.nav .ghost:hover { border-color: var(--accent-2); background: var(--accent-3); }

.progress {
  height: 2px;
  background: var(--accent);
  width: 0%;
  transition: width .08s linear;
}

@media (max-width: 760px) {
  .nav a:not(.ghost) { display: none; }
  .nav { gap: 14px; }
}

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

.hero { padding: 60px 0 0; }

/* full-width battle band */
.band {
  position: relative;
  height: clamp(272px, 31vw, 372px);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(var(--sky) 0%, var(--sky) 60%, var(--grass) 60.1%, var(--grass) 100%);
  overflow: hidden;
}
.band::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 60%;
  height: 1px;
  background: var(--horizon);
}
/* faint vertical lines on the ground to fake some perspective */
.band-rails {
  position: absolute;
  left: -25%; right: -25%; top: 60%; bottom: 0;
  background-image: linear-gradient(to right, rgba(26, 108, 174, .09) 1px, transparent 1px);
  background-size: 54px 100%;
  mask-image: linear-gradient(#000, transparent 88%);
}

.band-in {
  position: relative;
  height: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gut);
}

.mon {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  will-change: transform;
}
.mon-ally { left: 5%;  bottom: 6%;  }
.mon-foe  { right: 6%; bottom: 28%; }

.mon .sprite {
  image-rendering: pixelated;
  filter: drop-shadow(0 5px 7px rgba(15, 25, 34, .16));
  transform-origin: 50% 100%;
}
.mon-ally .sprite { width: clamp(130px, 15vw, 196px); animation: bob-b 3.4s ease-in-out infinite; }
.mon-foe  .sprite { width: clamp(86px, 9.5vw, 126px);  animation: bob-a 2.9s ease-in-out infinite; }

@keyframes bob-a {
  0%, 100% { transform: translateY(0) scaleY(1); }
  50%      { transform: translateY(-6px) scaleY(1.015); }
}
@keyframes bob-b {
  0%, 100% { transform: translateY(0) scaleY(1); }
  50%      { transform: translateY(-4px) scaleY(1.02); }
}

.plat {
  border-radius: 50%;
  background: rgba(26, 108, 174, .06);
  border: 1px solid rgba(26, 108, 174, .3);
  animation: plat 2.9s ease-in-out infinite;
}
.mon-ally .plat { width: clamp(150px, 17vw, 214px); height: 22px; margin-top: -26px; animation-duration: 3.4s; }
.mon-foe  .plat { width: clamp(104px, 11vw, 146px); height: 16px; margin-top: -10px; }
@keyframes plat {
  0%, 100% { transform: scaleX(1);    opacity: 1; }
  50%      { transform: scaleX(.945); opacity: .7; }
}

/* the VS plate in the middle */
.versus {
  position: absolute;
  left: 50%;
  top: 44%;
  transform: translate(-50%, -50%);
  text-align: center;
  will-change: transform, opacity;
}
.versus .vs {
  font-family: var(--sans);
  font-weight: 700;
  font-size: clamp(46px, 6vw, 78px);
  letter-spacing: -.04em;
  line-height: 1;
  color: rgba(26, 108, 174, .22);
}
.versus .fmt {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line-2);
  display: inline-block;
}

/* HP chrome */
.hpcard {
  width: 176px;
  background: var(--bg-1);
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 7px 9px 8px;
  margin-bottom: 12px;
  font-family: var(--mono);
}
.hpcard-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 11px;
  letter-spacing: .04em;
  margin-bottom: 5px;
}
.hpcard-top b {
  color: var(--ink);
  font-weight: 500;
  text-transform: uppercase;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hpcard-top span { color: var(--fg-3); font-size: 10px; flex: none; }
.hptrack { height: 5px; background: var(--bg-3); border-radius: 3px; overflow: hidden; }
.hpfill {
  height: 100%;
  width: 100%;
  background: var(--good);
  border-radius: 3px;
  transition: width .5s var(--ease), background .3s;
}
.hpfill.mid { background: #c8901c; }
.hpfill.low { background: var(--bad); }

/* headline and buttons, sitting under the band */
.hero-copy { padding: clamp(44px, 5vw, 68px) 0 0; }
.hero-copy h1 {
  font-size: clamp(34px, 4.6vw, 56px);
  line-height: 1.06;
  letter-spacing: -.032em;
  margin: 0 0 20px;
  max-width: 24ch;
}
.hero-copy h1 em { font-style: normal; color: var(--accent); }
.hero-copy p { max-width: 58ch; color: var(--fg-2); font-size: 17px; margin-bottom: 0; }

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 42px;
  padding: 0 20px;
  border-radius: var(--r);
  font-size: 14px;
  font-weight: 500;
  font-family: var(--sans);
  border: 1px solid transparent;
  transition: background .2s, border-color .2s, color .2s, transform .2s var(--ease);
  cursor: pointer;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; font-weight: 600; }
.btn-primary:hover { background: #12558a; color: #fff; }
.btn-ghost { border-color: var(--line-2); color: var(--ink); background: var(--bg-1); }
.btn-ghost:hover { border-color: var(--accent-2); background: var(--accent-3); color: var(--ink); }
.btn[disabled] { opacity: .5; cursor: not-allowed; pointer-events: none; }

/* On a phone there isn't room for two HP cards, two sprites and the VS plate,
   so shrink the plate and shove both sides out to the edges. */
@media (max-width: 700px) {
  .band { height: clamp(238px, 58vw, 304px); }
  .band-in { padding: 0 14px; }
  .versus { top: 38%; }
  .versus .vs { font-size: 30px; }
  .versus .fmt { display: none; }
  .mon .hpcard { width: 116px; padding: 5px 7px 6px; margin-bottom: 8px; }
  .mon .hpcard-top { font-size: 10px; margin-bottom: 4px; }
  .mon-ally { left: 8px; bottom: 4%; }
  .mon-foe  { right: 8px; bottom: 33%; }
  .mon-ally .sprite { width: 112px; }
  .mon-foe  .sprite { width: 66px; }
  .mon-ally .plat { width: 122px; height: 14px; margin-top: -16px; }
  .mon-foe  .plat { width: 80px; height: 11px; margin-top: -7px; }
}

/* ------------------------------------------------------------- stat blocks */

.stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--bg-1);
  box-shadow: var(--shadow);
  margin-top: clamp(46px, 5vw, 70px);
}
.stat { padding: 24px 20px; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat .n {
  font-family: var(--mono);
  font-size: clamp(25px, 2.8vw, 34px);
  font-weight: 500;
  letter-spacing: -.02em;
  color: var(--ink);
  line-height: 1;
  display: block;
  margin-bottom: 9px;
}
.stat .n small { font-size: .5em; color: var(--accent); margin-left: 2px; letter-spacing: 0; }
.stat .k {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--fg-3);
  display: block;
  margin-bottom: 5px;
}
.stat .d { font-size: 13px; color: var(--fg-2); line-height: 1.45; }

@media (max-width: 1000px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { border-bottom: 1px solid var(--line); }
  .stat:nth-child(2n) { border-right: 0; }
  .stat:last-child { border-bottom: 0; }
}
@media (max-width: 520px) {
  .stats { grid-template-columns: minmax(0, 1fr); }
  .stat { border-right: 0; }
}

/* ------------------------------------------------------------------- cards */

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.card { background: var(--bg-1); padding: 26px 24px; }
.card h3 { margin-bottom: 9px; font-size: 16.5px; }
.card p { color: var(--fg-2); font-size: 14.5px; margin: 0; line-height: 1.6; }
.card .ix {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: .1em;
  display: block;
  margin-bottom: 13px;
}

@media (max-width: 860px) { .grid-3 { grid-template-columns: minmax(0, 1fr); } }

/* ---------------------------------------------------------------- pipeline */

.pipe {
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--bg-1);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.pipe-steps { border-right: 1px solid var(--line); background: var(--bg-2); }
.pipe-step {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 15px 18px;
  cursor: pointer;
  color: var(--fg-2);
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: .03em;
  position: relative;
  transition: color .2s, background .2s;
}
.pipe-step:last-child { border-bottom: 0; }
.pipe-step::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
  transform: scaleX(0);
  opacity: 0;
  transform-origin: left;
  transition: transform .3s var(--ease), opacity .3s var(--ease);
}
.pipe-step em { font-style: normal; color: var(--fg-3); margin-right: 12px; }
.pipe-step:hover { color: var(--ink); background: var(--bg-3); }
.pipe-step.is-on { color: var(--ink); background: var(--bg-1); }
.pipe-step.is-on em { color: var(--accent); }
.pipe-step.is-on::before { transform: scaleX(1); opacity: 1; }

.pipe-body { padding: 28px 30px 30px; min-height: 320px; }
.pipe-panel { display: none; }
.pipe-panel.is-on { display: block; animation: fadein .42s var(--ease); }
@keyframes fadein {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
.pipe-panel h3 { font-size: 21px; margin-bottom: 11px; }
.pipe-panel p { color: var(--fg-2); max-width: 60ch; font-size: 15px; }

.pipe-fig {
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--bg-2);
  padding: 18px;
}
.pipe-fig p { max-width: none; }

@media (max-width: 860px) {
  .pipe { grid-template-columns: minmax(0, 1fr); }
  .pipe-steps { border-right: 0; border-bottom: 1px solid var(--line); }
  .pipe-body { padding: 24px 20px; min-height: 0; }
}

/* world fan-out */
.worlds { display: flex; flex-wrap: wrap; gap: 8px; }
.world {
  flex: 1 1 92px;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 9px 10px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--fg-2);
  line-height: 1.7;
  background: var(--bg-1);
  opacity: 0;
  transform: translateY(6px);
}
.is-seen .world { animation: pop .5s var(--ease) forwards; }
.world:nth-child(1) { animation-delay: .02s; }
.world:nth-child(2) { animation-delay: .07s; }
.world:nth-child(3) { animation-delay: .12s; }
.world:nth-child(4) { animation-delay: .17s; }
.world:nth-child(5) { animation-delay: .22s; }
.world:nth-child(6) { animation-delay: .27s; }
.world:nth-child(7) { animation-delay: .32s; }
.world:nth-child(8) { animation-delay: .37s; }
@keyframes pop { to { opacity: 1; transform: none; } }
.world b { color: var(--accent); display: block; font-weight: 500; letter-spacing: .08em; margin-bottom: 4px; }
.world span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* candidate bars */
.cands { font-family: var(--mono); font-size: 12.5px; }
.cand { display: grid; grid-template-columns: 132px minmax(0, 1fr) 44px; gap: 12px; align-items: center; padding: 5px 0; }
.cand-n { color: var(--fg-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cand.win .cand-n { color: var(--ink); }
.cand-t { height: 7px; background: var(--bg-3); border-radius: 3px; overflow: hidden; }
.cand-f { height: 100%; width: 0; background: var(--accent-2); border-radius: 3px; transition: width .85s var(--ease); }
.cand.win .cand-f { background: var(--accent); }
.cand-v { color: var(--fg-3); text-align: right; font-size: 11.5px; }

/* --------------------------------------------------------------- terminal */

.term {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--bg-1);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.term-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--fg-3);
}
.term-bar .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); flex: none; }
.term-bar .dot.live { background: var(--good); animation: blink 1.9s ease-in-out infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

.term pre {
  margin: 0;
  padding: 20px 22px 24px;
  font-family: var(--mono);
  font-size: 12.4px;
  line-height: 1.72;
  color: #4a5765;
  overflow-x: auto;
  white-space: pre;
}
/* keep these inline. The <pre> newlines already break the lines, and making
   them blocks double-spaces the whole terminal. */
.term .l { opacity: 0; }
.term.is-typed .l { animation: line .26s steps(1, end) forwards; }
@keyframes line { to { opacity: 1; } }
.term .hd { color: var(--fg-3); }
.term .us { color: var(--accent); }
.term .op { color: var(--warm); }
.term .pick { color: var(--ink); font-weight: 500; }
.term .ok { color: var(--good); }
.term .dim { color: #a8b3c0; }

@media (max-width: 700px) { .term pre { font-size: 10.6px; padding: 16px; } }

/* ----------------------------------------------------------------- replays */

.replay {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--bg-1);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.replay-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--fg-3);
  letter-spacing: .04em;
}
.replay-head .vs { color: var(--ink); letter-spacing: 0; }
.replay-head .elo { color: var(--warm); }
.replay-head .res {
  margin-left: auto;
  color: var(--good);
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: 10.5px;
}

.field {
  position: relative;
  aspect-ratio: 16 / 8.4;
  background: linear-gradient(var(--sky) 0%, var(--sky) 58%, var(--grass) 58.1%, var(--grass) 100%);
  overflow: hidden;
}
.field::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 58%;
  height: 1px;
  background: var(--horizon);
}
.field .fgrid {
  position: absolute;
  left: -25%; right: -25%; top: 58%; bottom: 0;
  background-image: linear-gradient(to right, rgba(26, 108, 174, .08) 1px, transparent 1px);
  background-size: 42px 100%;
  mask-image: linear-gradient(#000, transparent 88%);
}
.slot { position: absolute; display: flex; flex-direction: column; align-items: center; }
.slot-foe  { right: 9%; top: 8%; }
.slot-ally { left: 8%; bottom: 6%; }
.slot .sprite {
  image-rendering: pixelated;
  filter: drop-shadow(0 4px 6px rgba(15, 25, 34, .16));
  transition: transform .16s var(--ease), opacity .4s;
  transform-origin: 50% 100%;
}
.slot-foe  .sprite { width: 82px;  animation: bob-a 3.1s ease-in-out infinite; }
.slot-ally .sprite { width: 124px; animation: bob-b 3.5s ease-in-out infinite; }
.slot.fainted .sprite { opacity: 0; transform: translateY(18px); }
.slot.lunge-foe  .sprite { animation: lunge-f .34s var(--ease); }
.slot.lunge-ally .sprite { animation: lunge-a .34s var(--ease); }
@keyframes lunge-f { 50% { transform: translate(-16px, 12px); } }
@keyframes lunge-a { 50% { transform: translate(16px, -12px); } }
.slot.hit .sprite { animation: hit .3s steps(2, end) 2; }
@keyframes hit { 50% { opacity: .3; } }

.slot .plat { animation: none; }
.slot-foe  .plat { width: 100px; height: 14px; margin-top: -9px; }
.slot-ally .plat { width: 140px; height: 18px; margin-top: -20px; }

.slot .hpcard { width: 152px; margin-bottom: 9px; }
.slot-ally .hpcard { margin: 9px 0 0; }

.turnchip {
  position: absolute;
  left: 14px; top: 12px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--fg-2);
  background: rgba(255, 255, 255, .85);
  border: 1px solid var(--line-2);
  border-radius: 2px;
  padding: 3px 9px;
}

.replay-log {
  border-top: 1px solid var(--line);
  padding: 11px 18px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg-2);
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--bg-2);
}
.replay-log .caret { color: var(--accent); flex: none; }
.replay-log span.txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.replay-foot {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--fg-2);
}
.replay-foot .blurb { flex: 1; min-width: 0; font-size: 13px; }
.replay-foot a {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .09em;
  text-transform: uppercase;
  white-space: nowrap;
  border: 1px solid var(--line-2);
  border-radius: 2px;
  padding: 5px 11px;
  color: var(--ink);
  transition: border-color .2s, background .2s;
}
.replay-foot a:hover { border-color: var(--accent-2); background: var(--accent-3); }

.roster { display: flex; gap: 2px; align-items: center; }
.roster img { width: 26px; height: 26px; image-rendering: pixelated; }

/* minmax(0, 1fr) and not plain 1fr. A bare 1fr gets an auto minimum, and the
   battle field has an aspect-ratio and a min-height, so it blows the column out
   past the viewport and you get sideways scroll. Same deal on the other grids. */
.replay-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
@media (max-width: 940px) { .replay-grid { grid-template-columns: minmax(0, 1fr); } }

/* -------------------------------------------------------------------- play */

.play {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--bg-1);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
}
.play-copy { padding: 38px 36px; }
.play-side {
  border-left: 1px solid var(--line);
  padding: 38px 28px;
  background: var(--bg-2);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--warm);
  background: #fbf3e4;
  border: 1px solid #e8d5ad;
  border-radius: 2px;
  padding: 4px 10px;
  margin-bottom: 18px;
}
.badge .pulse { width: 6px; height: 6px; border-radius: 50%; background: #c8901c; animation: blink 2.2s ease-in-out infinite; }
.checklist { list-style: none; margin: 0; padding: 0; font-family: var(--mono); font-size: 12.5px; }
.checklist li {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  color: var(--fg-2);
}
.checklist li:last-child { border-bottom: 0; }
.checklist .mk { color: var(--fg-3); flex: none; width: 14px; }
.checklist li.done { color: var(--ink); }
.checklist li.done .mk { color: var(--good); }

@media (max-width: 860px) {
  .play { grid-template-columns: minmax(0, 1fr); }
  .play-side { border-left: 0; border-top: 1px solid var(--line); }
  .play-copy { padding: 28px 22px; }
}

.replay-index { margin: 26px 0 0; font-size: 14px; }
.replay-index a { white-space: nowrap; }

/* --------------------------------------------------------------------- faq */

.faq {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.qa { background: var(--bg-1); padding: 26px 24px; }
.qa h3 { margin-bottom: 9px; font-size: 16.5px; }
.qa p { color: var(--fg-2); font-size: 14.5px; margin: 0; line-height: 1.6; }

@media (max-width: 860px) { .faq { grid-template-columns: minmax(0, 1fr); } }

/* ------------------------------------------------------------------ author */

.author {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: 44px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--bg-1);
  box-shadow: var(--shadow);
  padding: 44px;
}
.author-photo {
  width: 232px;
  height: 309px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  object-fit: cover;
}
.author h2 { font-size: clamp(26px, 2.8vw, 33px); margin-bottom: 12px; }
.author p { color: var(--fg-2); max-width: 62ch; font-size: 15.5px; }
.author p:last-of-type { margin-bottom: 0; }

.author-links {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
}
.author-links a {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: .04em;
  border: 1px solid var(--line-2);
  border-radius: 2px;
  padding: 8px 14px;
  color: var(--ink);
  transition: border-color .2s, background .2s;
}
.author-links a:hover { border-color: var(--accent-2); background: var(--accent-3); }

@media (max-width: 720px) {
  .author { grid-template-columns: minmax(0, 1fr); gap: 24px; padding: 28px 24px; }
  .author-photo { width: 168px; height: 224px; }
}

/* ------------------------------------------------------------------ footer */

.foot {
  border-top: 1px solid var(--line);
  background: var(--bg-1);
  padding: 48px 0 36px;
  font-size: 13.5px;
  color: var(--fg-2);
}
.foot-in { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr)); gap: 40px; }
.foot h3 {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin-bottom: 14px;
  font-weight: 500;
}
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot li { margin-bottom: 8px; }
.foot a { color: var(--fg-2); }
.foot a:hover { color: var(--accent); }
.foot .colophon { max-width: 44ch; line-height: 1.62; }
.foot-bar {
  margin-top: 38px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .05em;
  color: var(--fg-3);
}
@media (max-width: 760px) { .foot-in { grid-template-columns: minmax(0, 1fr); gap: 26px; } }

/* ------------------------------------------------------------ narrow field */

@media (max-width: 620px) {
  .slot .hpcard { width: 122px; margin-bottom: 7px; }
  .slot-foe  .sprite { width: 62px; }
  .slot-ally .sprite { width: 94px; }
  .slot-foe  { right: 6%; top: 6%; }
  .slot-ally { left: 6%; bottom: 5%; }
  .slot-foe  .plat { width: 76px; height: 11px; }
  .slot-ally .plat { width: 106px; height: 14px; margin-top: -15px; }

  .hpcard { width: 132px; padding: 6px 8px 7px; }

  .replay-foot { flex-wrap: wrap; gap: 12px 14px; }
  .replay-foot .blurb { order: 3; flex: 1 0 100%; }
  .replay-foot a { margin-left: auto; }
}

/* --------------------------------------------------------- scroll reveals */

[data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .68s var(--ease), transform .68s var(--ease);
}
[data-reveal].is-seen { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
  /* don't reset the VS plate's transform, that's what centres it. Mons only. */
  .mon { transform: none !important; opacity: 1 !important; }
  .versus { opacity: 1 !important; }
}
