/* ============================================================
   CMDC — Design Tokens
   Palette: Midnight Blue (trust/governance), Deep Forest Green
   (stewardship), Metallic Gold (mineral value), Copper (industry)
   Signature idea: content is literally "strata" — layers of rock,
   layers of a value chain. Horizontal bands + a core-sample motif
   run through the site instead of generic gradient blobs.
   ============================================================ */

:root {
  --midnight: #0a2e5d;
  --midnight-deep: #071f3f;
  --forest: #0b5d3b;
  --gold: #c9a227;
  --charcoal: #3a3a3a;
  --white: #ffffff;
  --copper: #b87333;

  --bg: #f7f5f0;
  --ink: #1a1d22;
  --ink-soft: #4a5058;
  --line: rgba(10, 46, 93, 0.14);

  --display: 'Fraunces', Georgia, serif;
  --body: 'Inter', -apple-system, Segoe UI, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;

  --max: 1180px;
  --pad: clamp(20px, 5vw, 64px);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

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

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

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 0.4em;
  color: var(--midnight-deep);
}

h1 { font-size: clamp(2.4rem, 5vw, 4.2rem); line-height: 1.04; font-weight: 500; }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.5rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em; color: var(--ink-soft); max-width: 62ch; }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--copper);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--copper);
}

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); }

/* ---------- Header ---------- */
header.site {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247, 245, 240, 0.97);
  border-bottom: 1px solid var(--line);
}
.nav {
  max-width: var(--max);
  margin: 0 auto;
  padding: 12px var(--pad);
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--midnight-deep);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.logo span { color: var(--gold); }
.logo img { height: 52px; width: auto; display: block; }
.navlinks { display: flex; gap: 32px; list-style: none; margin: 0; padding: 0; }
.navlinks a {
  text-decoration: none;
  font-size: 0.9rem;
  color: var(--charcoal);
  font-weight: 500;
  position: relative;
  padding-bottom: 4px;
}
.navlinks a::after {
  content: "";
  position: absolute; left: 0; bottom: 0;
  width: 0; height: 2px; background: var(--gold);
  transition: width 0.25s ease;
}
.navlinks a:hover::after, .navlinks a.active::after { width: 100%; }
.navlinks a.active { color: var(--midnight-deep); }

.navtoggle { display: none; background: none; border: none; cursor: pointer; padding: 6px; color: var(--midnight-deep); }
.navtoggle svg { width: 22px; height: 22px; display: block; }
.navtoggle .icon-close { display: none; }
.navtoggle[aria-expanded="true"] .icon-open { display: none; }
.navtoggle[aria-expanded="true"] .icon-close { display: block; }

@media (max-width: 760px) {
  .nav {
    padding: 12px var(--pad);
    min-height: 76px;
    display: flex;
    align-items: center;
  }

  .logo {
    display: flex;
    align-items: center;
    height: 52px;
    line-height: 1;
  }

  .logo img {
    height: 52px;
    width: auto;
    display: block;
  }

.navlinks {
  position: fixed;
  top: 50px;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg);
  flex-direction: column;
  padding: 32px var(--pad);
  gap: 22px;
  transform: translateY(-110%);
  transition: transform 0.3s ease;
}

  .navlinks.open {
    transform: translateY(0);
  }

  .navtoggle {
    display: block;
  }

  header.site {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: var(--bg);
  }
}

/* ---------- Strata band (signature motif) ---------- */
.strata {
  position: relative;
  overflow: hidden;
  background: var(--midnight-deep);
  color: var(--white);
}
.strata-layers {
  position: absolute; inset: 0; opacity: 0.5; pointer-events: none;
}
.strata-layers div {
  position: absolute; left: -5%; right: -5%; height: 2px;
}
.strata::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 20% 0%, rgba(201,162,39,0.14), transparent 55%),
              radial-gradient(ellipse at 90% 100%, rgba(11,93,59,0.28), transparent 60%);
  pointer-events: none;
}

/* Any strata section needs light text, not just the full .hero — this
   catches page-intro banners on About/Pillars/Commodities/Contact that
   use .strata without .hero and were inheriting the dark default. */
.strata h1 { color: var(--white); }
.strata p { color: rgba(255,255,255,0.78); }
.strata .eyebrow { color: var(--gold); }
.strata .eyebrow::before { background: var(--gold); }

/* ---------- Hero ---------- */
.hero {
  padding: 96px var(--pad) 84px;
}
.hero .wrap { position: relative; z-index: 2; }
.hero .eyebrow { color: var(--gold); }
.hero .eyebrow::before { background: var(--gold); }
.hero h1 { color: var(--white); max-width: 16ch; }
.hero .lede {
  color: rgba(255,255,255,0.78);
  font-size: 1.15rem;
  max-width: 56ch;
  margin-top: 20px;
}
.hero-actions { display: flex; gap: 16px; margin-top: 36px; flex-wrap: wrap; }

/* Hero entrance — headline/copy/actions fade+rise in on load, staggered */
@keyframes heroIn {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}
.strata .eyebrow, .strata h1, .strata .lede, .strata .hero-actions, .strata .figure {
  animation: heroIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.strata .eyebrow { animation-delay: 0.05s; }
.strata h1 { animation-delay: 0.15s; }
.strata .lede { animation-delay: 0.28s; }
.strata .hero-actions { animation-delay: 0.4s; }
.strata .figure { animation-delay: 0.3s; }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 26px; border-radius: 2px;
  font-weight: 600; font-size: 0.92rem; text-decoration: none;
  border: 1px solid transparent; cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-gold { background: var(--gold); color: var(--midnight-deep); }
.btn-gold:hover { background: #d9b23a; }
.btn-ghost { border-color: rgba(255,255,255,0.35); color: var(--white); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn-dark { border-color: var(--midnight); color: var(--midnight-deep); }
.btn-dark:hover { background: var(--midnight); color: var(--white); }

/* ---------- Core sample strip (used as section divider) ---------- */
.core-strip { display: flex; height: 10px; }
.core-strip div { flex: 1; }

/* ---------- Sections ---------- */
section { padding: 88px var(--pad); }
.section-head { max-width: 640px; margin-bottom: 48px; }
.bg-alt { background: #efece3; }
.bg-forest { background: var(--forest); color: var(--white); }
.bg-forest h2, .bg-forest h3 { color: var(--white); }
.bg-forest p { color: rgba(255,255,255,0.82); }

/* ---------- Cards / Grids ---------- */
.grid { display: grid; gap: 28px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 860px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--white);
  border: 1px solid var(--line);
  padding: 30px;
  border-radius: 2px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 28px rgba(10,46,93,0.08);
}
.card .num {
  font-family: var(--mono);
  color: var(--copper);
  font-size: 0.85rem;
  margin-bottom: 14px;
  display: block;
}

/* Pillar list — numbering is real here (9 sequenced pillars) */
.pillar {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 24px;
  padding: 28px 0;
  border-top: 1px solid var(--line);
}
.pillar:last-child { border-bottom: 1px solid var(--line); }
.pillar .num { font-family: var(--display); font-size: 1.8rem; color: var(--gold); }

/* Values */
.value {
  border-left: 2px solid var(--gold);
  padding-left: 18px;
}

/* Commodity chips */
.chips { display: flex; flex-wrap: wrap; gap: 12px; }
.chip {
  font-family: var(--mono);
  font-size: 0.82rem;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--midnight-deep);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  font-family: var(--mono);
}
.chip:hover { border-color: var(--gold); }
.chip.active { background: var(--midnight-deep); color: var(--white); border-color: var(--midnight-deep); }
.chip.featured { background: var(--midnight-deep); color: var(--white); border-color: var(--midnight-deep); }
.chip.featured.active { background: var(--gold); color: var(--midnight-deep); border-color: var(--gold); }

/* Stakeholders list */
.stake-list { columns: 2; gap: 40px; list-style: none; padding: 0; margin: 0; }
.stake-list li {
  padding: 12px 0; border-bottom: 1px solid var(--line);
  font-size: 0.98rem; break-inside: avoid;
}

/* Quote / ethos block */
.ethos {
  font-family: var(--display);
  font-size: clamp(1.3rem, 2.6vw, 1.9rem);
  color: var(--midnight-deep);
  font-weight: 500;
  line-height: 1.4;
  max-width: 46ch;
}

/* CTA band */
.cta-band {
  background: var(--midnight-deep);
  color: var(--white);
  text-align: center;
  padding: 90px var(--pad);
}
.cta-band h2 { color: var(--white); }
.cta-band p { color: rgba(255,255,255,0.75); margin: 0 auto 30px; }
.cta-band .hero-actions { justify-content: center; }

/* ---------- Footer ---------- */
footer.site {
  background: var(--midnight-deep);
  color: rgba(255,255,255,0.6);
  padding: 48px var(--pad) 30px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.foot-grid {
  max-width: var(--max); margin: 0 auto;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 24px;
  padding-bottom: 24px;
}
.foot-logo { font-family: var(--display); color: var(--white); font-size: 1.1rem; }
.foot-logo img { height: 42px; width: auto; display: block; margin-bottom: 8px; }
.foot-links { display: flex; gap: 24px; list-style: none; padding: 0; margin: 0; flex-wrap: wrap; }
.foot-links a { text-decoration: none; font-size: 0.88rem; }
.foot-links a:hover { color: var(--gold); }
.foot-bottom {
  max-width: var(--max); margin: 0 auto;
  font-size: 0.78rem; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.08);
}

/* ---------- Contact form ---------- */
.form-grid { display: grid; gap: 18px; max-width: 560px; }
label { font-size: 0.82rem; font-weight: 600; color: var(--midnight-deep); display: block; margin-bottom: 6px; }
input, textarea, select {
  width: 100%; padding: 12px 14px; font-family: var(--body); font-size: 0.95rem;
  border: 1px solid var(--line); border-radius: 2px; background: var(--white); color: var(--ink);
}
textarea { min-height: 130px; resize: vertical; }
input:focus, textarea:focus, select:focus, a:focus-visible, button:focus-visible {
  outline: 2px solid var(--gold); outline-offset: 2px;
}

.contact-info { display: grid; gap: 18px; }
.contact-info .item { display: flex; gap: 14px; align-items: flex-start; }
.contact-info .item .icon { color: var(--gold); font-family: var(--mono); font-size: 0.8rem; margin-top: 3px; }

/* reveal-on-scroll */
.reveal { opacity: 0; transform: translateY(32px); transition: opacity 0.7s cubic-bezier(0.22,1,0.36,1), transform 0.7s cubic-bezier(0.22,1,0.36,1); }
.reveal.in { opacity: 1; transform: translateY(0); }

/* staggered children within a revealed grid */
.reveal .grid > *, .reveal .chips > *, .reveal .pillar {
  opacity: 0; transform: translateY(18px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal.in .grid > *, .reveal.in .chips > *, .reveal.in .pillar {
  opacity: 1; transform: translateY(0);
}
.reveal.in .grid > *:nth-child(1), .reveal.in .chips > *:nth-child(1), .reveal.in .pillar:nth-child(1) { transition-delay: 0.05s; }
.reveal.in .grid > *:nth-child(2), .reveal.in .chips > *:nth-child(2), .reveal.in .pillar:nth-child(2) { transition-delay: 0.12s; }
.reveal.in .grid > *:nth-child(3), .reveal.in .chips > *:nth-child(3), .reveal.in .pillar:nth-child(3) { transition-delay: 0.19s; }
.reveal.in .grid > *:nth-child(4), .reveal.in .chips > *:nth-child(4), .reveal.in .pillar:nth-child(4) { transition-delay: 0.26s; }
.reveal.in .grid > *:nth-child(5), .reveal.in .chips > *:nth-child(5), .reveal.in .pillar:nth-child(5) { transition-delay: 0.33s; }
.reveal.in .grid > *:nth-child(6), .reveal.in .chips > *:nth-child(6), .reveal.in .pillar:nth-child(6) { transition-delay: 0.4s; }
.reveal.in .grid > *:nth-child(n+7), .reveal.in .chips > *:nth-child(n+7), .reveal.in .pillar:nth-child(n+7) { transition-delay: 0.45s; }

/* ---------- Image slots ---------- */
/* Real photography drops in here later — placeholder reads as an
   intentional material swatch (core-sample stripe), not a broken image. */
.figure {
  margin: 0;
  border: 1px solid var(--line);
  overflow: hidden;
  border-radius: 2px;
}
.figure-frame {
  aspect-ratio: 4 / 5;
  width: 100%;
  position: relative;
  background:
    repeating-linear-gradient(115deg, rgba(58,58,58,0.05) 0 2px, transparent 2px 26px),
    linear-gradient(160deg, #e4e0d4 0%, #d8d3c3 60%, #cdc6b2 100%);
  display: flex;
  align-items: flex-end;
  transition: transform 0.5s cubic-bezier(0.22,1,0.36,1);
}
.figure:hover .figure-frame { transform: scale(1.035); }
.figure-frame img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.figure-frame::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0; width: 6px;
  background: linear-gradient(var(--forest), var(--gold) 45%, var(--copper) 75%, var(--midnight));
}
.figure-frame.wide { aspect-ratio: 16 / 10; }
.figure-frame.square { aspect-ratio: 1 / 1; }
.figure-label {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  padding: 14px 16px;
  background: rgba(247,245,240,0.72);
  width: 100%;
}
.figure figcaption {
  font-size: 0.82rem;
  color: var(--ink-soft);
  padding: 10px 2px 0;
}

.hero-split { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 56px; align-items: center; }
@media (max-width: 900px) { .hero-split { grid-template-columns: 1fr; } .hero-split .figure { order: -1; } }
.hero-split .figure-frame { aspect-ratio: 4/5; }
.hero-split .figure-frame::before { background: linear-gradient(var(--gold), var(--copper) 55%, var(--forest)); }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

/* ---------- Core-sample scroll indicator (interactive, on-theme) ---------- */
.core-nav {
  position: fixed;
  right: 22px; top: 50%; transform: translateY(-50%);
  z-index: 40;
  display: flex; flex-direction: column; gap: 14px;
  align-items: center;
}
.core-nav a {
  width: 9px; height: 9px; border-radius: 50%;
  background: rgba(10,46,93,0.22);
  border: 1px solid rgba(10,46,93,0.3);
  transition: background 0.25s ease, transform 0.25s ease;
  position: relative;
}
.core-nav a:hover { transform: scale(1.25); }
.core-nav a.active { background: var(--gold); border-color: var(--gold); }
.core-nav a .tip {
  position: absolute; right: 18px; top: 50%; transform: translateY(-50%);
  font-family: var(--mono); font-size: 0.68rem; white-space: nowrap;
  background: var(--midnight-deep); color: var(--white); padding: 4px 9px; border-radius: 2px;
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease;
}
.core-nav a:hover .tip { opacity: 1; }
@media (max-width: 900px) { .core-nav { display: none; } }

/* ---------- Interactive accordion cards (pillars preview) ---------- */
.card.expandable { cursor: pointer; }
.card.expandable .card-more {
  max-height: 0; overflow: hidden; opacity: 0;
  transition: max-height 0.35s ease, opacity 0.3s ease, margin 0.35s ease;
}
.card.expandable.open .card-more { max-height: 220px; opacity: 1; margin-top: 12px; }
.card.expandable .card-toggle {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 16px; font-family: var(--mono); font-size: 0.72rem;
  letter-spacing: 0.05em; color: var(--copper);
}
.card.expandable .card-toggle svg { width: 13px; height: 13px; transition: transform 0.3s ease; }
.card.expandable.open .card-toggle svg { transform: rotate(45deg); }

.pillar.expandable { cursor: pointer; }
.pillar.expandable .pillar-more {
  max-height: 0; overflow: hidden; opacity: 0;
  transition: max-height 0.35s ease, opacity 0.3s ease, margin 0.35s ease;
}
.pillar.expandable.open .pillar-more { max-height: 160px; opacity: 1; margin-top: 10px; }
.pillar.expandable .pillar-toggle {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 10px;
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.05em; color: var(--copper);
}
.pillar.expandable .pillar-toggle svg { width: 12px; height: 12px; transition: transform 0.3s ease; }
.pillar.expandable.open .pillar-toggle svg { transform: rotate(45deg); }
.pillar.expandable:hover { background: rgba(10,46,93,0.03); }

/* ---------- Team ---------- */
.team-grid { display: flex; flex-wrap: wrap; gap: 32px; justify-content: center; }
.team-tile {
  width: 520px; background: var(--white); border: 1px solid var(--line);
  border-radius: 4px; overflow: hidden; transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.team-tile:hover { transform: translateY(-4px); box-shadow: 0 14px 28px rgba(10,46,93,0.08); }
.team-tile-photo { width: 100%; aspect-ratio: 464 / 403; background: #e4e0d4; overflow: hidden; }
.team-tile-photo img { width: 100%; height: auto; object-fit: contain; display: block; }
.team-tile-body { padding: 22px 24px 26px; }
.team-tile-body h3 { font-size: 1.15rem; margin-bottom: 4px; }
.team-title {
  font-family: var(--mono); font-size: 0.74rem; color: var(--copper);
  letter-spacing: 0.04em; display: block; margin-bottom: 12px;
}
.team-tile-body p { color: var(--ink); font-size: 0.92rem; margin: 0 0 18px; max-width: none; }
.team-view-bio {
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.05em;
  color: var(--copper); background: none; border: 1px solid var(--copper);
  padding: 9px 18px; border-radius: 2px; cursor: pointer; text-transform: uppercase;
  transition: background 0.2s ease, color 0.2s ease;
}
.team-view-bio:hover { background: var(--copper); color: var(--white); }

/* ---------- Bio popup modal ---------- */
.bio-modal {
  position: fixed; inset: 0; z-index: 100;
  display: none; align-items: center; justify-content: center; padding: 24px;
}
.bio-modal.open { display: flex; }
.bio-modal-backdrop { position: absolute; inset: 0; background: rgba(7,31,63,0.6); }
.bio-modal-content {
  position: relative; background: var(--white); border-radius: 8px;
  max-width: 720px; width: 100%; max-height: 85vh; overflow-y: auto;
  display: flex; flex-direction: column;
}
.bio-modal-photo { width: 100%; aspect-ratio: 464 / 403; background: #e4e0d4; }
.bio-modal-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bio-modal-text { padding: 32px 36px 36px; }
.bio-modal-text h3 { margin-bottom: 4px; }
.bio-modal-text p { color: var(--ink); margin: 0 0 14px; max-width: none; }
.bio-modal-text p:last-child { margin-bottom: 0; }
.bio-modal-close {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  width: 34px; height: 34px; border-radius: 50%; border: none;
  background: rgba(255,255,255,0.9); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.bio-modal-close svg { width: 16px; height: 16px; color: var(--midnight-deep); }
@media (max-width: 480px) {
  .team-tile { width: 100%; max-width: 340px; }
}