/* home.css — Phase 2 Agent 1 partial
 * Owns: home hero carousel, services-index card grid, blog splash, header phone-icon override.
 * Depends on tokens.css + components.css.
 */

/* ---------- Header: phone icon (replaces text phone number) ---------- */
.site-header__phone {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--c-emerald-300);
  color: var(--c-emerald-700);
  text-decoration: none;
  transition: background var(--dur-base) var(--ease-out),
              color var(--dur-base) var(--ease-out);
}
.site-header__phone:hover {
  background: var(--bg-emphasis-soft);
  color: var(--c-emerald-900);
}
.site-header__phone svg { width: 18px; height: 18px; display: block; }
@media (max-width: 860px) {
  .site-header__phone { display: inline-flex; }  /* keep visible on mobile */
}

/* ---------- Header: wordmark (home page) ---------- */
.v2-wordmark {
  display: inline-flex;
  flex-direction: column;
  gap: 7px;
  text-decoration: none;
  color: inherit;
  padding: 2px 0;
}
.v2-wordmark .v2-name {
  font-family: 'Source Serif 4', 'Source Serif Pro', Georgia, serif;
  font-weight: 500;
  font-size: clamp(2.25rem, 4.5vw, 3.25rem);
  letter-spacing: -0.024em;
  line-height: 1;
  color: var(--c-emerald-700, #00713D);
  font-variation-settings: "opsz" 60;
}
.v2-wordmark .v2-rule-group {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  margin-top: 4px;
}
.v2-wordmark .v2-rule {
  display: block;
  height: 1px;
  background: var(--c-emerald-700, #00713D);
  width: 100%;
}
.v2-wordmark .v2-eyebrow {
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--c-ink-700, #3a3a36);
  font-weight: 500;
  line-height: 1;
}

/* ---------- Home hero carousel ---------- */
.home-hero {
  position: relative;
  min-height: 64svh;  /* svh: stable across iOS Safari URL-bar collapse */
  overflow: hidden;
  background: var(--c-emerald-900);
  color: var(--fg-on-emphasis);
  isolation: isolate;
}
.home-hero__slides {
  position: absolute; inset: 0;
}
.home-hero__slide {
  position: absolute; inset: 0;
  opacity: 0;
  transition: opacity var(--dur-hero) var(--ease-in-out);
  will-change: opacity;
}
.home-hero__slide[aria-hidden="false"] { opacity: 1; }
.home-hero__slide img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transform: scale(1.04);
  transition: transform 12s linear;
}
.home-hero__slide[aria-hidden="false"] img { transform: scale(1.12); }
.home-hero__slide::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(28,28,26,0.25) 0%, rgba(28,28,26,0.65) 100%);
}

.home-hero__inner {
  position: relative;
  z-index: 2;
  min-height: 64svh;
  display: flex;
  align-items: flex-end;
  padding: var(--space-hero) 0;
}
.home-hero__content {
  max-width: 760px;
  margin-inline: auto;
  text-align: center;
}
.home-hero__eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--c-emerald-300);
  margin: 0 0 var(--space-4);
}
.home-hero__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.5rem, 6.5vw, var(--fs-4xl));
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--fg-on-emphasis);
  margin: 0 0 var(--space-5);
  text-wrap: balance;
}
.home-hero__sub {
  font-size: var(--fs-md);
  line-height: var(--lh-relaxed);
  color: var(--c-cream-100);
  margin: 0 auto var(--space-6);
  max-width: 56ch;
}
.home-hero__cta {
  display: inline-flex; align-items: center; gap: var(--space-3);
}

/* dots */
.home-hero__dots {
  position: absolute;
  z-index: 3;
  bottom: var(--space-6);
  right: var(--gutter);
  display: flex; gap: var(--space-2);
  align-items: center;
}
.home-hero__dot {
  width: 24px; height: 2px;
  border: 0; padding: 0; margin: 0;
  background: rgba(251, 248, 243, 0.35);
  cursor: pointer;
  transition: width var(--dur-base) var(--ease-out),
              background var(--dur-base) var(--ease-out);
}
.home-hero__dot:hover { background: rgba(251, 248, 243, 0.7); width: 32px; }
.home-hero__dot[aria-selected="true"] {
  width: 48px;
  background: var(--c-cream-50);
}

/* prev / next arrows */
.home-hero__arrow {
  position: absolute;
  z-index: 3;
  top: 50%;
  transform: translateY(-50%);
  width: 60px; height: 60px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0;
  background: rgba(20, 38, 30, 0.55);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  color: var(--c-cream-50);
  border: 1px solid rgba(251, 248, 243, 0.4);
  border-radius: var(--radius-pill);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  cursor: pointer;
  transition: background var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out);
}
.home-hero__arrow svg { width: 22px; height: 22px; display: block; stroke-width: 1.75; }
.home-hero__arrow:hover {
  background: rgba(20, 38, 30, 0.78);
  border-color: var(--c-cream-50);
  transform: translateY(-50%) scale(1.05);
}
.home-hero__arrow:active { transform: translateY(-50%) scale(0.98); }
.home-hero__arrow:focus-visible {
  outline: 2px solid var(--c-cream-50);
  outline-offset: 3px;
}
.home-hero__arrow--prev { left: var(--space-6); }
.home-hero__arrow--next { right: var(--space-6); }

@media (max-width: 860px) {
  .home-hero, .home-hero__inner { min-height: 72svh; }
  .home-hero__dots { bottom: var(--space-5); right: var(--space-5); }
  .home-hero__content { padding-inline: 52px; }
  .home-hero__arrow { width: 44px; height: 44px; }
  .home-hero__arrow svg { width: 18px; height: 18px; }
  .home-hero__arrow--prev { left: var(--space-3); }
  .home-hero__arrow--next { right: var(--space-3); }
}

/* ---------- Services tile preview (Home) ---------- */
.home-services {
  padding: var(--space-section) 0;
  background: var(--bg-page);
}
.home-services__intro {
  max-width: 640px;
  margin: 0 0 var(--space-7);
}
/* Rides 12-col grid: three tiles × 4 cols each. */
.home-services__grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--grid-gap);
  row-gap: var(--grid-row-gap);
}
.home-services__grid > .home-services__tile { grid-column: span 4; }
@media (max-width: 860px) {
  .home-services__grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .home-services__grid > .home-services__tile { grid-column: span 6; }
}
@media (max-width: 640px) {
  .home-services__grid { grid-template-columns: 1fr; }
  .home-services__grid > .home-services__tile { grid-column: span 1; }
}
.home-services__tile {
  display: flex; flex-direction: column;
  text-decoration: none;
  color: inherit;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out);
}
.home-services__tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  color: inherit;
}
.home-services__tile-media { aspect-ratio: 4 / 3; overflow: hidden; background: var(--c-emerald-100); }
.home-services__tile-media img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--dur-slow) var(--ease-out); }
.home-services__tile:hover .home-services__tile-media img { transform: scale(1.04); }
.home-services__tile-body { padding: var(--space-5) var(--space-5) var(--space-6); }
.home-services__tile-title {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: 500;
  color: var(--c-ink-900);
  margin: 0 0 var(--space-2);
}
.home-services__tile-desc { color: var(--c-ink-700); margin: 0 0 var(--space-4); }
.home-services__tile-cta {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--c-emerald-700);
  letter-spacing: 0.01em;
}

/* ---------- Featured video (click-to-play facade) ---------- */
.home-video {
  background: var(--bg-page);
  padding: var(--space-section) 0;
}
.home-video .container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.home-video__intro {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: var(--space-5);
}
.home-video__frame {
  position: relative;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: var(--c-emerald-900);
}
.home-video__facade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  cursor: pointer;
  background: transparent;
}
.home-video__poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.home-video__facade:hover .home-video__poster,
.home-video__facade:focus-visible .home-video__poster {
  transform: scale(1.03);
}
.home-video__facade:focus-visible {
  outline: 3px solid var(--c-emerald-700);
  outline-offset: 3px;
}
.home-video__play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: clamp(56px, 9vw, 80px);
  height: auto;
  transition: transform 0.2s ease;
}
.home-video__play svg {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.35));
}
.home-video__play-bg {
  fill: var(--c-emerald-700);
  transition: fill 0.2s ease;
}
.home-video__facade:hover .home-video__play,
.home-video__facade:focus-visible .home-video__play {
  transform: translate(-50%, -50%) scale(1.08);
}
.home-video__facade:hover .home-video__play-bg,
.home-video__facade:focus-visible .home-video__play-bg {
  fill: var(--c-emerald-900);
}
/* Loaded YouTube iframe replaces the facade */
.home-video__frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---------- Testimonial section ---------- */
.home-testimonial {
  background: var(--bg-alt);
  padding: var(--space-section) 0;
}
.home-testimonial__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  text-align: left;
}
.home-testimonial .eyebrow { margin-bottom: var(--space-5); }
.home-testimonial .pull-quote {
  font-size: clamp(var(--fs-md), 1.4vw, var(--fs-lg));
  line-height: var(--lh-normal);
  max-width: 80ch;
}

/* ---------- Footer CTA ---------- */
.home-cta {
  background: var(--c-emerald-900);
  color: var(--fg-on-emphasis);
  padding: var(--space-section) 0;
  text-align: center;
}
.home-cta h2 { color: var(--fg-on-emphasis); margin-bottom: var(--space-3); }
.home-cta p { color: var(--c-cream-100); max-width: 50ch; margin: 0 auto var(--space-6); }

/* ---------- Services index page ---------- */
.services-index-intro {
  padding: var(--space-9) 0 var(--space-7);
}
.services-index-intro .container {
  max-width: var(--container-max);
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.services-index-intro .eyebrow {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.services-index-intro .eyebrow::after {
  content: "";
  flex: 1;
  max-width: 80px;
  height: 1px;
  background: var(--c-emerald-700);
}
.services-index-intro h1 {
  max-width: 14ch;
  text-wrap: balance;
  margin: 0;
}
.services-index-intro .intro-accent {
  font-style: italic;
  color: var(--c-emerald-700);
}
.services-index-intro .intro-body {
  max-width: 59ch;
  display: flex;
  flex-direction: column;
  gap: 0.63rem;
}
.services-index-intro .intro-body p {
  font-size: var(--fs-md);
  line-height: var(--lh-relaxed);
  color: var(--c-ink-700);
  margin: 0;
}
.services-index-intro .intro-body p:not(.lede) {
  font-size: var(--fs-base);
  color: var(--c-ink-900);
}

.services-index-grid {
  padding: var(--space-5) 0 var(--space-9);
}
/* Rides 12-col grid: 3 cards × 4 cols, collapses to 2-up (span 6) at md, 1-up at sm.
 * Orphan-row centering: when there are 5 cards, the 4th sits at col 3 so the
 * trailing pair (cards 4 and 5) centers under the full-width top row.
 */
.services-index-grid__grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--grid-gap);
  row-gap: var(--grid-row-gap);
}
.services-index-grid__grid > .services-index-card { grid-column: span 4; }
.services-index-grid__grid > .services-index-card:nth-child(4):nth-last-child(2) {
  grid-column: 3 / span 4;
}
@media (max-width: 1100px) {
  .services-index-grid__grid { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .services-index-grid__grid > .services-index-card { grid-column: span 6; }
  .services-index-grid__grid > .services-index-card:nth-child(4):nth-last-child(2) {
    grid-column: span 6;
  }
  .services-index-grid__grid > .services-index-card:nth-child(5):last-child {
    grid-column: 4 / span 6;
  }
}
@media (max-width: 640px) {
  .services-index-grid__grid { grid-template-columns: 1fr; }
  .services-index-grid__grid > .services-index-card,
  .services-index-grid__grid > .services-index-card:nth-child(4):nth-last-child(2),
  .services-index-grid__grid > .services-index-card:nth-child(5):last-child {
    grid-column: 1 / -1;
  }
}

.services-index-card { display: block; text-decoration: none; color: inherit; }
.services-index-card:hover { color: inherit; }

/* Numbered eyebrow + ECS tag over the card photo; scrim keeps the mono text legible */
.services-index-card .card__media { position: relative; }
.services-index-card .card__media::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(28, 28, 26, 0.42) 0%, rgba(28, 28, 26, 0) 45%);
  pointer-events: none;
}
.services-index-card__tag {
  position: absolute;
  top: var(--space-4);
  left: var(--space-4);
  z-index: 1;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fff;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.65);
}
.services-index-card .card__media::after {
  content: "ECS";
  position: absolute;
  right: var(--space-4);
  bottom: var(--space-3);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.45);
  padding-bottom: 2px;
}

.services-index-cta {
  background: var(--bg-alt);
  padding: var(--space-9) 0;
  text-align: center;
  border-top: 1px solid var(--border-soft);
}
.services-index-cta h2 { max-width: 22ch; margin-inline: auto; text-wrap: balance; }
.services-index-cta p {
  max-width: 50ch;
  margin-inline: auto;
  margin-bottom: var(--space-5);
}

/* ---------- Blog splash ---------- */
.blog-hero {
  padding: var(--space-9) 0 var(--space-7);
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border-soft);
}
.blog-hero .container { max-width: var(--container-max); }
.blog-hero h1 { max-width: none; white-space: nowrap; }
@media (max-width: 860px) {
  .blog-hero h1 { white-space: normal; text-wrap: balance; }
}

.blog-list {
  padding: var(--space-9) 0;
}
.blog-list__items {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: var(--container-narrow);
  margin: 0 auto;
}
.blog-list__item {
  padding: var(--space-6) 0;
  border-top: 1px solid var(--border-soft);
}
.blog-list__item:last-child { border-bottom: 1px solid var(--border-soft); }
.blog-list__link {
  display: block;
  text-decoration: none;
  color: var(--c-ink-900);
  position: relative;
  cursor: default;
}
.blog-list__title {
  font-family: var(--font-display);
  font-size: clamp(var(--fs-lg), 2.5vw, var(--fs-xl));
  font-weight: 500;
  line-height: var(--lh-snug);
  margin: 0 0 var(--space-2);
  color: var(--c-ink-900);
  transition: color var(--dur-base) var(--ease-out);
}
.blog-list__meta {
  font-size: var(--fs-sm);
  color: var(--fg-muted);
  letter-spacing: 0.01em;
}
.blog-list__soon {
  display: inline-block;
  margin-left: var(--space-3);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--c-sand-400);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out);
}
.blog-list__link:hover .blog-list__title { color: var(--c-emerald-700); }
.blog-list__link:hover .blog-list__soon  { opacity: 1; transform: translateX(0); }
