/* Black, white, one gray, one hairline. */

:root {
  color-scheme: light dark;
  --bg: #fff;
  --fg: #000;
  --muted: #595959;
  --line: #d9d9d9;
}

/* Dark mode inverts. The two grays trade places so secondary text stays readable. */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000;
    --fg: #fff;
    --muted: #d9d9d9;
    --line: #595959;
  }
}

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

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 1.125rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

h1, h2, h3, p, ul, ol { margin: 0; padding: 0; }
h1, h2, h3 { font-weight: 700; text-wrap: balance; }
p, li { text-wrap: pretty; }
ul, ol { list-style: none; }

a {
  color: var(--fg);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover { text-decoration-thickness: 2px; }

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

/* The main landmark takes focus from the skip link and needs no ring. */
main:focus { outline: none; }

.wrap {
  width: 100%;
  max-width: 960px;
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 3rem);
}

.nowrap { white-space: nowrap; }

.skip {
  position: absolute;
  left: 8px;
  top: -80px;
  z-index: 1;
  padding: 8px 16px;
  background: var(--bg);
}

.skip:focus { top: 8px; }

/* Header */

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  column-gap: 32px;
  row-gap: 8px;
  padding-block: 16px;
}

.site-header a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
}

.wordmark {
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
}

nav ul {
  display: flex;
  flex-wrap: wrap;
  column-gap: 24px;
  font-size: 1rem;
}

nav a { white-space: nowrap; }

/* Hero */

.hero { padding-block: 64px 48px; }

h1 {
  font-size: clamp(2.75rem, 8vw, 6rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
}

h1 span { display: block; }

.subhead {
  max-width: 32em;
  margin-top: 32px;
  font-size: 1.25rem;
  line-height: 1.5;
  color: var(--muted);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  max-width: 100%;
  margin-top: 40px;
  padding: 12px 32px;
  border: 2px solid var(--fg);
  border-radius: 0;
  background: var(--fg);
  color: var(--bg);
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
}

.button:hover,
.button:focus-visible {
  background: var(--bg);
  color: var(--fg);
}

/* Sections: 48px each side of a hairline makes 96px. 32px each side makes 64px on mobile. */

.section,
.site-footer { position: relative; }

.section { padding-block: 48px; }

.section::before,
.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  right: clamp(1.25rem, 5vw, 3rem);
  left: clamp(1.25rem, 5vw, 3rem);
  border-top: 1px solid var(--line);
}

h2 {
  margin-bottom: 32px;
  font-size: 1.75rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

/* Expertise */

.expertise { counter-reset: item; }

.expertise li {
  counter-increment: item;
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  column-gap: 16px;
  padding-block: 24px;
  border-top: 1px solid var(--line);
}

.expertise li:first-child {
  padding-top: 0;
  border-top: 0;
}

.expertise li:last-child { padding-bottom: 0; }

.expertise li::before {
  content: counter(item, decimal-leading-zero);
  grid-row: 1 / span 2;
  font-size: 1rem;
  line-height: 1.8;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

h3 {
  font-size: 1.25rem;
  line-height: 1.44;
  letter-spacing: -0.01em;
}

.expertise p {
  max-width: 36em;
  margin-top: 8px;
  font-size: 1rem;
  color: var(--muted);
}

/* Who I work with */

.statement {
  max-width: 12em;
  font-size: clamp(2rem, 5.5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.plain { margin-top: 32px; }
.plain li + li { margin-top: 8px; }

.closing {
  margin-top: 32px;
  font-weight: 700;
}

/* Track record */

.record li {
  padding-block: 16px;
  border-top: 1px solid var(--line);
}

.record li:first-child {
  padding-top: 0;
  border-top: 0;
}

.record li:last-child { padding-bottom: 0; }

/* Inline links get a taller hit area without moving the lines around them. */
.record a { padding-block: 12px; }

/* Kind words. The quote marks are decoration: the empty alt text keeps screen readers
   from announcing them. The first content line serves older browsers. */

.testimonial { margin: 0; }

.testimonial blockquote {
  max-width: 38em;
  margin: 0;
  font-size: clamp(1.25rem, 3.2vw, 1.5rem);
  font-weight: 400;
  line-height: 1.5;
}

.testimonial blockquote p::before {
  content: "\22";
  content: "\22" / "";
}

.testimonial blockquote p::after {
  content: "\22";
  content: "\22" / "";
}

.testimonial figcaption {
  margin-top: 24px;
  font-size: 1rem;
  font-weight: 700;
}

/* The name keeps a 44px touch target without adding space. */
.testimonial figcaption a { display: inline-block; padding-block: 10px; margin-block: -10px; }

/* About */

.about { max-width: 34em; }

/* Contact */

.button-large {
  min-height: 64px;
  margin-top: 0;
  font-size: clamp(1rem, 4.5vw, 1.5rem);
  overflow-wrap: anywhere;
}

.social {
  display: flex;
  column-gap: 32px;
  margin-top: 24px;
}

.social a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
}

/* Footer */

.site-footer {
  padding-block: 32px 48px;
  font-size: 1rem;
  color: var(--muted);
}

/* 404 */

.not-found { padding-block: 64px 96px; }

/* Narrow screens: the nav becomes a two by two grid. */

@media (max-width: 599px) {
  nav { width: 100%; }

  nav ul {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 16px;
  }

  .hero { padding-block: 48px 32px; }
  .section { padding-block: 32px; }
  h2 { margin-bottom: 24px; }

  .expertise li {
    grid-template-columns: 2rem minmax(0, 1fr);
    column-gap: 12px;
  }

  .button { width: 100%; }
  .button-large { padding-inline: 12px; }
}

@media (min-width: 600px) {
  .hero { padding-block: 96px 48px; }
}

/* On the narrowest phones, "Real momentum." needs a hair less size to hold one line. */
@media (max-width: 379px) {
  h1 { font-size: 2.65rem; }
  .statement { font-size: 1.75rem; }
}

/* Print: black on white, even when the screen is dark. */

@media print {
  :root {
    --bg: #fff;
    --fg: #000;
    --muted: #595959;
    --line: #d9d9d9;
  }

  body { font-size: 10.5pt; line-height: 1.5; }
  .skip, nav { display: none; }
  .wrap { max-width: none; padding-inline: 0; }
  .section::before, .site-footer::before { right: 0; left: 0; }
  .hero, .section, .site-footer, .not-found { padding-block: 12pt; }
  h2 { margin-bottom: 10pt; font-size: 15pt; }
  h3 { font-size: 12pt; }
  .expertise li, .record li { padding-block: 6pt; }
  .expertise li:first-child, .record li:first-child { padding-top: 0; }
  .expertise li:last-child, .record li:last-child { padding-bottom: 0; }
  .expertise p { margin-top: 2pt; font-size: 10pt; }
  .plain, .closing { margin-top: 10pt; }
  .record a { padding-block: 0; }
  .testimonial blockquote { font-size: 13pt; }
  .testimonial figcaption { margin-top: 10pt; }
  h1 { font-size: 36pt; }
  .statement { font-size: 22pt; }
  h2, h3 { break-after: avoid; }
  li, .about, .testimonial { break-inside: avoid; }

  .button {
    width: auto;
    min-height: 0;
    margin-top: 12pt;
    padding: 6pt 10pt;
    background: var(--bg);
    color: var(--fg);
    font-size: 11pt;
  }

  .button-large { margin-top: 0; }

  /* Paper cannot be clicked, so show where links go. */
  .record a[href^="https://"]::after,
  .testimonial figcaption a::after,
  .social a::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    overflow-wrap: anywhere;
  }

  .social { flex-direction: column; margin-top: 8pt; }
  .social a { min-height: 0; }
}
