/* =========================================================================
   Merdian Group — site styles
   -------------------------------------------------------------------------
   Brand: Merdian Group identity v1.0 "Shared Span" (15 October 2026).
   Palette, typography and logo usage follow the brand guidelines:
   - Deep teal #183D43 for identity, content text and dark backgrounds
   - Porcelain #F3F4EF for page backgrounds
   - Mineral #8BAEA5 for rules, panels and small accents only
     (never normal text on white or porcelain: 2.4:1)
   - Source Sans 3: 400 body, 600 headings, 700 emphasis
   ========================================================================= */

@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/SourceSans3-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/SourceSans3-Semibold.woff2") format("woff2");
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/SourceSans3-Bold.woff2") format("woff2");
}

:root {
  /* Brand palette */
  --teal: #183D43;
  --porcelain: #F3F4EF;
  --mineral: #8BAEA5;
  --white: #FFFFFF;

  /* Roles. Tints of teal are checked for AA contrast on porcelain and white. */
  --paper: var(--porcelain);
  --ink: var(--teal);
  --ink-soft: #3D5C61;     /* 6.6:1 on porcelain */
  --ink-faint: #4A666A;    /* 5.6:1 on porcelain */
  --rule: #D1DDD6;         /* light mineral tint, decorative */
  --on-teal-soft: #C9D8D3; /* 8.0:1 on teal */
  --focus: var(--teal);

  /* Typography */
  --font-body: "Source Sans 3", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  --font-project-serif: Georgia, "Times New Roman", serif;

  /* Scale: body 18px; main headings 40–64px desktop, 32–40px mobile */
  --step--1: 0.9375rem;
  --step-0: 1.125rem;
  --step-1: 1.375rem;
  --step-2: clamp(1.625rem, 1.4rem + 0.9vw, 2rem);
  --step-3: clamp(2rem, 1.5rem + 2.2vw, 3rem);
  --step-4: clamp(2.25rem, 1.4rem + 3.6vw, 4rem);

  /* Space & layout */
  --gutter: clamp(1rem, 0.5rem + 2.5vw, 2.5rem);
  --section: clamp(3.5rem, 2.5rem + 4.5vw, 6.5rem);
  --max: 70rem;
}

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

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 1rem;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-weight: 600;
  line-height: 1.15;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0 0 1em; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

strong { font-weight: 700; }

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  text-decoration-color: var(--mineral);
  transition: text-decoration-color 0.15s ease;
}
a:hover { text-decoration-color: currentColor; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}
main:focus { outline: none; }

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

.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;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 10;
  padding: 0.6rem 1rem;
  background: var(--white);
  color: var(--teal);
  font-weight: 600;
}
.skip-link:focus { top: 0.75rem; }

.wrap {
  width: 100%;
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---- Header ------------------------------------------------------------- */
/* Secondary teal logo on white, at least 180px wide. Clear space around the
   logo is a quarter of the symbol width (~9px at 200px), provided by padding. */

.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--mineral);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  flex-wrap: wrap;
  padding-block: 0.75rem;
}

.brand-link {
  display: inline-flex;
  padding: 10px;
  margin-left: -10px;
  flex: none;
}
.brand-logo {
  width: 200px;
  height: auto;
}

.nav-list, .footer-list, .link-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-list {
  display: flex;
  gap: 0.25rem 2rem;
  flex-wrap: wrap;
}
.nav-list a {
  display: inline-block;
  padding-block: 0.4rem;
  font-size: 1rem;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
.nav-list a:hover { border-bottom-color: var(--mineral); }
.nav-list a[aria-current="page"] {
  font-weight: 600;
  border-bottom-color: var(--teal);
}

/* ---- Shared type -------------------------------------------------------- */

.eyebrow, .project-category, .toc-title, .section-aside, .updated {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.eyebrow { margin-bottom: 1.25rem; }

.lede {
  font-size: var(--step-1);
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 36em;
}

.placeholder {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--rule);
  padding: 0.05em 0.35em;
}

/* ---- Buttons ------------------------------------------------------------ */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  min-height: 3rem;
  padding: 0.7rem 1.4rem;
  background: var(--teal);
  color: var(--white);
  border: 2px solid var(--teal);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.button:hover {
  background: transparent;
  color: var(--teal);
}
.button--ghost {
  background: transparent;
  color: var(--teal);
}
.button--ghost:hover {
  background: var(--teal);
  color: var(--white);
}

.ext {
  display: inline-block;
  margin-left: 0.2em;
  font-size: 0.9em;
  text-decoration: none;
}

/* ---- Hero & page heads -------------------------------------------------- */

.hero-inner {
  padding-block: clamp(3rem, 2rem + 5vw, 6.5rem) clamp(3rem, 2rem + 4vw, 5rem);
}
.hero-title {
  font-size: var(--step-4);
  line-height: 1.08;
  letter-spacing: -0.025em;
  max-width: 14em;
  margin-bottom: 1.5rem;
}

.page-head .wrap {
  padding-block: clamp(2.75rem, 2rem + 4vw, 5rem) clamp(1.5rem, 1rem + 2vw, 2.5rem);
}
.page-title {
  font-size: var(--step-3);
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
}
.updated { margin-top: 1.5rem; }

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

.section { padding-block: var(--section); }
.section--tight { padding-top: clamp(1rem, 0.5rem + 2vw, 2rem); }
.hero + .section { padding-top: clamp(1rem, 0.5rem + 2vw, 2rem); }

/* Rule drawn inside the gutters so it aligns with the content edges. */
.section--rule { padding-top: 0; }
.section--rule > .wrap {
  padding-top: var(--section);
  background: linear-gradient(var(--mineral), var(--mineral)) no-repeat center top / calc(100% - 2 * var(--gutter)) 1px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem 2rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}
.section-title { font-size: var(--step-2); }
.section-aside { margin: 0; }
.section-more { margin-top: 2rem; }

.split {
  display: grid;
  gap: 1.25rem 3rem;
}
@media (min-width: 48em) {
  .split { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
}

.prose { max-width: 40em; }
.prose h3 {
  font-size: var(--step-1);
  margin: 2rem 0 0.6rem;
}
.prose ul:not(.link-list) { padding-left: 1.2em; }

.cta-band {
  background: var(--white);
  border-top: 1px solid var(--mineral);
}

/* ---- Projects ----------------------------------------------------------- */
/* Merdian leads; each project keeps its own established colours, supplied
   per project as --project-accent / --project-ink / --project-font in
   projects.css (generated from src/data/projects.json). */

.project-list {
  display: grid;
  gap: 1.5rem;
}
@media (min-width: 48em) {
  .project-list { grid-template-columns: repeat(auto-fill, minmax(min(100%, 26rem), 1fr)); }
}

.project {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--project-accent, var(--teal));
  padding: clamp(1.5rem, 1.2rem + 1vw, 2rem);
}

.project-logo {
  height: 3rem;
  width: auto;
  margin-bottom: 1.25rem;
}

.project-category { margin-bottom: 0.5rem; }
.project-name {
  font-family: var(--project-font, inherit);
  color: var(--project-ink, var(--teal));
  font-size: var(--step-2);
  line-height: 1.2;
  margin-bottom: 0.9rem;
}
.project-summary {
  color: var(--ink-soft);
  font-size: 1.0625rem;
}
.project-link {
  margin: 1.25rem 0 1.5rem;
  font-weight: 600;
}

/* Pinned to the bottom so endorsements line up across cards. */
.endorsement {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: auto;
  padding-top: 1.1rem;
  border-top: 1px solid var(--rule);
  font-size: 0.875rem;
  color: var(--ink-soft);
}
.endorsement img { width: 20px; height: auto; flex: none; }

/* ---- About FAQ ---------------------------------------------------------- */

.faq { max-width: 40em; }
.faq h3 {
  font-size: var(--step-1);
  margin: 0 0 0.5rem;
}
.faq h3:not(:first-child) {
  margin-top: 1.75rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--rule);
}
.faq p { color: var(--ink-soft); }

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

.contact-primary {
  font-size: var(--step-2);
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.contact-primary .placeholder { font-size: 0.6em; font-weight: 400; }

.link-list li + li { margin-top: 0.6rem; }

/* ---- Legal -------------------------------------------------------------- */

.legal {
  display: grid;
  gap: 2rem 3rem;
}
@media (min-width: 48em) {
  .legal { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
  .toc { position: sticky; top: 2rem; align-self: start; }
}
.toc ol { margin: 0.75rem 0 0; padding-left: 1.2em; }
.toc li + li { margin-top: 0.35rem; }
.legal-body section + section {
  margin-top: 3rem;
  padding-top: 3rem;
  border-top: 1px solid var(--mineral);
}
.legal-body h2 {
  font-size: var(--step-2);
  margin-bottom: 1rem;
}

/* ---- Footer ------------------------------------------------------------- */
/* White secondary logo on deep teal. */

.site-footer {
  background: var(--teal);
  color: var(--white);
  font-size: var(--step--1);
}
.site-footer a { text-decoration-color: var(--mineral); }
.site-footer a:hover { text-decoration-color: currentColor; }
.site-footer :focus-visible { outline-color: var(--white); }

.footer-inner {
  display: grid;
  gap: 2rem 3rem;
  padding-block: 3rem;
}
@media (min-width: 48em) {
  .footer-inner { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
}
.footer-logo {
  width: 190px;
  height: auto;
  margin: 10px 0 1.25rem;
}
.footer-note { max-width: 24em; color: var(--on-teal-soft); }
.footer-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.75rem;
}
.footer-legal {
  grid-column: 1 / -1;
  padding-top: 1.5rem;
  border-top: 1px solid rgb(139 174 165 / 0.45);
  color: var(--on-teal-soft);
}

/* ---- Small screens ------------------------------------------------------ */
/* Keep the hero CTAs inside the first viewport on short phones (~360x640). */

@media (max-width: 30em) {
  .brand-logo { width: 180px; }
  .header-inner { gap: 0.25rem 1.5rem; padding-block: 0.5rem; }
  .hero-inner { padding-block: 2rem 3rem; }
  .hero-title { font-size: 2rem; margin-bottom: 1rem; }
  .hero .lede { font-size: var(--step-0); }
  .eyebrow { margin-bottom: 0.9rem; }
  .actions { margin-top: 1.5rem; }
}

/* ---- Print -------------------------------------------------------------- */

@media print {
  .site-header nav, .skip-link, .actions, .toc { display: none; }
  .site-footer { background: #fff; color: #000; }
  .footer-logo { display: none; }
  a[rel="external"]::after { content: " (" attr(href) ")"; font-size: 0.85em; }
}

/* ---- Cookie notice ------------------------------------------------------ */
/* Informational only: the site sets no non-essential cookies. Compact and
   fixed to the bottom; the body gets matching padding so the footer is
   never hidden behind it. Revealed by cookie-notice.js. */

.cookie-notice {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 20;
  background: var(--teal);
  color: var(--white);
  font-size: 0.9375rem;
  border-top: 1px solid var(--mineral);
}
.cookie-notice[hidden] { display: none; }
.cookie-notice-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.6rem;
}
.cookie-notice p { margin: 0; }
.cookie-notice a { text-decoration-color: var(--mineral); white-space: nowrap; }
.cookie-notice a:hover { text-decoration-color: currentColor; }
.cookie-notice :focus-visible { outline-color: var(--white); }
.cookie-notice-button {
  flex: none;
  min-height: 2.25rem;
  min-width: 3.5rem;
  padding: 0.3rem 1rem;
  background: var(--white);
  color: var(--teal);
  border: 2px solid var(--white);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.cookie-notice-button:hover { background: transparent; color: var(--white); }

.has-cookie-notice body { padding-bottom: 4.5rem; }

@media print {
  .cookie-notice { display: none !important; }
}
