/* ==========================================================================
   BHK Solutions Kenya — design tokens
   Signature: the "terrain line" — a rough, jagged line on the left easing
   into a calm, smooth wave on the right. Rough ground made walkable.
   ========================================================================== */
:root {
  /* Color */
  --ink:        #0E0D0C;   /* near-black, matches the logo background */
  --paper:      #F4EFE4;   /* warm off-white for text on dark */
  --stone:      #ECE6D8;   /* light section background */
  --stone-deep: #DCD3BE;
  --terracotta: #C1502E;   /* Kenyan earth — CTAs, primary accent */
  --terracotta-deep: #9C3E22;
  --gold:       #D9A441;   /* from the logo's "Pioneer Spirit" gradient */
  --savanna:    #3F6B3F;   /* secondary green, from logo gradient */
  --line-muted: rgba(244, 239, 228, 0.16);
  --line-muted-dark: rgba(14, 13, 12, 0.12);

  /* Type */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Work Sans', -apple-system, Segoe UI, sans-serif;
  --font-data: 'IBM Plex Mono', 'Courier New', monospace;

  --radius: 6px;
}

/* ==========================================================================
   Base
   ========================================================================== */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 0.75rem 1.25rem;
  z-index: 2000;
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

a { color: var(--terracotta-deep); }
a:hover { color: var(--terracotta); }

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

.eyebrow {
  font-family: var(--font-data);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--terracotta-deep);
  display: inline-block;
  margin-bottom: 0.75rem;
}
.eyebrow--on-dark { color: var(--gold); }

/* ==========================================================================
   Header / Nav
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #000000;
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(244, 239, 228, 0.08);
}
.navbar { padding: 0.25rem 0; }
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.navbar-brand img { border-radius: 5%; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--paper);
  font-size: 1.02rem;
}
.brand-tagline {
  font-family: var(--font-data);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}
.navbar-nav .nav-link {
  color: rgba(244, 239, 228, 0.78);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.5rem 0.9rem !important;
  transition: color 0.15s ease;
}
.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: var(--paper);
}
.navbar-nav .nav-link.active {
  position: relative;
}
.navbar-nav .nav-link.active::after {
  content: "";
  position: absolute;
  left: 0.9rem;
  right: 0.9rem;
  bottom: 0.2rem;
  height: 2px;
  background: var(--gold);
}
.navbar-toggler {
  border-color: rgba(244, 239, 228, 0.3);
}
.navbar-toggler-icon {
  filter: invert(1);
}

/* ==========================================================================
   Terrain divider (signature motif)
   ========================================================================== */
.terrain-divider { line-height: 0; color: var(--line-muted-dark); }
.terrain-divider--on-dark { color: var(--line-muted); }
.terrain-svg { width: 100%; height: 46px; display: block; }
.terrain-divider--footer { color: rgba(244, 239, 228, 0.18); }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  min-height: 84vh;
  display: flex;
  align-items: flex-end;
  background-size: cover;
  background-position: center;
  color: var(--paper);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(14,13,12,0.15) 0%, rgba(14,13,12,0.55) 55%, rgba(14,13,12,0.92) 100%);
}
.hero-content {
  position: relative;
  z-index: 2;
  padding-bottom: 4.5rem;
  max-width: 780px;
}
.hero h1 {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  line-height: 1.08;
  margin-bottom: 1.1rem;
}
.hero-lede {
  font-size: 1.15rem;
  color: rgba(244, 239, 228, 0.85);
  max-width: 620px;
  margin-bottom: 1.75rem;
}
.hero--short { min-height: 52vh; }

/* Page hero (for interior pages) */
.page-hero {
  position: relative;
  min-height: 46vh;
  display: flex;
  align-items: flex-end;
  background-size: cover;
  background-position: center;
  color: var(--paper);
}
.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(14,13,12,0.25) 0%, rgba(14,13,12,0.72) 100%);
}
.page-hero-content { position: relative; z-index: 2; padding-bottom: 3rem; max-width: 760px; }
.page-hero h1 { font-size: clamp(2rem, 4vw, 2.85rem); margin-bottom: 0.6rem; }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn-terracotta {
  background: var(--terracotta);
  border-color: var(--terracotta);
  color: var(--paper);
  font-weight: 600;
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius);
  transition: background 0.15s ease, transform 0.15s ease;
}
.btn-terracotta:hover {
  background: var(--terracotta-deep);
  border-color: var(--terracotta-deep);
  color: var(--paper);
  transform: translateY(-1px);
}
.btn-outline-paper {
  background: transparent;
  border: 1.5px solid rgba(244, 239, 228, 0.5);
  color: var(--paper);
  font-weight: 600;
  padding: 0.68rem 1.5rem;
  border-radius: var(--radius);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.btn-outline-paper:hover {
  border-color: var(--paper);
  background: rgba(244, 239, 228, 0.08);
  color: var(--paper);
}
.btn-outline-ink {
  background: transparent;
  border: 1.5px solid rgba(14, 13, 12, 0.35);
  color: var(--ink);
  font-weight: 600;
  padding: 0.68rem 1.5rem;
  border-radius: var(--radius);
}
.btn-outline-ink:hover {
  border-color: var(--ink);
  background: rgba(14, 13, 12, 0.05);
  color: var(--ink);
}

/* ==========================================================================
   Sections
   ========================================================================== */
.section { padding: 5.5rem 0; }
.section--sm { padding: 3.5rem 0; }
.section--dark { background: var(--ink); color: var(--paper); }
.section--stone { background: var(--stone); }
.section--paper { background: var(--paper); }

.section--dark h2, .section--dark h3 { color: var(--paper); }
.section--dark p { color: rgba(244, 239, 228, 0.78); }

.section-heading { max-width: 640px; margin-bottom: 2.5rem; }
.section-heading h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); }

/* ==========================================================================
   Stat callouts
   ========================================================================== */
.stat-card {
  padding: 1.75rem 1.5rem;
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: 0 1px 0 rgba(14,13,12,0.06);
  height: 100%;
}
.stat-card--on-dark {
  background: rgba(244, 239, 228, 0.05);
  border: 1px solid rgba(244, 239, 228, 0.12);
}
.stat-number {
  font-family: var(--font-data);
  font-size: 2.1rem;
  font-weight: 500;
  color: var(--terracotta-deep);
  display: block;
  line-height: 1;
  margin-bottom: 0.5rem;
}
.stat-card--on-dark .stat-number { color: var(--gold); }
.stat-label {
  font-size: 0.92rem;
  color: rgba(14,13,12,0.7);
}
.stat-card--on-dark .stat-label { color: rgba(244,239,228,0.72); }

/* ==========================================================================
   Feature / content blocks
   ========================================================================== */
.media-frame {
  border-radius: var(--radius);
  overflow: hidden;
}
.media-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }

.icon-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--terracotta);
  color: var(--paper);
  font-family: var(--font-data);
  font-weight: 500;
  flex-shrink: 0;
}
.icon-circle--dark { background: rgba(244, 239, 228, 0.1); color: var(--gold); }

.feature-row { display: flex; gap: 1.15rem; margin-bottom: 1.85rem; }
.feature-row:last-child { margin-bottom: 0; }
.feature-row h3 { font-size: 1.12rem; margin-bottom: 0.35rem; }
.feature-row p { color: rgba(14,13,12,0.72); margin-bottom: 0; }
.section--dark .feature-row p { color: rgba(244,239,228,0.72); }

.pull-quote {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 1.5rem;
  line-height: 1.4;
  border-left: none;
  padding: 0;
  margin: 0 0 1.25rem;
}

/* Spec table */
.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-data);
  font-size: 0.92rem;
}
.spec-table th, .spec-table td {
  text-align: left;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(14,13,12,0.1);
}
.section--dark .spec-table th,
.section--dark .spec-table td {
  border-bottom: 1px solid rgba(244,239,228,0.14);
}
.spec-table th { color: rgba(14,13,12,0.55); font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.76rem; }
.section--dark .spec-table th { color: rgba(244,239,228,0.55); }

/* Card grid */
.value-card {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 2rem 1.6rem;
  height: 100%;
  box-shadow: 0 1px 0 rgba(14,13,12,0.06);
}
.value-card h3 { font-size: 1.15rem; margin-bottom: 0.6rem; }
.value-card p { color: rgba(14,13,12,0.7); margin-bottom: 0; font-size: 0.96rem; }

/* Timeline / process (used only where content is genuinely sequential) */
.process-step { display: flex; gap: 1.25rem; }
.process-index {
  font-family: var(--font-data);
  font-size: 0.85rem;
  color: var(--gold);
  border: 1px solid rgba(244,239,228,0.25);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* CTA band */
.cta-band {
  background: var(--terracotta);
  color: var(--paper);
  padding: 3.5rem 0;
  text-align: center;
}
.cta-band h2 { color: var(--paper); }
.cta-band p { color: rgba(244,239,228,0.9); }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { background: var(--ink); color: rgba(244,239,228,0.8); padding-top: 0; }
.site-footer .container { padding-top: 3.5rem; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: 2.5rem;
  padding-bottom: 2.5rem;
}
.footer-brand img { margin-bottom: 1rem; border-radius: 50%; }
.footer-lede { font-size: 0.92rem; color: rgba(244,239,228,0.62); max-width: 280px; }
.footer-heading {
  font-family: var(--font-data);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1rem;
}
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 0.6rem; font-size: 0.92rem; }
.footer-links a { color: rgba(244,239,228,0.75); text-decoration: none; }
.footer-links a:hover { color: var(--gold); }
.footer-fine { font-size: 0.86rem; color: rgba(244,239,228,0.55); }
.footer-bottom {
  border-top: 1px solid rgba(244,239,228,0.1);
  padding: 1.4rem 0;
  font-size: 0.82rem;
  color: rgba(244,239,228,0.5);
}

@media (max-width: 767px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

/* ==========================================================================
   Scroll reveal
   ========================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ==========================================================================
   Forms
   ========================================================================== */
.form-control, .form-select {
  border-radius: var(--radius);
  border: 1px solid rgba(14,13,12,0.2);
  padding: 0.7rem 0.9rem;
}
.form-control:focus, .form-select:focus {
  border-color: var(--terracotta);
  box-shadow: 0 0 0 0.2rem rgba(193, 80, 46, 0.15);
}
.form-label { font-weight: 500; font-size: 0.92rem; margin-bottom: 0.4rem; }

.alert-success-custom {
  background: rgba(63, 107, 63, 0.1);
  border: 1px solid rgba(63, 107, 63, 0.35);
  color: var(--savanna);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}
.alert-error-custom {
  background: rgba(193, 80, 46, 0.08);
  border: 1px solid rgba(193, 80, 46, 0.35);
  color: var(--terracotta-deep);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}

/* ==========================================================================
   Utility
   ========================================================================== */
.text-gold { color: var(--gold) !important; }
.text-terracotta { color: var(--terracotta-deep) !important; }
.font-data { font-family: var(--font-data); }
.narrow-col { max-width: 680px; }
