/*
 * tinkets.com (BATCH-S, the VP2f site frames `docs/research/vp2/targets/vp2f/site*.png` and `press.png`).
 * The colours, spacing, radii and type are the game's own tokens (`tokensCss`, written into every page's head as `:root`),
 * and the sky behind the whole page is the game's sky through the day (`--page-sky`, from `themeOf`): day at the top,
 * golden by the middle, dusk, night at the footer. Words over sky wear the caption treatment (white face, ink outline and lip);
 * words on paper are ink. Phone first; 1200 wide content at a desktop.
 */
@font-face {
  font-family: Fredoka;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/fredoka-500.woff2") format("woff2");
}
@font-face {
  font-family: Fredoka;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/fredoka-600.woff2") format("woff2");
}
@font-face {
  font-family: Fredoka;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/fredoka-700.woff2") format("woff2");
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body {
  margin: 0;
  min-height: 100vh;
  font-family: Fredoka, system-ui, sans-serif;
  font-weight: 600;
  font-size: var(--text-body);
  line-height: 1.4;
  color: var(--ink);
  background: var(--page-sky);
  background-color: var(--page-night);
  overflow-x: hidden;
}
img,
svg,
iframe {
  display: block;
  max-width: 100%;
}
a {
  color: inherit;
}
.wrap {
  position: relative;
  width: min(1200px, 100% - 32px);
  margin-inline: auto;
}
@media (max-width: 699px) {
  /* The dotted run down the right edge keeps its own lane. */
  .wrap {
    width: calc(100% - 56px);
    margin-left: 20px;
    margin-right: auto;
  }
}
.skip {
  position: absolute;
  left: -999px;
}
.skip:focus {
  left: 16px;
  top: 16px;
  z-index: 100;
  padding: 8px 16px;
  background: var(--paper);
  border-radius: 12px;
}
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

/* ----- Words over sky: the caption treatment ----- */
.cap {
  color: var(--white);
  font-weight: 700;
  -webkit-text-stroke: 0.18em var(--ink);
  paint-order: stroke fill;
  stroke-linejoin: round;
  text-shadow: 0 0.07em 0 var(--ink);
  line-height: 1.08;
  margin: 0;
}
.cap b {
  color: var(--gold);
}

/* ----- Buttons: the kit's pills (face, lip, ink outline) ----- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--min-hit);
  padding: 0 24px;
  border-radius: 999px;
  border: 3px solid var(--ink);
  font: inherit;
  font-weight: 700;
  font-size: var(--text-heading);
  color: var(--white);
  background: var(--green);
  box-shadow:
    0 4px 0 var(--green-dark),
    0 4px 0 3px var(--ink);
  margin-bottom: 7px;
  text-decoration: none;
  cursor: pointer;
  -webkit-text-stroke: 0;
  text-shadow: 0 2px 0 var(--green-dark);
}
.btn:active {
  transform: translateY(3px);
  box-shadow:
    0 1px 0 var(--green-dark),
    0 1px 0 3px var(--ink);
}
.btn.butter {
  background: var(--gold);
  color: var(--ink);
  text-shadow: none;
  box-shadow:
    0 4px 0 var(--gold-dark),
    0 4px 0 3px var(--ink);
}
.btn.small {
  min-height: 40px;
  padding: 0 18px;
  font-size: var(--text-body);
}

/* ----- Header ----- */
.top {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 20px;
  padding-block: 16px;
}
.top .lockup {
  margin-right: auto;
  display: block;
}
.top nav {
  display: none;
  gap: 24px;
}
.top nav a {
  font-size: var(--text-body);
  font-weight: 700;
  color: var(--white);
  text-decoration: none;
  -webkit-text-stroke: 0.2em var(--ink);
  paint-order: stroke fill;
}
@media (min-width: 700px) {
  .top nav {
    display: flex;
  }
}

/* ----- The plate over the board ----- */
.plate {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px 6px 8px;
  border-radius: 999px;
  background: var(--paper);
  border: 3px solid var(--ink);
  box-shadow: 0 3px 0 var(--ink);
  font-weight: 700;
  font-size: var(--text-small);
}
.plate i {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--gold);
  border: 3px solid var(--ink);
}

/* ----- Hero: the live Daily ----- */
.hero {
  position: relative;
  display: grid;
  gap: 16px;
  padding-bottom: 32px;
}
.board {
  position: relative;
  width: 100%;
  height: min(72svh, 640px);
  min-height: 460px;
  border-radius: 28px;
  border: 4px solid var(--ink);
  overflow: hidden;
  background: var(--world-sky-1);
  box-shadow:
    0 8px 0 var(--ink),
    0 24px 40px rgba(20, 10, 60, 0.35);
  isolation: isolate;
}
.board iframe,
.board .poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.board .poster {
  object-fit: cover;
  object-position: 50% 40%;
  transition: opacity var(--t-mid) ease-out;
}
.board[data-live] .poster {
  opacity: 0;
  pointer-events: none;
}
.board .hit {
  position: absolute;
  inset: 0;
  z-index: 2;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.board[data-live] .hit {
  display: none;
}
.board .tap {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  padding: 8px 20px;
  border-radius: 999px;
  background: var(--paper);
  border: 3px solid var(--ink);
  font-weight: 700;
  font-size: var(--text-small);
  white-space: nowrap;
  pointer-events: none;
}
.board[data-live] .tap {
  display: none;
}
.pitch h1 {
  font-size: clamp(36px, 9vw, 60px);
  margin: 0 0 12px;
}
.pitch p {
  margin: 0 0 16px;
  font-size: var(--text-heading);
  color: var(--white);
  -webkit-text-stroke: 0.2em var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 0.08em 0 var(--ink);
  font-weight: 700;
}
.pitch .small {
  font-size: var(--text-small);
  margin: 4px 0 0;
}
.ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}
.badge {
  display: inline-block;
}
@media (min-width: 960px) {
  .hero {
    grid-template-columns: 7fr 5fr;
    align-items: center;
    gap: 48px;
    padding-top: 8px;
  }
  .hero .plate {
    position: absolute;
    left: 0;
    top: -8px;
    z-index: 4;
  }
  .board {
    height: 560px;
    min-height: 0;
    margin-top: 40px;
  }
  .pitch {
    max-width: 440px;
  }
}
@media (max-width: 959px) {
  .hero {
    grid-template-areas: "plate" "board" "pitch";
  }
  .hero .plate {
    grid-area: plate;
    justify-self: start;
  }
  .hero .board {
    grid-area: board;
  }
  .hero .pitch {
    grid-area: pitch;
    text-align: center;
  }
  .hero .ctas {
    justify-content: center;
  }
}

/* ----- Sections ----- */
section {
  position: relative;
  padding-block: 40px;
}
@media (min-width: 960px) {
  section {
    padding-block: 68px;
  }
}
h2.cap {
  font-size: clamp(30px, 6vw, 40px);
  margin-bottom: 24px;
}
.paper {
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: var(--radius-card);
  box-shadow: 0 5px 0 var(--ink);
  padding: 20px;
}
.paper h2,
.paper h3 {
  margin: 0 0 8px;
  font-size: var(--text-title);
  line-height: 1.15;
}
.paper p {
  margin: 0 0 12px;
}

/* How to play */
.how {
  display: grid;
  gap: 24px;
  align-items: center;
}
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 16px;
}
.steps li {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  align-items: center;
}
.steps .n {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gold);
  border: 3px solid var(--ink);
  font-weight: 700;
}
.steps b {
  font-size: var(--text-heading);
  line-height: 1.1;
}
.steps span {
  font-size: var(--text-small);
  font-weight: 500;
}
.mini {
  position: relative;
  height: min(70svh, 480px);
  min-height: 360px;
  border-radius: 24px;
  border: 4px solid var(--ink);
  overflow: hidden;
  background: var(--world-sky-1);
  box-shadow: 0 6px 0 var(--ink);
}
.mini iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.mini .label {
  position: absolute;
  inset: auto 0 12px;
  margin: auto;
  width: max-content;
  max-width: 90%;
  padding: 6px 16px;
  border-radius: 999px;
  background: var(--paper);
  border: 3px solid var(--ink);
  font-size: var(--text-small);
  font-weight: 700;
}
@media (min-width: 960px) {
  .how {
    grid-template-columns: 5fr 7fr;
    gap: 48px;
  }
  .mini {
    height: 460px;
  }
}

/* A look inside */
.looks {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 62%;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 4px 4px 16px;
  margin: 0;
  list-style: none;
  -webkit-overflow-scrolling: touch;
}
.looks li {
  scroll-snap-align: start;
  text-align: center;
}
.looks img {
  width: 100%;
  height: auto;
  border-radius: 28px;
  border: 3px solid var(--ink);
  box-shadow: 0 5px 0 var(--ink);
  background: var(--paper);
}
.looks figcaption {
  margin-top: 10px;
  font-size: var(--text-body);
}
.looks figcaption span {
  font-weight: 700;
}
.more {
  display: block;
  text-align: right;
  font-size: var(--text-small);
  margin-top: 4px;
}
@media (min-width: 700px) {
  .looks {
    grid-auto-flow: row;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-columns: auto;
    overflow: visible;
    gap: 24px;
  }
  .more {
    display: none;
  }
}

/* The world */
.world {
  display: grid;
  gap: 24px;
  align-items: center;
}
.world img {
  width: 100%;
  height: auto;
  border-radius: 24px;
  border: 3px solid var(--ink);
  box-shadow: 0 6px 0 var(--ink);
}
.world p {
  font-size: var(--text-heading);
  font-weight: 700;
  margin: 0 0 20px;
  color: var(--white);
  -webkit-text-stroke: 0.2em var(--ink);
  paint-order: stroke fill;
}
@media (min-width: 960px) {
  .world {
    grid-template-columns: 4fr 8fr;
    gap: 48px;
  }
}

/* Get it */
.get {
  text-align: center;
}
.get h2 {
  font-size: clamp(22px, 5vw, 28px);
  margin-bottom: 16px;
}
.get .ctas {
  justify-content: center;
}

/* Footer */
footer.foot {
  position: relative;
  z-index: 3;
  padding: 40px 0 48px;
  background: var(--page-night);
  color: var(--white);
  font-size: var(--text-small);
}
footer.foot .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 40px;
  align-items: center;
}
footer.foot a {
  font-weight: 700;
  text-decoration: none;
}
footer.foot .saves {
  margin-left: auto;
  font-weight: 500;
}
@media (max-width: 699px) {
  footer.foot .wrap {
    flex-direction: column;
    align-items: flex-start;
  }
  footer.foot .saves {
    margin-left: 0;
  }
}

/* Pages of words */
.doc {
  padding-block: 8px 48px;
  display: grid;
  gap: 20px;
}
.doc h1 {
  font-size: clamp(34px, 8vw, 52px);
  margin: 8px 0 4px;
}
.doc .lead {
  color: var(--white);
  font-size: var(--text-heading);
  font-weight: 700;
  -webkit-text-stroke: 0.2em var(--ink);
  paint-order: stroke fill;
  margin: 0;
}
.isle {
  position: absolute;
  z-index: 0;
  width: 64px;
  height: auto;
  opacity: 0.9;
  pointer-events: none;
}
.doc .isle {
  display: none;
  right: 4%;
  top: 56px;
}
@media (min-width: 960px) {
  .doc {
    grid-template-columns: 1fr 1fr;
    align-items: start;
    gap: 24px;
  }
  .doc h1,
  .doc .lead,
  .doc > p,
  .doc .ctas {
    grid-column: 1 / -1;
  }
  .doc .lead {
    max-width: 760px;
  }
  .doc .paper.wide {
    grid-column: 1 / -1;
    max-width: 820px;
  }
  .doc .isle {
    display: block;
  }
}
.doc ul {
  margin: 0 0 12px;
  padding-left: 22px;
}
.doc li {
  margin-bottom: 6px;
  font-weight: 500;
}
.doc h2 {
  font-size: var(--text-title);
  margin: 20px 0 8px;
}
.doc h2:first-child {
  margin-top: 0;
}

/* Press kit */
.press-head {
  position: relative;
  min-height: clamp(240px, 26vw, 360px);
  border-radius: 0 0 28px 28px;
  overflow: hidden;
  background: var(--world-sky-1);
}
.press-head img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 0;
}
.press-head h1 {
  position: absolute;
  left: max(16px, calc((100% - 1200px) / 2));
  bottom: 12px;
  font-size: clamp(40px, 8vw, 56px);
  margin: 0;
}
.press-body {
  background: color-mix(in srgb, var(--paper) 88%, var(--gold));
  margin-top: -28px;
  padding: 56px 0 48px;
}
.press-cols {
  display: grid;
  gap: 20px;
}
@media (min-width: 960px) {
  .press-cols {
    grid-template-columns: 5fr 7fr;
  }
}
.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 24px;
  margin: 0;
  font-size: var(--text-small);
}
.facts dt {
  font-weight: 700;
}
.facts dd {
  margin: 0;
  font-weight: 500;
}
.downloads {
  list-style: none;
  margin: 0;
  padding: 0;
}
.downloads li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 2px solid var(--paper-shade);
  font-size: var(--text-small);
  font-weight: 700;
}
.downloads li:first-child {
  border-top: 0;
}
.downloads .btn {
  margin: 0;
  box-shadow:
    0 3px 0 var(--gold-dark),
    0 3px 0 3px var(--ink);
}
.downloads .btn:not(.butter) {
  box-shadow:
    0 3px 0 var(--green-dark),
    0 3px 0 3px var(--ink);
}
.press-body .wrap > h2 {
  font-size: var(--text-title);
  margin: 32px 0 12px;
  color: var(--white);
  -webkit-text-stroke: 0.2em var(--ink);
  paint-order: stroke fill;
}
.shots {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 40%;
  gap: 12px;
  overflow-x: auto;
  list-style: none;
  margin: 0;
  padding: 0 0 8px;
}
.shots img {
  width: 100%;
  height: auto;
  border-radius: 14px;
  border: 3px solid var(--ink);
}
@media (min-width: 700px) {
  .shots {
    grid-auto-columns: calc((100% - 48px) / 5);
  }
}
.logos {
  display: grid;
  gap: 16px;
}
.logos div {
  display: grid;
  place-items: center;
  padding: 28px;
  border-radius: 20px;
  border: 3px solid var(--ink);
}
.doc p,
.doc .paper > div {
  font-weight: 500;
}
.logos .cream {
  background: var(--white);
}
.logos .night {
  background: var(--page-night);
}
.logos img {
  width: min(320px, 80%);
  height: auto;
}
.top .lockup img {
  height: 40px;
  width: auto;
}
@media (min-width: 700px) {
  .logos {
    grid-template-columns: 1fr 1fr;
  }
}
.press-foot {
  background: var(--page-night);
  color: var(--white);
  padding: 24px 0 40px;
  font-size: var(--text-small);
  font-weight: 500;
}

/* ----- The scroll: isles rise in, the marble rolls down the page ----- */
.run {
  position: fixed;
  z-index: 2;
  right: 4px;
  top: 0;
  bottom: 0;
  width: 28px;
  pointer-events: none;
}
.run .rail {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 50% 50%, var(--white) 2.5px, transparent 3.5px);
  background-size: 14px 14px;
  background-position: 50% 0;
  background-repeat: repeat-y;
  opacity: 0.85;
}
.run .marble {
  position: absolute;
  left: 1px;
  top: 55%;
  width: 26px;
  height: 26px;
  margin-top: -13px;
  display: none;
}
@media (min-width: 700px) {
  .run {
    right: 24px;
    width: 40px;
  }
  .run .marble {
    width: 36px;
    height: 36px;
    left: 2px;
    margin-top: -18px;
  }
  .isle {
    width: 96px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: scroll()) {
    .run .marble {
      display: block;
      animation: roll linear both;
      animation-timeline: scroll(root block);
    }
    .run .rail {
      animation: railing linear both;
      animation-timeline: scroll(root block);
    }
    .isle {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 10% entry 100%;
    }
    @keyframes roll {
      to {
        rotate: calc(var(--turns, 24) * 1turn);
      }
    }
    @keyframes railing {
      to {
        background-position: 50% calc(var(--rail, 4000) * -1px);
      }
    }
    @keyframes rise {
      from {
        transform: translateY(40px);
        opacity: 0;
      }
      to {
        transform: translateY(0);
        opacity: 0.9;
      }
    }
  }
}

/* ----- Polish: figures, cloud banks, a sun's glow behind the hero ----- */
figure {
  margin: 0;
}
.looks li figure {
  max-width: 300px;
  margin-inline: auto;
}
.sea {
  position: relative;
  z-index: 1;
  height: 120px;
  margin-block: -40px;
  pointer-events: none;
  /* The game's cloud sea: a shaded row behind a lit row, faded out below so it melts into the sky. */
  background:
    radial-gradient(70px 46px at 70px 100%, var(--world-cloud-lit) 98%, transparent 100%) 0 100% /
    240px 100% repeat-x,
    radial-gradient(90px 58px at 190px 100%, var(--world-cloud-lit) 98%, transparent 100%) 0 100% /
    240px 100% repeat-x,
    radial-gradient(70px 46px at 70px 100%, var(--world-cloud-shade) 98%, transparent 100%) 60px
    100% / 240px 100% repeat-x,
    radial-gradient(90px 58px at 190px 100%, var(--world-cloud-shade) 98%, transparent 100%) 60px
    100% / 240px 100% repeat-x;
  -webkit-mask-image: linear-gradient(to bottom, black 0, black 45%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 0, black 45%, transparent 100%);
  opacity: 0.85;
}
.hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -80px -10% auto auto;
  width: min(900px, 120%);
  aspect-ratio: 1;
  background: radial-gradient(
    circle,
    color-mix(in srgb, var(--world-sun, var(--glint)) 65%, transparent) 0,
    transparent 62%
  );
  pointer-events: none;
}
.board {
  transition: transform var(--t-mid, 200ms) ease-out;
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .board:not([data-live]):hover {
    transform: translateY(-3px) rotate(-0.4deg);
  }
}
