/* ==========================================================================
   Brent Mobbs — one-page site
   Editorial layout: Newsreader display serif + Inter, paper/ink neutrals,
   forest-green accent. Self-hosted fonts, no JavaScript.
   ========================================================================== */

/* --- Fonts ---------------------------------------------------------------- */

@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('assets/fonts/newsreader-latin-var.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('assets/fonts/inter-latin-var.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --- Tokens --------------------------------------------------------------- */

:root {
  --paper: #FBFAF8;
  --ink: #14151A;
  --ink-body: #2B2D33;
  --ink-muted: #5F625E;
  --rule: #E3E0D9;
  --accent: #1F3D30;
  --accent-hover: #2E5A47;
  --accent-faint: rgba(31, 61, 48, 0.28);
  --clay: #96502F;
  --sage: #EAEFE4;
  --sage-line: #D5DEC9;
  --moss: #DDE6D6;
  --moss-line: #C5D3BB;
  --masthead-bg: #413729;
  --masthead-line: #332B20;
  --umber: #2B2A21;
  --umber-deep: #201F18;

  --font-display: 'Newsreader', 'Iowan Old Style', Charter, Georgia, serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;

  --container: 64rem;
  --gutter: clamp(1.5rem, 5vw, 3rem);
  --measure: 66ch;
  --rail: 10rem;
  --nav-h: 3.75rem;

  /* Outward arrow for external links; masked so it inherits link colour. */
  --icon-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3.2 8.8 8.8 3.2M8.8 3.2H4.6M8.8 3.2v4.2' fill='none' stroke='%23000' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");

  color-scheme: light;
}

/* --- Base ----------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--nav-h) + 1.5rem);
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background-color: var(--paper);
  color: var(--ink-body);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { font-weight: 400; }

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

a { color: var(--accent); }
a:hover { color: var(--accent-hover); }

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

img { max-width: 100%; height: auto; }

hr { border: 0; margin: 0; }

.dot { padding: 0 0.35em; color: var(--ink-muted); }

/* Small letterspaced label, used for eyebrows and section headings. */
.eyebrow {
  margin: 0 0 0.9rem;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--accent);
  color: var(--paper);
  font-size: 0.8rem;
  text-decoration: none;
}
.skip-link:focus {
  left: 0;
  color: var(--paper);
}

/* --- Shared shell --------------------------------------------------------- */

.shell,
.masthead__inner,
.footer__inner {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* --- Masthead ------------------------------------------------------------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 20;
  background-color: var(--masthead-bg);
  border-bottom: 1px solid var(--masthead-line);
}

.masthead__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: var(--nav-h);
}

.wordmark {
  flex: none;
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: #FFFFFF;
  text-decoration: none;
}
.wordmark:hover { color: #F1E7D6; }

.nav {
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }

.nav ul {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav a {
  display: block;
  padding-block: 0.35rem;
  font-size: 0.7rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.nav a:hover {
  color: #FFFFFF;
  border-bottom-color: rgba(255, 255, 255, 0.5);
}

/* --- Hero ----------------------------------------------------------------- */

.hero {
  padding-block: clamp(4rem, 14vh, 8rem) clamp(3.5rem, 10vh, 6rem);
}

.hero__name {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.75rem, 10.5vw, 6.75rem);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.025em;
  color: var(--ink);
}

.hero__role {
  margin: clamp(1.5rem, 4vw, 2.25rem) 0 0.6rem;
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--clay);
}

.hero__affiliation {
  margin: 0;
  font-size: 0.95rem;
  color: var(--ink-muted);
}

.accent-rule {
  width: 3.5rem;
  height: 2px;
  margin-top: clamp(2rem, 5vw, 3rem);
  background: linear-gradient(90deg, var(--accent) 0 60%, var(--clay) 60% 100%);
}

/* --- Bands ------------------------------------------------------------------
   Full-bleed background bands that divide the page. Each band re-declares the
   color tokens, so everything inside adapts without per-element overrides. */

.band--sage {
  background-color: var(--sage);
  --rule: var(--sage-line);
}

.band--moss {
  background-color: var(--moss);
  --rule: var(--moss-line);
}

.band--earth {
  background-color: var(--umber);
  color: var(--ink-body); /* re-anchor inherited text color to the band's tokens */
  --ink: #F5F3EC;
  --ink-body: #D8D5C9;
  --ink-muted: #A6A494;
  --rule: rgba(245, 243, 236, 0.16);
  --accent: #9CC0A8;
  --accent-hover: #BAD8C5;
  --accent-faint: rgba(156, 192, 168, 0.35);
  --clay: #CE8F65;
}

/* The color change itself marks the seam — no hairline on top of it. */
.band + .band .shell > .section:first-child { border-top: 0; }

/* --- Sections ------------------------------------------------------------- */

.section {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  gap: clamp(1.75rem, 5vw, 3.5rem);
  padding-block: clamp(3.5rem, 8vw, 5.5rem);
  border-top: 1px solid var(--rule);
}

.section__heading {
  position: sticky;
  top: calc(var(--nav-h) + 2rem);
  align-self: start;
  margin: 0;
  padding-top: 0.35rem;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
}

.section__index {
  margin-right: 0.55em;
  font-weight: 500;
  color: var(--clay);
}

.section__body { max-width: var(--measure); }

.lede {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.4vw, 1.375rem);
  line-height: 1.55;
  color: var(--ink);
}

/* --- Experience ----------------------------------------------------------- */

.entry + .entry { margin-top: clamp(2.25rem, 5vw, 3rem); }

.entry__title {
  margin: 0 0 0.6rem;
  font-family: var(--font-display);
  font-size: 1.4rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.entry__title:last-child { margin-bottom: 0; }

.entry__meta {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
}

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

.ruled-list li {
  padding: 0.8rem 0;
  border-top: 1px solid var(--rule);
}

/* --- Articles ------------------------------------------------------------- */

.articles {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: none;
}

.article {
  padding: clamp(1.5rem, 3vw, 1.9rem) 0;
  border-top: 1px solid var(--rule);
}
.article:first-child { border-top: 0; padding-top: 0; }
.article:last-child { padding-bottom: 0; }

.article__title {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.3rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--ink);
}

/* Titles are links (to a hosted copy when one exists, else the source). */
.article__title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}
.article__title a:hover { color: var(--accent); }

.article__meta {
  margin: 0 0 0.7rem;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
}

.article__links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin: 1rem 0 0;
}

.article__links a {
  font-size: 0.7rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--accent-faint);
  transition: color 0.15s ease, border-color 0.15s ease;
}
.article__links a:hover { border-bottom-color: currentColor; }

/* --- Credentials ---------------------------------------------------------- */

.creds { margin: 0; }

.creds__row {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  gap: 0 1.75rem;
  padding: 1.1rem 0;
  border-top: 1px solid var(--rule);
}
.creds__row:first-child { border-top: 0; padding-top: 0; }

.creds dt {
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.9;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.creds dd {
  margin: 0;
  color: var(--ink-body);
}

/* --- Contact -------------------------------------------------------------- */

#contact .section__body { max-width: 48rem; }

.contact {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  gap: clamp(1.75rem, 4vw, 3rem);
  align-items: start;
}

/* Understated frame: a paper-white mat inside a hairline rule, lifted by
   a soft shadow so the photo doesn't sit flat on the page. */
.portrait {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  padding: 0.625rem;
  background-color: #fff;
  border: 1px solid var(--rule);
  border-radius: 2px;
  box-shadow:
    0 1px 2px rgba(20, 21, 26, 0.05),
    0 16px 32px -20px rgba(20, 21, 26, 0.28);
  filter: grayscale(1);
  transition: filter 0.25s ease;
}
.portrait:hover { filter: grayscale(0); }

.contact__details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 2rem 2.5rem;
}

.contact__group p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.65;
}

.contact__group a {
  color: var(--ink-body);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  transition: color 0.15s ease, border-color 0.15s ease;
}
.contact__group a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent-faint);
}

/* --- External-link arrow -------------------------------------------------- */

.link-ext::after {
  content: "";
  display: inline-block;
  width: 0.62em;
  height: 0.62em;
  margin-left: 0.4em;
  background-color: currentColor;
  -webkit-mask: var(--icon-arrow) no-repeat center / contain;
  mask: var(--icon-arrow) no-repeat center / contain;
}

/* --- Footer --------------------------------------------------------------- */

.footer {
  background-color: var(--umber-deep);
}

.footer__inner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  padding-block: 2.25rem 2.75rem;
}

.footer p {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: #A6A494;
}

.footer a {
  color: #C9C6B8;
  text-decoration: none;
  border-bottom: 1px solid rgba(245, 243, 236, 0.22);
  transition: color 0.15s ease, border-color 0.15s ease;
}
.footer a:hover {
  color: #BAD8C5;
  border-bottom-color: rgba(186, 216, 197, 0.5);
}

/* --- Article subpages ------------------------------------------------------ */

.article-head {
  max-width: 46rem;
  padding-top: clamp(3.5rem, 10vh, 5.5rem);
}

.article-head__kicker {
  margin: 0 0 1.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--clay);
}

.article-head__title {
  margin: 0 0 1.1rem;
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 5.5vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.article-head__byline {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-muted);
}

.article-head .accent-rule { margin-top: 2rem; }

/* Republished article body: serif prose, original formatting preserved. */
.prose {
  max-width: 44rem;
  padding-block: clamp(2.25rem, 5vw, 3.25rem) clamp(3rem, 7vw, 4.5rem);
  font-family: var(--font-display);
  font-size: 1.125rem;
  line-height: 1.75;
  color: var(--ink-body);
  overflow-wrap: break-word; /* long citation URLs must wrap, not overflow */
}

.prose p { margin: 0 0 1.3em; }

.prose b,
.prose strong { font-weight: 600; color: var(--ink); }

.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent-faint);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s ease, color 0.15s ease;
}
.prose a:hover {
  color: var(--accent-hover);
  text-decoration-color: currentColor;
}

.prose ul,
.prose ol {
  margin: 0 0 1.3em;
  padding-left: 1.5em;
}
.prose li { margin-bottom: 0.35em; }

.provenance {
  clear: both;
  margin-top: 2.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}

.provenance p {
  margin: 0;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--ink-muted);
}

/* --- Narrow viewports ----------------------------------------------------- */

@media (max-width: 56.25em) {
  .section {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
  }

  .section__heading {
    position: static;
    padding-top: 0;
  }

  .contact { grid-template-columns: minmax(0, 1fr); }

  .portrait { max-width: 10rem; }
}

@media (max-width: 43.75em) {
  .wordmark { display: none; }

  .nav { width: 100%; }

  .nav ul {
    justify-content: space-between;
    gap: 0.85rem;
  }

  .nav a { font-size: 0.65rem; }

  .creds__row {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.35rem;
  }

  .creds dt { line-height: 1.5; }
}

@media (max-width: 30em) {
  .nav a {
    font-size: 0.55rem;
    letter-spacing: 0.05em;
  }

  .nav ul { gap: 0.5rem; }
}
