/* 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-a12:rgba(255, 255, 255, 0.12);--brand-on-a14:rgba(255, 255, 255, 0.14);--brand-on-a5:rgba(255, 255, 255, 0.05);--brand-on-bubble:#0E1726;--brand-sun:#FFD34E;--brand-top:#081F3F;--brand-top-a34:rgba(8, 31, 63, 0.34);--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.
 * --------------------------------------------------------------------- */

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

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

.page {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: linear-gradient(165deg, var(--brand-top) 0%, var(--brand-middle) 62%, var(--brand-bottom) 100%);
}

/* Two soft circles, so that the blue is not flat. They reach past the edges. */
.backdrop {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  pointer-events: none;
}

.glow {
  position: absolute;
  border-radius: 50%;
  background: var(--brand-on-a5);
}

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

.glow-bottom {
  width: 420px;
  height: 420px;
  bottom: -190px;
  left: -160px;
}

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

/* The logo: the sizes of src/components/brand/Logo.tsx, times --k. */
.logo {
  --k: 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;
}

@media (prefers-reduced-motion: reduce) {
  .logo *,
  .logo *::after {
    animation: none !important;
  }
}

.soon {
  margin: 22px 0 0;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--brand-sun);
  color: var(--brand-on-bubble);
  font-size: 14px;
  line-height: 20px;
  font-weight: 700;
}

.home h1 {
  margin: 16px 0 0;
  max-width: 16em;
  font-size: clamp(30px, 6.4vw, 52px);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.lead {
  margin: 14px 0 0;
  max-width: 33em;
  font-size: clamp(17px, 2.1vw, 20px);
  line-height: 1.5;
  text-wrap: balance;
}

.features {
  list-style: none;
  width: 100%;
  margin: 32px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  text-align: left;
}

/* A veil of the darkest blue, so that the words on it read well wherever the tile sits on the page. */
.features li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--brand-on-a14);
  border-radius: 16px;
  background: var(--brand-top-a34);
}

.icon {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  padding: 10px;
  border-radius: 12px;
  background: var(--brand-on-a12);
}

.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.5;
}

.closing {
  margin: 28px 0 0;
  font-size: 15px;
  font-weight: 600;
  text-wrap: balance;
}

@media (min-width: 820px) {
  .logo {
    --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 48px;
  }

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

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

/* ------------------------------------------------------------------------
 * 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: 18px 20px 24px;
  border-top: 1px solid var(--brand-on-a14);
  background: var(--brand-top-a34);
  text-align: center;
}

.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. */
@media print {
  .doc {
    background: none;
  }

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

  .foot,
  .contents {
    display: none;
  }

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

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