/* Black and white palette — all ratios 4.5:1 or better */

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

:root {
  --black: #000000;
  --white: #ffffff;
  --gray-dark: #333333;
  --gray-mid: #555555;
  --gray-light: #f5f5f5;
  --gray-border: #cccccc;
  --measure: 42em;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 4em;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--black);
  background: var(--white);
}

/* Skip link */
#skip {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 0.75em 1.5em;
  background: var(--black);
  color: var(--white);
  font-weight: 600;
  z-index: 100;
  text-decoration: none;
}

#skip:focus {
  left: 0;
}

/* Header / Nav */
header {
  border-bottom: 2px solid var(--black);
  padding: 1em 2em;
  position: sticky;
  top: 0;
  background: var(--white);
  z-index: 10;
}

nav {
  max-width: var(--measure);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75em;
}

#brand {
  display: flex;
  align-items: center;
  gap: 0.6em;
  text-decoration: none;
  color: var(--black);
}

#brand img {
  height: 2em;
  width: auto;
}

#brand span {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

#brand:focus-visible {
  outline: 3px solid var(--black);
  outline-offset: 3px;
}

nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5em;
}

nav a {
  color: var(--black);
  text-decoration: none;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}

nav a:hover,
nav a:focus {
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

nav a[aria-current="page"] {
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.25em;
  text-decoration-thickness: 2px;
}

/* Main sections */
main > section {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 3em 2em;
}

main > section + section {
  border-top: 1px solid var(--gray-border);
}

/* Hero */
section[aria-labelledby="hero-heading"] {
  padding-top: 4em;
  padding-bottom: 4em;
}

h1 {
  font-size: 2.25rem;
  line-height: 1.2;
  font-weight: 700;
  margin-bottom: 1em;
  letter-spacing: -0.01em;
}

/* Headings */
h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.75em;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 1.75em;
  margin-bottom: 0.5em;
}

h4 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}

/* Paragraphs */
p {
  margin-bottom: 1em;
}

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

/* Headshot (About) */
#headshot {
  float: right;
  width: 220px;
  max-width: 40%;
  height: auto;
  margin: 0.25em 0 1.25em 1.75em;
  border-radius: 10px;
}

@media (max-width: 600px) {
  #headshot {
    float: none;
    display: block;
    width: 200px;
    max-width: 60%;
    margin: 0 0 1.5em;
  }
}

/* Links */
a {
  color: var(--black);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1.5px;
}

a:hover,
a:focus {
  text-decoration-thickness: 3px;
}

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

/* Hero CTA link */
section[aria-labelledby="hero-heading"] > p:last-child a {
  display: inline-block;
  background: var(--black);
  color: var(--white);
  padding: 0.6em 1.5em;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  margin-top: 0.5em;
}

section[aria-labelledby="hero-heading"] > p:last-child a:hover,
section[aria-labelledby="hero-heading"] > p:last-child a:focus {
  background: var(--gray-dark);
}

section[aria-labelledby="hero-heading"] > p:last-child a:focus-visible {
  outline: 3px solid var(--black);
  outline-offset: 3px;
}

/* Service list (also reused for the home overview) */
#services > ul,
#overview > ul {
  list-style: none;
  margin: 1.5em 0;
}

#services > ul > li,
#overview > ul > li {
  padding: 1.25em 0;
}

#services > ul > li + li,
#overview > ul > li + li {
  border-top: 1px solid var(--gray-border);
}

#services > ul > li h2,
#overview > ul > li h3 {
  margin-top: 0;
}

/* Home page: tighten hero-to-overview spacing */
section[aria-labelledby="hero-heading"] {
  padding-top: 2em;
  padding-bottom: 2.5em;
}

#overview {
  padding-top: 1.5em;
}

#overview-heading {
  margin-bottom: 0.4em;
}

#overview > ul {
  margin-top: 0.75em;
}

/* Stress test deliverables list */
#stress-test ul {
  list-style: disc;
  padding-left: 1.5em;
  margin: 1em 0;
}

#stress-test li {
  margin-bottom: 0.4em;
}

/* Contact engagement basics list */
#contact ul {
  list-style: disc;
  padding-left: 1.5em;
  margin: 1em 0;
}

#contact li {
  margin-bottom: 0.4em;
}

/* Accordion (Common Questions) */
#questions details {
  border: 1px solid var(--gray-border);
  margin-bottom: 0.75em;
}

#questions details[open] {
  border-color: var(--black);
}

#questions summary {
  cursor: pointer;
  padding: 1em 1.25em;
  font-weight: 600;
  font-size: 1.05rem;
  list-style-position: inside;
}

#questions summary:hover {
  background: var(--gray-light);
}

#questions summary:focus-visible {
  outline: 3px solid var(--black);
  outline-offset: -3px;
}

#questions details[open] summary {
  border-bottom: 1px solid var(--gray-border);
}

#questions details p {
  padding: 0 1.25em;
}

#questions details p:first-of-type {
  padding-top: 1em;
}

#questions details p:last-of-type {
  padding-bottom: 1em;
}

/* Address block */
address {
  font-style: normal;
  margin-top: 1.5em;
  padding: 1.5em;
  border: 2px solid var(--black);
}

address p {
  margin-bottom: 0.4em;
}

/* Footer */
footer {
  border-top: 2px solid var(--black);
  padding: 2em;
  text-align: center;
  max-width: var(--measure);
  margin: 0 auto;
}

footer p {
  margin-bottom: 0.75em;
}

footer small {
  font-size: 0.85rem;
  color: var(--gray-mid);
}

/* Responsive */
@media (max-width: 600px) {
  h1 {
    font-size: 1.75rem;
  }

  h2 {
    font-size: 1.4rem;
  }

  header {
    padding: 0.6em 1em;
  }

  nav {
    flex-direction: column;
    align-items: flex-start;
  }

  #brand span {
    font-size: 1.1rem;
  }

  #brand img {
    height: 1.7em;
  }

  nav ul {
    gap: 0.6em 1.1em;
  }

  nav a {
    font-size: 0.875rem;
  }

  main > section {
    padding: 2em 1em;
  }

  footer {
    padding: 1.5em 1em;
  }
}

/* Very narrow viewports and high zoom (e.g., WCAG reflow at 320px) */
@media (max-width: 380px) {
  header {
    padding: 0.5em 0.75em;
  }

  #brand span {
    font-size: 1rem;
  }

  #brand img {
    height: 1.4em;
  }

  nav ul {
    gap: 0.4em 0.85em;
  }

  nav a {
    font-size: 0.8rem;
  }
}
