/* =============================================================
   SJG Process Consulting LLC — site styles
   Fonts: Newsreader (serif headings) + Libre Franklin (sans body)
   ============================================================= */

:root {
  /* Brand palette (drawn from the logo greens + blues) */
  --ink: #14283a;          /* primary dark navy (headings) */
  --ink-deep: #0f2030;     /* dark section backgrounds */
  --footer: #0b1826;       /* footer background */
  --blue: #1f6f9c;         /* primary blue (links, accents, CTA) */
  --blue-dark: #17597f;    /* blue hover */
  --green: #6ba644;        /* primary green (buttons) */
  --green-light: #7cb84f;  /* green hover */
  --green-bright: #8fd06a; /* bright green on dark backgrounds */

  --bg: #f7f8f6;           /* page background */
  --surface: #eef2ef;      /* alternating section background */
  --line: #e2e7e4;         /* hairline borders */
  --line-2: #dfe4e2;       /* header border */

  --text: #22333f;         /* body text */
  --muted: #5c6b74;        /* muted body text */
  --muted-2: #616e77;      /* secondary muted (locations) — WCAG AA: ~4.9:1 on --bg */

  --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --sans: 'Libre Franklin', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --maxw: 1200px;
  --header-h: 88px;
}

/* ---------- Resets ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p, ul { margin: 0; }
img { max-width: 100%; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-dark); }
[id] { scroll-margin-top: var(--header-h); }

@keyframes sjgfade {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Accessibility helpers ---------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
  border-radius: 2px;
}
.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 200;
  background: var(--ink);
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 12px; color: #fff; }

/* Visually hidden, but still announced by screen readers. Used for the
   privacy page's programmatic <h1> (its visible title is Termly-styled markup). */
.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;
}

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

/* ---------- Shared layout ---------- */
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }
.container-narrow { max-width: 900px; }
.container-mid { max-width: 960px; }

.section { padding: 96px 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.section-head { max-width: 640px; margin-bottom: 52px; }
.section-head-center { max-width: 620px; margin: 0 auto 44px; text-align: center; }

.eyebrow {
  color: var(--blue);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.eyebrow-bright { color: var(--green-bright); }
.eyebrow-rule { width: 26px; height: 1px; background: currentColor; display: inline-block; }

.section-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.1;
  color: var(--ink);
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.section-title-light { color: #fff; }

.section-intro { margin-top: 16px; color: var(--muted); font-size: 16px; line-height: 1.6; }
.section-intro-light { color: rgba(255, 255, 255, 0.72); }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(247, 248, 246, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-2);
}
.header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 12px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark { height: 38px; width: auto; }
.brand-name {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 18px;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.nav-desktop { display: flex; align-items: center; gap: 6px; }
.nav-link { padding: 8px 14px; color: #3a4a55; font-size: 14px; font-weight: 500; }
.nav-link:hover { color: var(--ink); }
.nav-cta {
  margin-left: 8px;
  padding: 10px 20px;
  background: var(--blue);
  color: #fff;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
}
.nav-cta:hover { background: var(--blue-dark); color: #fff; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid #cfd6d2;
  border-radius: 8px;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink);
  font-size: 18px;
}

.mobile-nav {
  border-top: 1px solid var(--line-2);
  background: var(--bg);
  padding: 8px 28px 16px;
  flex-direction: column;
}
.mobile-nav:not([hidden]) { display: flex; }
.mobile-link { padding: 12px 4px; color: var(--text); font-weight: 500; border-bottom: 1px solid #e7ebe8; }
.mobile-cta {
  margin-top: 12px;
  padding: 12px 20px;
  background: var(--blue);
  color: #fff;
  border-radius: 8px;
  font-weight: 600;
  text-align: center;
}
.mobile-cta:hover { color: #fff; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 86vh;
  display: flex;
  align-items: center;
  background-image: linear-gradient(
      90deg,
      rgba(15, 32, 48, 0.94) 0%,
      rgba(15, 32, 48, 0.82) 42%,
      rgba(15, 32, 48, 0.42) 100%
    ),
    url('../assets/img/header-bg.jpg');
  background-size: cover;
  background-position: center;
}
.hero-inner { max-width: var(--maxw); margin: 0 auto; padding: 96px 28px; width: 100%; }
.hero-content { max-width: 640px; animation: sjgfade 0.8s ease both; }
.hero h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(34px, 5.2vw, 60px);
  line-height: 1.06;
  color: #fff;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.hero-sub {
  margin-top: 24px;
  font-size: clamp(16px, 1.7vw, 19px);
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.82);
  max-width: 540px;
}
.hero-actions { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 14px; }
.hero-note {
  margin-top: 40px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
}
.hero-note i { color: var(--green-bright); }

.btn-primary {
  padding: 15px 30px;
  background: var(--green);
  color: var(--ink-deep);
  border-radius: 9px;
  font-weight: 600;
  font-size: 15px;
}
.btn-primary:hover { background: var(--green-light); color: var(--ink-deep); }
.btn-ghost {
  padding: 15px 30px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 9px;
  font-weight: 600;
  font-size: 15px;
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.18); color: #fff; border-color: rgba(255, 255, 255, 0.5); }

/* ---------- Credibility strip ---------- */
.strip { background: var(--ink-deep); border-top: 1px solid rgba(255, 255, 255, 0.06); }
.strip-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 30px 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 22px 44px;
  justify-content: center;
}
.strip-label { color: #7f94a3; font-size: 12px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; }
.strip-logos { display: flex; flex-wrap: wrap; gap: 16px 40px; align-items: center; }
.strip-logo { color: #c4d1da; font-size: 17px; font-weight: 600; font-family: var(--serif); }

/* ---------- Services ---------- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  max-width: 952px;
}
.service-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 30px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.service-card:hover {
  border-color: #b9d3c1;
  transform: translateY(-4px);
  box-shadow: 0 16px 34px -20px rgba(15, 32, 48, 0.35);
}
.service-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: #e9f2f6;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue);
  font-size: 20px;
  margin-bottom: 20px;
}
.service-card h3 { font-family: var(--serif); font-weight: 600; font-size: 21px; color: var(--ink); margin-bottom: 12px; }
.service-card p { color: var(--muted); font-size: 15px; line-height: 1.65; }

/* ---------- Portfolio ---------- */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 26px;
}
.portfolio-card {
  text-align: left;
  padding: 0;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.portfolio-card:hover {
  border-color: #b9d3c1;
  transform: translateY(-5px);
  box-shadow: 0 22px 40px -24px rgba(15, 32, 48, 0.45);
}
.portfolio-media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; }
.portfolio-media img { width: 100%; height: 100%; object-fit: cover; }
.portfolio-tag {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(15, 32, 48, 0.82);
  color: var(--green-bright);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 6px 11px;
  border-radius: 6px;
}
.portfolio-body { padding: 24px 24px 26px; }
.portfolio-body h3 { font-family: var(--serif); font-weight: 600; font-size: 22px; color: var(--ink); margin-bottom: 10px; line-height: 1.2; }
.portfolio-body p { color: var(--muted); font-size: 14.5px; line-height: 1.6; margin-bottom: 16px; }
.portfolio-more { display: inline-flex; align-items: center; gap: 8px; color: var(--blue); font-size: 14px; font-weight: 600; }
.portfolio-more i { font-size: 12px; }

/* ---------- Timeline / history ---------- */
.timeline { position: relative; }
.timeline-line { position: absolute; left: 35px; top: 8px; bottom: 70px; width: 2px; background: #dbe2dd; }
.timeline-item {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 26px;
  padding-bottom: 44px;
}
.timeline-photo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 2px var(--green);
  background: #fff;
}
.timeline-body { padding-top: 2px; }
.timeline-years { color: var(--blue); font-size: 13px; font-weight: 700; letter-spacing: 0.04em; margin-bottom: 6px; }
.timeline-body h3 { font-family: var(--serif); font-weight: 600; font-size: 21px; color: var(--ink); line-height: 1.25; }
.timeline-loc { color: var(--muted-2); font-size: 14px; font-weight: 500; margin-top: 2px; margin-bottom: 10px; }
.timeline-text { color: var(--muted); font-size: 15px; line-height: 1.65; max-width: 560px; }

.timeline-cta { padding-bottom: 0; align-items: center; }
.timeline-cta-mark {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
  box-shadow: 0 0 0 6px rgba(107, 166, 68, 0.18);
}
.timeline-cta .timeline-body { align-self: center; padding-top: 0; }
.timeline-cta h3 { font-family: var(--serif); font-weight: 600; font-size: 24px; color: var(--ink); }
.timeline-cta-link { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; color: var(--blue); font-weight: 600; }
.timeline-cta-link i { font-size: 12px; }

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 56px;
  align-items: center;
}
.about-photo-col { display: flex; flex-direction: column; align-items: center; text-align: center; }
.about-photo {
  width: 230px;
  height: 230px;
  border-radius: 50%;
  object-fit: cover;
  border: 5px solid #fff;
  box-shadow: 0 20px 40px -20px rgba(15, 32, 48, 0.4);
}
.about-name { font-family: var(--serif); font-weight: 600; font-size: 26px; color: var(--ink); margin-top: 24px; }
.about-role { color: var(--muted); font-size: 15px; margin-top: 4px; }
.about-bio { color: #4a5a64; font-size: 17px; line-height: 1.72; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.chip {
  background: #fff;
  border: 1px solid #d7ded9;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: #3a4a55;
}

/* Social button (about + footer) */
.social-btn {
  margin-top: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.social-btn:hover { background: var(--blue); color: #fff; }
.social-btn-dark { margin-top: 0; width: 42px; height: 42px; background: #1a2c3d; }

/* ---------- Contact ---------- */
.contact { background: var(--ink-deep); }
.contact-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
  max-width: 760px;
  margin: 0 auto;
}
.field-col { display: flex; flex-direction: column; gap: 18px; }
.field {
  width: 100%;
  padding: 15px 18px;
  border-radius: 10px;
  /* Border lightened to ~3.7:1 against the dark contact bg so the input
     boundary meets WCAG 1.4.11 non-text contrast (was 0.16 ≈ 1.6:1). */
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
}
.field::placeholder { color: rgba(255, 255, 255, 0.55); }
.field-textarea { height: 100%; min-height: 172px; resize: vertical; }
.contact-actions { grid-column: 1 / -1; text-align: center; margin-top: 8px; }
.btn-submit {
  padding: 16px 40px;
  background: var(--green);
  color: var(--ink-deep);
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.02em;
  cursor: pointer;
}
.btn-submit:hover { background: var(--green-light); }

/* Turnstile widget: span the full form width and sit above the button.
   Never hide this container (display:none/opacity:0) — Cloudflare needs it
   in the DOM to inject a visible challenge for higher-risk visitors. The
   data-appearance="interaction-only" attribute handles hiding it otherwise. */
.cf-turnstile {
  grid-column: 1 / -1;
  margin-top: 4px;
  display: flex;
  justify-content: center;
}

/* Submission feedback line; muted white to read on the dark contact bg. */
.form-status {
  grid-column: 1 / -1;
  margin-top: 8px;
  text-align: center;
  color: rgba(255, 255, 255, 0.85);
  font-size: 15px;
  min-height: 1.2em;
}

/* ---------- Footer ---------- */
.site-footer { background: var(--footer); padding: 40px 0; }
.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  align-items: center;
}
.footer-copy { color: rgba(255, 255, 255, 0.72); font-size: 14px; }
.footer-social { display: flex; justify-content: center; }
.footer-legal { text-align: right; }
.footer-legal a { color: rgba(255, 255, 255, 0.72); font-size: 14px; }
.footer-legal a:hover { color: #fff; }

/* ---------- Portfolio modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(11, 24, 38, 0.72);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 5vh 20px;
  animation: sjgfade 0.25s ease both;
}
.modal-overlay[hidden] { display: none; }
.modal {
  background: #fff;
  border-radius: 18px;
  max-width: 760px;
  width: 100%;
  overflow: hidden;
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.6);
}
.modal-media { position: relative; }
.modal-media img { width: 100%; max-height: 340px; object-fit: cover; }
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: rgba(15, 32, 48, 0.85);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-body { padding: 36px 40px 40px; }
.modal-cat { color: var(--blue); font-size: 12px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; margin-bottom: 10px; }
.modal-body h2 { font-family: var(--serif); font-weight: 600; font-size: clamp(24px, 3.2vw, 32px); color: var(--ink); line-height: 1.15; }
.modal-intro { color: var(--muted-2); font-size: 15px; margin-top: 10px; font-style: italic; }
.modal-list { margin-top: 22px; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 14px; }
.modal-list li { display: grid; grid-template-columns: 22px 1fr; gap: 12px; color: #4a5a64; font-size: 15px; line-height: 1.6; }
.modal-list li i { color: var(--green); margin-top: 4px; font-size: 13px; }
.modal-close-btn {
  margin-top: 30px;
  padding: 13px 28px;
  background: var(--ink);
  color: #fff;
  border: none;
  border-radius: 9px;
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
.modal-close-btn:hover { background: var(--blue); }

/* ---------- Back to top ---------- */
#backToTop {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 90;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 24px -8px rgba(15, 32, 48, 0.5);
  font-size: 18px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease, background 0.2s ease;
}
#backToTop.visible { opacity: 1; visibility: visible; transform: none; }
#backToTop:hover { background: var(--blue-dark); color: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 859px) {
  .nav-desktop { display: none; }
  .nav-toggle { display: flex; }
  .section { padding: 72px 0; }
  .hero-inner { padding: 72px 28px; }
}

@media (max-width: 520px) {
  .brand-name { font-size: 16px; }
  .timeline-item { gap: 18px; grid-template-columns: 56px 1fr; }
  .timeline-line { left: 27px; }
  .timeline-photo { width: 56px; height: 56px; }
  .timeline-cta-mark { width: 56px; height: 56px; font-size: 16px; }
}

/* ---------- Privacy page ---------- */
/* Constrains the Termly-generated privacy content to a readable column and
   gives it breathing room below the sticky header. */
.privacy-main { max-width: 900px; margin: 0 auto; padding: 48px 28px 72px; }

/* "Back to site" affordance in the privacy header. Not using .nav-desktop
   here because that class is hidden below 860px — this must stay visible on
   mobile since the privacy page has no hamburger menu. */
.privacy-back {
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  background: var(--blue);
  color: #fff;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
}
.privacy-back:hover { background: var(--blue-dark); color: #fff; }
