@font-face {
  font-family: "Skrid";
  src: url("/fonts/Skrid-Variable.woff2") format("woff2");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f6f5f1;
  --ink: #060010;
  --cobalt: #1e3fd8;
  --lime: #d4f24a;
  --coral: #ff5c39;
  --lilac: #c4b5fd;
  --quiet: #5d5a69;
  --rule: rgb(6 0 16 / 14%);
  --gutter: clamp(20px, 5vw, 72px);
  --measure: 34rem;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Skrid", system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.55;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 0.07em;
}

:focus-visible {
  outline: 3px solid var(--cobalt);
  outline-offset: 3px;
  border-radius: 4px;
}

h2,
h3,
p,
ul,
ol,
dl,
dd,
pre {
  margin: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  z-index: 3;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
}

.skip:focus {
  top: 0.75rem;
}

/* Top bar */

.bar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.85rem var(--gutter);
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}

.bar-home {
  font-weight: 700;
  text-decoration: none;
  margin-right: auto;
}

.bar nav {
  display: flex;
  gap: 1.25rem;
}

.bar nav a {
  text-decoration: none;
}

.bar nav a:hover {
  text-decoration: underline;
}

.button {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  background: var(--cobalt);
  color: var(--paper);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.button:hover {
  background: var(--ink);
}

.button-large {
  padding: 0.9rem 1.6rem;
  font-size: 1.2rem;
}

/* Sections share one rhythm */

main > section {
  padding: clamp(3.5rem, 9vw, 7rem) var(--gutter);
  border-bottom: 1px solid var(--rule);
}

.section-head {
  display: grid;
  gap: 0.9rem;
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}

.section-head h2 {
  font-size: clamp(2.2rem, 6vw, 4.5rem);
  font-weight: 700;
  line-height: 1;
}

.section-head p,
.lede p,
.credit {
  max-width: var(--measure);
  font-size: 1.2rem;
}

/* The tester is the hero: the page opens on the font itself */

main > .try {
  padding-top: clamp(1.5rem, 4vw, 3rem);
}

.tester {
  --wght: 700;
  --size: 220px;
  min-height: 1.1em;
  font-size: min(var(--size), 30vw);
  font-variation-settings: "wght" var(--wght);
  line-height: 1.05;
  overflow-wrap: anywhere;
  caret-color: var(--cobalt);
  outline: none;
}

.tester:focus-visible {
  outline: none;
  box-shadow: inset 0 -4px 0 var(--cobalt);
}

.tester-hint {
  color: var(--quiet);
  margin-top: 0.5rem;
}

.controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1.25rem 2.5rem;
  margin: 2rem 0 3rem;
  padding: 1.5rem 0;
  border-block: 1px solid var(--rule);
}

.control {
  display: grid;
  gap: 0.5rem;
}

.control span {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
}

.control output {
  font-weight: 400;
  font-feature-settings: "tnum";
  color: var(--quiet);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--cobalt);
}

.switches {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.75rem;
  margin: 0;
  padding: 0;
  border: 0;
}

.switches legend {
  padding: 0;
  margin-bottom: 0.6rem;
  font-weight: 600;
}

.switches label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.switches input {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--cobalt);
}

.lede {
  display: grid;
  gap: 1.5rem;
}

.lede-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
}

.note {
  color: var(--quiet);
  font-size: 1rem;
}

/* The six letters: the one loud moment on the page */

.tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin-inline: calc(var(--gutter) * -1);
  padding: 0;
  list-style: none;
}

.tile {
  display: grid;
  align-content: end;
  gap: 0.25rem;
  min-height: clamp(17rem, 40vw, 33rem);
  padding: 1.5rem var(--gutter) 1.75rem;
  position: relative;
  overflow: hidden;
}

.tile span {
  position: absolute;
  inset: 0 0 auto;
  text-align: center;
  font-size: clamp(8rem, 24vw, 19rem);
  font-weight: 600;
  line-height: 1.1;
}

.tile b {
  font-weight: 700;
}

.tile-cobalt {
  background: var(--cobalt);
  color: var(--paper);
}

.tile-lime {
  background: var(--lime);
}

.tile-coral {
  background: var(--coral);
}

.tile-lilac {
  background: var(--lilac);
}

.tile-paper {
  background: #fff;
}

.tile-ink {
  background: var(--ink);
  color: var(--paper);
}

/* Weights */

.rows {
  padding: 0;
  list-style: none;
}

.rows li {
  display: grid;
  grid-template-columns: 9.5rem minmax(0, 1fr);
  align-items: baseline;
  gap: 1rem;
  padding: 0.6rem 0;
  border-top: 1px solid var(--rule);
}

.row-name {
  color: var(--quiet);
  font-feature-settings: "tnum";
}

.row-text {
  font-size: clamp(1.6rem, 5.2vw, 4rem);
  font-variation-settings: "wght" var(--w);
  line-height: 1.15;
  overflow-wrap: anywhere;
}

/* What is built in */

.built-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
  gap: 3rem var(--gutter);
}

.built-grid article {
  display: grid;
  align-content: start;
  gap: 1rem;
}

.built-grid h3 {
  font-size: 1.4rem;
  font-weight: 700;
}

.pair,
.alts,
.langs {
  min-height: 9rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 1.2rem;
  padding: 1.25rem;
  background: #fff;
  border-radius: 20px;
  line-height: 1;
}

.pair {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
}

.pair-text {
  font-size: 4.2rem;
}

.pair-tight {
  color: var(--cobalt);
}

.alts {
  font-size: 3.6rem;
  font-weight: 500;
  gap: 0.4rem 1.6rem;
}

.alts span {
  white-space: nowrap;
}

.alt {
  color: var(--cobalt);
  font-weight: inherit;
}

.langs {
  font-size: 2rem;
  font-weight: 600;
}

.langs span:last-child {
  color: var(--cobalt);
}

/* Use it */

.files {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 1.5rem var(--gutter);
  margin-bottom: 2.5rem;
}

.files dt {
  font-weight: 700;
  font-size: 1.3rem;
}

.code {
  display: grid;
  gap: 0.75rem;
  max-width: 46rem;
}

.code pre {
  padding: 1rem 1.25rem;
  background: var(--ink);
  color: var(--paper);
  border-radius: 14px;
  overflow-x: auto;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.95rem;
}

/* Licence */

.terms {
  display: grid;
  gap: 0.6rem;
  max-width: var(--measure);
  padding-left: 1.2rem;
  margin-bottom: 2rem;
  font-size: 1.2rem;
}

.terms li::marker {
  color: var(--cobalt);
}

.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding: 2.5rem var(--gutter);
  color: var(--quiet);
}

.foot img {
  display: block;
}

@media (max-width: 720px) {
  .bar nav {
    display: none;
  }

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

  .tile {
    padding-inline: 1rem;
    font-size: 0.95rem;
  }

  .rows li {
    grid-template-columns: 1fr;
    gap: 0.1rem;
  }
}

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