/* =========================================================
   The Human Skill Tree
   One stylesheet.

   Three columns: the timeline on the left, the cards in the
   middle, the clip on the right. The middle column is the page
   itself, so the browser's own scrollbar is the timeline.

   The palette is the gene cards and nothing else.
   ========================================================= */

/* Titles use RuneScape UF and body text uses Nunito Sans. Both files live
   in /fonts/ with the site's other two, because nothing on this site is
   allowed to load from anywhere else. If the files are not there yet the
   fallbacks below take over and nothing breaks. */
@font-face{
  font-family: "RuneScape UF";
  src: url("../fonts/runescape-uf.woff2") format("woff2");
  font-display: swap;
}
@font-face{
  font-family: "Nunito Sans";
  src: url("../fonts/nunito-sans.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}

:root{
  --bg:      #141618;   /* near black, the background        */
  --slate:   #262C30;   /* panel slate                       */
  --yellow:  #FFF000;   /* titles                            */
  --cyan:    #00CCCC;   /* Area, and the UNLOCKED label      */
  --magenta: #E82ADE;   /* buffs                             */
  --salmon:  #FC6A6A;   /* debuffs, and words that mean lost */
  --green:   #42FF00;   /* words that mean gained            */
  --gold:    #FFD700;   /* dates                             */
  --grey:    #BABABA;   /* quotes                            */
  --blue:    #0000FF;   /* Uncommon                          */
  --purple:  #962EFF;   /* Rare                              */

  --title: "RuneScape UF", "Courier New", ui-monospace, monospace;
  --body:  "Nunito Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --rail-w: 190px;
  --card-w: 520px;
}

*,*::before,*::after{ box-sizing: border-box; }
[hidden]{ display: none !important; }

html{ background: var(--bg); }   /* gliding is asked for in the script, per jump */
body{
  margin: 0;
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  color: #fff;
  background:
    linear-gradient(to right, rgba(38,44,48,.35) 1px, transparent 1px) 0 0/34px 34px,
    linear-gradient(to bottom, rgba(38,44,48,.35) 1px, transparent 1px) 0 0/34px 34px,
    var(--bg);
}
img, video{ max-width: 100%; height: auto; display: block; }

.skip{
  position: fixed; left: -9999px; top: 0; z-index: 60;
  background: var(--yellow); color: #000; padding: 10px 14px; border: 3px solid #000;
}
.skip:focus{ left: 8px; top: 8px; }
.noscript{ padding: 40px; color: var(--grey); }

/* =========================================================
   the three columns
   ========================================================= */

.frame{
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, var(--card-w)) minmax(0, 1fr);
  gap: 28px;
  max-width: 1700px;
  margin: 0 auto;
  padding: 0 28px;
  align-items: start;
}

/* no timeline block in the JSON: the rail goes, the page is two columns */
body.no-rail .frame{
  grid-template-columns: minmax(0, var(--card-w)) minmax(0, 1fr);
}

/* =========================================================
   left: the timeline
   ========================================================= */

.rail{
  position: sticky; top: 0;
  height: 100vh;
  padding: 22px 0 30px;
  display: flex; flex-direction: column;
}
.rail__back{
  font-size: .72rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--grey); text-decoration: none;
  border-bottom: 2px solid var(--slate); padding-bottom: 2px;
  align-self: flex-start;
}
.rail__back:hover{ color: var(--yellow); border-color: var(--yellow); }

.rail__year{
  font-family: var(--title);
  font-size: clamp(26px, 2.1vw, 38px);
  line-height: 1;
  color: var(--yellow);
  text-shadow: 4px 4px 0 #000;
  margin: 20px 0 0;
}
.rail__unit{ display: block; font-size: .4em; color: var(--gold); margin-top: 8px; }

.rail__track{
  position: relative;
  flex: 1 1 auto;
  margin: 22px 0 14px;
  min-height: 200px;
}
.rail__line{
  position: absolute; left: 10px; top: 0; bottom: 0;
  width: 4px; background: var(--slate);
}
.rail__thumb{
  position: absolute; left: 2px;
  width: 20px; height: 20px;
  margin-top: -10px;
  background: var(--yellow);
  border: 4px solid #000;
  box-shadow: 0 0 0 3px var(--yellow);
  cursor: grab;
}
.rail__thumb:active{ cursor: grabbing; }
.rail__thumb:focus-visible{ outline: 3px solid #fff; outline-offset: 4px; }

.tick{
  position: absolute; left: 0;
  display: flex; align-items: center; gap: 8px;
  transform: translateY(-50%);
  background: none; border: 0; padding: 2px 0 2px 26px;
  font: inherit; font-size: .68rem; letter-spacing: .06em;
  color: var(--grey); cursor: pointer;
  white-space: nowrap;
}
.tick::before{
  content: "";
  position: absolute; left: 6px; top: 50%;
  width: 12px; height: 2px; margin-top: -1px;
  background: var(--slate);
}
.tick:hover, .tick.is-near{ color: var(--yellow); }
.tick:hover::before{ background: var(--yellow); }
.tick:focus-visible{ outline: 2px solid var(--yellow); }

.mark{
  position: absolute; left: 4px;
  width: 12px; height: 12px;
  margin-top: -6px;
  transform: rotate(45deg);
  background: var(--gold);
  border: 0; padding: 0; cursor: pointer;
}
.mark:hover, .mark:focus-visible{ background: #fff; outline: none; }

.rail__hint{ font-size: .74rem; color: var(--grey); margin: 0; }

/* =========================================================
   middle: the cards
   ========================================================= */

.stream{
  padding: 30vh 0 40vh;
  display: flex; flex-direction: column; gap: 26vh;
}

/* the card, straight off the gene cards: slate outside, black inside,
   stepped pixel corners */
.card{
  --step: 8px;
  background: var(--slate);
  padding: var(--step);
  clip-path: polygon(
    0 calc(var(--step)*2), var(--step) calc(var(--step)*2), var(--step) var(--step),
    calc(var(--step)*2) var(--step), calc(var(--step)*2) 0,
    calc(100% - var(--step)*2) 0, calc(100% - var(--step)*2) var(--step),
    calc(100% - var(--step)) var(--step), calc(100% - var(--step)) calc(var(--step)*2),
    100% calc(var(--step)*2), 100% calc(100% - var(--step)*2),
    calc(100% - var(--step)) calc(100% - var(--step)*2),
    calc(100% - var(--step)) calc(100% - var(--step)),
    calc(100% - var(--step)*2) calc(100% - var(--step)),
    calc(100% - var(--step)*2) 100%, calc(var(--step)*2) 100%,
    calc(var(--step)*2) calc(100% - var(--step)), var(--step) calc(100% - var(--step)),
    var(--step) calc(100% - var(--step)*2), 0 calc(100% - var(--step)*2)
  );

  /* a card that has not been reached yet sits back and waits */
  opacity: .28;
  transform: translateY(26px);
  transition: opacity .25s steps(4, end), transform .25s steps(4, end);
}
.card.is-in{ opacity: 1; transform: none; }
.card.is-active{ box-shadow: 0 0 0 3px var(--yellow); }

.card__inner{
  background: linear-gradient(rgba(0,0,0,.85), rgba(0,0,0,.85)), var(--slate);
  padding: 20px 22px 22px;
  clip-path: polygon(
    0 var(--step), var(--step) var(--step), var(--step) 0,
    calc(100% - var(--step)) 0, calc(100% - var(--step)) var(--step),
    100% var(--step), 100% calc(100% - var(--step)),
    calc(100% - var(--step)) calc(100% - var(--step)),
    calc(100% - var(--step)) 100%, var(--step) 100%,
    var(--step) calc(100% - var(--step)), 0 calc(100% - var(--step))
  );
}

.card__unlocked{
  font-family: var(--title);
  font-size: .8rem; letter-spacing: .08em;
  color: var(--cyan);
  margin: 0 0 2px;
}
.card__title{
  font-family: var(--title);
  color: var(--yellow);
  font-size: clamp(1.6rem, 2.4vw, 2.1rem);
  line-height: 1.05;
  margin: 0;
}
.card__gene{ color: var(--grey); font-size: .78rem; letter-spacing: .06em; margin: 4px 0 0; }

.card__meta{
  display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline;
  margin: 12px 0 0;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--slate);
}
.card__date{ font-family: var(--title); color: var(--gold); font-size: 1.05rem; }
.card__area{ color: var(--cyan); font-weight: 800; font-size: .9rem; }
.card__label{
  color: #fff; font-weight: 800; text-transform: uppercase;
  font-size: .68rem; letter-spacing: .08em; margin-right: 6px;
}
.card__when{ margin: 10px 0 0; color: #d8d8d8; font-size: .84rem; }
.card__quote{
  color: var(--grey); font-style: italic;
  border-left: 3px solid var(--slate);
  padding-left: 12px; margin: 16px 0 0; font-size: .9rem;
}

/* the two rows that open and shut */
.fold{ border-top: 2px solid var(--slate); }
.fold:first-of-type{ margin-top: 16px; }
.fold__head{
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  background: none; border: 0; padding: 12px 2px;
  font: inherit; font-family: var(--title); font-size: 1rem;
  color: #fff; cursor: pointer; text-align: left;
}
.fold__head:hover{ color: var(--yellow); }
.fold__head:focus-visible{ outline: 2px solid var(--yellow); outline-offset: 2px; }
.fold--buff .fold__name{ color: var(--green); }
.fold--debuff .fold__name{ color: var(--salmon); }
.fold__count{ color: var(--grey); font-family: var(--body); font-size: .78rem; font-weight: 800; }
.fold__sign{
  margin-left: auto;
  font-family: var(--title); font-size: 1.2rem; color: var(--grey);
  width: 18px; text-align: center;
}
.fold__head[aria-expanded="true"] .fold__sign{ color: var(--yellow); }
.fold__body{ padding: 0 2px 14px; }

.claims{ list-style: none; margin: 0; padding: 0; }
.claim{ display: flex; gap: 10px; margin-bottom: 10px; align-items: flex-start; }
.claim:last-child{ margin-bottom: 0; }
.claim__text{ font-size: .9rem; }
.claims--buff .claim__text{ color: var(--magenta); }
.claims--debuff .claim__text{ color: var(--salmon); }

.arws{ display: inline-flex; gap: 1px; padding-top: 3px; flex: 0 0 auto; }
.arw{ fill: var(--yellow); shape-rendering: crispEdges; }

.state{ font-family: var(--title); }
.state--good{ color: var(--green); }
.state--bad{ color: var(--salmon); }

.rarity{ font-family: var(--title); }
.rarity--common{ color: var(--green); }
.rarity--uncommon{ color: var(--blue); text-shadow: 0 0 2px #9a9aff, 0 0 1px #9a9aff; }
.rarity--rare{ color: var(--purple); }
.rarity--legendary{ color: var(--gold); }

.stamp{
  display: inline-block;
  font-family: var(--title);
  font-size: .66rem; letter-spacing: .05em;
  padding: 1px 5px;
  border: 2px solid currentColor;
  white-space: nowrap;
  vertical-align: 1px;
}
.stamp--solid{ color: var(--green); }
.stamp--debated{ color: var(--yellow); }
.stamp--still-argued{ color: var(--salmon); }

.chips{ display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 14px 0 0; }
.chip{
  font: inherit; font-size: .74rem; font-weight: 800;
  background: transparent; color: var(--yellow);
  border: 2px solid var(--yellow);
  padding: 5px 8px; cursor: pointer;
}
.chip:hover{ background: rgba(255,240,0,.14); }
.chip:focus-visible{ outline: 2px solid #fff; outline-offset: 2px; }

.details{ margin-top: 4px; border-top: 2px solid var(--slate); padding-top: 10px; }
.details summary{
  cursor: pointer; font-family: var(--title); color: var(--yellow);
  font-size: .9rem; padding: 4px 0;
}
.details summary:focus-visible{ outline: 2px solid var(--yellow); }
.details a{ color: var(--cyan); }
.details ul{ color: #d8d8d8; padding-left: 1.1em; margin: 0 0 10px; }
.details li{ margin-bottom: 4px; font-size: .84rem; }
.details h4{ font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; margin: 12px 0 4px; }

/* the small gold banners between cards */
.event{
  display: flex; gap: 12px; align-items: baseline;
  border-left: 4px solid var(--gold);
  padding: 10px 0 10px 14px;
  opacity: .28;
  transition: opacity .25s steps(4, end);
}
.event.is-in{ opacity: 1; }
.event__when{ font-family: var(--title); color: var(--gold); font-size: 1rem; white-space: nowrap; }
.event__text{ font-size: .88rem; color: #d8d8d8; }
.event__name{ display: block; font-family: var(--title); color: #fff; font-size: .92rem; }

/* the closing block */
.end{ padding: 6vh 0 0; }
.end__title{ font-family: var(--title); color: var(--yellow); font-size: 1.6rem; margin: 0 0 10px; }
.end__body{ color: #d8d8d8; font-size: .95rem; max-width: 46ch; }
.end__list{ margin: 18px 0 0; padding: 0; list-style: none; }
.end__list li{ margin-bottom: 10px; font-size: .86rem; color: #d8d8d8; }
.end__list b{ color: #fff; font-family: var(--title); font-weight: 400; }

/* =========================================================
   right: the clip
   ========================================================= */

.stage{
  position: sticky; top: 0;
  height: 100vh;
  display: flex; flex-direction: column; justify-content: center;
  gap: 12px;
  padding: 22px 0;
}

.screen{
  --step: 10px;
  background: var(--slate);
  padding: var(--step);
  clip-path: polygon(
    0 calc(var(--step)*2), var(--step) calc(var(--step)*2), var(--step) var(--step),
    calc(var(--step)*2) var(--step), calc(var(--step)*2) 0,
    calc(100% - var(--step)*2) 0, calc(100% - var(--step)*2) var(--step),
    calc(100% - var(--step)) var(--step), calc(100% - var(--step)) calc(var(--step)*2),
    100% calc(var(--step)*2), 100% calc(100% - var(--step)*2),
    calc(100% - var(--step)) calc(100% - var(--step)*2),
    calc(100% - var(--step)) calc(100% - var(--step)),
    calc(100% - var(--step)*2) calc(100% - var(--step)),
    calc(100% - var(--step)*2) 100%, calc(var(--step)*2) 100%,
    calc(var(--step)*2) calc(100% - var(--step)), var(--step) calc(100% - var(--step)),
    var(--step) calc(100% - var(--step)*2), 0 calc(100% - var(--step)*2)
  );
}
.screen__inner{
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px;
  padding: 24px;
  text-align: center;
  overflow: hidden;
}
.screen__inner video{ position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.screen__title{
  font-family: var(--title); color: var(--yellow);
  font-size: clamp(1.5rem, 2.6vw, 2.6rem); line-height: 1.05; margin: 0;
}
.screen__date{ font-family: var(--title); color: var(--gold); font-size: 1rem; margin: 0; }
.screen__quote{ color: var(--grey); font-style: italic; font-size: .9rem; margin: 0; max-width: 34ch; }
.screen__soon{
  position: absolute; left: 12px; bottom: 10px;
  font-size: .62rem; letter-spacing: .1em; text-transform: uppercase;
  color: rgba(186,186,186,.5);
}
.screen__cap{
  margin: 0; font-size: .78rem; color: var(--grey);
  display: flex; gap: 10px; align-items: baseline;
}
.screen__cap b{ font-family: var(--title); color: #fff; font-weight: 400; font-size: .95rem; }

/* =========================================================
   narrower screens: one column, the clip rides along the top
   ========================================================= */

@media (max-width: 1100px){
  :root{ --card-w: 100%; }

  .frame{
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0 16px;
    max-width: 620px;
  }

  .rail{
    position: sticky; top: 0; z-index: 5;
    height: auto;
    flex-direction: row; align-items: center; gap: 14px;
    padding: 10px 0 8px;
    background: var(--bg);
    border-bottom: 2px solid var(--slate);
  }
  .rail__back{ order: 3; font-size: .62rem; }
  .rail__year{ font-size: 22px; margin: 0; }
  .rail__unit{ display: inline; font-size: .5em; margin-left: 6px; }
  .rail__track{
    order: 2; flex: 1 1 auto; height: 4px; min-height: 0; margin: 0;
  }
  .rail__line{ left: 0; right: 0; top: 50%; bottom: auto; width: auto; height: 4px; margin-top: -2px; }
  .rail__thumb{
    left: auto; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px;
  }
  .tick, .mark, .rail__hint{ display: none; }

  .stage{
    position: sticky; top: 46px; z-index: 4;
    height: auto; padding: 10px 0;
    background: var(--bg);
  }
  .screen__inner{ padding: 14px; gap: 6px; }
  .screen__quote{ display: none; }

  .stream{ padding: 8vh 0 30vh; gap: 14vh; }
  .card{ transform: none; }
}

@media (prefers-reduced-motion: reduce){
  .card, .event{ transition: none; }
}

/* =========================================================
   the top of the page
   ========================================================= */

.hero{
  max-width: 1700px;
  margin: 0 auto;
  padding: 40px 28px 10px;
  display: flex; align-items: flex-end; gap: 26px;
  border-bottom: 2px solid var(--slate);
}
.hero__text{ flex: 1 1 auto; min-width: 0; padding-bottom: 26px; }
.hero__kicker{
  font-size: .74rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--cyan); margin: 0 0 10px;
}
.hero__title{
  font-family: var(--title);
  font-size: clamp(2rem, 4.4vw, 3.6rem);
  line-height: 1.02;
  color: var(--yellow);
  text-shadow: 5px 5px 0 #000;
  margin: 0;
  max-width: 22ch;
}
.hero__sub{
  font-family: var(--title);
  font-size: clamp(1.1rem, 2vw, 1.6rem);
  color: var(--gold);
  margin: 10px 0 0;
}
.hero__line{ color: #d8d8d8; margin: 16px 0 0; font-size: 1rem; max-width: 44ch; }
.hero__prof{ width: clamp(120px, 14vw, 220px); flex: 0 0 auto; align-self: flex-end; }

/* =========================================================
   the bottom of the page
   ========================================================= */

.tail{
  max-width: 1700px;
  margin: 0 auto;
  padding: 0 28px 90px;
}

.check{ max-width: 640px; margin: 0 auto 70px; }
.check__lead{ color: #d8d8d8; font-size: .92rem; margin: 10px 0 0; }
.check__every{ font-size: .9rem; margin: 12px 0 0; }
.check__q{ font-size: 1.1rem; margin: 6px 0 20px; }
.check__bar{ height: 8px; background: #1b2023; border: 2px solid var(--slate); margin: 10px 0 16px; }
.check__bar i{ display: block; height: 100%; background: var(--yellow); }
.check__acts{ display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.check__acts .pixbtn{ flex: 1 1 auto; }
.check__list{ list-style: none; padding: 0; margin: 14px 0 0; font-size: .9rem; }
.check__list li{ margin-bottom: 4px; }
.check__respec{ color: var(--grey); font-size: .85rem; margin: 16px 0 0; }

.pixbtn{
  font: inherit; font-family: var(--title); font-size: 1rem;
  display: inline-block; text-align: center; text-decoration: none;
  background: var(--yellow); color: #000;
  border: 4px solid #000;
  box-shadow: 0 0 0 4px var(--slate);
  padding: 12px 20px;
  cursor: pointer;
}
.pixbtn:hover{ background: #fff; }
.pixbtn:focus-visible{ outline: 3px solid #fff; outline-offset: 5px; }
.pixbtn--yes{ background: var(--green); }
.pixbtn--no{ background: #fff; }
.pixbtn--maybe{ background: var(--grey); }
.pixbtn--quiet{ background: transparent; color: var(--grey); border-color: var(--slate); box-shadow: none; }

.ask{
  max-width: 640px; margin: 0 auto;
  text-align: center;
  padding: 40px 0 10px;
  border-top: 2px solid var(--slate);
}
.ask__title{ font-family: var(--title); color: var(--yellow); font-size: 1.5rem; margin: 0 0 14px; }
.ask__line{ margin: 0 0 6px; color: #d8d8d8; }
.ask .pixbtn{ margin-top: 22px; }

.ways{
  display: flex; flex-wrap: wrap; gap: 20px; justify-content: center;
  margin-top: 46px;
  font-size: .85rem;
}
.ways a{ color: var(--grey); }
.ways a:hover{ color: var(--yellow); }

@media (max-width: 1100px){
  .hero{
    max-width: 620px; padding: 24px 16px 6px; gap: 12px;
  }
  .hero__text{ padding-bottom: 14px; }
  .hero__prof{ width: 96px; }
  .tail{ max-width: 620px; padding: 0 16px 70px; }
}

/* =========================================================
   the small touchable bits
   ========================================================= */

.toy{
  margin: 18px 0 0;
  padding: 14px;
  border: 2px solid var(--slate);
  background: rgba(38,44,48,.35);
}
.toy__title{
  font-family: var(--title); color: var(--cyan);
  font-size: .95rem; margin: 0 0 10px;
}
.toy__range{
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 22px; background: none; cursor: grab; margin: 6px 0;
}
.toy__range:active{ cursor: grabbing; }
.toy__range::-webkit-slider-runnable-track{
  height: 8px; background: #1b2023; border: 2px solid var(--slate);
}
.toy__range::-moz-range-track{
  height: 8px; background: #1b2023; border: 2px solid var(--slate);
}
.toy__range::-webkit-slider-thumb{
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 20px; margin-top: -8px;
  background: var(--yellow); border: 4px solid #000;
}
.toy__range::-moz-range-thumb{
  width: 20px; height: 20px; border-radius: 0;
  background: var(--yellow); border: 4px solid #000;
}
.toy__range:focus-visible{ outline: 2px solid var(--yellow); outline-offset: 4px; }

.toy__bars{ display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.toy__bar{
  display: grid;
  grid-template-columns: 8.5em minmax(0, 1fr) 4.5em;
  align-items: center; gap: 10px;
  min-height: 26px;
}
.toy__track{
  position: relative;
  height: 16px;
  background: #1b2023;
  border: 2px solid var(--slate);
}
.toy__fill{
  position: absolute; left: 0; top: 0; bottom: 0; width: 0;
  background: var(--yellow);
}
.toy__fill--b{ background: var(--green); }
.toy__who{ font-size: .8rem; color: #d8d8d8; }
.toy__num{ font-family: var(--title); color: var(--yellow); text-align: right; }
.toy__read{ display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.toy__big{ font-family: var(--title); color: var(--yellow); font-size: 2rem; }
.toy__unit{ font-family: var(--title); color: var(--gold); }
.toy__note{ color: var(--grey); font-size: .78rem; }
.toy__line{ margin: 10px 0 0; font-size: .8rem; color: #d8d8d8; }
