/* ========================================================================== 
   ESPO 2.5.1.123.54 — Site cohesion / portfolio refinement
   Targeted visual refinement only. Keeps the approved ESPO identity intact.
   ========================================================================== */

:root {
  --espo-cohesion-ink: #101c28;
  --espo-cohesion-muted: #667587;
  --espo-cohesion-line: rgba(16, 28, 40, .09);
  --espo-cohesion-line-strong: rgba(16, 28, 40, .14);
  --espo-cohesion-paper: #fcfbf8;
  --espo-cohesion-radius: 1rem;
  --espo-cohesion-section: clamp(3.8rem, 6vw, 5.25rem);
  --espo-cohesion-section-mobile: clamp(3rem, 9vw, 4rem);
}

/* Rendering: keep project photography natural and crisp. */
body.espo-site main img {
  image-rendering: auto;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

body.espo-site main :is(
  .espo-project-card img,
  .espo-project-card__media img,
  .espo-cohesive-work__card img,
  .espo-project-related-card img,
  .espo-project-gallery img
) {
  filter: none !important;
  opacity: 1 !important;
}

/* Typography: slightly calmer editorial hierarchy without changing fonts. */
html:lang(en) body.espo-site,
html:lang(tr) body.espo-site {
  --espo-type-heading-tracking: -.028em;
}

body.espo-site main :is(
  .espo-section-label,
  .espo-projects-filter-head > p,
  .espo-projects-results-head p,
  .espo-home-service-meta,
  .espo-project-card__eyebrow
) {
  letter-spacing: .055em;
}

body.espo-site main :is(
  .espo-home-service-summary,
  .espo-sectors-intro,
  .espo-why-card p,
  .espo-home-insight-card p,
  .espo-project-card__body > p
) {
  color: var(--espo-cohesion-muted);
}

/* Home: compact, consistent section cadence. */
body:is(.home, .espo-home-context) :is(
  .espo-cohesive-about,
  .espo-cohesive-services,
  .espo-cohesive-work,
  .espo-sectors-section,
  .espo-why-section,
  .espo-home-trust,
  .espo-home-insights,
  .espo-ohec-section
) {
  padding-block: var(--espo-cohesion-section) !important;
}

body:is(.home, .espo-home-context) :is(
  .espo-cohesive-work__heading,
  .espo-services-heading,
  .espo-home-section-heading
) h2 {
  margin-top: .42rem !important;
}

body:is(.home, .espo-home-context) :is(
  .espo-services-intro,
  .espo-sectors-intro
) {
  margin-top: .9rem !important;
  max-width: 54ch;
}

/* Home portfolio rail: more architectural, less "UI card". */
body:is(.home, .espo-home-context) .espo-cohesive-work__rail {
  margin-top: clamp(1.8rem, 3.2vw, 2.45rem) !important;
  gap: clamp(1.1rem, 2vw, 1.55rem) !important;
  padding-bottom: 1.1rem !important;
}

body:is(.home, .espo-home-context) .espo-cohesive-work__card {
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  transition: transform .34s cubic-bezier(.22,1,.36,1) !important;
}

body:is(.home, .espo-home-context) .espo-cohesive-work__card:hover,
body:is(.home, .espo-home-context) .espo-cohesive-work__card:focus-visible {
  transform: translateY(-3px) !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

body:is(.home, .espo-home-context) .espo-cohesive-work__card > div:first-child {
  aspect-ratio: 16 / 11 !important;
  border: 1px solid rgba(16,28,40,.07);
  border-radius: .95rem !important;
  background: #eef1f2;
  box-shadow: 0 11px 30px rgba(16,28,40,.055);
  transform: translateZ(0);
}

body:is(.home, .espo-home-context) .espo-cohesive-work__card > div:last-child {
  margin-top: .82rem !important;
  padding-inline: .08rem;
}

body:is(.home, .espo-home-context) .espo-cohesive-work__card img {
  transform: scale(1.001) !important;
  transition: transform .65s cubic-bezier(.22,1,.36,1) !important;
}

body:is(.home, .espo-home-context) .espo-cohesive-work__card:hover img,
body:is(.home, .espo-home-context) .espo-cohesive-work__card:focus-visible img {
  transform: scale(1.022) !important;
}

body:is(.home, .espo-home-context) .espo-cohesive-work__card > div:first-child > span {
  min-height: 1.75rem;
  padding: .34rem .52rem !important;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: .55rem;
  line-height: 1;
  box-shadow: 0 3px 10px rgba(7,15,22,.08);
}

body:is(.home, .espo-home-context) .espo-cohesive-work__card > div:first-child > span:first-of-type {
  background: rgba(16,28,40,.76) !important;
}

body:is(.home, .espo-home-context) .espo-project-card-title {
  min-height: calc(1.38em * 2);
  margin-top: .3rem !important;
  font-weight: 620 !important;
  line-height: 1.38 !important;
  transition: color .24s ease;
}

body:is(.home, .espo-home-context) .espo-cohesive-work__card p {
  margin-top: .18rem;
  font-size: .76rem;
}

/* Services: retain the approved component, reduce visual weight. */
body:is(.home, .espo-home-context) .espo-home-service-card {
  border-color: rgba(16,28,40,.075) !important;
  box-shadow: 0 10px 28px rgba(16,28,40,.035) !important;
}

body:is(.home, .espo-home-context) .espo-home-service-card:hover,
body:is(.home, .espo-home-context) .espo-home-service-card:focus-visible {
  transform: translateY(-3px) !important;
  box-shadow: 0 20px 44px rgba(16,28,40,.075) !important;
}

/* Projects archive: premium editorial cards, natural imagery, less visual chrome. */
.espo-projects-page .espo-projects-grid {
  gap: clamp(1rem, 1.8vw, 1.35rem);
  margin-top: 1.65rem;
}

.espo-projects-page .espo-project-card {
  grid-template-rows: clamp(14rem, 18vw, 16rem) 1fr;
  border-color: var(--espo-cohesion-line);
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 10px 28px rgba(16,28,40,.04);
  transition: transform .32s cubic-bezier(.22,1,.36,1), box-shadow .28s ease, border-color .28s ease;
}

.espo-projects-page .espo-project-card:hover {
  transform: translateY(-4px);
  border-color: var(--espo-cohesion-line-strong);
  box-shadow: 0 20px 46px rgba(16,28,40,.075);
}

.espo-projects-page .espo-project-card__media {
  min-height: 0;
  background: #edf1f3;
}

.espo-projects-page .espo-project-card__media::after {
  opacity: 0 !important;
  background: none !important;
}

.espo-projects-page .espo-project-card__media img {
  filter: none !important;
  transform: scale(1.001);
  transition: transform .65s cubic-bezier(.22,1,.36,1) !important;
}

.espo-projects-page .espo-project-card:hover .espo-project-card__media img {
  filter: none !important;
  transform: scale(1.022);
}

.espo-projects-page .espo-project-card__number,
.espo-projects-page .espo-project-card__status {
  top: .72rem;
  min-height: 1.85rem;
  border-radius: .55rem;
  background: rgba(16,28,40,.76);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: 0 3px 12px rgba(7,15,22,.08);
}

.espo-projects-page .espo-project-card__number {
  inset-inline-start: .72rem;
  min-width: 1.9rem;
}

.espo-projects-page .espo-project-card__status {
  inset-inline-end: .72rem;
  padding: .38rem .56rem;
}

.espo-projects-page .espo-project-card__body {
  padding: 1rem 1.05rem 1.1rem;
}

.espo-projects-page .espo-project-card__eyebrow {
  font-size: .64rem;
}

.espo-projects-page .espo-project-card h3 {
  margin-top: .52rem;
  font-size: clamp(1.04rem, 1.2vw, 1.16rem) !important;
  font-weight: 620 !important;
  line-height: 1.4 !important;
}

.espo-projects-page .espo-project-card__body > p {
  min-height: calc(1.6em * 2);
  margin-top: .46rem;
  font-size: .76rem;
  line-height: 1.6;
  -webkit-line-clamp: 2;
}

.espo-projects-page .espo-project-card__meta {
  gap: .32rem;
  margin-top: .72rem;
  padding-top: .68rem;
}

.espo-projects-page .espo-project-card__link {
  padding-top: .72rem;
  font-size: .68rem;
}

/* Internal pages: normalize the most visible title-to-content spacing. */
body:not(.home) main :is(
  .espo-page-hero-inner,
  .espo-projects-hero__inner,
  .espo-contact-hero__inner,
  .espo-about-hero__inner
) :is(h1,h2) + p {
  margin-top: .9rem !important;
}

body:not(.home) main :is(
  .espo-projects-filter-section,
  .espo-projects-portfolio,
  .espo-about-story,
  .espo-about-approach,
  .espo-about-principles,
  .espo-about-leadership,
  .espo-about-credentials,
  .espo-contact-routes,
  .espo-contact-form-section
) {
  scroll-margin-top: 7rem;
}

@media (max-width: 900px) {
  body:is(.home, .espo-home-context) :is(
    .espo-cohesive-about,
    .espo-cohesive-services,
    .espo-cohesive-work,
    .espo-sectors-section,
    .espo-why-section,
    .espo-home-trust,
    .espo-home-insights,
    .espo-ohec-section
  ) {
    padding-block: var(--espo-cohesion-section-mobile) !important;
  }

  body:is(.home, .espo-home-context) .espo-cohesive-work__rail {
    gap: 1rem !important;
    margin-top: 1.55rem !important;
  }

  body:is(.home, .espo-home-context) .espo-cohesive-work__card {
    width: min(82vw, 22rem) !important;
  }

  .espo-projects-page .espo-project-card {
    grid-template-rows: clamp(13rem, 57vw, 15rem) 1fr;
  }
}

@media (max-width: 620px) {
  body:is(.home, .espo-home-context) .espo-cohesive-work__card > div:first-child {
    aspect-ratio: 4 / 3 !important;
  }

  body:is(.home, .espo-home-context) .espo-project-card-title {
    min-height: auto;
  }

  .espo-projects-page .espo-project-card__body {
    padding: .9rem .95rem 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  body:is(.home, .espo-home-context) .espo-cohesive-work__card,
  body:is(.home, .espo-home-context) .espo-cohesive-work__card img,
  .espo-projects-page .espo-project-card,
  .espo-projects-page .espo-project-card__media img {
    transition: none !important;
    transform: none !important;
  }
}
