/* The one stylesheet of the Typedfont site. The site's own chrome is set
   in Morela; samples and showcases choose their fonts through the classes
   generated in /fonts.css. */

:root {
  color-scheme: light dark;
  --ink: #16181d;
  --paper: #f4f2ec;
  --card: #fbfaf7;
  --quiet: #5d626c;
  --rule: #d9d6cf;
  --accent: #1f5d8c;
  --on-accent: #ffffff;
  --ok: #2f6b3a;
  --warn: #9a5a12;
  --bad: #a23b2c;
  --measure: 38rem;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #ecebe7;
    --paper: #101216;
    --card: #181b20;
    --quiet: #a2a6ae;
    --rule: #33373e;
    --accent: #8fc1e8;
    --on-accent: #101216;
    --ok: #9fd0a2;
    --warn: #e3b071;
    --bad: #e2806f;
  }
}

* { box-sizing: border-box; }
html { font-synthesis: none; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.5 "Morela", sans-serif;
  font-kerning: normal;
}
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.15; margin: 0; }
h1 { font: 700 clamp(2rem, 5vw, 3.2rem)/1.05 "Lodusa", sans-serif; }
h2 { font-size: 1.5rem; font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 700; }
p, ul, ol, dl, figure, blockquote { margin: 0; }
code, pre { font-family: "Morela Mono", monospace; font-size: .92em; }

/* ---- layout primitives ---- */
.center { max-width: 72rem; margin-inline: auto; padding-inline: 1rem; }
.stack > * + * { margin-top: 1rem; }
.cluster { display: flex; flex-wrap: wrap; gap: .6rem 1.1rem; align-items: center; }
.grid { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); }
.plain { list-style: none; padding: 0; }
main.center { padding-block: 2.5rem 4rem; }
main.stack > * + * { margin-top: 3rem; }

/* ---- header and footer ---- */
.site-header { border-bottom: 1px solid var(--rule); }
.site-nav { padding-block: .9rem; justify-content: space-between; }
.site-nav ul { list-style: none; padding: 0; margin: 0; font-size: .95rem; }
.site-nav a { color: var(--quiet); text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current] { color: var(--ink); }
.site-nav a[aria-current] { font-weight: 500; }
.brand { font: 900 1.35rem/1 "Lodusa", sans-serif; color: var(--ink) !important; }
.site-footer { border-top: 1px solid var(--rule); color: var(--quiet); font-size: .9rem; padding-block: 1.4rem; }

/* ---- shared pieces ---- */
.hero { max-width: var(--measure); }
.lede { font-size: 1.25rem; color: var(--quiet); }
.meta { color: var(--quiet); font-size: .9rem; }
.tagline { color: var(--quiet); }
.button {
  display: inline-block; padding: .45rem .95rem; border: 1px solid var(--rule); border-radius: 8px;
  color: var(--ink); text-decoration: none; font-weight: 500; font-size: .95rem; background: var(--card);
}
.button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.card { background: var(--card); border: 1px solid var(--rule); border-radius: 12px; padding: 1.4rem 1.5rem 1.5rem; }
.card-title { font-size: 2.4rem; }
.tags li { border: 1px solid var(--rule); border-radius: 999px; padding: .1rem .7rem; font-size: .88rem; color: var(--quiet); }
.sample { font-size: 1.15rem; line-height: 1.4; overflow-wrap: anywhere; }
dt { font-weight: 500; margin-top: .6rem; }
dd { margin: 0; color: var(--quiet); }

/* ---- collection page ---- */
.family { border-top: 1px solid var(--rule); padding-top: 1.4rem; }
.faces .face { display: grid; grid-template-columns: 8.5rem 1fr; gap: 1rem; align-items: baseline; padding: .35rem 0; }
.face-name { color: var(--quiet); font-size: .85rem; }
.faces .sample { font-size: 1.45rem; }
@media (max-width: 40rem) { .faces .face { grid-template-columns: 1fr; gap: 0; } }

/* ---- showcases: fonts come from the pairing's custom properties ---- */
.picker a { padding: .15rem .7rem; border: 1px solid var(--rule); border-radius: 999px; text-decoration: none; color: var(--quiet); font-size: .92rem; }
.picker a[aria-current] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.showcase { display: grid; gap: 1.5rem; }
.page { background: var(--card); border: 1px solid var(--rule); border-radius: 12px; padding: clamp(1.2rem, 4vw, 3rem); font-family: var(--text), serif; }
.page > * { max-width: var(--measure); }
.page > * + * { margin-top: .9rem; }
.page h2, .page h3, .page th, .page .kicker, .page .app-name { font-family: var(--head), sans-serif; }
.page h2 { font-size: 1.9rem; }
.page h3 { margin-top: 1.8rem; }
.page code, .page pre { font-family: var(--mono), monospace; }
.kicker { font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--quiet); }
.lead-in { font-variant-caps: small-caps; letter-spacing: .04em; }
.footnote { font-size: .85rem; color: var(--quiet); border-top: 1px solid var(--rule); padding-top: .7rem; margin-top: 1.6rem; }

.prose { font-size: 1.15rem; line-height: 1.5; font-variant-numeric: oldstyle-nums; }
.prose p { hyphens: auto; }
.prose blockquote { border-left: 3px solid var(--rule); padding-left: 1.1rem; font-style: italic; color: var(--quiet); }

.document { font-size: 1.05rem; }
.document ol { padding-left: 1.4rem; }
.document li + li { margin-top: .4rem; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: .45rem .8rem .45rem 0; border-bottom: 1px solid var(--rule); font-weight: 400; }
thead th, tfoot th { font-weight: 700; }
.num { text-align: right; font-variant-numeric: tabular-nums lining-nums; }

.page.code > * { max-width: none; }
.code figure { border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; }
.code figcaption { font-family: var(--head), sans-serif; font-size: .82rem; color: var(--quiet); padding: .4rem .9rem; border-bottom: 1px solid var(--rule); }
.code pre { margin: 0; padding: .9rem; overflow-x: auto; line-height: 1.5; font-size: .9rem; }

.page.app { display: grid; grid-template-columns: 11rem 1fr; gap: 0; padding: 0; overflow: hidden; font-size: .95rem; }
.page.app > * { max-width: none; margin-top: 0; }
.app aside { border-right: 1px solid var(--rule); padding: 1.2rem 1rem; }
.app-name { font-weight: 700; font-size: 1.1rem; margin-bottom: .8rem; }
.app aside li { padding: .3rem .6rem; border-radius: 6px; color: var(--quiet); }
.app aside li.current { background: var(--paper); color: var(--ink); font-weight: 500; }
.app-main { padding: 1.2rem 1.4rem 1.6rem; }
.app-main h2 { font-size: 1.4rem; margin-right: auto; }
.panel { border: 1px solid var(--rule); border-radius: 8px; padding: 1rem 1.1rem; }
.field { display: grid; grid-template-columns: 7rem 1fr; gap: .8rem; align-items: center; }
.field label { color: var(--quiet); }
.field input, .tester input, .tester select, .tester textarea {
  font: inherit; color: inherit; background: var(--paper); border: 1px solid var(--rule); border-radius: 6px; padding: .35rem .6rem;
}
.badge { font-size: .82rem; font-weight: 500; padding: .05rem .55rem; border-radius: 999px; border: 1px solid currentColor; }
.badge.ok { color: var(--ok); } .badge.warn { color: var(--warn); } .badge.bad { color: var(--bad); }
@media (max-width: 40rem) { .page.app { grid-template-columns: 1fr; } .app aside { border-right: 0; border-bottom: 1px solid var(--rule); } }

/* ---- type tester ---- */
.tester > div { display: grid; gap: 1.2rem; }
.tester .controls { background: var(--card); border: 1px solid var(--rule); border-radius: 12px; padding: 1rem 1.2rem; }
.tester label { display: flex; gap: .5rem; align-items: center; color: var(--quiet); font-size: .92rem; white-space: nowrap; }
.tester input[type="range"] { width: 12rem; padding: 0; }
.tester output { color: var(--ink); min-width: 3.5em; }
.tester textarea {
  width: 100%; min-height: 14rem; resize: vertical; padding: 1.2rem 1.4rem; border-radius: 12px;
  background: var(--card); line-height: 1.25; overflow-wrap: anywhere;
}
