/* icemintdata.com, set to docs/site-design.md v2: one typeface, four colours, a ruled register of labels and text. */
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/IBMPlexSans-Regular-latin.66048209a9a9.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/IBMPlexSans-SemiBold-latin.876120ed0f82.woff2") format("woff2");
}

/* The system face sized to Plex's metrics, so the swap does not reflow the page. */
@font-face {
  font-family: "IBM Plex Sans Fallback";
  src: local("Helvetica Neue"), local("Arial");
  size-adjust: 108%;
  ascent-override: 95%;
  descent-override: 25.5%;
  line-gap-override: 0%;
}

:root {
  color-scheme: light dark;
  --paper: #f4f6f4;
  --ink: #161b19;
  --quiet: #59645f;
  --ledger: #1f4e79;
  --hair: color-mix(in srgb, var(--ink) 14%, var(--paper));
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 40px;
  --s8: 56px;
  --s9: 80px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f1412;
    --ink: #e4e9e6;
    --quiet: #9da8a2;
    --ledger: #8fc4e4;
  }
}

html {
  background: var(--paper);
}

body {
  margin: 0;
  padding: 0 20px var(--s8);
  background: var(--paper);
  color: var(--ink);
  font-family: "IBM Plex Sans", "IBM Plex Sans Fallback", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
}

header,
main,
footer {
  max-width: 828px;
  margin-left: auto;
  margin-right: auto;
}

h1,
h2,
p,
ul {
  margin: 0;
}

h1 {
  font-size: 2rem;
  line-height: calc(1em + 4px);
  font-weight: 600;
}

h2 {
  font-size: 1.375rem;
  line-height: 1.75rem;
  font-weight: 600;
  scroll-margin-top: var(--s5);
}

p,
li {
  overflow-wrap: anywhere;
}

header {
  padding-top: var(--s5);
}

/* The wordmark: the mark, 8 px, then the name in the display weight; a 44 px target where it is a link. */
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  padding: 10px 0;
  color: var(--ink);
  font-size: 1.0625rem;
  line-height: 1.5rem;
  font-weight: 600;
  text-decoration: none;
}

.mark {
  display: block;
  width: 16px;
  height: 20px;
  color: var(--ledger);
}

.mark .bar {
  fill: var(--paper);
}

main {
  margin-top: 48px;
  margin-bottom: var(--s8);
}

.title {
  margin-bottom: 48px;
}

.title p {
  max-width: 540px;
  margin-top: var(--s4);
}

/* Each entry opens with a hairline; the space after its text is larger than the space inside it. */
section {
  border-top: 1px solid var(--hair);
  padding-top: var(--s5);
  padding-bottom: var(--s6);
}

section p {
  margin-top: var(--s2);
}

/* The last entry's space is the 56 px main margin to the footer hairline, not its own padding. */
section:last-of-type {
  padding-bottom: 0;
}

.standalone {
  margin-top: var(--s6);
}

footer {
  border-top: 1px solid var(--hair);
  padding-top: var(--s5);
  color: var(--quiet);
  font-size: 1rem;
  line-height: 1.5rem;
}

footer ul {
  list-style: none;
  padding: 0;
}

a {
  color: var(--ledger);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-skip-ink: auto;
  border-radius: 2px;
}

/* Standalone links are 44 px tall targets; prose links stay prose. */
.standalone a,
footer a {
  display: inline-block;
  padding: 10px 0;
}

/* States come last so they win over the link rules above at equal specificity. */
a:hover,
a:active {
  color: var(--ink);
  text-decoration-thickness: 2px;
}

a:focus-visible {
  outline: 2px solid var(--ledger);
  outline-offset: 3px;
}

a.wordmark:hover,
a.wordmark:active {
  text-decoration-line: underline;
}

@media (prefers-reduced-motion: no-preference) {
  a {
    transition: text-decoration-color 120ms, outline-color 120ms;
  }
}

/* Off-canvas until focused, then the first tab stop, top left, 44 px tall. */
.skip {
  position: absolute;
  top: -6rem;
  left: 20px;
  padding: 10px var(--s3);
  background: var(--paper);
  font-size: 1rem;
  line-height: 1.5rem;
}

.skip:focus {
  top: var(--s2);
  outline: 2px solid var(--ledger);
  outline-offset: 0;
}

/* From 880 px: 240 px label column, 48 px gap, 540 px text column; 200 percent zoom at 1280 is 640 CSS px and stays single column. */
@media (min-width: 880px) {
  h1 {
    font-size: 2.5rem;
    letter-spacing: -0.02em;
  }

  main {
    display: grid;
    grid-template-columns: 240px minmax(0, 540px);
    column-gap: 48px;
  }

  .title {
    grid-column: 1 / -1;
  }

  /* Subgrid rather than display: contents, so each aria-labelledby region survives for assistive tech. */
  section {
    display: grid;
    grid-template-columns: subgrid;
    grid-column: 1 / -1;
    column-gap: 48px;
    align-items: baseline;
    padding-bottom: var(--s7);
  }

  h2 {
    grid-column: 1;
  }

  section p {
    grid-column: 2;
    margin-top: 0;
  }

  .standalone {
    grid-column: 2;
    margin-top: var(--s7);
  }

  footer ul {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: var(--s7);
  }
}
