/* ──────────────────────────────────────────────────────────────────────
   NTS DESIGN SYSTEM v3 — Wiriiyn Option B Country Lines applied
   Montserrat only · Saltbush lead · Red Earth accent · Charcoal weight
   Brand Application Spec v1.0.3
   ────────────────────────────────────────────────────────────────────── */
:root {
  /* Brand palette — exact hex from Brand Application Spec §2.1 */
  --charcoal:      #1E1E1E;
  --charcoal-dark: #0F0F0F;
  --saltbush:      #FFEEDB;
  --saltbush-soft: #FFF7ED;
  --saltbush-mist: #FFF9F2;
  --rust:          #C03A1D;
  --rust-700:      #8F2C15;
  --butter:        #ED9B40;
  --pacific:       #1DA3C0;
  --pacific-soft:  #A0E2F1;

  --paper:         #FFFFFF;

  --ink:           var(--charcoal);
  --ink-mid:       #4A4238;
  --ink-soft:      #7A7067;
  --ink-faint:     #B8AFA3;

  --border:        #E7DFD1;
  --border-mid:    #D4C9B6;

  /* Tag mapping — each content type gets one of the palette colours */
  --tag-service:    var(--pacific);
  --tag-product:    var(--butter);
  --tag-solution:   var(--rust);
  --tag-method:     var(--charcoal);
  --tag-capability: var(--charcoal);

  /* Typography — Montserrat throughout (Brand Spec §3.1) */
  --font-sans:    'Montserrat', -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-display: 'Montserrat', -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono:    'JetBrains Mono', 'IBM Plex Mono', 'Courier New', Consolas, monospace;

  --gutter:   max(20px, env(safe-area-inset-left, 0px));
  --gutter-r: max(20px, env(safe-area-inset-right, 0px));
  --max-w:    1200px;
  --max-w-read: 720px;

  --nav-h: 84px;

  --radius-s: 6px;
  --radius-m: 10px;
  --radius-l: 16px;

  --shadow-s: 0 1px 2px rgba(30,30,30,0.04), 0 2px 8px rgba(30,30,30,0.03);
  --shadow-m: 0 2px 8px rgba(30,30,30,0.06), 0 12px 32px rgba(30,30,30,0.04);
}

/* ──── Base ──── */
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; }
a  { color: var(--rust); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--rust-700); }

.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter-r);
  position: relative;
}
.container-narrow {
  width: 100%;
  max-width: var(--max-w-read);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter-r);
}

/* ──── Navigation ──── */
.site-nav {
  position: sticky;
  top: 0; z-index: 100;
  background: var(--paper);
  border-bottom: 1px solid var(--border);
  height: var(--nav-h);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 100%;
}
.nav-brand {
  display: flex; align-items: center;
  color: var(--ink);
  height: 100%;
}
.nav-brand img {
  height: 52px;
  width: auto;
  border-radius: 0;
  display: block;
}
.nav-links {
  display: flex; gap: 28px;
  list-style: none; margin: 0; padding: 0;
  align-items: center;
}
.nav-links a {
  color: var(--ink-mid);
  font-size: 14px;
  font-weight: 500;
  position: relative;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a.active { color: var(--ink); }
.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -24px;
  height: 2px; background: var(--rust);
}
.nav-cta {
  padding: 8px 18px;
  background: var(--ink);
  color: var(--paper) !important;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  transition: background .15s ease;
}
.nav-cta:hover { background: var(--rust); }
.nav-burger {
  display: none; background: 0; border: 0; padding: 8px; cursor: pointer;
  color: var(--ink);
}
.nav-burger svg { width: 24px; height: 24px; }
@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-burger { display: block; }
  .site-nav.open .nav-links {
    display: flex; flex-direction: column;
    position: fixed; top: var(--nav-h); left: 0; right: 0;
    background: var(--paper);
    padding: 20px var(--gutter);
    border-bottom: 1px solid var(--border);
    gap: 18px; align-items: flex-start;
  }
  .site-nav.open .nav-links a.active::after { display: none; }
}

/* ──── Typography — sentence case throughout (Brand Spec §3.3) ──── */
.eyebrow {
  display: inline-flex;
  align-items: center; gap: 10px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--rust);
  margin-bottom: 20px;
}
.eyebrow::before { content: ""; width: 24px; height: 2px; background: currentColor; }
.on-dark .eyebrow { color: var(--butter); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.015em;
  line-height: 1.1;
  margin: 0 0 20px;
  text-wrap: balance;
}
h1 { font-size: clamp(36px, 4vw, 54px); font-weight: 700; }
h2 { font-size: clamp(28px, 3vw, 40px); font-weight: 700; }
h3 { font-size: clamp(20px, 1.8vw, 24px); font-weight: 600; }
h4 { font-size: 17px; letter-spacing: -0.005em; font-weight: 600; }

.lede {
  font-size: clamp(17px, 1.3vw, 20px);
  line-height: 1.5;
  color: var(--ink-mid);
  max-width: 720px;
  margin: 0 0 40px;
  font-weight: 400;
}

/* Analytical label — monospace (Brand Spec §3.2) */
.analytical {
  font-family: var(--font-mono);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 11px;
}

/* ──── Buttons ──── */
.btn {
  display: inline-flex;
  align-items: center; gap: 10px;
  padding: 12px 22px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all .15s ease;
  text-decoration: none;
}
.btn svg { width: 14px; height: 14px; }
.btn-primary { background: var(--ink); color: var(--paper) !important; border-color: var(--ink); }
.btn-primary:hover { background: var(--rust); border-color: var(--rust); }
.btn-outline  { background: transparent; color: var(--ink) !important; border-color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--paper) !important; }
.btn-ghost    { background: transparent; color: var(--ink) !important; border-color: var(--border-mid); }
.btn-ghost:hover { border-color: var(--ink); }

/* ──── Section pattern ──── */
section { padding: 96px 0; position: relative; }
section + section { border-top: 1px solid var(--border); }
section.pad-m { padding: 72px 0; }
section.on-warm { background: var(--saltbush-soft); }
section.on-sage { background: var(--saltbush); }
section.on-dark { background: var(--charcoal); color: var(--saltbush); }
section.on-dark h1, section.on-dark h2, section.on-dark h3 { color: var(--saltbush); }
section.on-dark .lede { color: #BCB4A8; }
@media (max-width: 720px) { section { padding: 64px 0; } }

/* ──── Country Lines motifs — Brand Spec §5 ──── */

/* Three-track body-page corner cluster (Brand Spec §5.5) */
.body-page {
  position: relative;
}
.body-page::before {
  content: "";
  position: absolute;
  top: 24px; right: 24px;
  width: 64px;
  height: 120px;
  background-image: url('images/logo_three_tracks_cluster.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: top right;
  opacity: 0.18;
  pointer-events: none;
  z-index: 1;
}
@media (max-width: 720px) {
  .body-page::before { width: 48px; height: 90px; top: 16px; right: 16px; }
}
.body-page > .container { position: relative; z-index: 2; }

/* The wave — hand-drawn organic line (Brand Spec §5.2) */
.wave {
  display: block;
  width: 100%;
  height: 48px;
  color: var(--rust);
}
.wave-band {
  display: block;
  width: 100%;
  height: 120px;
  color: var(--rust);
}
.wave-divider {
  position: relative;
  padding: 24px 0 48px;
  overflow: hidden;
}

/* Walking line — Charcoal single-track PNGs, forward-right, toes up */
.walking-line {
  display: flex;
  gap: 32px;
  align-items: flex-end;
  margin: 24px 0;
  min-height: 56px;
}
.walking-line img {
  width: 24px; height: auto;
  opacity: 0.65;
}
.walking-line img:nth-child(odd)  { transform: translateY(-4px) rotate(8deg); }
.walking-line img:nth-child(even) { transform: translateY(4px) rotate(-6deg); }

/* Giant cropped track mark — fragment-led signature (Brand Spec §5.1) */
.giant-track {
  position: absolute;
  pointer-events: none;
  z-index: 0;
}
.giant-track img {
  width: 100%; height: 100%;
  object-fit: contain;
}

/* ──── Tag pills (content-type markers) ──── */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--paper);
  line-height: 1.6;
}
.tag.service     { background: var(--pacific); }
.tag.product     { background: var(--butter); color: var(--charcoal); }
.tag.solution    { background: var(--rust); }
.tag.methodology { background: var(--charcoal); }
.tag.capability  { background: var(--charcoal); }
.tag.news        { background: var(--ink-mid); }
.tag.insight     { background: var(--rust); }
.tag.case-study  { background: var(--charcoal); }
.tag.legislation { background: #5A4E8E; }
.tag.glossary    { background: var(--charcoal); }
.tag.resource    { background: var(--pacific); }

.tag-outline {
  background: transparent !important;
  color: var(--ink-mid) !important;
  border: 1px solid var(--border-mid);
  padding: 4px 11px;
}

/* ──── Cards ──── */
.card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  display: block;
  color: inherit;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-m);
  border-color: var(--border-mid);
}
.card-image {
  aspect-ratio: 16/10;
  background: var(--saltbush);
  overflow: hidden;
}
.card-image img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 24px; }
.card-meta {
  display: flex; gap: 10px; align-items: center;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--ink-soft);
}
.card-meta time { font-weight: 500; }
.card h3 {
  margin: 0 0 10px;
  font-size: 18px;
  letter-spacing: -0.01em;
  line-height: 1.3;
  font-weight: 600;
}
.card p {
  margin: 0;
  font-size: 14px;
  color: var(--ink-mid);
  line-height: 1.55;
}
.card-foot {
  margin-top: 16px;
  display: flex; align-items: center; gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--rust);
}
.card-foot svg { width: 12px; height: 12px; transition: transform .15s ease; }
.card:hover .card-foot svg { transform: translateX(3px); }

/* ──── Footer ──── */
.site-footer {
  background: var(--charcoal);
  color: var(--saltbush);
  padding: 72px 0 32px;
  position: relative;
  overflow: hidden;
}
/* Decorative giant track on footer */
.site-footer::after {
  content: "";
  position: absolute;
  bottom: -80px; right: -60px;
  width: 280px; height: 440px;
  background-image: url('images/track_single_red_earth.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: bottom right;
  opacity: 0.12;
  pointer-events: none;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
  position: relative; z-index: 2;
}
.footer-brand img { width: 220px; margin-bottom: 20px; }
.footer-brand p { font-size: 14px; color: #BCB4A8; max-width: 340px; line-height: 1.6; }
.footer-col h5 {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--butter);
  margin: 0 0 16px;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-col a { color: var(--saltbush); font-size: 14px; opacity: 0.8; }
.footer-col a:hover { opacity: 1; color: var(--butter); }
.footer-col .social-link { display: inline-flex; align-items: center; gap: 8px; }
.footer-col .social-icon { width: 18px; height: 18px; flex: none; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 24px;
  display: flex; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  font-size: 13px; color: #8A827A;
  position: relative; z-index: 2;
}
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; } }
@media (max-width: 500px) { .footer-grid { grid-template-columns: 1fr; } }

/* ──── Utility ──── */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
