/* =====================================================================
   MI LINKS LIMITED — Design System
   Subject grounding: environmental survey & EIA work reads terrain through
   contour lines and elevation profiles. That motif (not a generic leaf/
   globe icon) is the visual signature carried through nav, dividers and
   footer. Typography pairs an editorial serif (reports, credibility) with
   a mono utility face (field data, reference codes, coordinates).
   ===================================================================== */

:root {
  /* ---- color tokens ---- */
  --ink: #16201c;            /* primary text */
  --ink-soft: #3d4a42;       /* secondary text on light */
  --paper: #f4f6f0;          /* page background — cool sage-white, not cream */
  --paper-raised: #ffffff;   /* card surfaces */
  --petrol: #0e3b36;         /* primary brand — deep teal */
  --petrol-deep: #0a2e2a;    /* darker petrol for gradients */
  --petrol-light: #155a52;   /* lighter petrol for hovers on dark */
  --clay: #bd6a35;           /* accent — burnt clay, CTAs & links */
  --clay-deep: #a35a2b;
  --sage: #5d7a68;           /* secondary accent — muted eucalyptus */
  --line: #d7ddcf;           /* hairline borders on light */
  --line-strong: #c3cab9;
  --on-petrol: #eef2ea;      /* off-white text on dark petrol */
  --on-petrol-soft: rgba(238, 242, 234, 0.68);
  --contour-on-dark: rgba(238, 242, 234, 0.14);
  --contour-on-light: rgba(14, 59, 54, 0.10);

  /* ---- type ---- */
  --font-display: "Fraunces", "Source Serif Pro", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;

  /* ---- layout ---- */
  --radius: 3px;
  --section-pad: 6.5rem;
}

@media (max-width: 767.98px) {
  :root { --section-pad: 3.5rem; }
}

/* ---------------------------------------------------------------- base */
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  font-size: 1.02rem;
  line-height: 1.7;
}

h1, h2, h3, h4, .font-display {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}

a { color: var(--clay); text-decoration: none; }
a:hover { color: var(--clay-deep); }

.font-mono { font-family: var(--font-mono); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--clay);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--clay);
  display: inline-block;
}
.eyebrow.on-dark { color: var(--on-petrol-soft); }
.eyebrow.on-dark::before { background: var(--on-petrol-soft); }

.lede {
  font-size: 1.18rem;
  color: var(--ink-soft);
  max-width: 640px;
}

section { padding: var(--section-pad) 0; }
.section-tight { padding: 3.25rem 0; }

:focus-visible {
  outline: 2px solid var(--clay);
  outline-offset: 2px;
}

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

/* --------------------------------------------------------- reveal-in */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ----------------------------------------------------------- buttons */
.btn { font-family: var(--font-body); font-weight: 600; border-radius: var(--radius); padding: 0.68rem 1.4rem; font-size: 0.92rem; }

.btn-clay { background: var(--clay); border: 1px solid var(--clay); color: #fff; }
.btn-clay:hover { background: var(--clay-deep); border-color: var(--clay-deep); color: #fff; }

.btn-outline-paper { background: transparent; border: 1px solid rgba(238,242,234,0.45); color: var(--on-petrol); }
.btn-outline-paper:hover { background: rgba(238,242,234,0.1); color: #fff; border-color: rgba(238,242,234,0.7); }

.btn-outline-ink { background: transparent; border: 1px solid var(--line-strong); color: var(--petrol); }
.btn-outline-ink:hover { background: var(--petrol); border-color: var(--petrol); color: #fff; }

/* ------------------------------------------------------------ navbar */
.site-header { background: var(--petrol); position: sticky; top: 0; z-index: 1000; box-shadow: 0 1px 0 rgba(238,242,234,0.08); }
.navbar { padding: 0.85rem 0; }

.navbar-brand { display: flex; align-items: center; gap: 0.6rem; }
.brand-mark { color: var(--on-petrol); }
.brand-logo { max-height: 50px; }
.brand-text { font-family: var(--font-display); font-weight: 600; letter-spacing: 0.02em; color: #fff; font-size: 1.05rem; line-height: 1; display: flex; flex-direction: column; }
.brand-suffix { font-family: var(--font-mono); font-size: 0.56rem; letter-spacing: 0.22em; color: var(--on-petrol-soft); font-weight: 400; margin-top: 0.15rem; }

.navbar-nav .nav-link { font-size: 0.86rem; font-weight: 500; color: var(--on-petrol-soft); padding: 0.5rem 1rem; position: relative; }
.navbar-nav .nav-link:hover { color: #fff; }
.navbar-nav .nav-link.active { color: #fff; }
.navbar-nav .nav-link.active::after {
  content: ""; position: absolute; left: 1rem; right: 1rem; bottom: 0.15rem; height: 2px; background: var(--clay);
}
.nav-cta { margin-left: 0.5rem; }
.navbar-toggler { border-color: rgba(238,242,234,0.3); }
.navbar-toggler-icon { filter: invert(1) brightness(2); }



.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
}

.brand-divider {
  width: 1px;
  height: 20px;
  background: rgba(238, 242, 234, 0.25);
  flex-shrink: 0;
  margin-left: 15px;
}

.brand-tagline {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(238, 242, 234, 0.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-left: 15px;
}

/* Tablet: shrink slightly */
@media (max-width: 991.98px) {
  .brand-tagline {
    font-size: 0.56rem;
    letter-spacing: 0.1em;
  }
}

/* Mobile: tagline stays inline between logo and hamburger toggler */
@media (max-width: 575.98px) {
  .navbar .container {
    flex-wrap: nowrap;
  }
  .brand-logo {
    height: 28px;
  }
  .brand-text {
    font-size: 0.85rem;
  }
  .brand-suffix {
    display: none; /* drop "LIMITED" first to make room */
  }
  .brand-divider {
    height: 16px;
  }
  .brand-tagline {
    font-size: 0.5rem;
    letter-spacing: 0.06em;
    max-width: 100px; /* truncates gracefully instead of wrapping/pushing toggler off-screen */
  }
  .navbar-toggler {
    flex-shrink: 0;
    padding: 0.25rem 0.5rem;
  }
}

/* Extra-narrow phones: trim brand name to just "MI LINKS" logic already handles this via brand-suffix hide above */
@media (max-width: 340px) {
  .brand-tagline {
    max-width: 60px;
  }
}




/* -------------------------------------------------------------- hero */
.hero {
  background: linear-gradient(168deg, var(--petrol) 0%, var(--petrol-deep) 100%);
  color: var(--on-petrol);
  position: relative;
  overflow: hidden;
  padding: 5.5rem 0 0;
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(transparent 0 0);
  pointer-events: none;
}
.hero-contour-bg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 1; pointer-events: none;
}
.hero-inner { position: relative; z-index: 2; }
.hero h1 { color: #fff; font-size: clamp(2.3rem, 4.6vw, 3.6rem); line-height: 1.08; max-width: 820px; }
.hero .lede { color: var(--on-petrol-soft); }
.hero-cta { display: flex; gap: 0.85rem; flex-wrap: wrap; margin-top: 1.9rem; }

.hero-divider { position: relative; z-index: 2; margin-top: 3.5rem; }
.hero-divider svg { display: block; width: 100%; }

/* page header (for non-home pages) */
.page-hero {
  background: linear-gradient(168deg, var(--petrol) 0%, var(--petrol-deep) 100%);
  color: var(--on-petrol);
  padding: 3.6rem 0 4.4rem;
  position: relative; overflow: hidden;
}
.page-hero h1 { color: #fff; font-size: clamp(2rem, 3.6vw, 2.7rem); max-width: 760px; }
.page-hero .lede { color: var(--on-petrol-soft); max-width: 620px; }

/* ----------------------------------------------------- stat / placard */
.stat-strip { background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius); margin-top: -3.25rem; position: relative; z-index: 3; box-shadow: 0 18px 40px -28px rgba(14,59,54,0.35); }
.stat-cell { padding: 1.6rem 1.4rem; border-right: 1px solid var(--line); }
.stat-cell:last-child { border-right: none; }
.stat-num { font-family: var(--font-mono); font-size: 1.7rem; color: var(--petrol); font-weight: 600; display: block; }
.stat-label { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); }
@media (max-width: 767.98px) {
  .stat-cell { border-right: none; border-bottom: 1px solid var(--line); }
  .stat-cell:last-child { border-bottom: none; }
}

/* --------------------------------------------------------- file tags */
.file-tag {
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.1em;
  color: var(--petrol); background: rgba(14,59,54,0.08); border: 1px solid rgba(14,59,54,0.18);
  padding: 0.25rem 0.55rem; border-radius: 2px; display: inline-block;
}
.file-tag.on-dark { color: var(--on-petrol); background: rgba(238,242,234,0.1); border-color: rgba(238,242,234,0.28); }

/* ------------------------------------------------------------- cards */
.card-practice {
  background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 2rem 1.8rem; height: 100%; position: relative; transition: border-color .25s ease, transform .25s ease;
}
.card-practice:hover { border-color: var(--clay); transform: translateY(-3px); }
.card-practice .file-tag { position: absolute; top: 1.4rem; right: 1.6rem; }
.card-practice h3 { font-size: 1.18rem; margin: 1.6rem 0 0.7rem; }
.card-practice ul { padding-left: 1.1rem; margin-bottom: 0; color: var(--ink-soft); font-size: 0.93rem; }
.card-practice ul li { margin-bottom: 0.35rem; }
.card-practice .icon-wrap { width: 46px; height: 46px; border-radius: 50%; background: rgba(93,122,104,0.12); display: flex; align-items: center; justify-content: center; color: var(--sage); }

/* ----------------------------------------------------- case-file card */
.case-file { background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius); padding: 2.1rem; margin-bottom: 1.6rem; }
.case-file-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.case-file h3 { font-size: 1.3rem; margin: 0; max-width: 560px; }
.case-file-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.6rem; margin-top: 1.4rem; }
@media (max-width: 767.98px) { .case-file-grid { grid-template-columns: 1fr; } }
.case-file-field-label { font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--sage); margin-bottom: 0.4rem; }
.case-file-field p, .case-file-field ul { font-size: 0.92rem; color: var(--ink-soft); margin: 0; padding-left: 1.05rem; }
.case-file-field ul li { margin-bottom: 0.25rem; }

/* ----------------------------------------------------------- divider */
.contour-divider { line-height: 0; position: relative; }
.contour-divider svg { display: block; width: 100%; height: auto; }
.divider-light { background: var(--paper); }
.divider-petrol { background: var(--petrol); }

/* ----------------------------------------------------- section blocks */
.section-eyebrow-row { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin-bottom: 2.6rem; }
.section-heading { font-size: clamp(1.7rem, 2.6vw, 2.2rem); max-width: 640px; }

.bg-petrol { background: var(--petrol); }
.bg-petrol-deep { background: var(--petrol-deep); }
.text-on-petrol { color: var(--on-petrol); }
.text-clay { color: var(--clay); }
.text-sage { color: var(--sage); }
.text-ink-soft { color: var(--ink-soft); }

.why-list { list-style: none; padding: 0; margin: 0; }
.why-list li { display: flex; gap: 0.85rem; padding: 0.9rem 0; border-bottom: 1px solid var(--line); }
.why-list li:last-child { border-bottom: none; }
.why-list .mark { font-family: var(--font-mono); color: var(--clay); flex-shrink: 0; }

/* --------------------------------------------------------- leadership */
.lead-card { background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius); padding: 2.4rem; }
.avatar-mark {
  width: 76px; height: 76px; border-radius: 50%; background: var(--petrol); color: #fff;
  display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 1.5rem; flex-shrink: 0;
}
.team-grid-item { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem; height: 100%; background: var(--paper-raised); }
.team-grid-item .icon-wrap { width: 40px; height: 40px; border-radius: 50%; background: rgba(189,106,53,0.12); color: var(--clay); display: flex; align-items: center; justify-content: center; margin-bottom: 1rem; }

/* ------------------------------------------------------------ insight */
.insight-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.9rem; height: 100%; background: var(--paper-raised); transition: border-color .25s ease; }
.insight-card:hover { border-color: var(--sage); }
.insight-card .file-tag { margin-bottom: 1rem; }

.pub-panel { background: var(--petrol); color: var(--on-petrol); border-radius: var(--radius); padding: 2.6rem; }
.pub-panel .lede { color: var(--on-petrol-soft); }

/* ------------------------------------------------------------ contact */
.contact-info-row { display: flex; gap: 1rem; padding: 1.1rem 0; border-bottom: 1px solid var(--line); }
.contact-info-row:last-child { border-bottom: none; }
.contact-info-row .icon-wrap { width: 38px; height: 38px; border-radius: 50%; background: rgba(14,59,54,0.08); color: var(--petrol); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

.form-label { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); }
.form-control { border-radius: var(--radius); border-color: var(--line-strong); padding: 0.62rem 0.85rem; font-size: 0.95rem; }
.form-control:focus { border-color: var(--clay); box-shadow: 0 0 0 3px rgba(189,106,53,0.15); }

.map-frame { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.map-frame iframe { display: block; width: 100%; height: 100%; min-height: 280px; border: 0; filter: grayscale(0.15) contrast(1.05); }

/* -------------------------------------------------------------- CTA band */
.cta-band { background: var(--petrol); color: var(--on-petrol); border-radius: var(--radius); padding: 3rem; position: relative; overflow: hidden; }
.cta-band h2 { color: #fff; }

/* ------------------------------------------------------------- footer */
.site-footer { background: var(--petrol-deep); color: var(--on-petrol-soft); padding-top: 4.5rem; position: relative; }
.footer-brand { color: #fff; font-size: 1.15rem; }
.footer-tag { font-size: 0.88rem; color: var(--on-petrol-soft); max-width: 320px; margin-top: 0.9rem; }
.footer-heading { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: #fff; margin-bottom: 1rem; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 0.6rem; font-size: 0.9rem; }
.footer-links a { color: var(--on-petrol-soft); }
.footer-links a:hover { color: var(--clay); }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; padding: 1.8rem 0; margin-top: 3rem; border-top: 1px solid rgba(238,242,234,0.1); font-size: 0.8rem; font-family: var(--font-mono); }

/* ------------------------------------------------------- misc utility */
.shadow-soft { box-shadow: 0 18px 40px -28px rgba(14,59,54,0.35); }
.rule { height: 1px; background: var(--line); border: none; margin: 0; }
.rule-dark { background: rgba(238,242,234,0.14); }
