/* ============================================================
   HOW IT WORKS — PAGE-SPECIFIC CSS
   Foundstone Infra | how-it-works.html
   ============================================================ */

/* ---- A. HERO ---- */
.hiw-hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding-top: 160px;
  padding-bottom: 6rem;
  box-sizing: border-box;
}

.hiw-hero-bg {
  position: absolute;
  inset: 0;
  background-image: url('https://images.unsplash.com/photo-1600566753376-12c8ab7fb75b?auto=format&fit=crop&w=1800&q=80');
  background-size: cover;
  background-position: center 35%;
  transform-origin: center center;
  transition: transform 8s ease;
}

.hiw-hero.loaded .hiw-hero-bg {
  transform: scale(1.07);
}

.hiw-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(20, 28, 22, 0.96) 0%,
    rgba(20, 28, 22, 0.70) 45%,
    rgba(20, 28, 22, 0.35) 100%
  );
}

.hiw-hero-rule {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  background: linear-gradient(to right, transparent, #C58B55 20%, #C58B55 80%, transparent);
  z-index: 3;
}

.hiw-hero-deco {
  position: absolute;
  bottom: 3.5rem;
  right: -1.5rem;
  font-family: 'Playfair Display', serif;
  font-size: clamp(3.8rem, 8.5vw, 8.5rem);
  font-weight: 800;
  color: rgba(255, 255, 255, 0.04);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1;
  pointer-events: none;
  z-index: 1;
  user-select: none;
  white-space: nowrap;
}

.hiw-hero .svc-hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
}

/* ---- B. INTRODUCTION ---- */
#hiw-intro {
  background: var(--ivory);
  padding: 7rem 0;
}

.hiw-intro-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: center;
}

.hiw-intro-text .section-label {
  display: block;
  margin-bottom: 1rem;
}

.hiw-intro-h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 3.2vw, 2.75rem);
  font-weight: 700;
  color: var(--charcoal);
  line-height: 1.25;
  margin-bottom: 2rem;
}

.hiw-intro-h2 em {
  font-style: italic;
  color: var(--forest);
}

.hiw-intro-body p {
  font-family: 'Manrope', sans-serif;
  font-size: 1.075rem;
  line-height: 1.85;
  color: #3d423e;
  margin-bottom: 1.35rem;
}

.hiw-intro-body p:last-child { margin-bottom: 0; }

.hiw-intro-img {
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  box-shadow: 0 20px 60px rgba(0,0,0,0.12);
}

.hiw-intro-img img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  transition: transform 0.8s ease;
}

.hiw-intro-img:hover img { transform: scale(1.03); }

.hiw-intro-img::after {
  content: '';
  position: absolute;
  bottom: -1px; left: -1px;
  width: 60px; height: 4px;
  background: var(--copper);
}

/* ---- C. PROCESS SECTION ---- */
#hiw-process {
  background: var(--charcoal);
  padding: 7rem 0;
}

.hiw-process-header {
  text-align: center;
  margin-bottom: 5rem;
}

.hiw-process-h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 3.2vw, 2.75rem);
  font-weight: 700;
  color: #fff;
  line-height: 1.25;
  margin-bottom: 0.85rem;
}

.hiw-process-h2 em {
  font-style: italic;
  color: var(--copper-lt);
}

.hiw-process-sub {
  font-family: 'Manrope', sans-serif;
  font-size: 1.075rem;
  color: rgba(245,240,231,0.75);
  max-width: 580px;
  margin: 0 auto;
  line-height: 1.75;
}

/* Timeline layout */
.hiw-timeline {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}

/* Horizontal connecting line */
.hiw-timeline::before {
  content: '';
  position: absolute;
  top: 72px;
  left: calc(12.5% + 24px);
  right: calc(12.5% + 24px);
  height: 2px;
  border-top: 2px dashed rgba(197,139,85,0.5);
  z-index: 1;
  pointer-events: none;
}

.hiw-step {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 1.75rem 2.5rem;
}

.hiw-step-badge-wrap {
  position: relative;
  margin-bottom: 2rem;
}

.hiw-step-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--forest);
  border: 2px solid rgba(197,139,85,0.5);
  box-shadow: 0 6px 20px rgba(0,0,0,0.3), 0 0 0 6px rgba(52,74,61,0.25);
  position: relative;
  z-index: 2;
  transition: transform 0.35s ease, background 0.35s ease;
}

.hiw-step:hover .hiw-step-badge {
  transform: scale(1.1);
  background: #25362c;
}

.hiw-step-badge-num {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--copper-lt);
  line-height: 1;
}

.hiw-step-dash {
  font-family: 'Manrope', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--copper);
  text-transform: uppercase;
  margin-bottom: 0.85rem;
}

.hiw-step-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: #FFFFFF;
  line-height: 1.3;
  margin-bottom: 0.85rem;
}

.hiw-step-desc {
  font-family: 'Manrope', sans-serif;
  font-size: 0.975rem;
  color: rgba(245,240,231,0.80);
  line-height: 1.72;
  max-width: 220px;
  margin: 0 auto;
}

/* ---- D. SERVICES SECTION ---- */
#hiw-services {
  background: var(--ivory);
  padding: 7rem 0;
}

.hiw-services-header {
  text-align: center;
  margin-bottom: 4rem;
}

.hiw-services-h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 3.2vw, 2.75rem);
  font-weight: 700;
  color: var(--charcoal);
  line-height: 1.25;
  margin-bottom: 0.85rem;
}

.hiw-services-h2 em {
  font-style: italic;
  color: var(--forest);
}

.hiw-services-sub {
  font-family: 'Manrope', sans-serif;
  font-size: 1.075rem;
  color: #555;
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.75;
}

.hiw-svc-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.5rem;
}

.hiw-svc-card {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  aspect-ratio: 3 / 4;
  background: #1a1e1b;
  box-shadow: 0 8px 30px rgba(0,0,0,0.14);
  border: 1px solid rgba(197,139,85,0.18);
  display: block;
  text-decoration: none;
  transition: transform 0.4s cubic-bezier(0.25,1,0.5,1), box-shadow 0.4s ease, border-color 0.4s ease;
}

.hiw-svc-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
  border-color: rgba(197,139,85,0.5);
}

.hiw-svc-img {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform 0.8s cubic-bezier(0.25,1,0.5,1), filter 0.6s ease;
  filter: brightness(0.6);
}

.hiw-svc-card:hover .hiw-svc-img {
  transform: scale(1.07);
  filter: brightness(0.45);
}

.hiw-svc-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(15,20,16,0.1) 0%,
    rgba(15,20,16,0.6) 50%,
    rgba(15,20,16,0.95) 100%
  );
  z-index: 1;
}

.hiw-svc-body {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 2rem 1.6rem;
}

.hiw-svc-num {
  font-family: 'Manrope', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--copper-lt);
  margin-bottom: 0.6rem;
}

.hiw-svc-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: #FFFFFF;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

.hiw-svc-desc {
  font-family: 'Manrope', sans-serif;
  font-size: 0.875rem;
  color: rgba(245,240,231,0.82);
  line-height: 1.6;
  margin-bottom: 1.1rem;
}

.hiw-svc-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: 'Manrope', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--copper-lt);
  text-transform: uppercase;
  transition: gap 0.3s ease;
}

.hiw-svc-card:hover .hiw-svc-link {
  gap: 0.65rem;
  color: #FFFFFF;
}

/* ---- E. OWNER TYPES — Alternating ---- */
#hiw-owners {
  background: var(--beige);
}

.hiw-owners-header {
  text-align: center;
  padding: 7rem 0 0;
}

.hiw-owners-h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 3.2vw, 2.75rem);
  font-weight: 700;
  color: var(--charcoal);
  line-height: 1.25;
  margin-bottom: 0.85rem;
}

.hiw-owners-h2 em {
  font-style: italic;
  color: var(--forest);
}

.hiw-owners-blocks {
  margin-top: 4.5rem;
}

.hiw-owner-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 440px;
}

.hiw-owner-block:nth-child(even) {
  direction: rtl;
}

.hiw-owner-block:nth-child(even) > * {
  direction: ltr;
}

.hiw-owner-photo {
  position: relative;
  overflow: hidden;
  height: 100%;
  min-height: 100%;
}

.hiw-owner-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.8s ease;
}

.hiw-owner-block:hover .hiw-owner-photo img {
  transform: scale(1.04);
}

.hiw-owner-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4.5rem 5rem;
}

.hiw-owner-block:nth-child(1) .hiw-owner-content { background: var(--ivory); }
.hiw-owner-block:nth-child(2) .hiw-owner-content { background: var(--beige); }
.hiw-owner-block:nth-child(3) .hiw-owner-content { background: var(--forest); }
.hiw-owner-block:nth-child(3) .hiw-owner-tag { color: var(--copper-lt); }
.hiw-owner-block:nth-child(3) .hiw-owner-rule { background: rgba(255,255,255,0.25); }
.hiw-owner-block:nth-child(3) .hiw-owner-h3 { color: #fff; }
.hiw-owner-block:nth-child(3) .hiw-owner-text { color: rgba(245,240,231,0.85); }

.hiw-owner-tag {
  font-family: 'Manrope', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--copper);
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.hiw-owner-rule {
  width: 48px; height: 2px;
  background: var(--copper);
  margin-bottom: 1.5rem;
}

.hiw-owner-h3 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.65rem, 2.4vw, 2.15rem);
  font-weight: 700;
  color: var(--charcoal);
  line-height: 1.25;
  margin-bottom: 1.2rem;
}

.hiw-owner-text {
  font-family: 'Manrope', sans-serif;
  font-size: 1.05rem;
  color: #444;
  line-height: 1.85;
}

/* ---- F. APPROACH SECTION ---- */
#hiw-approach {
  background: var(--forest);
  padding: 7rem 0;
  position: relative;
  overflow: hidden;
}

.hiw-approach-deco {
  position: absolute;
  inset: 0;
  background-image: url('https://images.unsplash.com/photo-1582407947304-fd86f028f716?auto=format&fit=crop&w=1600&q=70');
  background-size: cover;
  background-position: center;
  opacity: 0.06;
  pointer-events: none;
}

.hiw-approach-inner {
  position: relative;
  z-index: 2;
}

.hiw-approach-header {
  text-align: center;
  margin-bottom: 4rem;
}

.hiw-approach-h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 3.2vw, 2.75rem);
  font-weight: 700;
  color: #fff;
  line-height: 1.25;
  margin-bottom: 0.85rem;
}

.hiw-approach-h2 em {
  font-style: italic;
  color: var(--copper-lt);
}

.hiw-approach-sub {
  font-family: 'Manrope', sans-serif;
  font-size: 1.075rem;
  color: rgba(245,240,231,0.78);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.75;
}

.hiw-approach-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
}

.hiw-approach-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(197,139,85,0.28);
  border-radius: 4px;
  padding: 2.5rem 2rem;
  text-align: center;
  transition: background 0.35s ease, transform 0.35s ease, border-color 0.35s ease;
}

.hiw-approach-card:hover {
  background: rgba(255,255,255,0.11);
  transform: translateY(-5px);
  border-color: rgba(197,139,85,0.6);
}

.hiw-approach-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: rgba(197,139,85,0.18);
  border: 1px solid rgba(197,139,85,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  transition: background 0.35s ease;
}

.hiw-approach-card:hover .hiw-approach-icon {
  background: rgba(197,139,85,0.3);
}

.hiw-approach-icon svg {
  color: var(--copper-lt);
}

.hiw-approach-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 0.85rem;
}

.hiw-approach-text {
  font-family: 'Manrope', sans-serif;
  font-size: 0.975rem;
  color: rgba(245,240,231,0.80);
  line-height: 1.72;
}

/* ---- G. FAQ SECTION ---- */
#hiw-faq {
  background: var(--ivory);
  padding: 7rem 0;
}

.hiw-faq-header {
  text-align: center;
  margin-bottom: 4rem;
}

.hiw-faq-h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 3.2vw, 2.75rem);
  font-weight: 700;
  color: var(--charcoal);
  line-height: 1.25;
  margin-bottom: 0.85rem;
}

.hiw-faq-h2 em {
  font-style: italic;
  color: var(--forest);
}

.hiw-faq-list {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.hiw-faq-item {
  border-bottom: 1px solid rgba(52,74,61,0.15);
  overflow: hidden;
}

.hiw-faq-item:first-child {
  border-top: 1px solid rgba(52,74,61,0.15);
}

.hiw-faq-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  background: none;
  border: none;
  padding: 1.6rem 0;
  cursor: pointer;
  text-align: left;
  transition: color 0.25s ease;
}

.hiw-faq-btn:hover .hiw-faq-q {
  color: var(--forest);
}

.hiw-faq-q {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--charcoal);
  line-height: 1.35;
  transition: color 0.25s ease;
}

.hiw-faq-item.open .hiw-faq-q {
  color: var(--forest);
}

.hiw-faq-chevron {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1.5px solid rgba(52,74,61,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--forest);
  transition: transform 0.35s ease, background 0.25s ease, border-color 0.25s ease;
}

.hiw-faq-item.open .hiw-faq-chevron {
  transform: rotate(180deg);
  background: var(--forest);
  border-color: var(--forest);
  color: #fff;
}

.hiw-faq-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.42s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s ease;
}

.hiw-faq-item.open .hiw-faq-body {
  max-height: 300px;
}

.hiw-faq-a {
  font-family: 'Manrope', sans-serif;
  font-size: 1.025rem;
  color: #444;
  line-height: 1.82;
  padding-bottom: 1.75rem;
  max-width: 700px;
}

/* ---- H. FINAL CTA ---- */
#hiw-cta {
  position: relative;
  padding: 9rem 0;
  overflow: hidden;
}

.hiw-cta-bg {
  position: absolute;
  inset: 0;
  background-image: url('https://images.unsplash.com/photo-1560184897-ae75f418493e?auto=format&fit=crop&w=1800&q=80');
  background-size: cover;
  background-position: center;
}

.hiw-cta-overlay {
  position: absolute;
  inset: 0;
  background: rgba(28, 36, 30, 0.84);
}

.hiw-cta-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hiw-cta-h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.1rem, 3.8vw, 3.2rem);
  font-weight: 700;
  color: #fff;
  line-height: 1.25;
  margin: 0.5rem 0 1.25rem;
}

.hiw-cta-h2 em {
  font-style: italic;
  color: var(--copper-lt);
}

.hiw-cta-desc {
  font-family: 'Manrope', sans-serif;
  font-size: 1.1rem;
  color: rgba(245,240,231,0.9);
  line-height: 1.75;
  margin-bottom: 2.5rem;
  max-width: 580px;
}

.hiw-cta-btns {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
  .hiw-svc-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .hiw-approach-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 1024px) {
  .hiw-hero {
    padding-top: 140px;
    padding-bottom: 5rem;
  }

  .hiw-intro-grid {
    gap: 3rem;
  }

  .hiw-owner-content {
    padding: 3.5rem 3rem;
  }

  .hiw-timeline {
    grid-template-columns: repeat(2, 1fr);
    gap: 3rem 0;
  }

  .hiw-timeline::before {
    display: none;
  }

  .hiw-step {
    padding-bottom: 2rem;
  }
}

@media (max-width: 768px) {
  .hiw-hero {
    padding-top: 130px;
    padding-bottom: 4.5rem;
    min-height: 85vh;
  }

  .hiw-intro-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .hiw-intro-img {
    aspect-ratio: 16 / 9;
    order: -1;
  }

  .hiw-timeline {
    grid-template-columns: 1fr;
  }

  .hiw-svc-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hiw-owner-block,
  .hiw-owner-block:nth-child(even) {
    grid-template-columns: 1fr;
    direction: ltr;
    min-height: auto;
  }

  .hiw-owner-block:nth-child(even) > * {
    direction: ltr;
  }

  .hiw-owner-photo { aspect-ratio: 16 / 9; }

  .hiw-owner-content { padding: 3rem 1.75rem; }

  .hiw-owner-block:nth-child(even) .hiw-owner-photo { order: -1; }

  .hiw-approach-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }

  .hiw-process-h2,
  .hiw-services-h2,
  .hiw-owners-h2,
  .hiw-approach-h2,
  .hiw-faq-h2,
  .hiw-cta-h2 {
    font-size: 1.9rem;
  }

  .hiw-cta-btns {
    flex-direction: column;
    align-items: stretch;
    max-width: 340px;
    margin: 0 auto;
  }

  .hiw-cta-btns .btn-primary,
  .hiw-cta-btns .btn-outline {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .hiw-hero {
    padding-top: 115px;
    padding-bottom: 3.5rem;
    min-height: auto;
  }

  .hiw-hero-deco { display: none; }

  #hiw-intro { padding: 4.5rem 0; }
  #hiw-process { padding: 4.5rem 0; }
  .hiw-owners-header { padding: 4.5rem 0 0; }
  #hiw-approach { padding: 4.5rem 0; }
  #hiw-faq { padding: 4.5rem 0; }
  #hiw-cta { padding: 5.5rem 0; }

  .hiw-svc-grid {
    grid-template-columns: 1fr;
  }

  .hiw-svc-card {
    aspect-ratio: 16 / 10;
  }

  .hiw-approach-grid {
    grid-template-columns: 1fr;
  }

  .hiw-step { padding: 0 0.75rem 2rem; }

  .hiw-owner-content { padding: 2.25rem 1.25rem; }

  .hiw-process-header { margin-bottom: 3rem; }
}
