/* The landing page's ground (docs/site.md): snekot's ink and paper, swapped at night, one rounded face of type, the
   top bar, the buttons, the opening words, how headings and blocks arrive, and the foot. What each part of the page
   looks like is in sections.css, the crowds in crowd.css and the window in window.css. */

@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(fonts/outfit.woff2) format("woff2-variations");
}
/* Arial resized to Outfit's measure, so the page does not move when the face arrives. */
@font-face {
  font-family: "Outfit Fallback";
  src: local("Arial");
  size-adjust: 97%;
  ascent-override: 103%;
  descent-override: 27%;
  line-gap-override: 0%;
}

:root {
  color-scheme: light dark;
  --page: light-dark(#f4f4f2, #111111);
  --ink: light-dark(#111111, #f4f4f2);
  --tile: light-dark(#fbfbfa, #191919);
  --soft: light-dark(#e9e8e4, #222222);
  --softer: light-dark(#dddcd7, #2e2e2e);
  --rule: light-dark(#e4e3de, #262626);
  --mute: light-dark(#55554f, #a9a9a4);
  --inset: clamp(1.25rem, 4vw, 2rem);
  /* Air: between two parts of the page, and between a part's heading and what it shows. */
  --between: clamp(5.5rem, 3rem + 9vw, 10rem);
  --after-head: clamp(2.5rem, 1.5rem + 4vw, 5rem);
  --arrive: cubic-bezier(0.2, 0.8, 0.2, 1);
  --press: cubic-bezier(0.16, 1, 0.3, 1);
  --sans: "Outfit", "Outfit Fallback", ui-sans-serif, system-ui, sans-serif;
}
/* Each part owns one colour: the plain name reads as text, -fill is the same colour as paint. */
[data-tone="sky"] {
  --tone: light-dark(#0b74d6, #58b8ff);
  --tone-fill: #00b8ff;
}
[data-tone="mint"] {
  --tone: light-dark(#0c8f43, #35d584);
  --tone-fill: #12c95a;
}
[data-tone="coral"] {
  --tone: light-dark(#dc3a1c, #ff7256);
  --tone-fill: #ff3b30;
}
[data-tone="lilac"] {
  --tone: light-dark(#6a45ea, #ab93ff);
  --tone-fill: #6b4dff;
}
[data-tone="honey"] {
  --tone: light-dark(#a86a00, #ffb740);
  --tone-fill: #ffb800;
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 400 1.0625rem / 1.75rem var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
h1,
h2,
h3,
p,
figure {
  margin: 0;
}
h1,
h2 {
  font-weight: 500;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
h1 {
  font-size: clamp(2.5rem, 1rem + 5.5vw, 4.5rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
}
h2 {
  font-size: clamp(2rem, 1.2rem + 2.6vw, 3rem);
  line-height: 1.08;
}
h3 {
  font-size: 1.1875rem;
  line-height: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
p {
  color: var(--mute);
  text-wrap: pretty;
}
a {
  color: inherit;
  text-decoration: none;
}
.sprite {
  display: none;
}
.lede {
  font-size: 1.1875rem;
  line-height: 1.875rem;
}

/* Buttons carry a fill, always. */
button,
.button {
  font: inherit;
  cursor: pointer;
  border: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition:
    transform 100ms var(--press),
    opacity 100ms,
    background-color 100ms;
}
button:active,
.button:active {
  transform: scale(0.96);
}
:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  min-height: 2.5rem;
  padding: 0 1.125rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--page);
  font-weight: 500;
  font-size: 0.9375rem;
  white-space: nowrap;
}
/* A button's mark stands before its words, as on snekot.co. */
.button .ic {
  flex: none;
  width: 1.125rem;
  height: 1.125rem;
}
.button.quiet {
  background: var(--soft);
  color: var(--ink);
}
.button.large {
  min-height: 3rem;
  padding: 0 1.5rem;
  font-size: 1.0625rem;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}
@media (hover: hover) {
  .button:hover {
    opacity: 0.86;
  }
  .button.quiet:hover {
    opacity: 1;
    background: var(--softer);
  }
}

/* The top bar stays, on the page's own colour seen through. */
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--page) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.top-in {
  display: flex;
  align-items: center;
  gap: 2rem;
  max-width: calc(72rem + var(--inset) * 2);
  height: 4.5rem;
  margin: 0 auto;
  padding: 0 var(--inset);
}
.name {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-weight: 600;
  font-size: 1.1875rem;
  letter-spacing: -0.02em;
}
.name img {
  border-radius: 8px;
}
.top nav {
  display: flex;
  gap: 0.25rem;
  margin-right: auto;
}
:is(.top, .foot) nav a {
  padding: 0.375rem 0.75rem;
  border-radius: 999px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--mute);
  transition: opacity 100ms;
}
:is(.top, .foot) nav a:active {
  opacity: 0.6;
}
@media (hover: hover) {
  :is(.top, .foot) nav a:hover {
    color: var(--ink);
  }
}
@media (max-width: 47.9375rem) {
  .top nav {
    display: none;
  }
  .top-in {
    justify-content: space-between;
    height: 4rem;
  }
}

/* The opening: a small label, the page's one sentence large on the left, what it means on the right, and the
   buttons under the sentence. The window stands straight under it (sections.css). */
.hero {
  max-width: calc(72rem + var(--inset) * 2);
  margin: 0 auto;
  padding: clamp(3.5rem, 2rem + 6vw, 7rem) var(--inset) clamp(3.5rem, 2.5rem + 3vw, 5.5rem);
}
.words,
.head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
}
.label {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
}
.label b {
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}
/* What a heading means, beside it: its first sentence in ink, the rest quieter. */
:is(.words, .head) .lede {
  max-width: 26rem;
}
.lede b {
  font-weight: 400;
  color: var(--ink);
}
.words .actions {
  justify-content: flex-start;
}
@media (min-width: 56rem) {
  .words,
  .head {
    grid-template-columns: minmax(0, 1fr) minmax(0, 26rem);
    column-gap: 4rem;
    align-items: start;
  }
  :is(.words, .head) .label {
    grid-column: 1 / -1;
  }
  :is(.words, .head) .lede {
    grid-column: 2;
    grid-row: 2 / span 2;
    padding-top: 0.75rem;
  }
  .words h1 {
    max-width: 9.5em;
  }
  .head h2 {
    max-width: 11em;
  }
}
/* On a phone the two buttons do not fit side by side with their marks, so each takes the full width. */
@media (max-width: 26rem) {
  .actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
}

/* Arriving: a heading comes in a word at a time, each tipping up from below, and a block rises a little as it
   fades in. The headline plays on load, everything else when it is first seen (src/reveal.ts). */
.w {
  display: inline-block;
}
/* A heading waits unseen until it is split into its words, which then arrive; it is never shown whole first. */
.js [data-words]:not([aria-label]) {
  visibility: hidden;
}
@media (prefers-reduced-motion: no-preference) {
  [data-words] {
    perspective: 40em;
  }
  .js [data-words] .w {
    opacity: 0;
    transform: translateY(70%) rotateX(-45deg);
    transform-origin: 50% 100%;
    transition:
      opacity 0.6s var(--arrive) calc(var(--i) * 50ms),
      transform 0.9s var(--arrive) calc(var(--i) * 50ms);
  }
  .js [data-words][data-in] .w {
    opacity: 1;
    transform: none;
  }
  .js [data-rise],
  .js .words > :not(h1) {
    opacity: 0;
    transform: translateY(24px);
    transition:
      opacity 0.7s var(--arrive) var(--wait, 0ms),
      transform 0.9s var(--arrive) var(--wait, 0ms);
  }
  .js [data-rise][data-in],
  .js .words[data-in] > :not(h1) {
    opacity: 1;
    transform: none;
  }
  .words > .lede {
    --wait: 380ms;
  }
  .words > .actions {
    --wait: 470ms;
  }
}

.foot {
  border-top: 1px solid var(--rule);
}
.foot-in {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 2rem;
  max-width: calc(72rem + var(--inset) * 2);
  margin: 0 auto;
  padding: 2rem var(--inset) 2.5rem;
}
.foot .name {
  font-size: 1.0625rem;
}
.foot nav {
  display: flex;
  flex-wrap: wrap;
  margin-right: auto;
}
.foot p {
  font-size: 0.9375rem;
}
