/*
 * Munda marketing site.
 *
 * The palette, the gold kicker/rule furniture and the survey-parcel motif are
 * lifted from the pitch deck (docs/external/pitch.html) so the site and the
 * collateral read as one brand. Two deliberate departures from the deck: gold
 * text on light backgrounds uses a darker --gold-ink (the deck's #b98a1e is
 * ~3:1 on paper, which is fine in print and fails WCAG AA on screen), and type
 * is a system stack — no webfont request, because a page that loads instantly
 * on a Zimbabwean mobile connection is worth more here than a bespoke typeface.
 *
 * There is no JavaScript on this page and the CSP is helmet's default
 * ('self' everywhere, no inline anything), so all motion is CSS: hero entrances
 * on load, and scroll reveals behind @supports(animation-timeline) — where that
 * is unsupported, or motion is not wanted, every element sits in its final
 * state rather than at the animation's start.
 */

:root {
  --green-9: #0e2f1e;
  --green-8: #123b26;
  --green-7: #1b5236;
  --green-6: #2a6b47;
  --gold: #b98a1e;
  --gold-soft: #d9b768;
  --gold-ink: #8a6510;
  --cream: #fdfcf7;
  --paper: #fcfcfb;
  --band: #f4f3ee;
  --hairline: #e1e0d9;
  --ink: #14140f;
  --ink-2: #52514e;
  --muted: #6f6d67;
  --on-dark: #e8e4d4;
  --on-dark-2: #b9c8ba;
  --on-dark-3: #8ba38c;

  --sans:
    ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    "Noto Sans", sans-serif;
  --wrap: 1180px;
  --gutter: clamp(1.4rem, 5vw, 4.5rem);

  color-scheme: light;
}

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

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

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink-2);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.08rem);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--gold-soft);
  color: var(--green-9);
}

a {
  color: inherit;
}

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

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 10;
  background: var(--cream);
  color: var(--green-9);
  padding: 0.7rem 1.1rem;
  font-weight: 700;
}
.skip:focus {
  left: 1rem;
  top: 1rem;
}

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

/* ---------- shared furniture ---------- */

.kicker {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold-soft);
}
.kicker--ink {
  color: var(--gold-ink);
}

.rule {
  height: 2.5px;
  margin: 1.4rem 0 1.5rem;
  max-width: 460px;
  background: linear-gradient(90deg, var(--gold) 0 64px, var(--hairline) 64px 100%);
}
.rule--dark {
  background: linear-gradient(90deg, var(--gold) 0 64px, rgb(217 183 104 / 0.2) 64px 100%);
}

h1,
h2,
h3 {
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.4rem, 6.2vw, 4.4rem);
  line-height: 1.03;
  letter-spacing: -0.028em;
  color: var(--cream);
}

h2 {
  font-size: clamp(1.8rem, 3.3vw, 2.65rem);
}

.lede {
  font-size: clamp(1.05rem, 0.98rem + 0.5vw, 1.28rem);
  line-height: 1.6;
  max-width: 34em;
  text-wrap: pretty;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--gold-soft);
  color: var(--green-9);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  padding: 0.95rem 1.6rem;
  border-radius: 7px;
  transition:
    background 160ms ease,
    transform 160ms ease;
}
.btn:hover {
  background: var(--cream);
  transform: translateY(-1px);
}
.btn .arr {
  transition: transform 160ms ease;
}
.btn:hover .arr {
  transform: translateX(3px);
}

.cta-row {
  margin-top: 2.1rem;
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  background: var(--green-9);
  min-height: 100vh;
  display: flex;
  padding-block: 2rem 2.4rem;
}

/* svh, not vh: mobile browsers size vh to the *largest* viewport, so with the
   address bar showing the hero overflows and the fold lands mid-sentence. */
@supports (min-height: 100svh) {
  .hero {
    min-height: 100svh;
  }
}

.mesh {
  position: absolute;
  pointer-events: none;
}

/* Base state, and what a browser without the motion below renders: the survey
   lines already drawn. Declared before the .mesh--hero rules that animate them
   so specificity climbs in source order. */
.mesh-lines path {
  stroke-opacity: 0.34;
}

.mesh--hero {
  top: 0;
  right: 0;
  height: 100%;
  width: min(62%, 820px);
}

.hero-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.topbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.wordmark {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--cream);
}

.topbar-link {
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  color: var(--on-dark-2);
  text-decoration: none;
  border-bottom: 1px solid rgb(217 183 104 / 0.4);
  padding-bottom: 2px;
  transition:
    color 160ms ease,
    border-color 160ms ease;
}
.topbar-link:hover {
  color: var(--gold-soft);
  border-color: var(--gold-soft);
}

.hero-copy {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 46rem;
  padding-block: 3rem;
}

.hero-copy .kicker {
  margin-bottom: 1.4rem;
}
.hero-copy .lede {
  color: var(--on-dark-2);
  max-width: 30em;
}

.hero-foot {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--on-dark-3);
}

/* ---------- band ---------- */

.band {
  background: var(--paper);
  padding-block: clamp(4.5rem, 9vw, 8rem);
  border-bottom: 1px solid var(--hairline);
}

.band-head {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}

.band-copy .kicker {
  margin-bottom: 0.9rem;
}
.band-copy h2 {
  color: var(--green-9);
  margin-bottom: 1.5rem;
  max-width: 16em;
}
.band-copy p {
  max-width: 34em;
}
.band-copy p + p {
  margin-top: 1rem;
}

.note {
  background: var(--band);
  border-left: 4px solid var(--gold);
  border-radius: 0 10px 10px 0;
  padding: 1.7rem 1.8rem;
}
.note-word {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--green-9);
}
.note-gloss {
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-ink);
  margin-top: 0.3rem;
}
.note-def {
  font-size: 0.98rem;
  margin-top: 0.9rem;
}

.pillars {
  list-style: none;
  padding: 0;
  margin-top: clamp(3rem, 6vw, 5rem);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.5rem, 3vw, 2.5rem);
}

.pillar {
  border-top: 3px solid var(--hairline);
  padding-top: 1.4rem;
  transition: border-color 200ms ease;
}
.pillar:hover {
  border-top-color: var(--gold-soft);
}
.pillar-n {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--gold-ink);
}
.pillar h3 {
  font-size: 1.22rem;
  color: var(--green-9);
  margin: 0.55rem 0 0.6rem;
}
.pillar p {
  font-size: 0.98rem;
}

/* ---------- close ---------- */

.close {
  position: relative;
  overflow: hidden;
  background: var(--green-9);
  color: var(--on-dark);
  padding-block: clamp(4.5rem, 9vw, 8rem);
}

.mesh--close {
  left: 0;
  bottom: 0;
  width: min(46%, 560px);
  height: min(100%, 460px);
}

.close-wrap {
  position: relative;
}
.close-wrap .kicker {
  margin-bottom: 1rem;
}
.close-wrap h2 {
  color: var(--cream);
  max-width: 15em;
}
.close-wrap .lede {
  color: var(--on-dark-2);
}

.close-addr {
  margin-top: 1.5rem;
  font-size: 0.95rem;
}
.close-addr a {
  color: var(--on-dark-3);
  text-decoration-color: rgb(217 183 104 / 0.45);
  text-underline-offset: 4px;
  transition: color 160ms ease;
}
.close-addr a:hover {
  color: var(--gold-soft);
}

/* ---------- footer ---------- */

footer {
  background: var(--green-9);
  border-top: 1px solid rgb(217 183 104 / 0.16);
  padding-block: 1.9rem;
}

.foot-wrap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.foot-brand {
  color: var(--gold-soft);
  font-weight: 700;
}
.foot-meta {
  color: var(--on-dark-3);
}

/* ---------- narrow ---------- */

@media (max-width: 860px) {
  .br-lg {
    display: none;
  }
  /* Full width, not 78%: `slice` crops to the container's aspect, so a narrow
     box shows only a sliver of the parcel field and reads as stray lines. */
  .mesh--hero {
    width: 100%;
    opacity: 0.5;
  }
  .band-head {
    grid-template-columns: 1fr;
  }
  .pillars {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .mesh--close {
    width: 70%;
    opacity: 0.7;
  }
}

@media (max-width: 460px) {
  .topbar-link {
    font-size: 0.78rem;
  }
  .hero-copy {
    padding-block: 2.4rem;
  }
}

/* ---------- motion ----------
 *
 * Every animation block below is scoped to `screen`, so print gets the page in
 * its settled state without needing a single !important to unwind it.
 */

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes draw {
  from {
    stroke-dashoffset: 2600;
  }
  to {
    stroke-dashoffset: 0;
  }
}

@media screen and (prefers-reduced-motion: no-preference) {
  .topbar,
  .hero-copy > *,
  .hero-foot {
    animation: rise 0.75s cubic-bezier(0.2, 0.7, 0.3, 1) both;
  }
  .topbar {
    animation-delay: 0.05s;
  }
  .hero-copy > :nth-child(1) {
    animation-delay: 0.18s;
  }
  .hero-copy > :nth-child(2) {
    animation-delay: 0.26s;
  }
  .hero-copy > :nth-child(3) {
    animation-delay: 0.34s;
  }
  .hero-copy > :nth-child(4) {
    animation-delay: 0.42s;
  }
  .hero-copy > :nth-child(5) {
    animation-delay: 0.5s;
  }
  .hero-foot {
    animation-delay: 0.6s;
  }

  /* The parcels survey themselves in, row by row, then the land fills. */
  .mesh--hero .mesh-lines path {
    stroke-dasharray: 2600;
    animation: draw 2s cubic-bezier(0.25, 0.6, 0.25, 1) both;
  }
  .mesh--hero .mesh-lines path:nth-child(-n + 4) {
    animation-delay: 0.15s;
  }
  .mesh--hero .mesh-lines path:nth-child(n + 5):nth-child(-n + 8) {
    animation-delay: 0.28s;
  }
  .mesh--hero .mesh-lines path:nth-child(n + 9):nth-child(-n + 12) {
    animation-delay: 0.41s;
  }
  .mesh--hero .mesh-lines path:nth-child(n + 13) {
    animation-delay: 0.54s;
  }
  .mesh--hero .mesh-fills,
  .mesh--hero .mesh-tracks,
  .mesh--hero .mesh-nodes {
    animation: fade 1.4s ease-out both;
    animation-delay: 1s;
  }
}

/*
 * Scroll reveals. `both` means an element below the fold sits at the keyframe's
 * start (transparent) until it enters the scrollport — correct in a browser,
 * but it does mean a full-page screenshot composited at scroll 0 shows the band
 * blank. That is the capture tool, not the page; check reveals by scrolling.
 */
@supports (animation-timeline: view()) {
  @media screen and (prefers-reduced-motion: no-preference) {
    .band-copy,
    .note,
    .pillar,
    .close-wrap > * {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 8% entry 62%;
    }
  }
}

/*
 * Print / save-as-PDF. Browsers drop background graphics by default, which would
 * leave cream text on white paper, so the dark sections are re-inked here.
 * Every selector matches its screen counterpart exactly and simply comes later,
 * so source order does the overriding.
 */
@media print {
  .hero,
  .close,
  footer {
    background: #fff;
    min-height: auto;
  }
  .mesh {
    display: none;
  }
  h1,
  .wordmark,
  .close-wrap h2,
  .foot-brand {
    color: var(--green-9);
  }
  .kicker {
    color: var(--gold-ink);
  }
  .hero-copy .lede,
  .close-wrap .lede {
    color: var(--ink-2);
  }
  .hero-foot,
  .foot-meta,
  .close-addr a,
  .topbar-link {
    color: var(--muted);
  }
}
