/* First iteration: the look of the business card. White on black; the address and
   motto in IBM Plex Mono, the email in JetBrains Mono, running text in IBM Plex Sans.
   The tracking values are the card's. */

@font-face {
  font-family: "IBM Plex Mono";
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-400.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Mono";
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-500.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Mono";
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-600.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Sans";
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/ibm-plex-sans-400.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Sans";
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/ibm-plex-sans-500.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Sans";
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/ibm-plex-sans-700.woff2") format("woff2");
}

@font-face {
  font-family: "JetBrains Mono";
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/jetbrains-mono-400.woff2") format("woff2");
}

:root {
  --ground: #000;
  --ink: #fff;
  --muted: #9a9a9a;
  --rule: #2e2e2e;
  --warn-ground: #ffd400;
  --warn-ink: #000;

  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --mono-contact: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --text: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --measure: 46rem;
  --wide: 60rem;
  --gutter: 1rem;
}

* {
  box-sizing: border-box;
}

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

.masthead,
main,
.contact {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.masthead {
  padding-top: 6rem;
  padding-bottom: 3rem;
  font-family: var(--mono);
  text-align: center;
}

.address {
  color: var(--ink);
  font-size: clamp(1.5rem, 7vw, 2.25rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: 0.05em;
  text-decoration: none;
}

.motto {
  margin: 1rem 0 0;
  font-size: clamp(0.875rem, 3.9vw, 1.25rem);
  letter-spacing: 0.12em;
}

/* An inner page keeps the address and motto, smaller, above the bar of services. */
.inner .masthead {
  padding-top: 2.5rem;
  padding-bottom: 2.5rem;
}

.inner .address {
  font-size: 1.25rem;
}

.inner .motto {
  margin-top: 0.5rem;
  font-size: 0.8125rem;
}

.services-bar {
  display: flex;
  justify-content: center;
  gap: clamp(0.75rem, 4vw, 2rem);
  margin-top: 2rem;
  border-bottom: 1px solid var(--rule);
}

.services-bar a {
  padding: 0.5rem 0;
  margin-bottom: -1px;
  border-bottom: 1px solid transparent;
  color: var(--muted);
  font-size: clamp(0.8125rem, 3.6vw, 1rem);
  text-decoration: none;
}

.services-bar a:hover,
.services-bar a[aria-current="page"] {
  border-bottom-color: var(--ink);
  color: var(--ink);
}

main {
  padding-bottom: 4rem;
}

h1 {
  margin: 0 0 1.5rem;
  font-family: var(--mono);
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: lowercase;
}

/* The services at the top of the home page: plain monospace text in two columns,
   names on the left. A line too long for a phone wraps under its own column. */
.services {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.6rem 1.5rem;
  margin: 1.5rem 0 1rem;
  font-family: var(--mono);
  font-size: 1rem;
  line-height: 1.6;
}

.services dt,
.services dd {
  margin: 0;
}

/* On a phone, each line goes under its name rather than squeezing beside it. */
@media (max-width: 34rem) {
  .services {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .services dd {
    margin-bottom: 1rem;
  }
}

.services a {
  font-weight: 600;
}

/* The email, bottom right as on the card. The rule is on the link so that it lines
   up with the rules above the headings. */
.contact {
  padding-bottom: 3rem;
  text-align: right;
  font-size: 0.875rem;
}

.contact a {
  display: block;
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
}

h2 {
  margin: 3rem 0 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: lowercase;
  color: var(--muted);
}

/* The home page's thesis, the statement the cartoon leads to: a heading in the
   reader's own case, not a section label. */
h2.thesis {
  margin: 0 0 1.5rem;
  padding-top: 0;
  border-top: 0;
  font-family: var(--text);
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--ink);
}

/* A rule between parts of a page, matching the ones above section headings. */
hr {
  margin: 3rem 0 0;
  border: 0;
  border-top: 1px solid var(--rule);
}

a {
  color: var(--ink);
}

/* An image may run wider than the text column, up to the window, and stays centered
   on it. */
main img {
  display: block;
  width: min(100vw - 2 * var(--gutter), var(--wide));
  max-width: none;
  height: auto;
  margin: 3rem 0 3rem 50%;
  transform: translateX(-50%);
}

a[href^="mailto:"] {
  font-family: var(--mono-contact);
  letter-spacing: 0.03em;
}

.stopgap {
  margin: 0;
  padding: 0.5rem var(--gutter);
  background: var(--warn-ground);
  color: var(--warn-ink);
  font-family: var(--mono);
  text-align: center;
}
