/* The landing page. Two grounds, lime and graphite, taken from the app's theme and turned up: where the app
   keeps lime for what is live, the page floods with it. Display type is Bricolage Grotesque at its heaviest,
   knocked a little out of line like the wordmark; text is Geist, as in the app. */

:root {
  --lime: #c6f24e;
  --ink: #0a0b0d;
  --panel: #131418;
  --paper: #e9ecf1;
  --mute: #969ca7;
  --hot: #ff9f70;
  --line: rgb(232 236 242 / 12%);
  --display: 'Bricolage Grotesque', 'Arial Black', system-ui, sans-serif;
  --text: 'Geist', system-ui, sans-serif;
  --mono: 'Geist Mono', ui-monospace, monospace;
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --gutter: clamp(20px, 4.5vw, 72px);
  --max: 1320px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font: 400 17px / 1.55 var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

h1,
h2,
h3,
p {
  margin: 0;
}

a {
  color: inherit;
}

img,
svg {
  display: block;
  max-width: 100%;
}

code {
  font-family: var(--mono);
  font-size: 0.92em;
}

:focus-visible {
  outline: 3px solid currentcolor;
  outline-offset: 3px;
  border-radius: 6px;
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 20;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 14px;
  border-radius: 8px;
}

.skip:focus {
  top: 12px;
}

.defs {
  position: absolute;
}

h2 {
  font: 800 clamp(44px, 7.2vw, 112px) / 0.9 var(--display);
  font-variation-settings: 'opsz' 96;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.lead {
  font-size: clamp(18px, 1.55vw, 22px);
  line-height: 1.45;
  max-width: 34em;
  text-wrap: pretty;
}

/* ------------------------------------------------------------ buttons */

.btn {
  display: inline-flex;
  align-items: center;
  font: 600 17px / 1 var(--text);
  text-decoration: none;
  color: var(--ink);
  background: var(--lime);
  border: 2px solid var(--ink);
  border-radius: 12px;
  padding: 16px 22px;
  box-shadow: 4px 4px 0 var(--ink);
  transition:
    transform 0.15s var(--out),
    box-shadow 0.15s var(--out);
}

.btn--ink {
  background: var(--ink);
  color: var(--paper);
  box-shadow: 4px 4px 0 rgb(10 11 13 / 35%);
}

.btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--ink);
}

.btn--ink:hover {
  box-shadow: 6px 6px 0 rgb(10 11 13 / 35%);
}

.btn:active {
  transform: translate(4px, 4px);
  box-shadow: 0 0 0 var(--ink);
}

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

.hero {
  position: relative;
  background: var(--lime);
  color: var(--ink);
  padding: 0 var(--gutter);
}

.hero > * {
  max-width: var(--max);
  margin-inline: auto;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-block: 22px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.4vw, 34px);
  font-weight: 500;
}

.nav__links a {
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.nav__links a:hover {
  border-bottom-color: currentcolor;
}

.lang {
  font: 600 14px / 1 var(--mono);
  color: var(--ink);
  background: none;
  border: 2px solid var(--ink);
  border-radius: 9px;
  padding: 8px 10px;
  cursor: pointer;
}

.lang:hover {
  background: var(--ink);
  color: var(--lime);
}

.hero__top {
  position: relative;
  padding-top: clamp(12px, 3vw, 44px);
}

.hero__title {
  font: 800 clamp(58px, 12vw, 204px) / 0.9 var(--display);
  font-variation-settings: 'opsz' 96;
  letter-spacing: -0.035em;
  word-spacing: 0.1em;
  margin-left: -0.04em;
}

/* letters, set by app.js: each one stands a little out of line and gives way to the pointer */
.ch {
  display: inline-block;
  transform: translate(var(--x, 0), var(--y, 0)) rotate(var(--r, 0deg));
  transition: transform 0.5s var(--spring);
  will-change: transform;
}

.word {
  display: inline-block;
  white-space: nowrap;
}

.is-in .ch {
  animation: slam 0.7s var(--spring) both;
  animation-delay: calc(var(--i) * 28ms + 120ms);
}

@keyframes slam {
  from {
    opacity: 0;
    transform: translateY(-0.6em) rotate(calc(var(--r, 0deg) * -5)) scale(1.25);
    font-stretch: 75%;
  }
}

.bub {
  position: absolute;
  right: -1%;
  top: 4%;
  width: clamp(150px, 30vw, 470px);
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  border-radius: 30%;
  -webkit-tap-highlight-color: transparent;
  /* Bub lands once, as the button: the hop and the shout are the picture's, and when one of them ended on the
     same element, the landing started again. */
  transform-origin: 30% 86%;
  animation: bub-drop 0.9s var(--spring) 0.5s both;
}

.bub svg {
  overflow: visible;
  transform-origin: 30% 86%;
}

/* Bub leans toward the pointer (app.js): the body a little, the face more */
.bub__body {
  transform-box: fill-box;
  transform-origin: 40% 92%;
  transform: translate(var(--bx, 0), var(--by, 0)) rotate(var(--br, 0deg));
  transition: transform 0.3s var(--out);
}

.bub__shape {
  fill: var(--ink);
}

.bub__chev,
.bub__smile {
  fill: none;
  stroke: var(--lime);
  stroke-width: 46;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bub__smile {
  stroke-width: 24;
}

.bub__cur,
.bub__mouth {
  fill: var(--lime);
}

.bub__cur {
  transform-box: fill-box;
  transform-origin: center;
  animation: bub-blink 5.2s 2s infinite;
}

.bub__mouth {
  opacity: 0;
}

.bub__face {
  transform: translate(var(--ex, 0), var(--ey, 0));
  transition: transform 0.25s var(--out);
}

.bub__noise path {
  fill: none;
  stroke: var(--ink);
  stroke-width: 34;
  stroke-linecap: round;
  stroke-dasharray: 80;
  stroke-dashoffset: 80;
}

.bub:hover svg {
  animation: bub-hop 0.6s var(--spring);
}

.bub.is-loud svg {
  animation: bub-shout 0.9s var(--spring);
}

.bub.is-loud .bub__mouth {
  opacity: 1;
}

.bub.is-loud .bub__smile {
  opacity: 0;
}

.bub.is-loud .bub__noise path {
  animation: bub-noise 0.9s var(--out);
}

@keyframes bub-drop {
  0% {
    opacity: 0;
    transform: translateY(-70%) rotate(18deg);
  }

  60% {
    opacity: 1;
    transform: translateY(0) rotate(-4deg) scale(1.08, 0.86);
  }
}

@keyframes bub-hop {
  40% {
    transform: translateY(-7%) rotate(5deg) scale(0.96, 1.06);
  }

  70% {
    transform: translateY(0) scale(1.06, 0.92);
  }
}

@keyframes bub-shout {
  20% {
    transform: scale(1.16) rotate(-7deg);
  }

  45% {
    transform: scale(1.1) rotate(6deg);
  }

  70% {
    transform: scale(1.12) rotate(-3deg);
  }
}

@keyframes bub-noise {
  0% {
    stroke-dashoffset: 80;
  }

  30%,
  75% {
    stroke-dashoffset: 0;
  }

  100% {
    stroke-dashoffset: -80;
  }
}

@keyframes bub-blink {
  0%,
  92%,
  100% {
    transform: scaleY(1);
  }

  95% {
    transform: scaleY(0.12);
  }
}

.hero__sub {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(20px, 4vw, 64px);
  align-items: start;
  padding-top: clamp(26px, 3.4vw, 52px);
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.hero__note {
  flex-basis: 100%;
  font: 500 14px / 1.4 var(--mono);
  opacity: 0.72;
}

.hero__win {
  position: relative;
  z-index: 2;
  margin-top: clamp(40px, 5.5vw, 84px);
  margin-bottom: calc(-1 * clamp(110px, 19vw, 300px));
  transform: perspective(1800px) rotateX(calc((1 - var(--p, 1)) * 16deg)) scale(calc(0.93 + var(--p, 1) * 0.07));
  transform-origin: 50% 0;
  filter: drop-shadow(0 40px 60px rgb(10 11 13 / 45%));
}

/* ------------------------------------------------------------ the room */

.room {
  background: var(--ink);
  padding: clamp(190px, 26vw, 420px) var(--gutter) clamp(60px, 8vw, 120px);
}

.room__pin {
  max-width: var(--max);
  margin-inline: auto;
}

.room h2 {
  margin-bottom: clamp(28px, 4vw, 56px);
}

.room__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: clamp(44px, 7vw, 72px);
}

.room__list button {
  all: unset;
  display: block;
  cursor: default;
}

.room__list h3 {
  font: 800 clamp(28px, 3vw, 42px) / 1 var(--display);
  letter-spacing: -0.025em;
  margin-bottom: 12px;
  text-wrap: balance;
}

.room__list p {
  color: var(--mute);
  max-width: 30em;
}

.room__list code {
  color: var(--lime);
}

.room__mini {
  margin-top: 22px;
}

.room__win {
  display: none;
}

@media (min-width: 1040px) {
  .room {
    /* one screen of scrolling per scene */
    height: calc(100vh + 5 * 80vh);
    padding-block: 0;
  }

  .room__pin {
    position: sticky;
    top: 0;
    height: 100vh;
    display: grid;
    grid-template-columns: minmax(300px, 0.52fr) minmax(0, 1fr);
    gap: clamp(32px, 4vw, 72px);
    align-items: center;
  }

  .room h2 {
    font-size: clamp(44px, 5.2vw, 84px);
  }

  .room__list {
    gap: 0;
  }

  .room__list li {
    border-left: 3px solid var(--line);
    padding: 11px 0 11px 20px;
    transition: border-color 0.3s;
  }

  .room__list button {
    cursor: pointer;
    border-radius: 6px;
  }

  .room__list h3 {
    margin: 0;
    font-size: clamp(22px, 2.1vw, 32px);
    color: var(--mute);
    transition: color 0.3s;
  }

  .room__list p {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition:
      max-height 0.5s var(--out),
      opacity 0.3s,
      margin 0.5s var(--out);
  }

  .room__list li.is-on {
    border-left-color: var(--lime);
  }

  .room__list li.is-on h3 {
    color: var(--paper);
  }

  .room__list li.is-on p {
    max-height: 12em;
    opacity: 1;
    margin-top: 10px;
  }

  .room__mini {
    display: none;
  }

  .room__win {
    display: block;
    filter: drop-shadow(0 30px 50px rgb(0 0 0 / 60%));
  }

  .room__win .rw-scene.play {
    animation: scene-in 0.5s var(--out);
  }
}

@keyframes scene-in {
  from {
    opacity: 0;
    clip-path: inset(0 0 100% 0);
  }

  to {
    opacity: 1;
    clip-path: inset(0);
  }
}

/* ------------------------------------------------------------ tape */

.tape {
  position: relative;
  z-index: 3;
  background: var(--paper);
  color: var(--ink);
  transform: rotate(-2deg) scale(1.04);
  margin-block: -34px;
  padding-block: 16px;
  overflow: hidden;
  border-block: 2px solid var(--ink);
}

.tape__run {
  display: flex;
  width: max-content;
  gap: 34px;
  align-items: center;
  font: 600 clamp(20px, 2.4vw, 32px) / 1 var(--mono);
  white-space: nowrap;
  will-change: transform;
}

.tape__run svg {
  width: 1.3em;
  height: 1.3em;
  --mark-body: var(--ink);
  --mark-face: var(--paper);
}

/* ------------------------------------------------------------ what it refuses */

.no {
  background: var(--lime);
  color: var(--ink);
  padding: clamp(110px, 14vw, 200px) var(--gutter) clamp(90px, 12vw, 180px);
}

.no__in {
  max-width: var(--max);
  margin-inline: auto;
}

.no__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: clamp(40px, 6vw, 90px);
}

.no__bub {
  width: clamp(120px, 20vw, 300px);
  height: auto;
  margin-bottom: -2%;
  transform-origin: 40% 90%;
}

.no__bub.is-hit {
  animation: bub-hop 0.6s var(--spring);
}

.no__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.no__list li {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 10px clamp(24px, 4vw, 64px);
  align-items: center;
  padding-block: clamp(18px, 2.4vw, 34px);
  border-top: 2px solid var(--ink);
}

.no__list li:last-child {
  border-bottom: 2px solid var(--ink);
}

.no__what {
  font: 800 clamp(34px, 5.6vw, 92px) / 0.95 var(--display);
  font-variation-settings: 'opsz' 96;
  letter-spacing: -0.035em;
}

.sw {
  position: relative;
  display: inline-block;
  margin-right: 0.22em;
  transition: color 0.35s;
  -webkit-text-stroke: 0.02em var(--ink);
}

.sw i {
  position: absolute;
  left: -4%;
  top: 30%;
  width: 108%;
  height: 50%;
  clip-path: inset(-60% calc((1 - clamp(0, var(--p, 1) * var(--n) - var(--i), 1)) * 100%) -60% 0);
}

.sw svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.sw path {
  fill: none;
  stroke: var(--ink);
  stroke-width: 0.085em;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

/* the same line underneath, wider and in the ground's color, so the stroke shows across solid letters */
.sw path:first-child {
  stroke: var(--lime);
  stroke-width: 0.19em;
}

.is-struck .sw {
  color: transparent;
}

.no__so {
  font-size: clamp(16px, 1.35vw, 19px);
  font-weight: 500;
  max-width: 30em;
  opacity: 0.25;
  transform: translateX(-10px);
  transition:
    opacity 0.4s,
    transform 0.5s var(--spring);
}

.is-struck .no__so {
  opacity: 1;
  transform: none;
}

/* ------------------------------------------------------------ alone / together */

.net {
  background: var(--ink);
  padding: clamp(100px, 13vw, 190px) var(--gutter) clamp(80px, 10vw, 150px);
}

.net > * {
  max-width: var(--max);
  margin-inline: auto;
}

.net__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(28px, 4vw, 64px);
  margin-top: clamp(36px, 5vw, 72px);
}

.net article {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: clamp(18px, 2.4vw, 34px);
}

.net h3 {
  font: 800 clamp(26px, 2.6vw, 38px) / 1 var(--display);
  letter-spacing: -0.02em;
  margin: 18px 0 10px;
}

.net article p {
  color: var(--mute);
  max-width: 32em;
}

.net__svg {
  width: 100%;
  height: auto;
  font-family: var(--text);
}

.net__pc {
  fill: #191b20;
  stroke: rgb(232 236 242 / 22%);
  stroke-width: 2;
}

.net__chip {
  fill: var(--ink);
  stroke: var(--line);
}

.net__name {
  fill: var(--paper);
  font-weight: 600;
  font-size: 19px;
}

.net__mono {
  fill: var(--lime);
  font: 500 16px var(--mono);
}

.net__small {
  fill: var(--mute);
  font-size: 15px;
}

.net__links path {
  stroke: rgb(198 242 78 / 45%);
  stroke-width: 3;
  stroke-dasharray: 2 9;
  stroke-linecap: round;
}

.net__pulses circle {
  fill: var(--lime);
}

.net__ghost :is(rect, path) {
  fill: none;
  stroke: var(--mute);
  stroke-width: 2.5;
  stroke-dasharray: 6 7;
}

.net__ghost .net__x {
  stroke: var(--hot);
  stroke-width: 6;
  stroke-dasharray: none;
  stroke-linecap: round;
}

.net__ghost text {
  fill: var(--hot);
  font: 500 15px var(--mono);
}

.more {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(26px, 3vw, 44px) clamp(22px, 3vw, 48px);
  margin-top: clamp(60px, 8vw, 110px);
  margin-bottom: 0;
}

.more dt {
  font: 800 22px / 1.1 var(--display);
  letter-spacing: -0.01em;
  color: var(--lime);
  margin-bottom: 8px;
}

.more dt code {
  font-weight: 600;
  font-size: 0.9em;
}

.more dd {
  margin: 0;
  color: var(--mute);
  font-size: 16px;
}

.more dd code {
  color: var(--paper);
}

/* ------------------------------------------------------------ the end */

.end {
  position: relative;
  background: var(--lime);
  color: var(--ink);
  padding: clamp(90px, 12vw, 170px) var(--gutter) clamp(90px, 11vw, 160px);
  overflow: hidden;
}

.end > * {
  max-width: var(--max);
  margin-inline: auto;
}

.end h2 {
  font-size: clamp(72px, 15vw, 250px);
  line-height: 0.82;
  letter-spacing: -0.05em;
  margin-bottom: clamp(24px, 3vw, 44px);
}

.end .lead {
  margin-bottom: 28px;
}

.end__bub {
  position: absolute;
  right: max(var(--gutter), calc((100% - var(--max)) / 2));
  bottom: 6%;
  width: clamp(150px, 30vw, 440px);
  height: auto;
  margin: 0;
  transform: rotate(6deg);
}

.foot {
  background: var(--ink);
  padding: 44px var(--gutter) 56px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px 44px;
  color: var(--mute);
  font-size: 14.5px;
}

.foot p:first-of-type {
  flex: 1 1 320px;
  max-width: 46em;
}

.foot p:last-child {
  display: flex;
  gap: 22px;
}

.burst {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 30;
}

.is-shaking .hero__top,
.is-shaking .hero__sub {
  animation: shake 0.5s linear;
}

@keyframes shake {
  10% {
    transform: translate(-7px, 4px) rotate(-0.6deg);
  }

  30% {
    transform: translate(8px, -5px) rotate(0.7deg);
  }

  50% {
    transform: translate(-6px, -3px) rotate(-0.4deg);
  }

  70% {
    transform: translate(5px, 4px) rotate(0.3deg);
  }

  90% {
    transform: translate(-2px, 1px);
  }
}

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

@media (max-width: 860px) {
  .nav__links a:not([href^='https']) {
    display: none;
  }

  .hero__sub,
  .net__grid,
  .no__list li {
    grid-template-columns: minmax(0, 1fr);
  }

  .more {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bub {
    top: -6%;
    right: -3%;
    width: clamp(120px, 34vw, 240px);
  }

  .hero__top {
    padding-top: clamp(70px, 22vw, 150px);
  }

  .end__bub {
    position: static;
    margin: 0 0 12px auto;
  }
}

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

  .logo img:last-child {
    width: 112px;
    height: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .hero__win {
    transform: none;
  }
}
