/* ============================================================
   Joseph Mumo Philip - Shared Stylesheet
   ============================================================ */

/* Reset  */
*, *::before, *::after { box-sizing: border-box; }

/* Base  */
body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  overflow-x: hidden;
  background-color: #e6e2dc;
  background-image: radial-gradient(circle, rgba(22,101,52,0.055) 1px, transparent 1px);
  background-size: 30px 30px;
}

/* Boxed site container  */
#site-box {
  max-width: 1200px;
  margin: 0 auto;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.06), 0 8px 100px rgba(0,0,0,0.18);
  border-left: 4px solid #166534;
}

/* Margin labels  */
.margin-left, .margin-right {
  position: fixed;
  top: 0;
  bottom: 0;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 5;
}
@media (min-width: 1380px) {
  .margin-left { display: flex; left: 0; width: calc((100vw - 1204px) / 2 - 4px); }
  .margin-right { display: flex; right: 0; width: calc((100vw - 1204px) / 2); }
}
.margin-left > span, .margin-right > span {
  writing-mode: vertical-rl;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  white-space: nowrap;
}
.margin-left > span { transform: rotate(180deg); color: rgba(22,101,52,0.3); }
.margin-right > span { color: rgba(0,0,0,0.13); }

/* Scroll progress  */
#scroll-progress {
  position: fixed;
  top: 0;
  right: 0;
  width: 3px;
  height: 0;
  background: linear-gradient(180deg, #166534 0%, #d97706 100%);
  z-index: 999;
  pointer-events: none;
}
@media (min-width: 1204px) {
  #scroll-progress { right: calc((100vw - 1200px) / 2); }
}

/* Dot grid background  */
.dot-grid {
  background-image: radial-gradient(circle, rgba(22,101,52,0.07) 1px, transparent 1px);
  background-size: 30px 30px;
}

/* Navigation  */
#nav { transition: box-shadow 0.3s; box-shadow: 0 1px 0 rgba(22,101,52,0.15); }
#nav.scrolled { box-shadow: 0 4px 40px rgba(0,0,0,0.14), 0 1px 0 rgba(22,101,52,0.15); }

.nav-link {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: #111827;
  transition: color 0.2s;
  position: relative;
  padding-bottom: 2px;
}
.nav-link::before {
  content: '';
  position: absolute;
  inset: -5px -8px;
  background: transparent;
  border-radius: 6px;
  transition: background 0.2s;
  z-index: -1;
  pointer-events: none;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 2px;
  background: #166534;
  border-radius: 2px;
  transition: width 0.25s;
}
.nav-link:hover::before { background: rgba(22,101,52,0.08); }
.nav-link.active::before { background: rgba(22,101,52,0.12); }
.nav-link:hover, .nav-link.active { color: #166534; }
.nav-link:hover::after, .nav-link.active::after { width: 100%; }

#mob-menu { max-height: 0; overflow: hidden; transition: max-height 0.35s ease; }
#mob-menu.open { max-height: 500px; }

/* Scroll reveal  */
.reveal   { opacity: 0; transform: translateY(26px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal-l { opacity: 0; transform: translateX(-30px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal-r { opacity: 0; transform: translateX(30px);  transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.on, .reveal-l.on, .reveal-r.on { opacity: 1; transform: none; }
.d1 { transition-delay: 0.10s; } .d2 { transition-delay: 0.20s; }
.d3 { transition-delay: 0.30s; } .d4 { transition-delay: 0.40s; }
.d5 { transition-delay: 0.50s; } .d6 { transition-delay: 0.60s; }

/* Hero animations (index)  */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(32px); }
  to   { opacity: 1; transform: none; }
}
.hero-item { opacity: 0; animation: fadeUp 0.8s ease forwards; }

/* Buttons  */
.btn-green {
  display: inline-block;
  background: #166534;
  color: #fff;
  padding: 0.78rem 1.9rem;
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 0.4rem;
  transition: background 0.2s, transform 0.15s;
}
.btn-green:hover { background: #14532d; transform: translateY(-2px); }

.btn-border {
  display: inline-block;
  border: 1.5px solid #166534;
  color: #166534;
  padding: 0.78rem 1.9rem;
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 0.4rem;
  transition: background 0.2s, color 0.2s;
}
.btn-border:hover { background: #f0fdf4; }

.btn-amber {
  display: inline-block;
  background: #d97706;
  color: #fff;
  padding: 0.6rem 1.4rem;
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  border-radius: 9999px;
  transition: background 0.2s;
}
.btn-amber:hover { background: #b45309; }

/* Typography helpers  */
.sec-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #16a34a;
}
.stat-n {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  color: #166534;
  line-height: 1;
}

/* Generic card  */
.card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  transition: box-shadow 0.3s, transform 0.3s, border-color 0.3s;
}
.card:hover {
  box-shadow: inset 4px 0 0 #166534, 0 14px 40px rgba(22,101,52,0.11);
  transform: translateY(-5px);
  border-color: rgba(22,101,52,0.28);
}

/* Service icon strip (index hero)  */
.svc-icon {
  width: 48px;
  height: 48px;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Quote mark (index + testimonials)  */
.quote-mark {
  font-family: 'Playfair Display', serif;
  font-size: 7rem;
  color: rgba(22,101,52,0.1);
  line-height: 1;
  position: absolute;
  top: -10px;
  left: 12px;
  pointer-events: none;
}

/* Service cards (services page)  */
.svc-card {
  position: relative;
  overflow: hidden;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 1.25rem;
  transition: box-shadow 0.35s, transform 0.35s, border-color 0.35s;
}
.svc-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #166534 0%, #16a34a 100%);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s cubic-bezier(0.25,0.46,0.45,0.94);
  border-radius: 1.25rem 1.25rem 0 0;
}
.svc-card:hover::before { transform: scaleX(1); }
.svc-card:hover {
  box-shadow: 0 20px 56px rgba(22,101,52,0.13);
  transform: translateY(-5px);
  border-color: rgba(22,101,52,0.25);
}
.svc-num {
  position: absolute;
  top: -8px; right: 18px;
  font-family: 'Playfair Display', serif;
  font-size: 6.5rem;
  font-weight: 800;
  line-height: 1;
  color: rgba(22,101,52,0.055);
  pointer-events: none;
  user-select: none;
  z-index: 0;
}
.svc-inner { position: relative; z-index: 1; padding: 2rem; }
.svc-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #166534;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: gap 0.25s;
}
.svc-cta:hover { gap: 11px; }

/* Check list (services page)  */
.check-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.83rem;
  color: #4b5563;
  line-height: 1.55;
}
.check-list li::before {
  content: '';
  display: block;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #f0fdf4;
  border: 1.5px solid #86efac;
  flex-shrink: 0;
  margin-top: 2px;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23166534' stroke-width='3' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

/* Timeline - About page  */
.tl-item {
  position: relative;
  padding-left: 2.5rem;
}
.tl-item::before {
  content: '';
  position: absolute;
  left: 0; top: 7px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #166534;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px #166534;
}
.tl-item::after {
  content: '';
  position: absolute;
  left: 5px; top: 22px;
  width: 2px;
  height: calc(100% - 14px);
  background: #dcfce7;
}
.tl-item:last-child::after { display: none; }

/* Expertise pill (about page)  */
.ep {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 500;
  border: 1px solid #bbf7d0;
  color: #166534;
  background: #f0fdf4;
  border-radius: 9999px;
  padding: 0.3rem 0.85rem;
  transition: background 0.2s, border-color 0.2s;
}
.ep:hover { background: #dcfce7; border-color: #86efac; }

/* Timeline - Achievements page  */
.tl {
  position: relative;
  padding-left: 3rem;
}
.tl::before {
  content: '';
  position: absolute;
  left: 7px; top: 16px; bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, #166534, #dcfce7);
}
.tl-dot {
  position: absolute;
  left: 0; top: 10px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #166534;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px #166534;
}

/* Stat card (achievements page)  */
.stat-card {
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  background: #fff;
  text-align: center;
  padding: 2rem 1.5rem;
}

/* Testimonial card  */
.t-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 1.25rem;
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.3s, transform 0.3s, border-color 0.3s;
}
.t-card:hover {
  box-shadow: 0 14px 40px rgba(22,101,52,0.1);
  transform: translateY(-4px);
  border-color: rgba(22,101,52,0.25);
}
.t-card::before {
  content: '\201C';
  font-family: 'Playfair Display', serif;
  font-size: 8rem;
  color: rgba(22,101,52,0.07);
  position: absolute;
  top: -18px; left: 12px;
  line-height: 1;
  pointer-events: none;
}
.star { color: #f59e0b; font-size: 14px; }

/* Contact form  */
.fi {
  width: 100%;
  background: #fff;
  border: 1.5px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.875rem;
  color: #111827;
  font-weight: 400;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.fi:focus { border-color: #166534; box-shadow: 0 0 0 3px rgba(22,101,52,0.09); }
.fi::placeholder { color: #9ca3af; }

label.field-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b7280;
  margin-bottom: 0.5rem;
}
.info-box { border: 1px solid #e5e7eb; border-radius: 1rem; background: #fff; }
#form-success { display: none; }

/* Mobile & touch optimizations  */
@media (hover: none) {
  .card:hover, .svc-card:hover, .t-card:hover {
    transform: none;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  }
  .btn-green:hover { transform: none; }
  .btn-border:hover { background: none; }
}

@media (max-width: 767px) {
  #site-box { box-shadow: 0 2px 20px rgba(0,0,0,0.09); }
  #site-box section.py-24 { padding-top: 3.5rem; padding-bottom: 3.5rem; }
  #site-box section.py-20 { padding-top: 2.75rem; padding-bottom: 2.75rem; }
  #site-box section.py-16 { padding-top: 2.25rem; padding-bottom: 2.25rem; }
  .btn-green, .btn-border, .btn-amber { min-height: 44px; }
  #mob-menu a.nav-link { min-height: 44px; display: flex; align-items: center; }
  footer ul a { display: block; padding: 0.35rem 0; }
  /* Services */
  .svc-inner { padding: 1.5rem; }
  /* Stat cards */
  .stat-card { padding: 1.25rem 0.75rem; }
  .stat-card p.font-display { font-size: 2.25rem; }
  /* Contact form */
  .fi { font-size: 1rem; }
}

/* Accessibility  */
:focus-visible { outline: 2px solid #166534; outline-offset: 3px; border-radius: 3px; }
