:root {
  /* Committed to a light design, so `color-scheme: light` keeps the
     scrollbars and form controls light too — without it a dark-mode OS
     paints a dark scrollbar down the side of a white page. */
  color-scheme: light;

  --bg: #ffffff;
  --fg: #1c1b1a;
  --muted: #6e6a65;
  --rule: #e4e1dc;
  --accent: #8a4b2a;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 17px/1.65 ui-serif, Georgia, "Times New Roman", serif;
  display: flex;
  min-height: 100vh;
}

main {
  margin: auto;
  padding: 4rem 1.5rem;
  max-width: 40rem;
  width: 100%;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 2.75rem);
  font-weight: 500;
  letter-spacing: -0.02em;
}

.tagline {
  margin: 0.4rem 0 0;
  color: var(--muted);
}

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, currentColor 35%, transparent);
  transition: border-color 0.15s ease;
}

a:hover,
a:focus-visible {
  border-bottom-color: currentColor;
}

/* --- masthead ------------------------------------------------------- */

.masthead {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  flex-wrap: wrap;
}

/* The source photo is a 4:3 landscape with the subject left of centre and
   high in the frame, so a plain object-fit:cover centre-crop cuts his head.
   These two values frame a head-and-shoulders square out of the original:
   background-size zooms, background-position picks the crop origin. */
.photo {
  width: 8.5rem;
  aspect-ratio: 1;
  flex-shrink: 0;
  border-radius: 50%;
  background-image: url("/assets/photo.jpg");
  background-size: 186%;
  background-position: 26% 9%;
  background-repeat: no-repeat;
  box-shadow: 0 0 0 1px var(--rule);
}

.bio {
  flex: 1 1 16rem;
  min-width: 0;
}

.welcome {
  margin: 0.35rem 0 0;
}

.subtitle {
  margin: 0.1rem 0 0;
  color: var(--muted);
  font-style: italic;
}

.links {
  margin-top: 1.1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.9rem;
  font-size: 0.95rem;
}

.links .cv {
  border-bottom-color: currentColor;
  margin-right: 0.2rem;
}

/* Icons are set in currentColor, so they follow the light/dark palette and
   the hover state for free — no second set of assets, no extra requests. */
.links .icon {
  display: inline-flex;
  padding: 0.3rem;
  border-bottom: 0;
  border-radius: 6px;
  color: var(--muted);
  transition: color 0.15s ease, background-color 0.15s ease;
}

.links .icon svg {
  width: 1.15rem;
  height: 1.15rem;
  display: block;
  fill: currentColor;
}

.links .icon:hover {
  color: var(--accent);
  background: color-mix(in srgb, currentColor 10%, transparent);
}

.links .icon:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  color: var(--accent);
}

/* --- body ----------------------------------------------------------- */

section {
  margin-top: 3rem;
}

h2 {
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}

section p {
  margin: 0 0 1rem;
  text-wrap: pretty;
}

.education {
  margin: 0;
  padding: 0;
  list-style: none;
}

.education li {
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--rule);
}

.education li:last-child {
  border-bottom: 0;
}

footer {
  margin-top: 3.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.85rem;
}

footer p { margin: 0.25rem 0; }

.build {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.75rem;
  opacity: 0.7;
}

/* Links to /build.txt for the full deploy record, but a footer stamp should
   not shout -- inherit the muted colour instead of the accent. */
.build a {
  color: inherit;
  border-bottom-color: transparent;
}

.build a:hover,
.build a:focus-visible {
  border-bottom-color: currentColor;
}
