/* =========================================================
   The Cornerstone Systems — Main Stylesheet
   ---------------------------------------------------------
   1. Variables (colors, spacing, fonts)
   2. Base / reset
   3. Layout helpers (container, sections, grids)
   4. Buttons & links
   5. Header & navigation
   6. Hero
   7. Problem
   8. Services
   9. Process timeline
   10. Solutions stages
   11. About
   12. Call to action
   13. Contact & form
   14. Footer
   15. Responsive breakpoints
   ========================================================= */

/* ---------- 1. Variables ---------- */
:root {
  --charcoal: #20272D;
  --charcoal-2: #2B343B;   /* slightly lighter charcoal for cards on dark */
  --gold: #B68A45;
  --gold-dark: #94702F;    /* darker gold for text/hover (better contrast on light) */
  --cream: #F7F4EE;
  --white: #FFFFFF;
  --gray: #697078;
  --line: #E4DED3;         /* soft border on light backgrounds */

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --radius: 10px;
  --shadow: 0 10px 30px rgba(32, 39, 45, 0.08);
  --header-h: 72px;
  --transition: 0.25s ease;
}

/* ---------- 2. Base / reset ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h); /* keeps section titles visible under the sticky header */
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--charcoal);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 0.6em; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.1rem, 4.5vw, 3.4rem); }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); }
h3 { font-size: 1.15rem; }
p  { margin: 0 0 1em; }
img, svg { max-width: 100%; display: block; }
a { color: inherit; }

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  background: var(--gold);
  color: var(--charcoal);
  padding: 0.6rem 1rem;
  z-index: 200;
  border-radius: 6px;
}
.skip-link:focus { top: 1rem; }

/* ---------- 3. Layout helpers ---------- */
.container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.section { padding: 5.5rem 0; }
.section-cream { background: var(--cream); }
.section-dark { background: var(--charcoal); color: var(--cream); }

.section-head {
  max-width: 680px;
  margin-bottom: 3rem;
}
.section-head p { color: var(--gray); font-size: 1.05rem; }
.section-dark .section-head p { color: #C5C9CC; }

/* small gold label above headings, with a "corner" line */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-dark);
  margin-bottom: 0.9rem;
}
.eyebrow::before {
  content: "";
  width: 14px;
  height: 14px;
  border-left: 2px solid var(--gold);
  border-bottom: 2px solid var(--gold);
}
.section-dark .eyebrow,
.hero .eyebrow { color: var(--gold); }

.grid { display: grid; gap: 1.5rem; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-services { grid-template-columns: repeat(6, 1fr); }
/* 3 cards on top row, 2 centered on second row */
.grid-services > * { grid-column: span 2; }
.grid-services > *:nth-child(4) { grid-column: 2 / span 2; }

.placeholder { color: var(--gray); font-style: italic; }

/* ---------- 4. Buttons & links ---------- */
.btn {
  display: inline-block;
  padding: 0.85rem 1.6rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.98rem;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  font-family: inherit;
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform var(--transition);
}
.btn:hover { transform: translateY(-2px); }
.btn-sm { padding: 0.55rem 1.1rem; font-size: 0.9rem; }
.btn-block { width: 100%; }

.btn-gold { background: var(--gold); color: var(--charcoal); }
.btn-gold:hover { background: #C79A54; }

.btn-dark { background: var(--charcoal); color: var(--white); }
.btn-dark:hover { background: #333D45; }

.btn-outline-light { border-color: rgba(247, 244, 238, 0.5); color: var(--cream); }
.btn-outline-light:hover { border-color: var(--gold); color: var(--gold); }

.btn-row { display: flex; flex-wrap: wrap; gap: 1rem; }

.text-link {
  display: inline-flex;
  gap: 0.35rem;
  font-weight: 600;
  color: var(--gold-dark);
  text-decoration: none;
  margin-top: auto;
}
.text-link span { transition: transform var(--transition); }
.text-link:hover span { transform: translateX(4px); }

/* ---------- 5. Header & navigation ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(32, 39, 45, 0.97);
  color: var(--cream);
  transition: box-shadow var(--transition);
}
.site-header.scrolled { box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25); }

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--cream);
}
.logo-mark { width: 34px; height: 34px; flex-shrink: 0; }
.logo-text { font-size: 1.02rem; font-weight: 500; letter-spacing: 0.01em; }
.logo-text strong { color: var(--gold); font-weight: 700; }

.primary-nav { display: flex; align-items: center; gap: 2rem; }
.primary-nav ul {
  display: flex;
  gap: 1.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.primary-nav ul a {
  text-decoration: none;
  font-size: 0.95rem;
  color: #D7D9DB;
  position: relative;
  padding: 0.3rem 0;
  transition: color var(--transition);
}
.primary-nav ul a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 2px;
  background: var(--gold);
  transition: width var(--transition);
}
.primary-nav ul a:hover,
.primary-nav ul a.active { color: var(--white); }
.primary-nav ul a:hover::after,
.primary-nav ul a.active::after { width: 100%; }

/* hamburger button (shown on mobile only) */
.nav-toggle {
  display: none;
  background: none;
  border: 0;
  width: 44px;
  height: 44px;
  padding: 10px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--cream);
  margin: 5px 0;
  transition: transform var(--transition), opacity var(--transition);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- 6. Hero ---------- */
.hero {
  background: var(--charcoal);
  color: var(--cream);
  padding: 5rem 0 6rem;
  position: relative;
  overflow: hidden;
}
/* subtle architectural grid in the background */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(182, 138, 69, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(182, 138, 69, 0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to right, transparent, #000 60%);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 60%);
  pointer-events: none;
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 3rem;
  align-items: center;
}
.hero .lead { font-size: 1.15rem; color: #C5C9CC; max-width: 540px; margin-bottom: 2rem; }

.flow-lines { animation: flow 2.5s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -22; } }

/* ---------- 7. Problem ---------- */
.problem-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: transform var(--transition), box-shadow var(--transition);
}
.problem-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.problem-card p { color: var(--gray); margin: 0; }
.problem-num {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gold-dark);
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--gold);
  width: 2.2rem;
}

.callout {
  margin-top: 2.5rem;
  padding: 1.5rem 1.75rem;
  background: var(--white);
  border-left: 4px solid var(--gold);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.callout p { margin: 0; }

/* ---------- 8. Services ---------- */
.service-card {
  display: flex;
  flex-direction: column;
  padding: 2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  position: relative;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
/* gold "cornerstone" accent that appears on hover */
.service-card::after {
  content: "";
  position: absolute;
  left: -1px;
  bottom: -1px;
  width: 0;
  height: 0;
  border-left: 3px solid var(--gold);
  border-bottom: 3px solid var(--gold);
  border-bottom-left-radius: var(--radius);
  opacity: 0;
  transition: width var(--transition), height var(--transition), opacity var(--transition);
}
.service-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.service-card:hover::after { width: 48px; height: 48px; opacity: 1; }
.service-card p { color: var(--gray); }

.icon {
  width: 40px;
  height: 40px;
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  margin-bottom: 1.25rem;
}
.icon-sm { width: 20px; height: 20px; margin: 0; flex-shrink: 0; }

/* ---------- 9. Process timeline ---------- */
.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  position: relative;
}
/* the horizontal line connecting the steps */
.timeline::before {
  content: "";
  position: absolute;
  top: 22px;
  left: 22px;
  right: 22px;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), var(--line));
}
.timeline-step { position: relative; }
.timeline-step p { color: var(--gray); margin: 0; }
.step-dot {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 6px;
  background: var(--charcoal);
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 1.25rem;
  position: relative;
  transition: background var(--transition), color var(--transition);
}
.timeline-step:hover .step-dot { background: var(--gold); color: var(--charcoal); }

/* ---------- 10. Solutions stages ---------- */
.stages {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  align-items: end; /* lets stages rise like steps */
}
.stage {
  background: var(--charcoal-2);
  border: 1px solid #3C464E;
  border-top: 3px solid var(--gold);
  border-radius: 6px;
  padding: 1.5rem;
  transition: transform var(--transition), border-color var(--transition);
}
.stage:hover { transform: translateY(-4px); border-color: var(--gold); }
.stage p { color: #C5C9CC; margin: 0; font-size: 0.95rem; }
.stage-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.6rem;
}
/* step heights: each stage stands a little taller than the last */
.stage-1 { min-height: 180px; border-top-color: rgba(182, 138, 69, 0.4); }
.stage-2 { min-height: 220px; border-top-color: rgba(182, 138, 69, 0.6); }
.stage-3 { min-height: 260px; border-top-color: rgba(182, 138, 69, 0.8); }
.stage-4 { min-height: 300px; background: var(--gold); color: var(--charcoal); border-color: var(--gold); }
.stage-4 .stage-label, .stage-4 p { color: var(--charcoal); }

/* ---------- 11. About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}
.about-grid > div > p { color: var(--gray); font-size: 1.05rem; }

.values { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.25rem; }
.values li {
  display: flex;
  gap: 1rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
}
.values li:last-child { border-bottom: 0; }
.values h3 { font-size: 1.02rem; margin-bottom: 0.2em; }
.values p { color: var(--gray); margin: 0; font-size: 0.95rem; }
.value-mark {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 0.3rem;
  border-left: 3px solid var(--gold);
  border-bottom: 3px solid var(--gold);
}

/* ---------- 12. Call to action ---------- */
.cta {
  background: var(--gold);
  padding: 4.5rem 0;
  text-align: center;
}
.cta-inner { max-width: 760px; }
.cta p { font-size: 1.1rem; margin-bottom: 2rem; }
.cta .btn-gold { background: var(--charcoal); color: var(--white); }
.cta .btn-gold:hover { background: #333D45; }

/* ---------- 13. Contact & form ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 4rem;
  align-items: start;
}
.contact-info > p { color: var(--gray); }

.contact-list { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: 1rem; }
.contact-list li { display: flex; align-items: center; gap: 0.85rem; }
.contact-list a { text-decoration: none; font-weight: 500; }
.contact-list a:hover { color: var(--gold-dark); }

.contact-form {
  background: var(--white);
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.form-notice {
  font-size: 0.88rem;
  background: var(--cream);
  border-left: 3px solid var(--gold);
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
  color: var(--charcoal);
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-weight: 600; font-size: 0.92rem; margin-bottom: 0.4rem; }
.req { color: var(--gold-dark); }

.field input,
.field select,
.field textarea {
  width: 100%;
  font: inherit;
  font-size: 0.97rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid #CFC8BB;
  border-radius: 6px;
  background: var(--white);
  color: var(--charcoal);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.field textarea { resize: vertical; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(182, 138, 69, 0.2);
}
.field.invalid input,
.field.invalid select,
.field.invalid textarea { border-color: #B3412F; }

.error { color: #B3412F; font-size: 0.85rem; margin: 0.35rem 0 0; min-height: 0; }
.form-status { margin: 1rem 0 0; font-size: 0.95rem; }
.form-status.success { color: #2F6B45; }

/* ---------- 14. Footer ---------- */
.site-footer {
  background: var(--charcoal);
  color: #C5C9CC;
  padding: 4rem 0 1.5rem;
  font-size: 0.95rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid #3C464E;
}
.footer-brand p { margin-top: 1rem; max-width: 340px; }
.site-footer h4 { color: var(--cream); font-size: 0.95rem; margin-bottom: 1rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.55rem; }
.site-footer a { text-decoration: none; transition: color var(--transition); }
.site-footer a:hover { color: var(--gold); }
.site-footer .placeholder { color: #8D949A; }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 1.5rem;
  font-size: 0.88rem;
}
.footer-bottom p { margin: 0; }

/* ---------- 15. Responsive breakpoints ---------- */

/* Tablet */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-services { grid-template-columns: repeat(2, 1fr); }
  .grid-services > *,
  .grid-services > *:nth-child(4) { grid-column: auto; }
  .grid-services > *:nth-child(5) { grid-column: 1 / -1; }
  .stages { grid-template-columns: repeat(2, 1fr); align-items: stretch; }
  .stage { min-height: 0 !important; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

/* Mobile navigation kicks in */
@media (max-width: 900px) {
  .nav-toggle { display: block; }

  .primary-nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    padding: 1.25rem 1.25rem 1.75rem;
    background: var(--charcoal);
    border-top: 1px solid #3C464E;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);
    display: none;
  }
  .primary-nav.open { display: flex; }
  .primary-nav ul { flex-direction: column; gap: 0; }
  .primary-nav ul a { display: block; padding: 0.8rem 0; border-bottom: 1px solid #333D45; }
  .primary-nav ul a::after { display: none; }
  .primary-nav .btn { text-align: center; }

  .hero-grid,
  .about-grid,
  .contact-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .hero { padding: 3.5rem 0 4rem; }
  .hero-visual { max-width: 480px; margin: 0 auto; }

  /* Timeline becomes vertical */
  .timeline { grid-template-columns: 1fr; gap: 1.75rem; }
  .timeline::before {
    top: 22px;
    bottom: 22px;
    left: 22px;
    right: auto;
    width: 2px;
    height: auto;
    background: linear-gradient(180deg, var(--gold), var(--line));
  }
  .timeline-step { padding-left: 4.25rem; }
  .step-dot { position: absolute; left: 0; top: 0; }
}

/* Phone */
@media (max-width: 600px) {
  .section { padding: 4rem 0; }
  .grid-4,
  .grid-services,
  .stages,
  .form-row { grid-template-columns: 1fr; }
  .grid-services > *:nth-child(5) { grid-column: auto; }
  .btn-row .btn { width: 100%; text-align: center; }
  .logo-text { font-size: 0.92rem; }
  .contact-form { padding: 1.5rem; }
  .footer-grid { grid-template-columns: 1fr; }
}
