/* The colours of the app (src/lib/palette.ts), written by scripts/landing/build.mjs. */
:root{--bg:#F6F7F9;--border:#E3E6EB;--brand-bottom:#0F6BC0;--brand-bubble:#FFFFFF;--brand-middle:#0D5EAF;--brand-on:#FFFFFF;--brand-on-a14:rgba(255, 255, 255, 0.14);--brand-on-a20:rgba(255, 255, 255, 0.2);--brand-on-a30:rgba(255, 255, 255, 0.3);--brand-on-a40:rgba(255, 255, 255, 0.4);--brand-on-a5:rgba(255, 255, 255, 0.05);--brand-on-a70:rgba(255, 255, 255, 0.7);--brand-on-a8:rgba(255, 255, 255, 0.08);--brand-on-bubble:#0E1726;--brand-on-bubble-a0:rgba(14, 23, 38, 0);--brand-on-bubble-a40:rgba(14, 23, 38, 0.4);--brand-sun:#FFD34E;--brand-sun-a20:rgba(255, 211, 78, 0.2);--brand-sun-a30:rgba(255, 211, 78, 0.3);--brand-sun-a40:rgba(255, 211, 78, 0.4);--brand-sun-a60:rgba(255, 211, 78, 0.6);--brand-sun-a8:rgba(255, 211, 78, 0.08);--brand-top:#081F3F;--brand-top-a30:rgba(8, 31, 63, 0.3);--brand-top-a34:rgba(8, 31, 63, 0.34);--brand-top-a40:rgba(8, 31, 63, 0.4);--brand-top-a70:rgba(8, 31, 63, 0.7);--brand-top-a90:rgba(8, 31, 63, 0.9);--card:#FFFFFF;--gold-soft:#F7F0DF;--muted:#566175;--primary:#0D5EAF;--primary-text:#0D5EAF;--subtle:#F1F3F6;--text:#0E1726}
@media (prefers-color-scheme: dark){:root{--bg:#0B111B;--border:#232E41;--card:#131B29;--gold-soft:#33290F;--muted:#9BA6B8;--primary:#1F6FC2;--primary-text:#6CB0F5;--subtle:#1A2434;--text:#E8ECF3}}
/*
 * The stylesheet of the website of tileei.ch.
 *
 * A colour is a name of the palette of the app (src/lib/palette.ts), never a
 * value: the build writes the values above these rules (paletteCss in
 * ./site.ts). --brand-top-a34 is the colour brand.top let through to 34 in a
 * hundred. No rule loads anything from anywhere.
 */

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

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

body {
  margin: 0;
  font: 16px/1.5 system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

a {
  color: inherit;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-thickness: 2px;
}

a:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ------------------------------------------------------------------------
 * The page that says the app is coming. It is drawn on the blue of the
 * brand, the same by day and by night, like the opening screen of the app.
 *
 * It opens the way the app opens: the hand rings, and what the app gathers
 * in one place comes out of it as small tiles; the words come up one after
 * the other while it does. Everything that moves on its own has come to rest
 * by the fifth second, because what keeps moving beside words keeps the eye
 * from them. After that only the reader moves things: scrolling brings the
 * tiles of the app up as they come into view and lets the drawings behind
 * drift at their own pace, and the mouse lifts a tile or makes the hand ring
 * again. Every rule says where a thing rests, and each animation starts from
 * before that, so a browser that plays nothing shows the page at rest, and a
 * browser set to reduce motion shows it at rest and nothing else.
 * --------------------------------------------------------------------- */

.home {
  background: var(--brand-middle);
  color: var(--brand-on);
}

.home ::selection {
  background: var(--brand-sun);
  color: var(--brand-on-bubble);
}

.home a:focus-visible {
  outline-color: var(--brand-sun);
}

.page {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  /*
   * Clipped rather than hidden where the browser can: a box that hides what
   * overflows it is a box that scrolls, and the tiles that come up as they
   * come into view have to watch the page itself scroll.
   */
  overflow: hidden;
  overflow: clip;
  background: linear-gradient(165deg, var(--brand-top) 0%, var(--brand-middle) 62%, var(--brand-bottom) 100%);
}

/* Behind the words: a field of small dots around the logo, and two soft circles so that the blue is not flat. */
.backdrop {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  pointer-events: none;
}

.dots {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 900px;
  background-image: radial-gradient(circle, var(--brand-on-a20) 1.1px, transparent 1.6px);
  background-position: center 10px;
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(ellipse 62% 58% at 50% 24%, var(--brand-on) 0%, transparent 100%);
  mask-image: radial-gradient(ellipse 62% 58% at 50% 24%, var(--brand-on) 0%, transparent 100%);
  animation: appear 1.6s ease-out 0.2s backwards;
}

.glow {
  position: absolute;
  border-radius: 50%;
  background: var(--brand-on-a5);
  animation: glow-in 2.4s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.glow-top {
  width: 340px;
  height: 340px;
  top: -120px;
  right: -110px;
}

.glow-bottom {
  width: 420px;
  height: 420px;
  bottom: -190px;
  left: -160px;
  animation-delay: 0.15s;
}

@keyframes glow-in {
  from {
    opacity: 0;
    transform: scale(0.7);
  }
}

.hero {
  position: relative;
  flex: 1 0 auto;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 44px 20px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/*
 * The logo and what stands around it. --k is the size of the logo (1 on a
 * phone); the tiles are placed from the middle of the logo, --x to the side
 * and --y down from its top, and come out of the hand, which is 75px * --k
 * down from the top.
 */
.emblem {
  --k: 1;
  position: relative;
}

.orbit {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  pointer-events: none;
}

/* The light of the hand: the yellow of the hand, very soft, behind it. */
.halo {
  position: absolute;
  top: calc(75px * var(--k));
  left: 50%;
  width: calc(360px * var(--k));
  height: calc(360px * var(--k));
  margin: calc(-180px * var(--k)) 0 0 calc(-180px * var(--k));
  border-radius: 50%;
  background: radial-gradient(circle, var(--brand-sun-a20) 0%, var(--brand-sun-a8) 34%, transparent 68%);
  animation: glow-in 1.8s cubic-bezier(0.22, 1, 0.36, 1) 0.1s backwards;
}

.chip {
  position: absolute;
  top: var(--y);
  left: calc(50% + var(--x));
  width: var(--size);
  height: var(--size);
  margin: calc(var(--size) / -2) 0 0 calc(var(--size) / -2);
  display: grid;
  place-items: center;
  border: 1px solid var(--brand-on-a20);
  border-radius: 30%;
  background: linear-gradient(145deg, var(--brand-on-a20), var(--brand-on-a5));
  box-shadow: 0 16px 32px -14px var(--brand-top-a70);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--brand-on);
  transform: translate(0, 0) rotate(var(--tilt)) scale(1);
  animation: chip-in 1.25s cubic-bezier(0.18, 1.3, 0.4, 1) var(--delay) backwards;
}

/* From behind the hand, small, to where the tile stays. */
@keyframes chip-in {
  from {
    opacity: 0;
    transform: translate(calc(var(--x) * -1), calc(75px * var(--k) - var(--y))) rotate(0deg) scale(0.2);
  }
  30% {
    opacity: 1;
  }
}

.glyph {
  width: 46%;
  height: 46%;
}

/* On a phone, four tiles beside the logo, clear of the bubble and of the name. */
.chip-1 {
  --x: max(-150px, 30px - 50vw);
  --y: 60px;
  --size: 46px;
  --tilt: -8deg;
  --delay: 0.5s;
}

.chip-2 {
  --x: min(148px, 50vw - 30px);
  --y: 20px;
  --size: 42px;
  --tilt: 7deg;
  --delay: 0.58s;
}

.chip-3 {
  --x: min(152px, 50vw - 30px);
  --y: 118px;
  --size: 44px;
  --tilt: -5deg;
  --delay: 0.66s;
}

.chip-4 {
  --x: max(-146px, 30px - 50vw);
  --y: 146px;
  --size: 40px;
  --tilt: 9deg;
  --delay: 0.74s;
}

.chip-5 {
  --x: 445px;
  --y: 400px;
  --size: 60px;
  --tilt: -6deg;
  --delay: 0.82s;
}

.chip-6 {
  --x: -440px;
  --y: 422px;
  --size: 66px;
  --tilt: 5deg;
  --delay: 0.9s;
}

.chip-5,
.chip-6 {
  display: none;
}

/* On the narrowest phones the name of the logo reaches further out: the lower tile on the left moves up. */
@media (max-width: 359px) {
  .chip-4 {
    --y: 126px;
    --size: 38px;
  }
}

/* Something new on the map, a message, an event: a small yellow dot, as the app shows one. */
.chip-1::before,
.chip-2::after,
.chip-3::after {
  content: '';
  position: absolute;
}

.chip-2::after,
.chip-3::after {
  top: -4px;
  right: -4px;
  width: 12px;
  height: 12px;
  border: 2px solid var(--brand-middle);
  border-radius: 50%;
  background: var(--brand-sun);
  animation: pop 0.5s cubic-bezier(0.22, 1, 0.36, 1) 2.2s backwards;
}

.chip-3::after {
  animation-delay: 2.45s;
}

/* The pin of the map calls twice, like somebody who has just shown up on it. */
.chip-1::before {
  top: -1px;
  right: -1px;
  bottom: -1px;
  left: -1px;
  border: 2px solid var(--brand-sun);
  border-radius: inherit;
  opacity: 0;
  animation: call 1.3s ease-out 1.9s 2;
}

@keyframes call {
  from {
    opacity: 0.85;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(1.65);
  }
}

/* The logo: the sizes of src/components/brand/Logo.tsx, times --k. */
.logo {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stage {
  position: relative;
  width: calc(190px * var(--k));
  height: calc(150px * var(--k));
  display: flex;
  align-items: center;
  justify-content: center;
}

.ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: calc(104px * var(--k));
  height: calc(104px * var(--k));
  margin: calc(-52px * var(--k)) 0 0 calc(-52px * var(--k));
  border: 2px solid var(--brand-on);
  border-radius: 50%;
}

/* Where each ring stands when nothing moves: the first has faded, the second is on its way out. */
.ring-a {
  opacity: 0;
}

.ring-b {
  opacity: 0.19;
  transform: scale(1.3);
}

.hand {
  position: relative;
  display: inline-block;
  font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
  font-size: calc(82px * var(--k));
  line-height: calc(104px * var(--k));
}

.wiggle {
  display: inline-block;
}

.bubble {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  padding: 6px 13px;
  border-radius: 16px;
  background: var(--brand-bubble);
  color: var(--brand-on-bubble);
  font-size: calc(19px * var(--k));
  line-height: calc(24px * var(--k));
  font-weight: 800;
  letter-spacing: 0.2px;
  transform: rotate(-7deg);
}

.bubble::after {
  content: '';
  position: absolute;
  right: 14px;
  bottom: -5px;
  width: 13px;
  height: 13px;
  border-radius: 2px;
  background: var(--brand-bubble);
  transform: rotate(45deg);
}

.words {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  margin-top: 6px;
  font-size: calc(46px * var(--k));
  line-height: calc(56px * var(--k));
  font-weight: 800;
  letter-spacing: -1px;
}

.word,
.hop,
.mark {
  display: inline-block;
}

.leei {
  margin-left: calc(10px * var(--k));
}

.hop {
  margin-left: 1px;
}

/* How each question mark leans once it has landed. */
.mark {
  color: var(--brand-sun);
  font-weight: 900;
  letter-spacing: 0;
  transform: rotate(var(--lean));
}

.mark-1 {
  --lean: -10deg;
}

.mark-2 {
  --lean: 2deg;
}

.mark-3 {
  --lean: 13deg;
}

/*
 * The scene, told once: the hand, the bubble with its three dots, the two
 * words, the three question marks. Every rule above is the end of the scene,
 * and each of these starts from before it, so a browser that plays nothing
 * shows the end.
 */
@keyframes pop {
  from {
    transform: scale(0);
  }
  55% {
    transform: scale(1.14);
  }
  78% {
    transform: scale(0.97);
  }
}

@keyframes bubble-in {
  from {
    opacity: 0;
    transform: rotate(-7deg) scale(0);
  }
  60% {
    opacity: 1;
    transform: rotate(-7deg) scale(1.1);
  }
  to {
    opacity: 1;
    transform: rotate(-7deg) scale(1);
  }
}

@keyframes appear {
  from {
    opacity: 0;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
}

@keyframes mark-in {
  from {
    opacity: 0;
    transform: rotate(var(--lean)) scale(0);
  }
  60% {
    opacity: 1;
    transform: rotate(var(--lean)) scale(1.25);
  }
  to {
    opacity: 1;
    transform: rotate(var(--lean)) scale(1);
  }
}

.hand {
  animation: pop 0.62s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.bubble {
  animation: bubble-in 0.42s ease-out 0.38s backwards;
}

.dot {
  animation: appear 0.12s linear backwards;
}

.dot-1 {
  animation-delay: 0.68s;
}

.dot-2 {
  animation-delay: 0.85s;
}

.dot-3 {
  animation-delay: 1.02s;
}

.word {
  animation: rise 0.28s cubic-bezier(0.33, 1, 0.68, 1) backwards;
}

.ti {
  animation-delay: 1.18s;
}

.leei {
  animation-delay: 1.33s;
}

.mark {
  animation: mark-in 0.46s ease-out backwards;
}

.mark-1 {
  animation-delay: 1.56s;
}

.mark-2 {
  animation-delay: 1.69s;
}

.mark-3 {
  animation-delay: 1.82s;
}

/*
 * Then, for a few seconds: the hand rings twice, the rings spread, the
 * question marks take two turns to hop. On the opening screen of the app
 * this goes on for as long as the screen is up. A page stays open far
 * longer, and what keeps moving beside words keeps the eye from them, so
 * here it comes to rest by the fifth second, each thing where its rule
 * above puts it.
 */
@keyframes wiggle {
  0%,
  13.1% {
    transform: rotate(0deg);
  }
  18.7% {
    transform: rotate(15deg);
  }
  28.8% {
    transform: rotate(-15deg);
  }
  38.9% {
    transform: rotate(15deg);
  }
  49% {
    transform: rotate(-15deg);
  }
  54.5%,
  100% {
    transform: rotate(0deg);
  }
}

/* A ring leaves the hand, grows and fades. */
@keyframes ring {
  from {
    opacity: 0;
    transform: scale(0.7);
  }
  12% {
    opacity: 0.34;
  }
  to {
    opacity: 0;
    transform: scale(1.9);
  }
}

/* The same turn, begun half way: from where the second ring stands still, and back to there. */
@keyframes ring-late {
  from {
    opacity: 0.19;
    transform: scale(1.3);
  }
  50% {
    opacity: 0;
    transform: scale(1.9);
  }
  50.01% {
    opacity: 0;
    transform: scale(0.7);
  }
  62% {
    opacity: 0.34;
  }
  to {
    opacity: 0.19;
    transform: scale(1.3);
  }
}

/* Up fast and slowing, down slow and gathering speed, then a rest until the next turn. */
@keyframes hop {
  0% {
    transform: translateY(0);
    animation-timing-function: cubic-bezier(0.5, 1, 0.89, 1);
  }
  11.7% {
    transform: translateY(calc(-9px * var(--k)));
    animation-timing-function: cubic-bezier(0.11, 0, 0.5, 0);
  }
  25.5%,
  100% {
    transform: translateY(0);
  }
}

.wiggle {
  animation: wiggle 1.98s cubic-bezier(0.45, 0, 0.55, 1) 2;
}

.ring {
  animation: ring 1.7s linear 2;
}

.ring-b {
  animation-name: ring-late;
}

/* Two turns, the second one only as far as the landing: nothing of the scene is left to wait for. */
.hop {
  animation: hop 1.88s linear 1.255;
}

.hop-1 {
  animation-delay: 2.3s;
}

.hop-2 {
  animation-delay: 2.45s;
}

.hop-3 {
  animation-delay: 2.6s;
}

/* With the mouse on it, the hand rings again and the question marks hop once more. */
@keyframes ring-again {
  0%,
  100% {
    transform: rotate(0deg);
  }
  15% {
    transform: rotate(15deg);
  }
  35% {
    transform: rotate(-15deg);
  }
  55% {
    transform: rotate(15deg);
  }
  75% {
    transform: rotate(-15deg);
  }
}

@keyframes hop-again {
  0%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(calc(-9px * var(--k)));
  }
}

@media (hover: hover) {
  .logo:hover .wiggle {
    animation: wiggle 1.98s cubic-bezier(0.45, 0, 0.55, 1) 2, ring-again 1.1s ease-in-out;
  }

  .logo:hover .hop {
    animation: hop 1.88s linear 1.255, hop-again 0.5s ease-in-out;
  }

  .logo:hover .hop-1 {
    animation-delay: 2.3s, 0.2s;
  }

  .logo:hover .hop-2 {
    animation-delay: 2.45s, 0.32s;
  }

  .logo:hover .hop-3 {
    animation-delay: 2.6s, 0.44s;
  }
}

/* The words, one after the other, while the hand still rings. */
.soon {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin: 24px 0 0;
  padding: 6px 16px 6px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  background: var(--brand-sun);
  color: var(--brand-on-bubble);
  box-shadow: 0 10px 28px -10px var(--brand-sun-a60);
  font-size: 14px;
  line-height: 20px;
  font-weight: 700;
  animation: rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.35s backwards;
}

/* A dot that calls twice: it is coming. */
.soon::before {
  content: '';
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-on-bubble);
  box-shadow: 0 0 0 7px var(--brand-on-bubble-a0);
  animation: dot-call 1.2s cubic-bezier(0, 0, 0.2, 1) 1.1s 2;
}

@keyframes dot-call {
  from {
    box-shadow: 0 0 0 0 var(--brand-on-bubble-a40);
  }
}

/* A light that passes over the mark once. */
.soon::after {
  content: '';
  position: absolute;
  z-index: -1;
  top: 0;
  bottom: 0;
  left: 0;
  width: 60%;
  background: linear-gradient(100deg, transparent 15%, var(--brand-on-a70) 50%, transparent 85%);
  transform: translateX(260%);
  animation: sheen 1.1s ease-in-out 2.1s backwards;
}

@keyframes sheen {
  from {
    transform: translateX(-120%);
  }
}

.home h1 {
  margin: 18px 0 0;
  max-width: 16em;
  /* As large as the first of its two lines still fits a phone on one line. */
  font-size: clamp(24px, 8.6vw - 4px, 62px);
  line-height: 1.06;
  font-weight: 800;
  letter-spacing: -0.035em;
  text-wrap: balance;
  animation: focus-in 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.5s backwards;
}

@keyframes focus-in {
  from {
    opacity: 0;
    transform: translateY(24px);
    filter: blur(10px);
  }
}

/* Where the letters can be painted, a glint of the yellow of the hand runs over them once. */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .home h1 {
    background: linear-gradient(100deg, var(--brand-on) 42%, var(--brand-sun) 50%, var(--brand-on) 58%) 0 0 / 300% 100% no-repeat;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation:
      focus-in 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.5s backwards,
      shine 1.6s ease-in-out 2.3s backwards;
  }

  .home h1::selection {
    -webkit-text-fill-color: var(--brand-on-bubble);
  }
}

@keyframes shine {
  from {
    background-position: 100% 0;
  }
}

.lead {
  margin: 16px 0 0;
  max-width: 33em;
  font-size: clamp(17px, 2.1vw, 20px);
  line-height: 1.55;
  text-wrap: balance;
  animation: rise 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.7s backwards;
}

.features {
  list-style: none;
  width: 100%;
  margin: 36px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  text-align: left;
  animation: rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.9s backwards;
}

/*
 * Glass of the darkest blue, so that the words on it read well wherever the
 * tile sits on the page, with an edge that catches the light.
 */
.features li {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px;
  border: 1px solid transparent;
  border-radius: 20px;
  background:
    linear-gradient(var(--brand-top-a40), var(--brand-top-a30)) padding-box,
    linear-gradient(150deg, var(--brand-on-a30), var(--brand-on-a8) 45%, var(--brand-sun-a30)) border-box;
  box-shadow: 0 22px 44px -26px var(--brand-top-a90);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  transition:
    transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.4s ease;
}

.icon {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  padding: 11px;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--brand-sun-a20), var(--brand-on-a5));
  box-shadow: inset 0 0 0 1px var(--brand-sun-a30);
  color: var(--brand-sun);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.features h2 {
  margin: 0;
  font-size: 16.5px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.features p {
  margin: 4px 0 0;
  font-size: 14.5px;
  line-height: 1.55;
}

@media (hover: hover) {
  .features li:hover {
    transform: translateY(-6px);
    box-shadow:
      0 30px 54px -26px var(--brand-top-a90),
      0 0 0 1px var(--brand-sun-a40);
  }

  .features li:hover .icon {
    transform: rotate(-8deg) scale(1.08);
  }
}

.closing {
  margin: 30px 0 0;
  padding: 10px 18px 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--brand-on-a20);
  border-radius: 18px;
  background: var(--brand-top-a34);
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  text-wrap: balance;
  animation: rise 0.8s cubic-bezier(0.22, 1, 0.36, 1) 1.1s backwards;
}

.phone {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  color: var(--brand-sun);
}

@media (min-width: 820px) {
  .emblem {
    --k: 1.25;
  }

  .glow-top {
    width: 620px;
    height: 620px;
    top: -220px;
    right: -160px;
  }

  .glow-bottom {
    width: 760px;
    height: 760px;
    bottom: -340px;
    left: -240px;
  }

  .hero {
    padding: 64px 32px 52px;
  }

  .features {
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-top: 44px;
  }

  .features li {
    flex-direction: column;
    padding: 22px;
  }

  .closing {
    border-radius: 999px;
  }

  /* Four tiles, further out: the logo is larger. */
  .chip-1 {
    --x: -250px;
    --y: 52px;
    --size: 58px;
  }

  .chip-2 {
    --x: 242px;
    --y: 16px;
    --size: 52px;
  }

  .chip-3 {
    --x: 268px;
    --y: 150px;
    --size: 56px;
  }

  .chip-4 {
    --x: -262px;
    --y: 188px;
    --size: 50px;
  }
}

/* On a wide screen, six tiles in the space beside the words. */
@media (min-width: 1180px) {
  .chip-1 {
    --x: -470px;
    --y: 40px;
    --size: 66px;
  }

  .chip-2 {
    --x: 452px;
    --y: 4px;
    --size: 58px;
  }

  .chip-3 {
    --x: min(575px, 50vw - 50px);
    --y: 204px;
    --size: 72px;
  }

  .chip-4 {
    --x: max(-585px, 44px - 50vw);
    --y: 236px;
    --size: 56px;
  }

  .chip-5,
  .chip-6 {
    display: grid;
  }
}

/*
 * What only the reader moves, where the browser can tie a movement to the
 * scroll of the page: each tile of the app comes up as it comes into view,
 * and the drawings behind drift at their own pace, the small tiles a little
 * faster than the page and the circles slower.
 */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .features li {
      animation: come-up linear backwards;
      animation-timeline: view();
      animation-range: entry 0% entry 90%;
    }
  }

  @supports (animation-timeline: scroll()) {
    .chip {
      animation:
        chip-in 1.25s cubic-bezier(0.18, 1.3, 0.4, 1) var(--delay) backwards,
        drift linear;
      animation-timeline: auto, scroll(root);
      animation-range: normal, 0 700px;
    }

    .chip-1,
    .chip-4,
    .chip-6 {
      --drift: -120px;
    }

    .chip-2,
    .chip-3,
    .chip-5 {
      --drift: -70px;
    }

    .glow {
      animation:
        glow-in 2.4s cubic-bezier(0.22, 1, 0.36, 1) backwards,
        drift linear;
      animation-timeline: auto, scroll(root);
      animation-range: normal, 0 700px;
      --drift: 140px;
    }

    .glow-bottom {
      animation-delay: 0.15s, 0s;
      --drift: 90px;
    }
  }
}

@keyframes come-up {
  from {
    opacity: 0;
    translate: 0 48px;
    scale: 0.94;
  }
}

@keyframes drift {
  to {
    translate: 0 var(--drift);
  }
}

/* Whoever asked for less motion gets none: every thing stands where it rests. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* High contrast: the letters in the colour the system chooses, without the painted glint. */
@media (forced-colors: active) {
  .home h1 {
    background: none;
    -webkit-text-fill-color: currentColor;
  }
}

/* ------------------------------------------------------------------------
 * The foot of every page: the texts, and that nobody is followed.
 * --------------------------------------------------------------------- */

.foot {
  position: relative;
  font-size: 14px;
  line-height: 1.5;
}

.foot ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0 18px;
}

/* Room around each link, for a thumb. */
.foot a {
  display: inline-block;
  padding: 6px 0;
}

.foot p {
  margin: 6px 0 0;
}

.home .foot {
  padding: 20px 20px 26px;
  border-top: 1px solid var(--brand-on-a14);
  background: var(--brand-top-a40);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  text-align: center;
  animation: appear 0.8s ease-out 1.2s backwards;
}

.home .foot a {
  text-decoration-color: var(--brand-on-a40);
  transition:
    text-decoration-color 0.25s ease,
    text-underline-offset 0.25s ease;
}

.home .foot a:hover {
  text-decoration-color: var(--brand-sun);
  text-underline-offset: 5px;
}

.home .foot ul {
  justify-content: center;
}

.doc .foot {
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--muted);
}

.foot a[aria-current='page'] {
  font-weight: 600;
  text-decoration: none;
}

/* ------------------------------------------------------------------------
 * The texts: the colours of the app, by day and by night.
 * --------------------------------------------------------------------- */

.doc {
  background: var(--bg);
  color: var(--text);
}

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 20px 16px 48px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.top {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 10px;
}

.brand {
  color: var(--primary-text);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.4px;
  text-decoration: none;
}

.tagline {
  color: var(--muted);
  font-size: 13.5px;
}

.card {
  padding: 24px 20px 28px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  overflow-wrap: anywhere;
}

.card h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -0.5px;
}

.card h2 {
  margin: 28px 0 8px;
  font-size: 17px;
  line-height: 1.3;
  letter-spacing: -0.1px;
}

.card p,
.card li {
  font-size: 15px;
  line-height: 1.6;
}

.card p {
  margin: 10px 0 0;
}

.card ul {
  margin: 10px 0 0;
  padding-left: 22px;
}

.card li {
  margin: 6px 0 0;
}

.card li::marker {
  color: var(--muted);
}

.card a {
  color: var(--primary-text);
}

.card section {
  scroll-margin-top: 12px;
}

.card .draft {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--gold-soft);
  font-size: 13.5px;
  line-height: 1.45;
}

.card .version {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.contents {
  margin: 16px 0 0;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--subtle);
}

.contents summary {
  cursor: pointer;
  font-size: 14.5px;
  font-weight: 600;
}

.card .contents ul {
  list-style: none;
  margin: 6px 0 2px;
  padding: 0;
}

.card .contents li {
  margin: 0;
  padding: 3px 0;
  font-size: 14.5px;
  line-height: 1.45;
}

.intro {
  margin-top: 18px;
}

/* The rules of the community, numbered as the app numbers them. */
.rules {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  counter-reset: rule;
}

.card .rules li {
  position: relative;
  margin: 0;
  padding: 14px 0 14px 40px;
  border-top: 1px solid var(--border);
  counter-increment: rule;
}

.card .rules li:first-child {
  border-top: 0;
}

.rules li::before {
  content: counter(rule);
  position: absolute;
  top: 12px;
  left: 0;
  color: var(--primary-text);
  font-size: 20px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.card .rules h2 {
  margin: 0;
  font-size: 16px;
}

.card .rules p {
  margin: 4px 0 0;
}

@media (min-width: 640px) {
  .wrap {
    padding: 28px 24px 64px;
  }

  .card {
    padding: 36px 40px 40px;
  }
}

/* On paper: the text, and nothing around it; the first page as it rests. */
@media print {
  .home *,
  .home *::before,
  .home *::after {
    animation: none !important;
  }

  .doc {
    background: none;
  }

  .wrap {
    max-width: none;
    padding: 0;
  }

  .foot,
  .contents {
    display: none;
  }

  .card {
    padding: 0;
    border: 0;
  }

  .card h2 {
    break-after: avoid;
  }
}
