:root {
  color-scheme: light;
  --bg: #ffffff;
  --fg: #000000;
  --line: 3px;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Corte", "Helvetica Neue", Arial, sans-serif;
  font-size: 18px;
  line-height: 1.5;
  font-synthesis: none;
}

a { color: inherit; text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 5px; }
a:hover { text-decoration: none; }
:focus-visible { outline: 3px solid var(--fg); outline-offset: 3px; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px); }

header { border-bottom: var(--line) solid var(--fg); }
header .wrap { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 32px; padding-top: 20px; padding-bottom: 20px; }
.mark { margin: 0; font-size: 28px; line-height: 1; }
nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }

section { border-bottom: var(--line) solid var(--fg); padding: clamp(32px, 6vw, 72px) 0; }
h2 { margin: 0 0 24px; font-size: clamp(36px, 6vw, 64px); font-weight: 700; line-height: 1.05; }
h3 { margin: 32px 0 8px; font-size: 24px; font-weight: 700; line-height: 1.2; }
strong, b { font-weight: 700; }
em, i { font-style: italic; }

/* tester */
#tester { padding-bottom: 32px; }
.stage {
  --k: 1;
  margin: 0;
  font-size: calc(clamp(80px, 22vw, 320px) * var(--k));
  font-weight: 400;
  line-height: 1;
  min-height: 1.1em;
  overflow-wrap: anywhere;
  outline-offset: 8px;
  cursor: text;
}
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-top: 32px; font-size: 16px; }
.controls label { display: flex; align-items: center; gap: 12px; }
input[type="range"] { accent-color: var(--fg); width: min(260px, 60vw); }

/* style switch */
.styles { display: flex; flex-wrap: wrap; gap: var(--line); }
.styles button {
  font: inherit;
  font-size: 16px;
  padding: 8px 16px;
  background: var(--bg);
  color: var(--fg);
  border: var(--line) solid var(--fg);
  border-radius: 0;
  cursor: pointer;
}
.styles button[aria-pressed="true"] { background: var(--fg); color: var(--bg); }
.styles button:focus-visible { outline: 3px solid var(--fg); outline-offset: 3px; }

/* styles */
.specimens { display: grid; gap: 0; border: var(--line) solid var(--fg); }
.specimens > div { padding: 20px 24px; border-bottom: var(--line) solid var(--fg); }
.specimens > div:last-child { border-bottom: 0; }
.specimens .label { margin: 0 0 8px; font-size: 14px; font-weight: 400; font-style: normal; letter-spacing: .02em; }
.specimens .big { margin: 0; font-size: clamp(32px, 6vw, 64px); line-height: 1.1; overflow-wrap: anywhere; }
.w300 { font-weight: 300; font-style: normal; }
.w300i { font-weight: 300; font-style: italic; }
.w400 { font-weight: 400; font-style: normal; }
.w400i { font-weight: 400; font-style: italic; }
.w700 { font-weight: 700; font-style: normal; }
.w700i { font-weight: 700; font-style: italic; }

/* characters */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: var(--line);
  background: var(--fg);
  border: var(--line) solid var(--fg);
}
.grid button {
  font: inherit;
  font-size: 40px;
  line-height: 1;
  aspect-ratio: 1;
  background: var(--bg);
  color: var(--fg);
  border: 0;
  border-radius: 0;
  cursor: pointer;
  padding: 0;
}
.grid .cell-fill { background: var(--bg); aspect-ratio: 1; }
.grid button:hover, .grid button:focus-visible { background: var(--fg); color: var(--bg); outline: none; }
.hint { margin: 16px 0 0; font-size: 16px; }

/* text sizes */
.sample { margin: 0 0 24px; }
.s48 { font-size: clamp(32px, 6vw, 48px); line-height: 1.15; max-width: 24ch; }
.s24 { font-size: 24px; line-height: 1.3; max-width: 44ch; }
.s16 { font-size: 16px; line-height: 1.5; max-width: 62ch; margin-bottom: 0; }

/* use it */
.lead { margin: 0 0 24px; max-width: 52ch; }
.table { width: 100%; max-width: 640px; border-collapse: collapse; margin: 0 0 24px; font-size: 16px; }
.table th, .table td { text-align: left; padding: 8px 12px; border: var(--line) solid var(--fg); font-weight: 400; }
.table th { font-weight: 700; }
.code {
  margin: 0 0 24px;
  padding: 20px;
  overflow-x: auto;
  border: var(--line) solid var(--fg);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 15px;
  line-height: 1.6;
}
.downloads { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0; }
