:root {
  --paper: #F6F2E9;
  --paper-raised: #FFFDF8;
  --paper-sunk: #EDE7DA;
  --ink: #1E1A15;
  --ink-soft: #574E43;
  --ink-faint: #6F665A;
  --line: #E3DBCC;
  --line-strong: #C9BEAA;
}
/* masteries.app — the app's « illustrated encyclopedia » on the web: paper,
   ink, Fraunces for titles and reading, Figtree for the interface. The
   colour variables above are generated from apps/mobile design tokens. */

@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/fraunces-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Fraunces";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/fraunces-latin-400-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/fraunces-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/figtree-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/figtree-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/figtree-latin-600-normal.woff2") format("woff2");
}

:root {
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  /* About 70 characters of Fraunces at 18px. */
  --content: 600px;
  --gutter: 20px;
  color-scheme: light;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--paper-sunk);
  color: var(--ink);
}

a {
  color: var(--ink);
  text-decoration-line: underline;
  text-decoration-color: var(--line-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover {
  text-decoration-color: var(--ink);
}
a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Header: the brand and the other language, quiet chrome. */

.site-header {
  width: 100%;
  max-width: calc(var(--content) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 20px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--sans);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  text-decoration: none;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 20px;
}
.brand img {
  border-radius: 8px;
  border: 1px solid var(--line);
}

.language {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-soft);
}

main {
  flex: 1;
  width: 100%;
  max-width: calc(var(--content) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Home: one column, the seal first, then a single sentence that says
   what the app is. */

.home {
  padding: 56px 0 72px;
  text-align: center;
}

.home-icon {
  display: block;
  margin: 0 auto 28px;
  border-radius: 28px;
  border: 1px solid var(--line);
}

.home h1 {
  text-wrap: balance;
  margin: 0 0 12px;
  font-weight: 600;
  font-size: clamp(40px, 8vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.home p {
  margin: 0 auto 16px;
  text-wrap: pretty;
}

.home .lead {
  text-wrap: balance;
  font-style: italic;
  font-size: clamp(20px, 3.4vw, 24px);
  line-height: 1.45;
  margin-bottom: 24px;
}

.home .availability,
.home .contact {
  font-family: var(--sans);
  font-size: 16px;
  color: var(--ink-soft);
}

.home .availability {
  margin-top: 32px;
  font-weight: 600;
  color: var(--ink);
}

/* Legal pages: reading first. */

.prose {
  padding: 24px 0 64px;
}

.prose h1 {
  text-wrap: balance;
  margin: 0 0 8px;
  font-weight: 600;
  font-size: clamp(30px, 5.5vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

/* The "Last updated" line right under the title. */
.prose .updated {
  margin-top: 0;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink-faint);
}

.prose h2 {
  margin: 2.2em 0 0.5em;
  font-weight: 600;
  font-size: 24px;
  line-height: 1.25;
}

.prose h3 {
  margin: 1.6em 0 0.4em;
  font-weight: 600;
  font-size: 19px;
  line-height: 1.3;
}

.prose p,
.prose ul,
.prose ol {
  margin: 0 0 1em;
  text-wrap: pretty;
}

.prose ul,
.prose ol {
  padding-left: 1.3em;
}

.prose li {
  margin-bottom: 0.35em;
}

.prose li::marker {
  color: var(--ink-faint);
}

.prose strong {
  font-weight: 600;
}

/* Tables are data: the interface face, hairlines only. */
.prose table {
  width: 100%;
  margin: 0 0 1.4em;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  display: block;
  overflow-x: auto;
}

.prose th,
.prose td {
  padding: 10px 12px 10px 0;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.prose th {
  font-weight: 600;
  border-bottom-color: var(--line-strong);
}

/* Footer */

.site-footer {
  width: 100%;
  max-width: calc(var(--content) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 24px var(--gutter) 40px;
  border-top: 1px solid var(--line);
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink-soft);
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
}

.site-footer nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink-soft);
}

.site-footer nav a[aria-current="page"] {
  color: var(--ink);
  text-decoration-color: var(--ink);
}

.site-footer p {
  margin: 8px 0 0;
  color: var(--ink-faint);
}

@media (max-width: 480px) {
  body {
    font-size: 17px;
  }
  .home {
    padding-top: 32px;
  }
}
