/* Modelworks - the launch storefront. Decisions and why: DESIGN.md. */

@font-face {
  font-family: "Plex Sans";
  src: url("fonts/IBMPlexSans-var.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Plex Serif";
  src: url("fonts/IBMPlexSerif-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Plex Serif";
  src: url("fonts/IBMPlexSerif-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #fcfcfa;
  --ink: #14161a;
  --muted: #5b6169;
  --rule: #e3e4e1;
  --signal: #0e6b5c;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { color-scheme: light; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Plex Sans", system-ui, sans-serif;
  font-size: 1.125rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* The chrome runs wide; the reading column inside it is centred, so the page
   does not sit against the left edge of a wide screen with a dead margin on
   the right. */
main > section,
main > .hero {
  max-width: 1080px;
  margin-left: auto;
  margin-right: auto;
}

/* The page uses the width the screen gives it; prose keeps a readable measure
   of its own, so long lines do not run the full 1120px on a wide display. */
.wrap {
  max-width: min(1440px, 92vw);
  margin: 0 auto;
  padding: 0 2rem;
}

a { color: var(--signal); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Top bar */

.top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--rule);
}
.wordmark {
  font-family: "Plex Serif", Georgia, serif;
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--ink);
}
.top nav { display: flex; gap: 1.25rem; font-size: 0.9375rem; }
.top nav a { color: var(--muted); text-decoration: none; }
.top nav a:hover { color: var(--ink); }

/* Hero */

.hero { padding: 4.5rem 0 2.5rem; }
.hero h1 {
  font-family: "Plex Serif", Georgia, serif;
  font-weight: 600;
  font-size: clamp(2.35rem, 5.2vw, 4.15rem);
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0 0 1.25rem;
  text-wrap: balance;
}
.hero .lede {
  font-size: 1.1875rem;
  color: var(--muted);
  margin: 0 0 2rem;
}
.hero .actions { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: baseline; }
.hero .actions .primary {
  display: inline-block;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  padding: 0.7rem 1.3rem;
  font-weight: 500;
}
.hero .actions .primary:hover { background: var(--signal); }
.hero .actions .secondary { font-size: 0.9375rem; color: var(--muted); }

/* The one decorative device: a waveform rule. */

.wave { display: block; width: 100%; height: 44px; margin: 2.5rem 0 0; }
.wave path { fill: none; stroke: var(--rule); stroke-width: 1.5; }

/* Sections */

section { padding: 2.75rem 0; }
section + section { border-top: 1px solid var(--rule); }

h2 {
  font-family: "Plex Serif", Georgia, serif;
  font-weight: 600;
  font-size: 1.6rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 0 0 1.1rem;
}
p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

.quiet { color: var(--muted); }
.small { font-size: 0.9375rem; }

/* Tables - real numbers, so real tables. */

table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.25rem;
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
}
th, td {
  text-align: left;
  padding: 0.55rem 0.75rem 0.55rem 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
th {
  font-weight: 500;
  color: var(--muted);
  font-size: 0.8125rem;
  letter-spacing: 0.01em;
}
td.num, th.num { text-align: right; }
th + th, td + td { padding-left: 0.9rem; }
tr.us td { font-weight: 600; }

/* Reasons */

.reasons p { margin-bottom: 1.1rem; }
.reasons strong { font-weight: 600; }

/* Voice samples - the only part of the page that can be heard. */

.voices { list-style: none; margin: 0 0 1.25rem; padding: 0; }
.voices li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.4rem 1.25rem;
  align-items: center;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--rule);
}
.voices li:first-child { border-top: 1px solid var(--rule); }
.voices .vlabel { font-size: 0.9375rem; }
.voices .vlabel code {
  display: block;
  color: var(--muted);
  font-size: 0.8125rem;
  margin-top: 0.15rem;
}
.voices audio { width: 260px; max-width: 100%; height: 36px; }

/* Code */

pre {
  background: #f4f5f2;
  border: 1px solid var(--rule);
  padding: 1rem 1.1rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.875rem;
  line-height: 1.55;
  margin: 0 0 1rem;
}
code { font-family: var(--mono); font-size: 0.9em; }

/* Footer */

footer {
  border-top: 1px solid var(--rule);
  padding: 2rem 0 3rem;
  font-size: 0.875rem;
  color: var(--muted);
}
footer nav { display: flex; flex-wrap: wrap; gap: 1.25rem; margin-bottom: 1rem; }
footer a { color: var(--muted); }
footer a:hover { color: var(--ink); }

@media (max-width: 560px) {
  .wrap { padding: 0 1.05rem; }
  .hero { padding: 3rem 0 1.5rem; }
  .top nav { gap: 0.9rem; }
  th, td { padding-right: 0.5rem; }
  .voices li { grid-template-columns: 1fr; }
  .voices audio { width: 100%; }
}
