/* Palette drawn from the headshot: navy blazer, brick wall, light-blue shirt. */
:root {
  --navy: #1f3a5f;
  --brick: #9c4a35;
  --ink: #2b2f36;
  --muted: #5d6470;
  --rule: #e4ded6;
  --paper: #faf8f5;
  --card: #ffffff;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(15px, 0.35vw + 13.5px, 17px);
  line-height: 1.55;
}

.page {
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(24px, 5vh, 64px) clamp(16px, 4vw, 48px) 16px;
  display: grid;
  /* Desktop: photo beside the name block and intro as a header; Background
     full width underneath. */
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "photo intro"
    "bg    bg";
  column-gap: clamp(24px, 3vw, 44px);
  row-gap: 14px;
  align-items: center;
  /* Share any spare height evenly above, between and below the blocks. */
  align-content: space-evenly;
}

.photo { grid-area: photo; }
.intro { grid-area: intro; text-align: left; max-width: 760px; }
.background { grid-area: bg; margin-top: 14px; }


.headshot {
  display: block;
  width: clamp(140px, min(18vw, 26vh), 240px);
  height: auto;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 4px solid var(--card);
  box-shadow: 0 2px 12px rgba(31, 58, 95, 0.18);
}

h1 {
  margin: 0 0 2px;
  font-family: var(--serif);
  font-weight: normal;
  font-size: clamp(1.9rem, 2.4vw + 1rem, 2.6rem);
  color: var(--navy);
  letter-spacing: 0.01em;
}

.role {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--brick);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.location { margin: 2px 0 0; color: var(--muted); font-size: 0.95rem; }

.summary {
  margin: 18px 0 0;
  text-align: left;
  color: var(--ink);
}

/* Right column: what */
.page h2 {
  margin: 0 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--rule);
  font-family: var(--serif);
  font-weight: normal;
  font-size: 1.3rem;
  color: var(--navy);
}

.page h2 + * { margin-top: 0; }
.page h2:not(:first-child) { margin-top: 22px; }


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

.timeline li {
  display: grid;
  grid-template-columns: 7.5em 1fr;
  gap: 12px;
  padding: 5px 0;
  border-bottom: 1px solid var(--rule);
}

.timeline li:last-child { border-bottom: none; }

.when { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

.education { margin: 10px 0 0; color: var(--muted); }
.education strong { color: var(--ink); }

/* Footer: text-only menu, centered, copyright below */
.site-footer {
  padding: 16px 16px 20px;
  text-align: center;
  border-top: 1px solid var(--rule);
}

.footer-menu { display: flex; justify-content: center; gap: 28px; flex-wrap: wrap; }

.footer-menu a {
  color: var(--navy);
  text-decoration: none;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
}

.footer-menu a:hover, .footer-menu a:focus-visible { color: var(--brick); text-decoration: underline; }

.copyright { margin: 8px 0 0; color: var(--muted); font-size: 0.85rem; }

/* Contact popup */
.contact-dialog {
  width: min(480px, calc(100vw - 32px));
  padding: 0;
  border: none;
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.contact-dialog::backdrop { background: rgba(31, 58, 95, 0.45); }

.contact-form { display: grid; gap: 12px; padding: 24px; }

.contact-form h2 {
  margin: 0 0 4px;
  font-family: var(--serif);
  font-weight: normal;
  color: var(--navy);
}

.contact-form label { display: grid; gap: 4px; font-size: 0.9rem; color: var(--muted); }

.contact-form input, .contact-form textarea {
  font: inherit;
  color: var(--ink);
  padding: 9px 10px;
  border: 1px solid #cfc8bf;
  border-radius: 4px;
  background: var(--card);
}

.contact-form input:focus, .contact-form textarea:focus { outline: 2px solid var(--navy); outline-offset: 1px; }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }

.form-actions button {
  font: inherit;
  padding: 8px 18px;
  border-radius: 4px;
  border: 1px solid var(--navy);
  background: var(--navy);
  color: #fff;
  cursor: pointer;
}

.form-actions button.secondary { background: transparent; color: var(--navy); }

.form-status { margin: 0; min-height: 1.2em; font-size: 0.9rem; color: var(--muted); }

/* Short desktop screens (common laptops): tighten so the page still fits on one screen */
@media (min-width: 761px) and (max-height: 920px) {
  body { font-size: 15px; line-height: 1.45; }
  .headshot { width: clamp(140px, min(18vw, 24vh), 240px); }
  .page { padding-top: 20px; row-gap: 10px; }
  .background { margin-top: 8px; }
  h1 { font-size: 2rem; }
  .summary { margin-top: 12px; }
  .page h2 { margin-bottom: 6px; }
  .page h2:not(:first-child) { margin-top: 16px; }
  .timeline li { padding: 4px 0; }
  .education { margin-top: 6px; }
}

/* Very short desktop screens (up to 820px tall): tighten further */
@media (min-width: 761px) and (max-height: 820px) {
  .headshot { width: clamp(120px, min(18vw, 22vh), 240px); }
  .page { padding-top: 14px; row-gap: 6px; }
  .background { margin-top: 4px; }
  .timeline li { padding: 3px 0; }
  .site-footer { padding: 10px 16px 12px; }
  .copyright { margin-top: 4px; }
}

/* Narrow screens and portrait tablets: one column, in reading order */
@media (max-width: 760px) {
  .page {
    grid-template-columns: 1fr;
    grid-template-areas: "photo" "intro" "bg";
    row-gap: 20px;
    align-content: start;
  }
  .photo { justify-self: center; }
  .intro { max-width: 560px; margin: 0 auto; text-align: center; }
  .background { margin-top: 0; }
}

@media (max-width: 420px) {
  .timeline li { grid-template-columns: 1fr; gap: 0; }
}
