/* ============================================================
   Mansfield Consulting — shared styles
   Deep navy + warm cream, editorial serif, organic curves.
   ============================================================ */

:root {
  --ink:    #0c1f30;   /* deepest navy — footer, hero */
  --navy:   #12293d;   /* primary navy */
  --navy-2: #1c3a54;   /* lifted navy */
  --steel:  #6d99ba;   /* steel blue accent */
  --haze:   #c9dcea;   /* pale blue */
  --cream:  #f4efe3;   /* warm cream */
  --paper:  #fbf8f1;   /* card paper */
  --clay:   #c16a3f;   /* terracotta accent */
  --sage:   #7d9070;   /* muted green */
  --ink-soft: rgba(18,41,61,0.72);
  --ink-faint: rgba(18,41,61,0.09);
  --cream-soft: rgba(244,239,227,0.72);
  --cream-faint: rgba(244,239,227,0.14);

  --serif: 'Fraunces', 'Cormorant Garamond', Georgia, serif;
  --sans:  'DM Sans', -apple-system, sans-serif;
  --mono:  'IBM Plex Mono', 'Courier New', monospace;

  --accent: var(--steel);           /* per-page accent, overridden below */
  --radius: 1.75rem;
  --gutter: clamp(1.25rem, 5vw, 3.5rem);
  --measure: 68ch;
}

body.page-oceans      { --accent: var(--steel); }
body.page-environment { --accent: var(--sage); }
body.page-urbanism    { --accent: var(--clay); }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
html:focus-within { scroll-behavior: smooth; }

body {
  background: var(--cream);
  color: var(--navy);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Soft paper grain over everything */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 2000;
  pointer-events: none;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.35 0 0 0 0 0.32 0 0 0 0 0.27 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: var(--steel); color: var(--paper); }

img { max-width: 100%; display: block; }
a { color: inherit; }

/* ---------- type helpers ---------- */

.kicker {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: 1.4rem;
}

h1, h2, h3 { font-family: var(--serif); font-weight: 380; line-height: 1.08; letter-spacing: -0.01em; }

h1 em, h2 em, h3 em, .lede em {
  font-style: italic;
  font-weight: 340;
  color: var(--steel);
}

.lede {
  font-size: clamp(1.02rem, 1.6vw, 1.18rem);
  font-weight: 300;
  line-height: 1.75;
  max-width: var(--measure);
  color: var(--ink-soft);
}

/* ============================================================
   NAV
   ============================================================ */

.site-head { position: relative; background: var(--navy); color: var(--cream); overflow: hidden; }

.nav {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  max-width: 1160px;
  margin: 0 auto;
  padding: 1.4rem var(--gutter) 0;
}

.brand { text-decoration: none; line-height: 1.05; display: inline-block; }
.brand .brand-name {
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 420;
  color: var(--cream);
  letter-spacing: 0.01em;
}
.brand .brand-name span { color: var(--steel); }
.brand .brand-sub {
  display: block;
  font-family: var(--mono);
  font-size: 0.52rem;
  font-weight: 500;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--cream-soft);
  margin-top: 0.28rem;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: clamp(1.2rem, 2.6vw, 2.4rem);
  list-style: none;
}
.nav-menu a:not(.nav-cta) {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--cream-soft);
  padding: 0.4rem 0;
  border-bottom: 1px solid transparent;
  transition: color 0.25s, border-color 0.25s;
}
.nav-menu a:not(.nav-cta):hover { color: var(--cream); }
.nav-menu a:not(.nav-cta)[aria-current="page"] { color: var(--cream); border-bottom-color: var(--accent); }

.nav-cta {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--cream);
  padding: 0.6rem 1.35rem;
  border: 1px solid rgba(244,239,227,0.35);
  border-radius: 999px;
  transition: background 0.25s, border-color 0.25s, color 0.25s;
}
.nav-cta:hover { background: var(--cream); color: var(--navy); border-color: var(--cream); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  position: relative;
  z-index: 40;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--cream);
  margin: 5px auto;
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { transform: translateY(-6.5px) rotate(-45deg); }

/* ============================================================
   HERO / PAGE HEADER
   ============================================================ */

.hero {
  position: relative;
  z-index: 10;
  max-width: 1160px;
  margin: 0 auto;
  padding: clamp(4.5rem, 11vh, 8rem) var(--gutter) clamp(4rem, 10vh, 7rem);
}
.hero h1 {
  font-size: clamp(2.7rem, 6.4vw, 5.2rem);
  color: var(--cream);
  max-width: 21ch;
  margin-bottom: 1.8rem;
}
.hero .kicker { color: var(--steel); }
.hero .lede { color: var(--cream-soft); }

.hero-ctas { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2.6rem; }
.btn {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.9rem 1.9rem;
  border-radius: 999px;
  transition: transform 0.2s, background 0.25s, color 0.25s, border-color 0.25s;
}
.btn:hover { transform: translateY(-2px); }
.btn-solid { background: var(--cream); color: var(--navy); border: 1px solid var(--cream); }
.btn-solid:hover { background: var(--paper); }
.btn-ghost { color: var(--cream); border: 1px solid rgba(244,239,227,0.35); }
.btn-ghost:hover { border-color: var(--cream); }

/* soft aurora blobs behind navy sections */
.blob {
  position: absolute;
  border-radius: 58% 42% 46% 54% / 52% 46% 54% 48%;
  filter: blur(70px);
  opacity: 0.35;
  pointer-events: none;
}
.blob-steel { background: #2c567a; }
.blob-sage  { background: #33503c; }
.blob-clay  { background: #6e4530; }

/* curved transitions between sections */
.curve { display: block; width: 100%; height: clamp(42px, 7vw, 96px); }
.curve svg { display: block; width: 100%; height: 100%; }

/* ============================================================
   SECTIONS
   ============================================================ */

.section { padding: clamp(3.5rem, 9vh, 6.5rem) var(--gutter); position: relative; }
.section-inner { max-width: 1160px; margin: 0 auto; position: relative; }
.section h2 { font-size: clamp(2rem, 4.6vw, 3.4rem); color: var(--navy); max-width: 22ch; margin-bottom: 1.4rem; }
.section-head { margin-bottom: clamp(2.5rem, 6vh, 4rem); }

/* ---------- sector cards (home) ---------- */

.sector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 1.5rem;
}
.sector-card {
  --sector: var(--steel);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  background: var(--paper);
  border-radius: var(--radius);
  border-top-left-radius: 4.5rem;
  padding: 2.4rem 2.1rem 2.2rem;
  text-decoration: none;
  box-shadow: 0 24px 48px -32px rgba(12,31,48,0.28);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.sector-card:hover { transform: translateY(-6px); box-shadow: 0 34px 60px -34px rgba(12,31,48,0.4); }
.sector-card::before {
  content: '';
  position: absolute;
  top: -3.2rem;
  right: -3.2rem;
  width: 9rem;
  height: 9rem;
  border-radius: 58% 42% 46% 54% / 52% 46% 54% 48%;
  background: var(--sector);
  opacity: 0.14;
  transition: transform 0.4s ease, opacity 0.3s ease;
}
.sector-card:hover::before { transform: scale(1.35); opacity: 0.2; }
.sector-card.is-oceans      { --sector: var(--steel); }
.sector-card.is-environment { --sector: var(--sage); }
.sector-card.is-urbanism    { --sector: var(--clay); }

.sector-num {
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--sector);
}
.sector-card h3 { font-size: 1.85rem; color: var(--navy); }
.sector-card p { font-size: 0.92rem; color: var(--ink-soft); line-height: 1.7; }
.sector-more {
  margin-top: auto;
  padding-top: 1.1rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sector);
}
.sector-more::after { content: ' \2192'; transition: margin-left 0.25s; }
.sector-card:hover .sector-more::after { margin-left: 0.5rem; }

/* ---------- dark section variant ---------- */

.section-dark { background: var(--navy); color: var(--cream); overflow: hidden; }
.section-dark h2 { color: var(--cream); }
.section-dark .lede { color: var(--cream-soft); }
.section-dark .kicker { color: var(--steel); }

/* ---------- tag pills ---------- */

.tags { display: flex; flex-wrap: wrap; gap: 0.45rem; list-style: none; }
.tags li, .pill {
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--navy);
  background: var(--ink-faint);
  padding: 0.34rem 0.85rem;
  border-radius: 999px;
  white-space: nowrap;
}
.tags-invert li { background: var(--cream-faint); color: var(--cream-soft); }

/* colour-coordinated tag families */
.tags .t-delivery  { background: rgba(193,106,63,0.16);  color: #98512d; }   /* operations & delivery — clay */
.tags .t-fund      { background: rgba(176,139,62,0.18);  color: #7f6126; }   /* fundraising & growth — gold */
.tags .t-policy    { background: rgba(109,153,186,0.2);  color: #3b678b; }   /* policy, research & science — steel */
.tags .t-community { background: rgba(125,144,112,0.2);  color: #56694a; }   /* engagement & partnerships — sage */
.tags .t-eng       { background: rgba(18,41,61,0.12);    color: var(--navy); } /* engineering & systems — navy */

/* ---------- approach list (home) ---------- */

.approach-list { display: grid; gap: 0; max-width: 860px; }
.approach-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.6rem;
  align-items: baseline;
  padding: 1.8rem 0;
}
.approach-item + .approach-item { border-top: 1px solid rgba(244,239,227,0.14); }
.approach-item .num {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  color: var(--steel);
}
.approach-item h3 { font-size: 1.5rem; color: var(--cream); margin-bottom: 0.5rem; }
.approach-item p { font-size: 0.94rem; color: var(--cream-soft); max-width: 58ch; line-height: 1.7; }

/* ---------- stats ---------- */

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
  gap: 2.2rem 1.8rem;
}
.stat .stat-num {
  font-family: var(--serif);
  font-size: clamp(2.8rem, 5vw, 4rem);
  font-weight: 340;
  line-height: 1;
  color: var(--navy);
}
.stat .stat-num em { font-style: italic; color: var(--steel); }
.stat .stat-label {
  font-family: var(--mono);
  font-size: 0.64rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin: 0.7rem 0 0.4rem;
}
.stat p { font-size: 0.85rem; color: var(--ink-soft); max-width: 26ch; line-height: 1.6; }

/* ============================================================
   CAROUSEL — track record
   ============================================================ */

.carousel { position: relative; }
.carousel-track {
  display: flex;
  gap: 1.4rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 0.4rem 0.2rem 1.6rem;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.carousel-track::-webkit-scrollbar { display: none; }

.project-card {
  flex: 0 0 min(400px, 86%);
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  background: var(--paper);
  border-radius: var(--radius);
  border-bottom-right-radius: 4rem;
  padding: 2.2rem 2rem 2rem;
  box-shadow: 0 24px 48px -32px rgba(12,31,48,0.26);
}
.project-card .card-kicker {
  font-family: var(--mono);
  font-size: 0.64rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}
.project-card h3 { font-size: 1.6rem; color: var(--navy); }
.project-card .card-body { font-size: 0.9rem; color: var(--ink-soft); line-height: 1.7; }
.project-card .card-fact {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.08rem;
  color: var(--steel);
  line-height: 1.4;
}
.project-card .tags { margin-top: auto; padding-top: 1rem; }

.carousel-controls {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-top: 0.4rem;
}
.car-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(18,41,61,0.22);
  background: transparent;
  color: var(--navy);
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.25s, color 0.25s, border-color 0.25s, opacity 0.25s;
}
.car-btn:hover { background: var(--navy); color: var(--cream); border-color: var(--navy); }
.car-btn[disabled] { opacity: 0.3; pointer-events: none; }
.carousel-hint {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  opacity: 0.6;
}

/* ============================================================
   PEOPLE
   ============================================================ */

.person {
  display: grid;
  grid-template-columns: minmax(240px, 340px) 1fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}
.person-photo-wrap { position: relative; }
.person-photo {
  width: 100%;
  aspect-ratio: 4 / 4.6;
  object-fit: cover;
  object-position: center top;
  border-radius: 46% 54% 50% 50% / 42% 42% 58% 58%;
  filter: grayscale(1) contrast(1.04);
}
.person-photo-wrap::before {
  content: '';
  position: absolute;
  inset: -1.1rem -1.4rem 1rem 1.2rem;
  border-radius: 54% 46% 52% 48% / 48% 54% 46% 52%;
  background: var(--steel);
  opacity: 0.16;
  z-index: -1;
}
.person-role {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--clay);
  display: block;
  margin-bottom: 0.9rem;
}
.person h2 { margin-bottom: 1.3rem; }
.person .bio p { max-width: var(--measure); color: var(--ink-soft); font-weight: 300; line-height: 1.8; }
.person .bio p + p { margin-top: 1rem; }

.fact-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px,100%), 1fr)); gap: 1.4rem; margin-top: 2.2rem; }
.fact-list .fact-label {
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--steel);
  display: block;
  margin-bottom: 0.35rem;
}
.fact-list .fact-value { font-family: var(--serif); font-size: 1.15rem; color: var(--navy); line-height: 1.35; }

.recognition { list-style: none; display: grid; gap: 0; max-width: 760px; }
.recognition li { padding: 1.15rem 0; }
.recognition li + li { border-top: 1px solid rgba(18,41,61,0.1); }
.recognition h3 { font-size: 1.2rem; color: var(--navy); margin-bottom: 0.2rem; }
.recognition p { font-size: 0.86rem; color: var(--ink-soft); }

/* ============================================================
   FOOTER — "Let's talk" band + contact on every page
   ============================================================ */

.site-foot { position: relative; background: var(--ink); color: var(--cream); overflow: hidden; }
.foot-inner { max-width: 1160px; margin: 0 auto; padding: clamp(3.5rem, 9vh, 6rem) var(--gutter) 2.4rem; position: relative; z-index: 5; }
.foot-inner .kicker { color: var(--steel); }
.foot-title {
  font-size: clamp(2rem, 4.8vw, 3.6rem);
  color: var(--cream);
  max-width: 20ch;
  margin-bottom: 2.6rem;
}
.foot-title em { color: var(--steel); }
.foot-mail {
  display: inline-block;
  font-family: var(--serif);
  font-size: clamp(1.25rem, 2.6vw, 1.8rem);
  color: var(--cream);
  text-decoration: none;
  border-bottom: 1px solid rgba(244,239,227,0.35);
  padding-bottom: 0.2rem;
  transition: border-color 0.25s, color 0.25s;
}
.foot-mail:hover { color: var(--steel); border-color: var(--steel); }

.foot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
  gap: 1.6rem;
  margin-top: 3rem;
  padding-top: 2.2rem;
  border-top: 1px solid rgba(244,239,227,0.14);
}
.foot-grid .foot-label {
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--steel);
  display: block;
  margin-bottom: 0.4rem;
}
.foot-grid a, .foot-grid span.foot-value { font-size: 0.92rem; color: var(--cream-soft); text-decoration: none; }
.foot-grid a:hover { color: var(--cream); }

.foot-base {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.6rem;
  justify-content: space-between;
  margin-top: 3rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(244,239,227,0.4);
}
.foot-base a { color: rgba(244,239,227,0.55); text-decoration: none; }
.foot-base a:hover { color: var(--cream); }

/* ============================================================
   REVEAL + MOTION
   ============================================================ */

.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

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

/* ============================================================
   MOBILE
   ============================================================ */

@media (max-width: 780px) {
  .nav { padding-top: 1.1rem; }
  .nav-toggle { display: block; }
  .nav-menu {
    position: fixed;
    inset: 0;
    z-index: 30;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 0.4rem;
    padding: 6rem var(--gutter) 4rem;
    background: var(--ink);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4%);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
  }
  .nav-menu.open { opacity: 1; visibility: visible; transform: none; }
  .nav-menu a:not(.nav-cta) {
    font-family: var(--serif);
    font-size: 2rem;
    font-weight: 380;
    letter-spacing: 0;
    text-transform: none;
    color: var(--cream);
    padding: 0.55rem 0;
    border-bottom: none;
  }
  .nav-menu a:not(.nav-cta)[aria-current="page"] { color: var(--steel); }
  .nav-menu .nav-cta { margin-top: 1.6rem; padding: 0.85rem 1.8rem; font-size: 0.72rem; }
  body.nav-open { overflow: hidden; }

  .hero { padding-top: 3.5rem; }
  .person { grid-template-columns: 1fr; }
  .person-photo-wrap { max-width: 300px; }
  .project-card { padding: 1.8rem 1.5rem 1.6rem; border-bottom-right-radius: 3rem; }
  .sector-card { border-top-left-radius: 3.2rem; }
  .stat-row { gap: 1.8rem 1.2rem; }
  .approach-item { grid-template-columns: 1fr; gap: 0.4rem; }
}
