/* -----------------------------------------------------------------------------
   evah.institute — design system
   Phase 1, hand-authored static. Designed to port cleanly to Astro later.
   Tokens (:root) → reset → base type → layout → components.
   ----------------------------------------------------------------------------- */

:root {
  /* ---- Colour ----
     Direction-B teal palette. Body/detail/caption text is solid black — no
     grey-on-grey. Headings + dark elements use deep teal. Links / nav active /
     secondary accents use moss teal. Contact pill uses ember. */
  --c-ink:        #000000;
  --c-ink-soft:   #000000;
  --c-muted:      #000000;
  --c-line:       #e5e7eb;

  --c-bg:         #ffffff;
  --c-bg-alt:     #f8f7f4;
  --c-bg-soft:    #f3f1ec;

  --c-accent:     #5C8A80;   /* moss teal — links, nav active, secondary accents */
  --c-accent-ink: #1F3A35;   /* deep teal — headings, Contact pill, dark elements */
  --c-maroon:     #1F3A35;   /* legacy token, now deep teal */
  --c-rose:       #D9E8E6;   /* legacy token, now light teal (footer bg) */
  --c-rose-ink:   #1F3A35;   /* legacy token, now deep teal */
  --c-danger:     #8b3a3a;   /* error / form-panel--error only; also Contact pill */
  --c-ember:      #D24A1B;   /* Contact pill */

  /* ---- Type ---- */
  --ff-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua",
              Cambria, Georgia, serif;
  --ff-sans:  -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
              "Helvetica Neue", Arial, system-ui, sans-serif;

  --fs-xs:    0.8125rem;   /* 13 */
  --fs-sm:    0.9375rem;   /* 15 — detail text */
  --fs-base:  1.0625rem;   /* 17 — body */
  --fs-lg:    1.25rem;     /* 20 — subsection h3 */
  --fs-xl:    1.5rem;      /* 24 */
  --fs-2xl:   2rem;        /* 32 — section h2 max */
  --fs-3xl:   2.75rem;     /* 44 — page H1 base */
  --fs-4xl:   3.5rem;      /* 56 — page H1 max */

  --lh-tight:  1.15;
  --lh-snug:   1.35;
  --lh-detail: 1.45;
  --lh-body:   1.65;

  /* ---- Spacing (4px base) ---- */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.25rem;
  --s-6: 1.75rem;
  --s-7: 2.5rem;
  --s-8: 3.5rem;
  --s-9: 5rem;

  /* ---- Layout ---- */
  --container: 72rem;
  --measure:   38rem;
  --radius:    4px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.04);
}

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

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

body {
  margin: 0;
  font-family: var(--ff-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  color: var(--c-ink);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

/* Links — colour for affordance, underline only on hover/focus */
a {
  color: var(--c-ink);
  text-decoration: none;
}
a:hover,
a:focus-visible {
  color: var(--c-accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

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

/* -----------------------------------------------------------------------------
   Heading hierarchy
   Page H1 > section H2 (.display) > subsection H3.
   Page H1 lives inside .hero__title / .page-hero__title so the bare element
   defaults stay calm (44px max) and the page-hero title is the visual H1.
   ----------------------------------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--ff-serif);
  font-weight: 500;
  color: var(--c-ink);
  line-height: var(--lh-tight);
  margin: 0 0 var(--s-4);
  letter-spacing: -0.005em;
}
h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); font-weight: 500; }
h4 { font-size: var(--fs-base); }

p { margin: 0 0 var(--s-4); }
p:last-child { margin-bottom: 0; }

ul, ol { margin: 0 0 var(--s-5); padding-left: 1.25rem; }
li { margin-bottom: var(--s-2); }
li:last-child { margin-bottom: 0; }

strong { font-weight: 600; }

hr {
  border: 0;
  border-top: 1px solid var(--c-line);
  margin: var(--s-7) 0;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: var(--s-4);
  left: var(--s-4);
  background: var(--c-ink);
  color: #fff;
  padding: var(--s-2) var(--s-4);
  z-index: 100;
  border-radius: var(--radius);
  transform: translateY(calc(-100% - var(--s-4) - 4px));
}
.skip-link:focus { transform: translateY(0); }

/* -----------------------------------------------------------------------------
   Layout primitives
   ----------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--s-5);
}
@media (min-width: 48em) {
  .container { padding: 0 var(--s-6); }
}

/* Even section rhythm across alternating bands */
.section { padding: var(--s-7) 0; }
@media (min-width: 48em) { .section { padding: var(--s-8) 0; } }

.section--alt { background: var(--c-bg-alt); }

/* Feature band — light teal, centred, used for the "Our name" panel on Home */
.section--name {
  background: var(--c-rose);
  color: var(--c-accent-ink);
  text-align: center;
  padding: var(--s-6) 0;
}
.section--name__title { margin: 0 auto var(--s-3); }
.section--name__pronunciation {
  max-width: 62ch;
  margin: 0 auto var(--s-3);
  color: var(--c-accent-ink);
  font-size: var(--fs-lg);
  font-weight: 600;
  line-height: var(--lh-body);
}
.section--name__body {
  max-width: 62ch;
  margin: 0 auto;
  line-height: var(--lh-body);
  color: var(--c-accent-ink);
}
.section--name__body p { margin-bottom: var(--s-3); }
.section--name__body p:last-child { margin-bottom: 0; }
@media (min-width: 48em) { .section--name { padding: var(--s-7) 0; } }
@media (max-width: 47.99em) {
  .section--name__pronunciation { font-size: var(--fs-base); }
}

/* Bring two consecutive .section blocks closer together when they share content,
   used sparingly on intro + body pairs */
.section--tight { padding: var(--s-5) 0; }
@media (min-width: 48em) { .section--tight { padding: var(--s-6) 0; } }

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

.eyebrow {
  font-family: var(--ff-sans);
  font-size: var(--fs-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--c-muted);
  margin: 0 0 var(--s-3);
  font-weight: 600;
}

.lede {
  font-size: var(--fs-lg);
  line-height: var(--lh-snug);
  color: var(--c-ink-soft);
  max-width: var(--measure);
}

/* Display heading — section H2. Sits clearly below the page H1 in scale. */
.display {
  font-family: var(--ff-serif);
  font-size: clamp(1.5rem, 3.2vw, 2.25rem);
  color: var(--c-maroon);
  line-height: var(--lh-tight);
  margin: 0 0 var(--s-4);
  font-weight: 500;
  letter-spacing: -0.005em;
}

/* Subsection — used for the smaller in-page headings (e.g. "Industry supply-chain LCI",
   "Adopted EN 15804 Sub-PCRs"). Sans-serif uppercase keeps them distinctly tertiary. */
.subhead {
  font-family: var(--ff-sans);
  font-size: var(--fs-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-muted);
  margin: var(--s-6) 0 var(--s-3);
  font-weight: 600;
}

/* Detail text — smaller font + tighter line-height. Apply to dense reference lists,
   product directories, PCR/EPD lists, geography lists, year-blocks, tables. */
.detail {
  font-size: var(--fs-sm);
  line-height: var(--lh-detail);
}
.detail li { margin-bottom: var(--s-1); }

/* Two-column section: display heading on the left, body on the right */
.split {
  display: grid;
  gap: var(--s-5);
  grid-template-columns: 1fr;
}
@media (min-width: 56em) {
  .split { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: var(--s-7); }
}

/* -----------------------------------------------------------------------------
   Header / nav
   ----------------------------------------------------------------------------- */
.site-header {
  border-bottom: 1px solid var(--c-line);
  background: var(--c-bg);
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-5);
  padding-top: var(--s-4);
  padding-bottom: var(--s-4);
  flex-wrap: wrap;
}

.brand { text-decoration: none; color: var(--c-ink); }
.brand:hover { color: var(--c-ink); text-decoration: none; }
.brand__name {
  font-family: var(--ff-serif);
  font-size: 1.625rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.005em;
  display: block;
}
.brand__tag {
  font-size: var(--fs-xs);
  letter-spacing: 0.06em;
  color: var(--c-muted);
  margin-top: 2px;
  display: block;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--s-6);
  flex-wrap: wrap;
}
.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: var(--s-6);
  flex-wrap: wrap;
}
/* Header gets a wider container than page content so the 8-item nav can breathe */
.site-header .container { max-width: 80rem; }
.site-nav li { margin: 0; }
.site-nav ul a {
  color: var(--c-ink);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: var(--s-2) 0;
}
.site-nav ul a:hover,
.site-nav ul a:focus-visible {
  color: var(--c-accent);
  text-decoration: none;
}
/* Active state — scoped to the nav list so it doesn't bleed into the .btn pill */
.site-nav ul a[aria-current="page"],
.site-nav ul a[aria-current="true"] {
  color: var(--c-accent);
  font-weight: 600;
}

/* Pill button — warm maroon pill with white text. Active state keeps the same fill. */
.btn {
  display: inline-block;
  background: var(--c-danger);
  color: #fff;
  padding: var(--s-3) var(--s-5);
  border-radius: var(--radius-pill);
  font-size: var(--fs-sm);
  text-decoration: none;
  border: 1px solid var(--c-danger);
  transition: background-color .15s, color .15s, border-color .15s;
}
.btn:hover,
.btn:focus-visible {
  background: transparent;
  color: var(--c-danger);
  border-color: var(--c-danger);
  text-decoration: none;
}
.btn[aria-current="page"] {
  background: var(--c-danger);
  border-color: var(--c-danger);
  color: #fff;
}
.btn[aria-current="page"]:hover,
.btn[aria-current="page"]:focus-visible {
  background: var(--c-danger);
  color: #fff;
  opacity: 0.92;
}
.btn--ghost {
  background: transparent;
  color: var(--c-ink);
}
.btn--ghost:hover { background: var(--c-ink); color: #fff; }

/* -----------------------------------------------------------------------------
   Hero — full-bleed (Home)
   100vw, ~80vh, headline overlaid white.
   ----------------------------------------------------------------------------- */
.hero {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  min-height: 80vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  color: #fff;
  background: #1a1a1a;
  isolation: isolate;
}

.hero__media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  opacity: 0;
  transition: opacity 1.4s ease-in-out;
}
.hero__media[data-active="true"] { opacity: 1; }
.hero__media video,
.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0,0,0,0.40) 0%, rgba(0,0,0,0.25) 45%, rgba(0,0,0,0.55) 100%);
  z-index: -1;
}

.hero__inner {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--s-9) var(--s-5);
}
@media (min-width: 48em) { .hero__inner { padding: var(--s-9) var(--s-6); } }

.hero__title {
  font-family: var(--ff-serif);
  font-size: clamp(2.25rem, 6vw, 4.5rem);   /* trimmed ~14% from the previous max */
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0 0 var(--s-5);
  max-width: 16ch;
  color: #fff;
  text-shadow: 0 1px 24px rgba(0,0,0,0.35);
}
.hero__title em {
  font-style: italic;
  color: #fff;
}
.hero__lede {
  font-size: clamp(1rem, 1.5vw, 1.1875rem);
  line-height: var(--lh-snug);
  max-width: 42ch;
  color: #f5f5f5;
  text-shadow: 0 1px 16px rgba(0,0,0,0.4);
}

@media (prefers-reduced-motion: reduce) {
  .hero__media video { display: none; }
}

/* -----------------------------------------------------------------------------
   Page hero — interior pages. One consistent leaves banner across
   Services / EPDs / People / LCA / LCIs. Contact uses Home hero treatment.
   ----------------------------------------------------------------------------- */
.page-hero {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  min-height: clamp(420px, 65vh, 720px);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  color: #fff;
  background: #1f1f1f;
  isolation: isolate;
}
.page-hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}
.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.20) 0%, rgba(0,0,0,0.55) 100%);
  z-index: -1;
}
.page-hero__inner {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--s-8) var(--s-5);
}
@media (min-width: 48em) { .page-hero__inner { padding: var(--s-8) var(--s-6); } }
.page-hero .eyebrow {
  color: rgba(255,255,255,0.85);
  margin-bottom: var(--s-2);
}
.page-hero__title {
  font-family: var(--ff-serif);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 400;
  line-height: 1.08;
  margin: 0;
  color: #fff;
  text-shadow: 0 1px 16px rgba(0,0,0,0.4);
}

/* -----------------------------------------------------------------------------
   Preface gallery (Home)
   ----------------------------------------------------------------------------- */
.preface-gallery {
  margin-top: var(--s-6);
  display: grid;
  gap: var(--s-4);
  grid-template-columns: 1fr;
}
@media (min-width: 40em) {
  .preface-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.preface-gallery figure { margin: 0; }
.preface-gallery img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: var(--radius);
  display: block;
}

/* -----------------------------------------------------------------------------
   Content lists
   ----------------------------------------------------------------------------- */
.card {
  background: var(--c-bg);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  padding: var(--s-5);
}

/* Dense, columned lists — automatically use detail text scale */
.cols-list {
  columns: 1;
  column-gap: var(--s-7);
  font-size: var(--fs-sm);
  line-height: var(--lh-detail);
}
@media (min-width: 40em) { .cols-list { columns: 2; } }
@media (min-width: 64em) { .cols-list { columns: 3; } }
.cols-list ul { padding-left: 1.1rem; margin: 0; }
.cols-list li {
  break-inside: avoid;
  margin-bottom: var(--s-1);
}

/* Year-grouped client lists (Services page) — detail text */
.year-block { margin-bottom: var(--s-7); }
.year-block:last-child { margin-bottom: 0; }
.year-block h3 {
  font-family: var(--ff-sans);
  font-size: var(--fs-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--c-muted);
  margin-bottom: var(--s-3);
  font-weight: 600;
}
.year-block > p {
  font-size: var(--fs-sm);
  line-height: var(--lh-detail);
  color: var(--c-ink-soft);
  max-width: var(--measure);
  margin-bottom: var(--s-3);
}

/* Contact block */
.contact-block { font-style: normal; }
.contact-block p { margin-bottom: var(--s-4); }
.contact-dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: var(--s-5);
  row-gap: var(--s-2);
  margin: var(--s-5) 0;
}
.contact-dl dt {
  color: var(--c-muted);
  font-size: var(--fs-sm);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.contact-dl dd { margin: 0; }
.contact-cta { margin-top: var(--s-5); }

/* LCA radar figure (+ markdown figures on Insights posts) */
.lca-figure,
.md-figure { margin: var(--s-6) 0 var(--s-8); }
.lca-figure--spacious { margin-bottom: var(--s-9); }
.lca-figure img,
.md-figure img {
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
  display: block;
  border-radius: var(--radius);
}
.lca-figure figcaption,
.md-figure figcaption {
  margin-top: var(--s-2);
  font-size: var(--fs-xs);
  color: var(--c-ink);
  text-align: center;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

/* Insights index — post cards */
.post-cards {
  list-style: none;
  padding: 0;
  margin: var(--s-6) 0 0;
  display: grid;
  gap: var(--s-6);
}
.post-card { margin: 0; }
.post-card a {
  display: grid;
  color: var(--c-ink);
  text-decoration: none;
  background: var(--c-bg);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  overflow: hidden;
}
@media (min-width: 48em) {
  .post-card a { grid-template-columns: 2fr 3fr; }
}
.post-card__media img {
  width: 100%;
  height: 100%;
  min-height: 220px;
  object-fit: cover;
  display: block;
}
.post-card__body {
  padding: var(--s-6);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
.post-card__meta {
  margin: 0;
  font-size: var(--fs-xs);
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.post-card__title {
  margin: 0;
  font-family: var(--ff-serif);
  font-size: var(--fs-xl);
  font-weight: 500;
  color: var(--c-maroon);
}
.post-card a:hover .post-card__title,
.post-card a:focus-visible .post-card__title { color: var(--c-accent-ink); }
.post-card__desc {
  margin: 0;
  font-size: var(--fs-sm);
  line-height: 1.5;
  max-width: 38rem;
}
.post-card__cta {
  margin-top: auto;
  padding-top: var(--s-2);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--c-accent-ink);
}

/* Insights posts */
.post-meta {
  font-size: var(--fs-sm);
  color: var(--c-muted);
  margin-bottom: var(--s-4);
}
.post-body h2 { margin-top: var(--s-7); }
.post-body h3 { margin-top: var(--s-5); }
@media (min-width: 48em) {
  .post-body { column-count: 2; column-gap: var(--s-8); }
  .post-body h2,
  .post-body h3,
  .post-body .md-figure { column-span: all; }
  .post-body h2 { margin-top: var(--s-6); }
  .post-body p { orphans: 2; widows: 2; }
  .post-body ul { break-inside: avoid-column; }
}
@media (max-width: 47.99em) {
  .post-body p,
  .post-body ul { max-width: 44rem; }
}

/* People page */
.person {
  margin-bottom: var(--s-6);
}
.person:last-child { margin-bottom: 0; }
.person__profile {
  display: block;
}
.person__profile::after {
  display: block;
  clear: both;
  content: "";
}
.person__portrait {
  display: block;
  float: right;
  width: 6.25rem;
  height: 6.25rem;
  margin: 0 0 var(--s-2) var(--s-4);
  object-fit: cover;
  border-radius: 50%;
}
.person__content { min-width: 0; }
@media (min-width: 48em) {
  .person__profile {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 6.25rem;
    align-items: start;
    gap: var(--s-4);
  }
  .person__profile::after { content: none; }
  .person__portrait {
    float: none;
    grid-column: 2;
    grid-row: 1;
    margin: 0;
  }
  .person__content {
    grid-column: 1;
    grid-row: 1;
  }
}
.person h3 {
  font-family: var(--ff-serif);
  font-size: var(--fs-lg);
  color: var(--c-maroon);
  font-weight: 500;
  margin-bottom: var(--s-2);
}
.person p {
  font-size: var(--fs-sm);
  line-height: var(--lh-detail);
  color: var(--c-ink-soft);
}
.person__where {
  font-family: var(--ff-sans);
  font-size: var(--fs-xs);
  color: var(--c-muted);
  font-weight: 400;
  letter-spacing: 0.02em;
}
.person--delwyn { margin-bottom: var(--s-8); }
.person .person__role {
  margin: 0 0 var(--s-1);
  color: var(--c-ink);
  font-weight: 600;
}
.person .person__location {
  margin: 0 0 var(--s-4);
  color: var(--c-muted);
  font-size: var(--fs-xs);
  letter-spacing: 0.02em;
}
.delwyn-publication {
  margin-top: var(--s-5);
  padding-top: var(--s-5);
  border-top: 1px solid var(--c-line);
}
.delwyn-publication h4 {
  margin-bottom: var(--s-4);
  color: var(--c-maroon);
  font-family: var(--ff-serif);
  font-size: var(--fs-base);
  font-weight: 500;
}
.delwyn-publication__layout { display: grid; gap: var(--s-4); }
.delwyn-publication__cover {
  display: block;
  width: 7rem;
  height: auto;
}
.person .delwyn-publication__title {
  margin-bottom: var(--s-2);
  color: var(--c-ink);
  font-size: var(--fs-base);
}
.person .delwyn-publication__editors,
.person .delwyn-publication__imprint { margin-bottom: var(--s-2); }
.delwyn-publication__link { text-decoration: underline; text-underline-offset: 0.15em; }
.delwyn-publication__link:hover,
.delwyn-publication__link:focus-visible { text-decoration-thickness: 2px; }
.delwyn-track-record {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--s-2) var(--s-4);
  margin-top: var(--s-5);
  padding: var(--s-3) 0;
  border-top: 1px solid var(--c-line);
  border-bottom: 1px solid var(--c-line);
  color: var(--c-ink);
  text-decoration: none;
}
.delwyn-track-record:hover,
.delwyn-track-record:focus-visible { color: var(--c-accent); }
.delwyn-track-record__meta {
  color: var(--c-muted);
  font-size: var(--fs-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
@media (min-width: 48em) {
  .delwyn-publication__layout {
    grid-template-columns: 8rem minmax(0, 1fr);
    gap: var(--s-5);
  }
  .delwyn-publication__cover { width: 8rem; }
}

/* Delwyn's research story — editorial rows, dated milestones and source record */
.research-body { max-width: 66ch; min-width: 0; }
.research-breadcrumb { margin-bottom: var(--s-7); font-size: var(--fs-sm); }
.research-breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin: 0;
  padding: 0;
  list-style: none;
}
.research-breadcrumb li { margin: 0; }
.research-breadcrumb li + li::before { content: ">"; margin-right: var(--s-2); }
.research-breadcrumb a { text-decoration: underline; text-underline-offset: 3px; }
.research-intro::after { content: ""; display: block; clear: both; }
.research-intro__portrait {
  float: right;
  width: 6.25rem;
  height: 6.25rem;
  margin: 0 0 var(--s-3) var(--s-5);
  object-fit: cover;
  border-radius: 50%;
}
.research-contribution {
  padding: var(--s-7) 0;
  border-top: 1px solid var(--c-line);
}
.research-contribution:first-of-type { margin-top: var(--s-6); }
.research-contribution:last-child { padding-bottom: 0; }
.research-contribution h3 {
  margin: 0;
  color: var(--c-accent-ink);
  font-size: var(--fs-xl);
  line-height: var(--lh-snug);
}
.research-case {
  margin-top: var(--s-6);
  padding: var(--s-5);
  background: var(--c-rose);
}
.research-case h4 {
  margin-bottom: var(--s-3);
  color: var(--c-accent-ink);
  font-size: var(--fs-lg);
}
.research-case p { font-size: var(--fs-sm); line-height: var(--lh-body); }
.research-dated-list { margin: 0; padding: 0; list-style: none; }
.research-dated-list li {
  display: grid;
  grid-template-columns: 3.25rem minmax(0, 1fr);
  gap: var(--s-4);
  margin: 0;
  padding: var(--s-4) 0;
  border-top: 1px solid var(--c-line);
}
.research-dated-list li:last-child { border-bottom: 1px solid var(--c-line); }
.research-dated-list__date { color: var(--c-accent-ink); font-variant-numeric: tabular-nums; font-weight: 600; }
.research-book { margin-top: var(--s-7); }
.research-book h3 { color: var(--c-accent-ink); line-height: var(--lh-snug); }
.research-book__editors,
.research-book__imprint { font-size: var(--fs-sm); margin-bottom: var(--s-2); }
.research-source-note { font-size: var(--fs-xs); margin: var(--s-3) 0 0; }
.research-talks article { padding: var(--s-6) 0; border-top: 1px solid var(--c-line); }
.research-talks article:last-child { padding-bottom: 0; }
.research-talks h3 { color: var(--c-accent-ink); line-height: var(--lh-snug); }
.research-talks__meta { font-size: var(--fs-xs); margin-bottom: var(--s-3); }
.research-credentials { display: grid; gap: var(--s-7); }
.research-contact .btn { margin-top: var(--s-2); }
.page-delwyn .site-footer { margin-top: 0; }
@media (min-width: 48em) {
  .research-split { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: var(--s-7); }
  .research-case { padding: var(--s-6); }
  .research-dated-list li { grid-template-columns: 4rem minmax(0, 1fr); gap: var(--s-5); }
  .research-credentials { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--s-8); }
}

/* EPD directory — definition list, 2 columns on desktop, detail scale */
.epd-list { margin: 0; }
@media (min-width: 48em) {
  .epd-list { column-count: 2; column-gap: var(--s-7); }
}
.epd-list dt {
  font-family: var(--ff-serif);
  font-size: var(--fs-base);
  color: var(--c-maroon);
  margin: 0 0 var(--s-1);
  font-weight: 500;
  break-after: avoid;
}
.epd-list dd {
  margin: 0 0 var(--s-4);
  padding-left: 0;
  color: var(--c-ink-soft);
  font-size: var(--fs-sm);
  line-height: var(--lh-detail);
  break-inside: avoid;
}

/* Document download list */
.doc-list { list-style: none; padding: 0; margin: 0; }
.doc-list li {
  border-top: 1px solid var(--c-line);
  padding: var(--s-3) 0;
  margin-bottom: 0;
}
.doc-list li:last-child { border-bottom: 1px solid var(--c-line); }
.doc-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-4);
  color: var(--c-ink);
  text-decoration: none;
}
.doc-list a:hover,
.doc-list a:focus-visible {
  color: var(--c-accent);
  text-decoration: none;
}
.doc-list .doc-list__meta {
  font-size: var(--fs-xs);
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

/* -----------------------------------------------------------------------------
   LCBA metrics table — horizontally scrollable on mobile, detail scale
   ----------------------------------------------------------------------------- */
.lcba-metrics-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: var(--s-5) 0 var(--s-3);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  background: var(--c-bg);
}
.lcba-metrics {
  width: 100%;
  min-width: 44rem;
  border-collapse: collapse;
  font-size: var(--fs-sm);
  line-height: var(--lh-detail);
}
.lcba-metrics caption {
  caption-side: top;
  text-align: left;
  padding: var(--s-3) var(--s-4);
  font-size: var(--fs-xs);
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--c-bg-alt);
  border-bottom: 1px solid var(--c-line);
}
.lcba-metrics th,
.lcba-metrics td {
  padding: var(--s-2) var(--s-4);
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--c-line);
}
.lcba-metrics thead th {
  font-family: var(--ff-sans);
  background: var(--c-bg-soft);
  font-weight: 600;
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-muted);
  white-space: nowrap;
}
.lcba-metrics tr.group th {
  background: var(--c-bg-alt);
  color: var(--c-maroon);
  font-family: var(--ff-serif);
  font-size: var(--fs-base);
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  padding: var(--s-3) var(--s-4);
}
.lcba-metrics tbody th[scope="row"] {
  font-weight: 600;
  color: var(--c-ink);
  font-family: var(--ff-sans);
}
.lcba-metrics sub { font-size: 0.78em; }
.table-note {
  font-size: var(--fs-xs);
  color: var(--c-muted);
  margin-top: var(--s-2);
}
.lcba-metrics-hint {
  display: none;
  margin: 0 0 var(--s-2);
  font-size: var(--fs-xs);
  color: var(--c-muted);
  text-align: right;
  letter-spacing: 0.04em;
}
@media (max-width: 47.99em) {
  .lcba-metrics-hint { display: block; }
  .lcba-metrics-wrap {
    box-shadow:
      inset -1.25rem 0 1rem -1rem rgba(0, 0, 0, 0.12),
      inset 1.25rem 0 1rem -1rem rgba(0, 0, 0, 0.06);
  }
}

/* -----------------------------------------------------------------------------
   CRC partners tables (LCIs) — 3-col / 2-col on desktop, stacked on mobile
   ----------------------------------------------------------------------------- */
.crc-partners,
.crc-alliances {
  margin: var(--s-5) 0 var(--s-7);
}
.crc-partners h3,
.crc-alliances h3 {
  font-family: var(--ff-serif);
  font-size: var(--fs-lg);
  color: var(--c-maroon);
  font-weight: 500;
  margin-bottom: var(--s-4);
}
.crc-cols {
  display: grid;
  gap: var(--s-5);
  grid-template-columns: 1fr;
}
@media (min-width: 48em) {
  .crc-partners .crc-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .crc-alliances .crc-cols { grid-template-columns: 1fr 1.6fr; gap: var(--s-7); }
}
.crc-col h4 {
  font-family: var(--ff-sans);
  font-size: var(--fs-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--c-muted);
  margin-bottom: var(--s-3);
  font-weight: 600;
}
.crc-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: var(--fs-sm);
  line-height: var(--lh-detail);
}
.crc-col li {
  border-top: 1px solid var(--c-line);
  padding: var(--s-2) 0;
  margin-bottom: 0;
}
.crc-col li:last-child { border-bottom: 1px solid var(--c-line); }

/* -----------------------------------------------------------------------------
   Contact form
   ----------------------------------------------------------------------------- */
.contact-form {
  display: grid;
  gap: var(--s-4);
}
.contact-form .form-row {
  display: grid;
  gap: var(--s-4);
  grid-template-columns: 1fr;
}
@media (min-width: 36em) {
  .contact-form .form-row { grid-template-columns: 1fr 1fr; }
}
.contact-form .field {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}
.contact-form label {
  font-family: var(--ff-sans);
  font-size: var(--fs-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-muted);
  font-weight: 600;
}
.contact-form input,
.contact-form textarea {
  font: inherit;
  font-family: var(--ff-serif);
  font-size: var(--fs-base);
  color: var(--c-ink);
  background: var(--c-bg);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  padding: var(--s-3) var(--s-4);
  width: 100%;
  line-height: var(--lh-snug);
  transition: border-color .15s, box-shadow .15s;
}
.contact-form textarea { resize: vertical; min-height: 9rem; }
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--c-accent-ink);
  box-shadow: 0 0 0 3px rgba(92,138,128,0.22);
}
.contact-form .hp-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.contact-form .form-actions {
  display: flex;
  align-items: center;
  gap: var(--s-5);
  flex-wrap: wrap;
  margin-top: var(--s-2);
}
.contact-form .form-status {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--c-muted);
}
.contact-form .form-status.is-error { color: var(--c-danger); }
.contact-form button[type="submit"]:disabled { opacity: 0.6; cursor: progress; }

/* -----------------------------------------------------------------------------
   Contact form panels — success + error post-submit states
   ----------------------------------------------------------------------------- */
.form-shell { display: block; }
.form-shell > [hidden] { display: none; }

.form-panel {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: var(--s-5);
  row-gap: var(--s-3);
  padding: var(--s-7) var(--s-6);
  border-radius: var(--radius);
  background: var(--c-bg);
  border: 1px solid var(--c-line);
  animation: form-panel-in 0.45s ease-out;
}
.form-panel:focus { outline: none; }
.form-panel:focus-visible {
  outline: 2px solid var(--c-accent-ink);
  outline-offset: 3px;
}

.form-panel__icon {
  grid-row: 1 / span 3;
  width: 3rem;
  height: 3rem;
  flex: none;
}
.form-panel__icon svg { width: 100%; height: 100%; display: block; }

.form-panel__title {
  grid-column: 2;
  font-family: var(--ff-serif);
  font-size: var(--fs-xl);
  font-weight: 500;
  line-height: var(--lh-tight);
  margin: 0;
  letter-spacing: -0.005em;
}
.form-panel__body {
  grid-column: 2;
  margin: 0;
  font-size: var(--fs-base);
  line-height: var(--lh-snug);
  color: var(--c-ink-soft);
}
.form-panel__actions {
  grid-column: 2;
  margin: var(--s-2) 0 0;
}

/* Success — deep teal on light teal */
.form-panel--success {
  background: #D9E8E6;
  border-color: #B7D1CB;
  color: var(--c-ink);
}
.form-panel--success .form-panel__icon  { color: var(--c-accent-ink); }
.form-panel--success .form-panel__title { color: var(--c-accent-ink); }

/* Error — danger red, kept distinct so failure still reads as failure */
.form-panel--error {
  background: #faf1ef;
  border-color: #e8cfca;
  color: var(--c-ink);
}
.form-panel--error .form-panel__icon  { color: var(--c-danger); }
.form-panel--error .form-panel__title { color: var(--c-danger); }
.form-panel--error a {
  color: var(--c-danger);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.form-panel--error a:hover,
.form-panel--error a:focus-visible {
  color: #5e2e2a;
}

@keyframes form-panel-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .form-panel { animation: none; }
}

@media (max-width: 30em) {
  .form-panel {
    grid-template-columns: 1fr;
    column-gap: 0;
    padding: var(--s-6) var(--s-5);
    text-align: left;
  }
  .form-panel__icon { grid-row: auto; grid-column: 1; }
  .form-panel__title,
  .form-panel__body,
  .form-panel__actions { grid-column: 1; }
}

/* -----------------------------------------------------------------------------
   Footer
   ----------------------------------------------------------------------------- */
.site-footer {
  background: var(--c-rose);          /* light teal */
  color: var(--c-ink);
  padding: var(--s-8) 0 var(--s-6);
  margin-top: var(--s-9);
}
/* Pages ending on a colour band: footer abuts the last section directly */
.page-contact .site-footer,
.page-insights .site-footer { margin-top: 0; }
.site-footer a { color: var(--c-accent-ink); text-decoration: underline; }
.site-footer a:hover,
.site-footer a:focus-visible { color: var(--c-accent); text-decoration: underline; }

.site-footer__grid {
  display: grid;
  gap: var(--s-6);
  grid-template-columns: 1fr;
}
@media (min-width: 56em) {
  .site-footer__grid { grid-template-columns: 1fr 1fr; gap: var(--s-8); }
}

.site-footer h2 {
  font-family: var(--ff-serif);
  font-size: var(--fs-2xl);
  color: var(--c-accent-ink);
  margin: 0 0 var(--s-4);
  font-weight: 500;
}
.site-footer h3 {
  font-family: var(--ff-serif);
  font-size: var(--fs-lg);
  color: var(--c-accent-ink);
  margin: 0 0 var(--s-2);
  font-weight: 500;
}
.site-footer__pronunciation {
  margin: calc(-1 * var(--s-2)) 0 var(--s-2);
  font-size: var(--fs-xs);
  line-height: var(--lh-detail);
}
.site-footer__tag {
  letter-spacing: 0.06em;
  font-size: var(--fs-sm);
  margin-bottom: var(--s-5);
}
.site-footer__contact {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: var(--fs-sm);
  line-height: 1.7;
}
.site-footer__contact li { margin-bottom: var(--s-2); }
.site-footer__label {
  display: inline-block;
  min-width: 6rem;
}
.site-footer__social {
  list-style: none;
  padding: 0;
  margin: var(--s-4) 0 0;
  display: flex;
  gap: var(--s-3);
}
.site-footer__social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--c-accent-ink);
  text-decoration: none;
  transition: color 0.15s;
}
.site-footer__social a:hover,
.site-footer__social a:focus-visible { color: var(--c-accent); text-decoration: none; }
.site-footer__social svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: currentColor;
}
.site-footer__bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 0 0.4em;
  margin-top: var(--s-7);
  padding-top: var(--s-4);
  border-top: 1px solid rgba(31,58,53,0.20);
  text-align: center;
  font-size: var(--fs-xs);
}
.site-footer__bar a { font-weight: inherit; }
@media (max-width: 35.9375em) {
  .site-footer__sep { display: none; }
  .site-footer__copy,
  .site-footer__credit { width: 100%; line-height: 1.8; }
}

/* -----------------------------------------------------------------------------
   Utility
   ----------------------------------------------------------------------------- */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.mt-0 { margin-top: 0; }
.mt-5 { margin-top: var(--s-5); }
.mt-6 { margin-top: var(--s-6); }
.mb-0 { margin-bottom: 0; }

/* =============================================================================
   Mobile / small-screen overrides
   ============================================================================= */

/* overflow-x: clip prevents full-bleed hero causing horizontal scroll
   without breaking sticky positioning (unlike overflow: hidden). */
html { overflow-x: clip; }

/* Header: always add a small base top padding, then extend further into the
   notch / status bar on devices that expose a safe-area-inset-top.
   viewport-fit=cover must be set in the meta viewport for the env() to resolve
   to a non-zero value on real iOS/Android devices. */
.site-header { padding-top: max(var(--s-2), env(safe-area-inset-top, 0px)); }

/* ---- Hamburger toggle button (hidden by default; shown on mobile via media query) ---- */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0.5rem;
  background: none;
  border: 2px solid transparent;
  cursor: pointer;
  border-radius: var(--radius);
  color: var(--c-ink);
  flex-shrink: 0;
}
.nav-toggle:focus-visible {
  outline: 2px solid var(--c-accent-ink);
  outline-offset: 2px;
}
.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.15s ease;
  transform-origin: center;
}
/* X state */
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
/* No animation for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  .nav-toggle span { transition: none; }
}

@media (max-width: 47.9375em) {
  /* Show hamburger */
  .nav-toggle { display: flex; }

  /* No-JS fallback: nav visible by default. JS adds .js to <html>;
     only then do we collapse it and require the toggle. */
  .js .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--c-bg);
    border-bottom: 1px solid var(--c-line);
    padding: var(--s-4) var(--s-5) var(--s-6);
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: flex-start;   /* override desktop centre-alignment */
    gap: var(--s-3);
    z-index: 20;
    box-shadow: 0 8px 20px rgba(0,0,0,0.10);
    /* Scroll if panel taller than viewport (e.g. landscape phone) */
    max-height: calc(100dvh - 4rem);
    overflow-y: auto;
  }
  .js .site-nav.is-open { display: flex; }

  /* Non-JS nav: stack naturally in the header flex row (wraps below brand) */
  .site-nav ul {
    flex-direction: column;
    gap: 0;
    width: 100%;
  }
  .site-nav li { border-top: 1px solid var(--c-line); }
  .site-nav li:last-child { border-bottom: 1px solid var(--c-line); }
  /* 44px minimum tap target on each link */
  .site-nav ul a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: var(--s-3) 0;
    font-size: var(--fs-base);
  }
  /* Contact Us: plain nav link in the mobile panel — no pill */
  .site-nav .btn {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 44px;
    padding: var(--s-3) 0;
    margin-top: 0;
    background: none;
    border: none;

    border-radius: 0;
    color: var(--c-ink);
    font-size: var(--fs-base);
    font-weight: 500;
    letter-spacing: 0.02em;
  }
  .site-nav .btn:hover,
  .site-nav .btn:focus-visible {
    background: none;
    color: var(--c-accent);
    border-color: var(--c-line);
  }
  .site-nav .btn[aria-current="page"] {
    color: var(--c-accent);
    background: none;
    opacity: 1;
  }

  /* Footer contact: stack label above value */
  .site-footer__label {
    display: block;
    min-width: 0;
    font-size: var(--fs-xs);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 2px;
    opacity: 0.7;
  }
  .site-footer__contact li { margin-bottom: var(--s-3); }

  /* Hero overlay: stronger gradient for text legibility on small screens */
  .hero::before {
    background: linear-gradient(180deg,
      rgba(0,0,0,0.55) 0%,
      rgba(0,0,0,0.35) 40%,
      rgba(0,0,0,0.68) 100%);
  }
  .page-hero::before {
    background: linear-gradient(180deg,
      rgba(0,0,0,0.30) 0%,
      rgba(0,0,0,0.68) 100%);
  }
}
