/* Phase Six. System fonts, one small palette, no third-party requests.
   Every text color pair below meets WCAG 2.2 AA (most meet AAA) in both schemes. */

:root {
  color-scheme: light dark;
  --bg: #fbfaf7;
  --surface: #efece5;
  --ink: #1b1d21;
  --muted: #4b5058;
  --accent: #0a5c73;
  --rule: #d8d3c8;
  --measure: 38rem;
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171a;
    --surface: #23262b;
    --ink: #ecebe7;
    --muted: #b6bac0;
    --accent: #85cde0;
    --rule: #3a3e45;
  }
}

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

html {
  font-size: 100%;
  -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(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

.wrap {
  max-width: 54rem;
  margin-inline: auto;
  padding-inline: 1.25rem;
}

/* Skip link: off screen until focused, then a plain visible button. */
.skip-link {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  z-index: 10;
  padding: var(--space-1) var(--space-2);
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-300%);
}

.skip-link:focus {
  transform: none;
}

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

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

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

/* main takes focus from the skip link; it is not a control, so no ring. */
#main:focus {
  outline: none;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--rule);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-1) var(--space-3);
  padding-block: var(--space-2);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.75rem;
  color: var(--ink);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
}

.wordmark img {
  display: block;
  width: auto;
  height: 3.25rem;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: inline-block;
  padding-block: var(--space-1);
  color: var(--ink);
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.35em;
}

.site-nav a[aria-current="page"] {
  font-weight: 600;
}

/* Content */
main {
  padding-block: var(--space-4) var(--space-5);
}

h1,
h2,
h3 {
  line-height: 1.25;
  text-wrap: balance;
}

h1 {
  margin: 0 0 var(--space-2);
  font-size: clamp(1.9rem, 1.5rem + 1.6vw, 2.6rem);
  letter-spacing: -0.01em;
}

h2 {
  margin: var(--space-5) 0 var(--space-2);
  font-size: 1.5rem;
}

h3 {
  margin: 0 0 var(--space-1);
  font-size: 1.1875rem;
}

p,
ul {
  max-width: var(--measure);
}

p {
  margin: 0 0 var(--space-2);
}

.lede {
  color: var(--muted);
  font-size: 1.1875rem;
}

/* The four lines of work */
.services {
  display: grid;
  gap: var(--space-4);
  max-width: none;
  margin: 0;
  padding: 0;
  list-style: none;
}

.services li {
  padding-top: var(--space-2);
  border-top: 3px solid var(--accent);
}

.services p:last-child {
  margin-bottom: 0;
}

@media (min-width: 50rem) {
  .services {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4) var(--space-5);
  }
}

/* People */
.person {
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

/* Grid children may shrink below their longest word (an email address at 200% text). */
.person > *,
.services > li {
  min-width: 0;
}

.person + .person {
  padding-top: var(--space-4);
  border-top: 1px solid var(--rule);
}

.person h2 {
  margin: 0;
}

.role {
  margin: 0.25rem 0 var(--space-2);
  color: var(--muted);
}

.photo-placeholder {
  width: 100%;
  max-width: 12rem;
  aspect-ratio: 3 / 4;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 4px;
}

.photo {
  display: block;
  width: 100%;
  max-width: 12rem;
  height: auto;
  border-radius: 4px;
}

@media (min-width: 46rem) {
  .person {
    grid-template-columns: 12rem 1fr;
    align-items: start;
  }

  .person-body {
    grid-column: 2;
  }
}

/* Contact */
.contact-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.contact-list li {
  padding-block: var(--space-3);
  border-top: 1px solid var(--rule);
}

.contact-list li:last-child {
  border-bottom: 1px solid var(--rule);
}

.contact-list h2 {
  margin: 0;
}

.email {
  font-size: 1.1875rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.9375rem;
}

.site-footer .wrap {
  padding-block: var(--space-3);
}

.site-footer p {
  margin: 0;
}

/* Windows high contrast and other forced-color modes */
@media (forced-colors: active) {
  .photo-placeholder {
    border: 2px solid CanvasText;
  }

  .services li {
    border-top-color: CanvasText;
  }
}
