@font-face {
  font-family: "Source Serif 4";
  src: url("fonts/source-serif-4-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

@font-face {
  font-family: "Public Sans";
  src: url("fonts/public-sans-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

/* Each color is a light/dark pair. The system setting picks one unless theme.js has set data-theme. */
:root {
  color-scheme: light dark;
  --paper: light-dark(#f2f4f7, #0f1a2e);
  --ink: light-dark(#15264a, #e9edf4);
  --text: light-dark(#28344c, #c3cad7);
  --muted: light-dark(#5c6880, #8e99ae);
  --rule: light-dark(#c9d0db, #2b3a55);
  --serif: "Source Serif 4", Georgia, serif;
  --sans: "Public Sans", system-ui, sans-serif;
  --gutter: clamp(20px, 5vw, 56px);
  /* Left margin column that holds section names, like the side column on company stationery. */
  --margin-col: 10rem;
  --col-gap: clamp(2rem, 5vw, 4.5rem);
}

:root[data-theme="light"] {
  color-scheme: light;
}

:root[data-theme="dark"] {
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--paper);
}

h1,
h2,
h3,
p,
ul,
dl,
dd {
  margin: 0;
  padding: 0;
}

p {
  text-wrap: pretty;
}

a {
  color: var(--ink);
  text-decoration-color: color-mix(in srgb, var(--ink) 35%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-color: var(--ink);
}

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

.page {
  max-width: 70rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Letterhead */

.letterhead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem 2rem;
  padding-block: 2.25rem 2rem;
  border-bottom: 1px solid var(--rule);
}

.lockup {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-family: var(--serif);
  font-size: 1.375rem;
  font-weight: 600;
  line-height: 1.08;
  color: var(--ink);
  text-decoration: none;
}

.mark {
  flex: none;
  width: auto;
  height: 3.75rem;
}

/* Navy cat on the light page, white cat on the dark one. */
.mark-dark {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .mark-light {
    display: none;
  }

  :root:not([data-theme="light"]) .mark-dark {
    display: block;
  }
}

:root[data-theme="dark"] .mark-light {
  display: none;
}

:root[data-theme="dark"] .mark-dark {
  display: block;
}

.lockup-name {
  padding-left: 1rem;
  border-left: 1px solid var(--rule);
}

.lockup-name > span {
  display: block;
}

.letterhead nav {
  display: flex;
  gap: 1.75rem;
  font-size: 0.9375rem;
  font-weight: 500;
}

.letterhead nav a {
  text-decoration: none;
}

.letterhead nav a:hover,
.theme-toggle:hover {
  text-decoration: underline;
}

.theme-toggle {
  padding: 0 0 0 1.75rem;
  border: 0;
  border-left: 1px solid var(--rule);
  background: none;
  font: inherit;
  color: var(--ink);
  text-underline-offset: 0.2em;
  cursor: pointer;
}

/* Two-column rows: section name in the margin, content beside it */

.row {
  display: grid;
  grid-template-columns: var(--margin-col) minmax(0, 1fr);
  column-gap: var(--col-gap);
  align-items: baseline;
}

.lede {
  padding-block: clamp(3.5rem, 8vw, 6.5rem) clamp(0.5rem, 2vw, 1.5rem);
}

.lede > * {
  grid-column: 2;
}

.statement {
  max-width: 40ch;
  font-family: var(--serif);
  font-size: clamp(1.75rem, 1.1rem + 2.4vw, 2.625rem);
  font-weight: 400;
  line-height: 1.22;
  color: var(--ink);
  text-wrap: pretty;
}

.lede .statement + p {
  max-width: 52ch;
  margin-top: 1.25rem;
}

.entry {
  padding-top: clamp(3rem, 6vw, 4.5rem);
}

.entry h2 {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
}

.entry-body {
  max-width: 44rem;
}

/* App list */

.apps {
  list-style: none;
}

.app + .app {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
}

.app h3 {
  font-family: var(--serif);
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink);
}

.app p {
  max-width: 58ch;
  margin-top: 0.5rem;
}

.facts {
  display: grid;
  /* Fixed columns so Platforms, Status and Website line up from one entry to the next. */
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem 2rem;
}

.app .facts {
  margin-top: 1.25rem;
}

.facts dt {
  font-size: 0.875rem;
  color: var(--muted);
}

/* Contact */

address {
  font-style: normal;
}

/* Two columns here; the email address is too long for a third of the row. */
.contacts .facts {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.site-footer {
  margin-top: clamp(4rem, 9vw, 7rem);
  padding-block: 1.5rem 3rem;
  border-top: 1px solid var(--rule);
  font-size: 0.875rem;
  color: var(--muted);
}

@media (max-width: 720px) {
  .row {
    grid-template-columns: minmax(0, 1fr);
  }

  .lede > * {
    grid-column: 1;
  }

  .entry h2 {
    margin-bottom: 1rem;
  }

  .facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .contacts .facts {
    grid-template-columns: minmax(0, 1fr);
  }
}
