/* ===========================================================================
   Michael R. Fettiplace — single-page site
   Modern minimal: system sans throughout, near-monochrome, one accent,
   hairline rules, generous whitespace. Light and dark from OS preference.
   Every color is a token below — change --accent to re-skin the page.
   =========================================================================== */

:root {
  --paper:       #fcfcfb;
  --surface:     #ffffff;
  --surface-alt: #f5f5f3;
  --ink:         #17191c;
  --ink-soft:    #4b5158;
  --ink-faint:   #767c85;
  --rule:        #e5e4e0;
  --rule-strong: #cfcec9;
  --accent:      #1c4f7c;
  --accent-soft: #eaf0f5;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --measure: 68ch;
  --page: 1000px;
  --header-h: 58px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:       #101214;
    --surface:     #16181b;
    --surface-alt: #1a1d20;
    --ink:         #e9e8e4;
    --ink-soft:    #b0b6bd;
    --ink-faint:   #868d95;
    --rule:        #262a2e;
    --rule-strong: #3a3f45;
    --accent:      #6fa8d6;
    --accent-soft: #17242e;
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.65;
  font-feature-settings: "kern" 1;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3 { font-weight: 600; line-height: 1.12; letter-spacing: -0.028em; margin: 0 0 0.4em; }
h1 { font-size: clamp(2.4rem, 6.5vw, 4.1rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
h3 { font-size: 1rem; letter-spacing: -0.01em; }

p { margin: 0 0 1.2em; max-width: var(--measure); }

::selection { background: var(--accent-soft); color: var(--ink); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* --- Layout --------------------------------------------------------------- */
.wrap { width: min(100% - 3rem, var(--page)); margin-inline: auto; }

.section { padding: 6rem 0; border-top: 1px solid var(--rule); }
.section:first-of-type { border-top: 0; }
section[id] { scroll-margin-top: calc(var(--header-h) + 16px); }

.kicker {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 1.5rem;
  display: flex; align-items: baseline; gap: 0.9rem;
}
.kicker__n { color: var(--accent); font-variant-numeric: tabular-nums; }

.lede { font-size: 1.22rem; line-height: 1.55; color: var(--ink-soft); max-width: 40ch; }
.body-copy { color: var(--ink-soft); }

/* --- Skip link ------------------------------------------------------------ */
.skip { position: absolute; left: -9999px; background: var(--accent); color: var(--paper); padding: 0.6rem 1rem; z-index: 100; }
.skip:focus { left: 1rem; top: 1rem; }

/* --- Header --------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--rule);
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 2rem; min-height: var(--header-h);
}
.brand {
  font-size: 0.92rem; font-weight: 600; letter-spacing: -0.01em;
  color: var(--ink); text-decoration: none; white-space: nowrap;
}
.nav {
  display: flex; align-items: center; gap: 1.4rem;
  overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  font-size: 0.83rem; color: var(--ink-faint); text-decoration: none;
  white-space: nowrap; padding: 0.15rem 0; border-bottom: 1.5px solid transparent;
}
.nav a:hover { color: var(--ink); }
.nav a[aria-current] { color: var(--ink); border-bottom-color: var(--accent); }

/* --- Hero ----------------------------------------------------------------- */
.hero { padding: 7rem 0 5rem; border-top: 0; }
.hero h1 { margin-bottom: 0.35em; }
.hero__role {
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink-faint); margin: 0 0 2rem;
}
.hero__grid {
  display: grid; grid-template-columns: minmax(0, 1fr) 150px;
  gap: 3.5rem; align-items: start; margin-top: 2.5rem;
}
.hero__portrait { margin: 0; }
.hero__portrait img {
  width: 150px; height: 150px; object-fit: cover; object-position: 50% 22%;
  border-radius: 50%; filter: grayscale(1) contrast(1.04);
}
.hero__bio { font-size: 1.05rem; color: var(--ink-soft); max-width: 58ch; }
.hero__bio strong { color: var(--ink); font-weight: 600; }

.btn-row { display: flex; flex-wrap: wrap; gap: 1.5rem; margin-top: 2rem; align-items: center; }
.btn {
  font-size: 0.88rem; text-decoration: none; color: var(--ink);
  border-bottom: 1.5px solid var(--accent); padding-bottom: 2px;
}
.btn:hover { color: var(--accent); }

/* --- Section index -------------------------------------------------------- */
.index-list { list-style: none; padding: 0; margin: 0; }
.index-list li + li { border-top: 1px solid var(--rule); }
.index-list a {
  display: grid; grid-template-columns: 3.5rem minmax(0, 22rem) minmax(0, 1fr) 1.5rem;
  gap: 0 1.5rem; align-items: baseline;
  padding: 1.35rem 0; text-decoration: none; color: inherit;
}
.index-list a:hover .index-list__t { color: var(--accent); }
.index-list a:hover .index-list__arrow { transform: translateX(4px); color: var(--accent); }
.index-list__n { font-size: 0.78rem; color: var(--ink-faint); font-variant-numeric: tabular-nums; letter-spacing: 0.08em; }
.index-list__t { font-size: 1.15rem; font-weight: 600; letter-spacing: -0.02em; }
.index-list__d { font-size: 0.92rem; color: var(--ink-faint); }
.index-list__arrow { color: var(--rule-strong); transition: transform .15s ease, color .15s ease; justify-self: end; }

/* --- Figures -------------------------------------------------------------- */
.figure { margin: 3.5rem 0; max-width: 780px; }
.figure svg, .figure img { width: 100%; height: auto; }
.figure figcaption {
  font-size: 0.85rem; line-height: 1.55; color: var(--ink-faint);
  margin-top: 1.25rem; padding-top: 1rem;
  border-top: 1px solid var(--rule);
  max-width: 62ch; text-wrap: pretty;
}
.figure figcaption a { color: var(--ink-soft); }
.figure figcaption a:hover { color: var(--accent); }

/* --- Publication list ----------------------------------------------------- */
.pubs { list-style: none; padding: 0; margin: 2.5rem 0 0; max-width: 820px; }
.pubs li { border-top: 1px solid var(--rule); padding: 1.15rem 0; }
.pubs li:last-child { border-bottom: 1px solid var(--rule); }

.pub__title { font-size: 1rem; font-weight: 600; letter-spacing: -0.015em; margin: 0 0 0.35rem; line-height: 1.4; }
.pub__title a { color: var(--ink); text-decoration: none; }
.pub__title a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.pub__meta { font-size: 0.85rem; color: var(--ink-faint); margin: 0; max-width: none; }
.pub__meta em { font-style: normal; color: var(--ink-soft); }
.pub__meta .sep { color: var(--rule-strong); margin: 0 0.45rem; }
.pub__meta a { color: var(--ink-faint); text-decoration: none; border-bottom: 1px solid var(--rule-strong); }
.pub__meta a:hover { color: var(--accent); border-bottom-color: currentColor; }

.section-more { margin-top: 1.75rem; font-size: 0.88rem; color: var(--ink-faint); }

/* --- Links / resources ---------------------------------------------------- */
.links { list-style: none; padding: 0; margin: 2.5rem 0 0; }
.links li + li { border-top: 1px solid var(--rule); }
.links a {
  display: grid; grid-template-columns: minmax(0, 20rem) minmax(0, 1fr) 1.5rem;
  gap: 0 1.5rem; align-items: baseline;
  padding: 1.2rem 0; text-decoration: none; color: inherit;
}
.links a:hover .links__t { color: var(--accent); }
.links a:hover .links__arrow { transform: translate(3px, -3px); color: var(--accent); }
.links__t { font-size: 1.02rem; font-weight: 600; letter-spacing: -0.015em; }
.links__d { font-size: 0.9rem; color: var(--ink-faint); }
.links__arrow { color: var(--rule-strong); justify-self: end; transition: transform .15s ease, color .15s ease; }

/* --- Contact -------------------------------------------------------------- */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 2.5rem; margin-top: 2.5rem; }
.contact-grid h3 { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-faint); margin: 0 0 0.75rem; }
.contact-grid p { font-size: 0.95rem; color: var(--ink-soft); margin: 0; }
.mail { font-size: 1.15rem; font-weight: 600; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; border-bottom: 1.5px solid var(--accent); }
.mail:hover { color: var(--accent); }

/* --- Footer --------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--rule);
  padding: 2.5rem 0 3.5rem;
  font-size: 0.82rem; color: var(--ink-faint);
}
.site-footer__grid { display: flex; flex-wrap: wrap; gap: 0.75rem 2.5rem; justify-content: space-between; }

/* --- Responsive ----------------------------------------------------------- */
@media (max-width: 860px) {
  .index-list a { grid-template-columns: 2.5rem minmax(0, 1fr) 1.25rem; }
  .index-list__d { grid-column: 2; margin-top: 0.25rem; }
  .links a { grid-template-columns: minmax(0, 1fr) 1.25rem; }
  .links__d { grid-column: 1; margin-top: 0.25rem; }
}

@media (max-width: 700px) {
  body { font-size: 17px; }
  .wrap { width: calc(100% - 2.25rem); }
  .hero { padding: 3.5rem 0 3rem; }
  .hero__grid { grid-template-columns: 1fr; gap: 2rem; }
  .hero__portrait { order: -1; }
  .hero__portrait img { width: 110px; height: 110px; }
  .section { padding: 4rem 0; }
  .site-header__inner { flex-direction: column; align-items: flex-start; gap: 0.2rem; padding: 0.55rem 0; }
  .nav { width: 100%; gap: 1.15rem; padding-bottom: 0.3rem; }
}

@media print {
  .site-header, .skip, .index-list__arrow, .links__arrow { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .section { padding: 1.5rem 0; }
  .figure, .pubs li { break-inside: avoid; }
}
