:root {
  color-scheme: light dark;
  --background: #ffffff;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --line: #e5e5e7;
  --link: #0071e3;
  --soft: #f5f5f7;
  --initial: #299e9e;
  --final: #168fce;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--text);
  background: var(--background);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--link);
  text-underline-offset: 0.15em;
}

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

.site-header {
  border-bottom: 1px solid var(--line);
}

.header-inner,
main,
.footer-inner {
  width: min(780px, calc(100% - 40px));
  margin: 0 auto;
}

.header-inner {
  display: flex;
  min-height: 60px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  color: var(--text);
  font-weight: 650;
  text-decoration: none;
}

nav,
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

nav a,
.footer-links a {
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}

nav a:hover,
nav a[aria-current="page"],
.footer-links a:hover {
  color: var(--text);
}

.intro {
  padding: 70px 0 58px;
  text-align: center;
}

.app-icon {
  width: 112px;
  height: 112px;
  margin: 0 auto 24px;
  border-radius: 24px;
}

h1,
h2,
h3 {
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 {
  margin: 0 0 12px;
  font-size: 42px;
}

h2 {
  margin: 0 0 12px;
  font-size: 28px;
}

h3 {
  margin: 28px 0 8px;
  font-size: 20px;
}

p,
ul,
ol {
  margin-top: 0;
  margin-bottom: 18px;
}

li + li {
  margin-top: 6px;
}

.lede {
  margin-bottom: 4px;
  font-size: 21px;
}

.secondary,
.meta,
.prose p,
.prose li {
  color: var(--muted);
}

.button {
  display: inline-block;
  margin-top: 16px;
  padding: 9px 17px;
  border-radius: 9px;
  color: #ffffff;
  background: var(--link);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}

.button:hover {
  color: #ffffff;
  opacity: 0.88;
}

.download-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.button-secondary {
  color: var(--link);
  background: var(--soft);
}

.button-secondary:hover {
  color: var(--link);
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9em;
}

.checksum {
  overflow-wrap: anywhere;
}

.section {
  padding: 40px 0;
  border-top: 1px solid var(--line);
}

.legend-note {
  color: var(--muted);
}

.initial-text,
.key-initial {
  color: var(--initial);
}

.final-text,
.key-finals {
  color: var(--final);
}

.keyboard-legend {
  width: 100%;
  margin: 24px 0;
}

.keyboard-row {
  display: grid;
  gap: clamp(2px, 0.8vw, 8px);
  margin-bottom: clamp(3px, 1vw, 10px);
}

.keyboard-row-top {
  grid-template-columns: repeat(10, minmax(0, 1fr));
}

.keyboard-row-home {
  width: 90%;
  margin-right: auto;
  margin-left: auto;
  grid-template-columns: repeat(9, minmax(0, 1fr));
}

.keyboard-row-bottom {
  width: 70%;
  margin-right: auto;
  margin-left: auto;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.legend-key {
  position: relative;
  min-width: 0;
  aspect-ratio: 1 / 1;
  border-radius: 2px;
  background: var(--soft);
}

.key-letter,
.key-initial,
.key-finals {
  position: absolute;
}

.key-letter {
  top: 8%;
  left: 9%;
  color: var(--text);
  font-size: clamp(13px, 3.2vw, 27px);
  line-height: 1;
}

.key-initial {
  top: 9%;
  right: 8%;
  font-size: clamp(9px, 2vw, 17px);
  line-height: 1;
}

.key-finals {
  right: 8%;
  bottom: 7%;
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  font-size: clamp(8px, 1.9vw, 16px);
  line-height: 1.08;
}

.site-footer {
  margin-top: 30px;
  padding: 28px 0 40px;
  border-top: 1px solid var(--line);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  font-size: 14px;
}

.page-main {
  padding: 56px 0 80px;
}

.page-intro,
.document {
  width: min(720px, 100%);
  margin-right: auto;
  margin-left: auto;
}

.page-intro {
  margin-bottom: 36px;
}

.page-intro h1 {
  font-size: 40px;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
}

.prose h2 {
  margin-top: 42px;
}

.prose h2:first-of-type {
  margin-top: 0;
}

.prose hr {
  height: 1px;
  margin: 46px 0;
  border: 0;
  background: var(--line);
}

.license-index {
  display: grid;
  margin: 32px 0 48px;
  border-top: 1px solid var(--line);
}

.license-index a {
  display: grid;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
  grid-template-columns: minmax(170px, 0.8fr) minmax(0, 1.2fr);
  gap: 20px;
}

.license-index a:hover strong {
  color: var(--link);
}

.license-index span {
  color: var(--muted);
}

.prose section[id] {
  scroll-margin-top: 24px;
}

.resource-links a {
  overflow-wrap: anywhere;
}

.contact-box {
  margin-top: 32px;
  padding: 20px;
  border-radius: 10px;
  background: var(--soft);
}

.contact-box h3 {
  margin-top: 0;
}

.contact-box p:last-child {
  margin-bottom: 0;
}

@media (max-width: 560px) {
  .header-inner,
  main,
  .footer-inner {
    width: min(100% - 28px, 780px);
  }

  nav {
    gap: 12px;
  }

  .intro {
    padding-top: 52px;
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .license-index a {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #111111;
    --text: #f5f5f7;
    --muted: #a1a1a6;
    --line: #333336;
    --link: #2997ff;
    --soft: #242426;
    --initial: #54b9b9;
    --final: #4aaee2;
  }
}
