/*
 * AH Digital — Services Hub v2
 * Rebuilt for responsive layout, browser zoom resilience and readability.
 */

.ah-services-page,
.ah-services-page * {
  box-sizing: border-box;
}

.ah-services-page {
  background: var(--ah-color-bg);
  color: var(--ah-color-text);
  overflow-x: clip;
}

.ah-services-page :where(h1, h2, h3, p) {
  margin-block-start: 0;
}

.ah-services-page :where(.ah-container, section, article, div) {
  min-width: 0;
}

.ah-services-eyebrow {
  display: inline-block;
  color: var(--ah-color-brand);
  font-family: var(--ah-font-mono);
  font-size: clamp(0.66rem, 0.62rem + 0.12vw, 0.76rem);
  font-weight: 750;
  letter-spacing: 0.085em;
  line-height: 1.45;
  text-transform: uppercase;
}

/* ------------------------------------------------------------
   HERO
   ------------------------------------------------------------ */

.ah-services-hero {
  position: relative;
  padding-block: clamp(72px, 8vw, 126px);
  background:
    radial-gradient(circle at 83% 27%, color-mix(in srgb, var(--ah-color-brand) 9%, transparent), transparent 29%),
    var(--ah-color-bg);
}

.ah-services-hero::before {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(color-mix(in srgb, var(--ah-color-border) 55%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--ah-color-border) 55%, transparent) 1px, transparent 1px);
  background-size: clamp(54px, 5vw, 72px) clamp(54px, 5vw, 72px);
  content: "";
  mask-image: linear-gradient(to bottom, black 0%, transparent 92%);
  pointer-events: none;
}

.ah-services-hero > .ah-container {
  position: relative;
  z-index: 1;
}

.ah-services-hero__layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(420px, 0.92fr);
  align-items: center;
  gap: clamp(42px, 6vw, 92px);
}

.ah-services-hero__copy h1 {
  max-width: 12.8ch;
  margin-block: 18px 0;
  color: var(--ah-color-text);
  font-size: clamp(3rem, 4.9vw, 5.45rem);
  letter-spacing: -0.06em;
  line-height: 0.99;
  text-wrap: balance;
}

.ah-services-hero__copy > p {
  max-width: 60ch;
  margin-block-start: 24px;
  color: var(--ah-color-text-secondary);
  font-size: clamp(1rem, 0.95rem + 0.18vw, 1.14rem);
  line-height: 1.7;
}

.ah-services-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-block-start: 30px;
}

.ah-services-system {
  overflow: hidden;
  border: 1px solid var(--ah-color-border);
  border-radius: clamp(20px, 1.5vw, 28px);
  background: var(--ah-color-surface);
  box-shadow: var(--ah-shadow-feature);
}

.ah-services-system__head,
.ah-services-case__system-head {
  display: flex;
  min-height: 60px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-block-end: 1px solid var(--ah-color-border);
  color: var(--ah-color-text-muted);
  font-family: var(--ah-font-mono);
  font-size: clamp(0.58rem, 0.56rem + 0.08vw, 0.66rem);
  font-weight: 700;
  letter-spacing: 0.065em;
  padding: 14px 18px;
}

.ah-services-system__body {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 22px;
}

.ah-services-system__body::before,
.ah-services-system__body::after {
  position: absolute;
  background: linear-gradient(90deg, transparent, var(--ah-color-border-strong), transparent);
  content: "";
  pointer-events: none;
}

.ah-services-system__body::before {
  inset-inline: 22px;
  inset-block-start: 50%;
  height: 1px;
}

.ah-services-system__body::after {
  inset-block: 22px;
  inset-inline-start: 50%;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--ah-color-border-strong), transparent);
}

.ah-services-system__node {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 136px;
  align-content: center;
  gap: 6px;
  border: 1px solid var(--ah-color-border);
  border-radius: 16px;
  background: var(--ah-color-surface-soft);
  padding: 18px;
}

.ah-services-system__node span,
.ah-services-system__node small {
  color: var(--ah-color-text-muted);
  font-family: var(--ah-font-mono);
  font-size: clamp(0.55rem, 0.53rem + 0.06vw, 0.62rem);
  font-weight: 700;
  letter-spacing: 0.045em;
  line-height: 1.45;
}

.ah-services-system__node strong {
  color: var(--ah-color-text);
  font-size: clamp(0.92rem, 0.86rem + 0.14vw, 1.02rem);
  line-height: 1.28;
}

.ah-services-system__foot {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-block-start: 1px solid var(--ah-color-border);
  font-family: var(--ah-font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.07em;
}

.ah-services-system__foot span {
  color: var(--ah-color-text-muted);
}

.ah-services-system__foot strong {
  color: var(--ah-color-signal);
}

.ah-services-system__foot i {
  width: clamp(22px, 3vw, 38px);
  height: 1px;
  background: var(--ah-color-border-strong);
}

/* ------------------------------------------------------------
   SERVICE MAP
   ------------------------------------------------------------ */

.ah-services-map {
  padding-block: clamp(88px, 9vw, 142px);
}

.ah-services-section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.72fr);
  align-items: end;
  gap: clamp(40px, 6vw, 88px);
}

.ah-services-section-head h2,
.ah-services-choice__head h2,
.ah-services-faq__intro h2,
.ah-services-cta__shell h2 {
  margin-block-start: 16px;
  color: var(--ah-color-text);
  font-size: clamp(2.45rem, 4vw, 4.55rem);
  letter-spacing: -0.052em;
  line-height: 1.02;
  text-wrap: balance;
}

.ah-services-section-head h2 {
  max-width: 13ch;
}

.ah-services-section-head > p,
.ah-services-faq__intro > p {
  color: var(--ah-color-text-secondary);
  font-size: clamp(0.94rem, 0.91rem + 0.1vw, 1rem);
  line-height: 1.72;
}

.ah-services-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-block-start: clamp(48px, 6vw, 76px);
}

.ah-service-card {
  display: grid;
  grid-template-rows: auto auto auto auto auto 1fr;
  min-height: 510px;
  border: 1px solid var(--ah-color-border);
  border-radius: 24px;
  background: var(--ah-color-surface);
  padding: clamp(28px, 3.2vw, 42px);
}

.ah-service-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ah-service-card__number {
  color: var(--ah-color-brand);
  font-family: var(--ah-font-mono);
  font-size: 0.72rem;
  font-weight: 800;
}

.ah-service-card__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  box-shadow: 0 0 0 7px color-mix(in srgb, currentColor 8%, transparent);
}

.ah-service-card__dot--brand { color: var(--ah-color-brand); background: currentColor; }
.ah-service-card__dot--cyan { color: var(--ah-color-intelligence); background: currentColor; }
.ah-service-card__dot--signal { color: var(--ah-color-signal); background: currentColor; }
.ah-service-card__dot--muted { color: var(--ah-color-text-muted); background: currentColor; }

.ah-service-card__intent {
  margin-block-start: 44px;
  color: var(--ah-color-text-muted);
  font-family: var(--ah-font-mono);
  font-size: clamp(0.62rem, 0.6rem + 0.06vw, 0.68rem);
  font-weight: 700;
  letter-spacing: 0.065em;
  text-transform: uppercase;
}

.ah-service-card h3 {
  margin-block-start: 12px;
  color: var(--ah-color-text);
  font-size: clamp(1.9rem, 2.55vw, 2.95rem);
  letter-spacing: -0.046em;
  line-height: 1.05;
}

.ah-service-card > p {
  max-width: 58ch;
  margin-block-start: 16px;
  color: var(--ah-color-text-secondary);
  font-size: 0.92rem;
  line-height: 1.68;
}

.ah-service-card ul {
  display: grid;
  gap: 8px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.ah-service-card li {
  position: relative;
  color: var(--ah-color-text-secondary);
  font-size: 0.82rem;
  line-height: 1.52;
  padding-inline-start: 15px;
}

.ah-service-card li::before {
  position: absolute;
  inset-inline-start: 0;
  inset-block-start: 0.62em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ah-color-brand);
  content: "";
}

.ah-service-card > .ah-link,
.ah-service-card__links {
  align-self: end;
  margin-block-start: 28px;
}

.ah-service-card__links {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
}

/* ------------------------------------------------------------
   CHOICE
   ------------------------------------------------------------ */

.ah-services-choice {
  padding-block: clamp(82px, 8vw, 126px);
  background: var(--ah-color-surface-soft);
}

.ah-services-choice__head {
  max-width: 880px;
}

.ah-services-choice__head h2 {
  max-width: 15ch;
}

.ah-services-choice__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-block-start: 52px;
  overflow: hidden;
  border: 1px solid var(--ah-color-border);
  border-radius: 24px;
  background: var(--ah-color-surface);
}

.ah-services-choice__grid article {
  min-height: 270px;
  padding: clamp(26px, 3vw, 36px);
}

.ah-services-choice__grid article + article {
  border-inline-start: 1px solid var(--ah-color-border);
}

.ah-services-choice__grid article > span {
  color: var(--ah-color-brand);
  font-family: var(--ah-font-mono);
  font-size: 0.66rem;
  font-weight: 800;
}

.ah-services-choice__grid h3 {
  margin-block-top: 42px;
  color: var(--ah-color-text);
  font-size: clamp(1.18rem, 1.45vw, 1.48rem);
  letter-spacing: -0.03em;
  line-height: 1.24;
}

.ah-services-choice__grid p {
  margin-block-top: 13px;
  color: var(--ah-color-text-secondary);
  font-size: 0.86rem;
  line-height: 1.65;
}

/* ------------------------------------------------------------
   REAL CASE
   ------------------------------------------------------------ */

.ah-services-case {
  padding-block: clamp(88px, 9vw, 138px);
}

.ah-services-case__shell {
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(380px, 1.22fr);
  align-items: center;
  gap: clamp(42px, 6vw, 84px);
  border: 1px solid var(--ah-color-border);
  border-radius: 28px;
  background: var(--ah-color-surface);
  padding: clamp(32px, 5vw, 64px);
}

.ah-services-case__copy h2 {
  margin-block-start: 10px;
  color: var(--ah-color-text);
  font-size: clamp(2.25rem, 3.45vw, 3.9rem);
  letter-spacing: -0.05em;
}

.ah-services-case__copy > p {
  max-width: 54ch;
  margin-block-start: 16px;
  color: var(--ah-color-text-secondary);
  font-size: 0.94rem;
  line-height: 1.7;
}

.ah-services-case__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-block: 24px 26px;
}

.ah-services-case__tags span {
  border: 1px solid var(--ah-color-border);
  border-radius: var(--ah-radius-pill);
  color: var(--ah-color-text-secondary);
  font-family: var(--ah-font-mono);
  font-size: 0.62rem;
  padding: 7px 10px;
}

.ah-services-case__system {
  overflow: hidden;
  border: 1px solid var(--ah-color-border);
  border-radius: 20px;
  background: var(--ah-color-surface-soft);
}

.ah-services-case__flow {
  display: grid;
  grid-template-columns: repeat(7, auto);
  align-items: center;
  gap: 10px;
  padding: 44px 22px;
}

.ah-services-case__flow > div {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.ah-services-case__flow span {
  color: var(--ah-color-text-muted);
  font-family: var(--ah-font-mono);
  font-size: 0.56rem;
  font-weight: 700;
}

.ah-services-case__flow strong {
  color: var(--ah-color-text);
  font-size: 0.84rem;
}

.ah-services-case__flow i {
  width: clamp(18px, 2.5vw, 30px);
  height: 1px;
  background: linear-gradient(90deg, var(--ah-color-brand), var(--ah-color-intelligence));
}

/* ------------------------------------------------------------
   FAQ
   ------------------------------------------------------------ */

.ah-services-faq {
  padding-block: clamp(84px, 9vw, 136px);
  background: var(--ah-color-surface-soft);
}

.ah-services-faq__layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.58fr) minmax(0, 1.42fr);
  align-items: start;
  gap: clamp(44px, 6vw, 86px);
}

.ah-services-faq__intro {
  position: sticky;
  inset-block-start: 108px;
}

.ah-services-faq__intro h2 {
  max-width: 10.5ch;
  font-size: clamp(2.35rem, 3.5vw, 4rem);
}

.ah-services-faq__intro > p {
  max-width: 36ch;
  margin-block-top: 18px;
}

.ah-services-faq__items {
  border-block-start: 1px solid var(--ah-color-border);
}

.ah-services-faq details {
  border-block-end: 1px solid var(--ah-color-border);
}

.ah-services-faq summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  align-items: center;
  gap: 20px;
  min-height: 90px;
  cursor: pointer;
  color: var(--ah-color-text);
  font-size: clamp(1.02rem, 1.05vw, 1.18rem);
  font-weight: 700;
  line-height: 1.4;
  list-style: none;
  padding-block: 18px;
}

.ah-services-faq summary::-webkit-details-marker {
  display: none;
}

.ah-services-faq summary > span {
  position: relative;
  width: 28px;
  height: 28px;
  justify-self: end;
  border: 1px solid var(--ah-color-border);
  border-radius: 50%;
}

.ah-services-faq summary > span::before,
.ah-services-faq summary > span::after {
  position: absolute;
  inset-inline-start: 50%;
  inset-block-start: 50%;
  width: 9px;
  height: 1px;
  background: var(--ah-color-text);
  content: "";
  transform: translate(-50%, -50%);
}

.ah-services-faq summary > span::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.ah-services-faq details[open] summary > span::after {
  transform: translate(-50%, -50%);
}

.ah-services-faq details > p {
  max-width: 66ch;
  margin: 0;
  padding: 0 48px 28px 0;
  color: var(--ah-color-text-secondary);
  font-size: 0.9rem;
  line-height: 1.72;
}

/* ------------------------------------------------------------
   CTA
   ------------------------------------------------------------ */

.ah-services-cta {
  padding-block: clamp(72px, 7vw, 108px);
}

.ah-services-cta__shell {
  overflow: hidden;
  border: 1px solid var(--ah-color-border);
  border-radius: 28px;
  background:
    radial-gradient(circle at 82% 28%, color-mix(in srgb, var(--ah-color-intelligence) 10%, transparent), transparent 30%),
    linear-gradient(145deg, color-mix(in srgb, var(--ah-color-brand) 7%, var(--ah-color-surface)), var(--ah-color-surface));
  padding: clamp(36px, 6vw, 72px);
}

.ah-services-cta__shell h2 {
  max-width: 15ch;
  font-size: clamp(2.4rem, 3.9vw, 4.45rem);
}

.ah-services-cta__shell > p {
  max-width: 62ch;
  margin-block: 22px 30px;
  color: var(--ah-color-text-secondary);
  font-size: 0.96rem;
  line-height: 1.7;
}

/* ------------------------------------------------------------
   LARGE / ZOOM-SAFE LAPTOP BREAKPOINT
   ------------------------------------------------------------ */

@media (max-width: 1240px) {
  .ah-services-hero__layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .ah-services-hero__copy {
    max-width: 900px;
  }

  .ah-services-hero__copy h1 {
    max-width: 14ch;
    font-size: clamp(3rem, 6vw, 5rem);
  }

  .ah-services-system {
    width: min(100%, 820px);
  }

  .ah-services-case__shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .ah-services-case__system {
    width: min(100%, 820px);
  }
}

/* Helps 125%/150% zoom on common laptop heights. */
@media (min-width: 900px) and (max-height: 760px) {
  .ah-services-hero {
    padding-block: 56px 68px;
  }

  .ah-services-hero__copy h1 {
    font-size: clamp(2.9rem, 5vw, 4.65rem);
  }

  .ah-services-hero__copy > p {
    margin-block-start: 18px;
  }

  .ah-services-hero__actions {
    margin-block-start: 22px;
  }
}

/* ------------------------------------------------------------
   TABLET
   ------------------------------------------------------------ */

@media (max-width: 980px) {
  .ah-services-section-head,
  .ah-services-faq__layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .ah-services-section-head > p {
    max-width: 680px;
  }

  .ah-services-faq__intro {
    position: static;
  }

  .ah-services-faq__intro h2 {
    max-width: 14ch;
  }

  .ah-services-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .ah-service-card {
    min-height: 0;
  }

  .ah-services-choice__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .ah-services-choice__grid article {
    min-height: 0;
  }

  .ah-services-choice__grid article + article {
    border-inline-start: 0;
    border-block-start: 1px solid var(--ah-color-border);
  }
}

/* ------------------------------------------------------------
   MOBILE
   ------------------------------------------------------------ */

@media (max-width: 767px) {
  .ah-services-hero {
    padding-block: 64px 72px;
  }

  .ah-services-map,
  .ah-services-case,
  .ah-services-faq {
    padding-block: 72px;
  }

  .ah-services-choice {
    padding-block: 68px;
  }

  .ah-services-cta {
    padding-block: 60px;
  }

  .ah-services-hero__copy h1 {
    max-width: 100%;
    font-size: clamp(2.45rem, 11.5vw, 4rem);
    letter-spacing: -0.05em;
    line-height: 1.01;
  }

  .ah-services-section-head h2,
  .ah-services-choice__head h2,
  .ah-services-faq__intro h2,
  .ah-services-cta__shell h2 {
    max-width: 100%;
    font-size: clamp(2.1rem, 9.6vw, 3.35rem);
  }

  .ah-services-hero__actions {
    align-items: stretch;
    flex-direction: column;
  }

  .ah-services-hero__actions .ah-button {
    width: 100%;
    justify-content: space-between;
  }

  .ah-services-system__body {
    grid-template-columns: minmax(0, 1fr);
  }

  .ah-services-system__body::before,
  .ah-services-system__body::after {
    display: none;
  }

  .ah-services-system__node {
    min-height: 108px;
  }

  .ah-service-card {
    border-radius: 20px;
    padding: 26px 22px;
  }

  .ah-service-card__intent {
    margin-block-start: 34px;
  }

  .ah-service-card__links {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .ah-services-case__shell,
  .ah-services-cta__shell {
    border-radius: 20px;
  }

  .ah-services-case__flow {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding: 28px 20px;
  }

  .ah-services-case__flow i {
    width: 1px;
    height: 18px;
    margin-inline-start: 10px;
    background: linear-gradient(180deg, var(--ah-color-brand), var(--ah-color-intelligence));
  }

  .ah-services-faq summary {
    min-height: 82px;
    font-size: 1rem;
  }

  .ah-services-faq details > p {
    padding-inline-end: 0;
  }
}

/* ------------------------------------------------------------
   SMALL MOBILE
   ------------------------------------------------------------ */

@media (max-width: 480px) {
  .ah-services-system__head,
  .ah-services-case__system-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .ah-services-system__foot {
    overflow-x: auto;
    justify-content: flex-start;
    padding-inline: 18px;
  }

  .ah-services-choice__grid {
    border-radius: 18px;
  }

  .ah-services-faq summary {
    grid-template-columns: minmax(0, 1fr) 28px;
    gap: 14px;
  }
}

/* ------------------------------------------------------------
   FALLBACKS / MOTION
   ------------------------------------------------------------ */

@supports not (color: color-mix(in srgb, black, white)) {
  .ah-services-hero,
  .ah-services-cta__shell {
    background: var(--ah-color-bg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ah-services-page * {
    scroll-behavior: auto !important;
  }
}

/* AH Services — dedicated Site Vitrine internal link v1 */
.ah-services-vitrine-link {
  position: relative;
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 0.55rem;
  margin-block-start: 0.85rem;
  color: var(--ah-color-brand, #5657E6);
  font-size: 0.92rem;
  font-weight: 750;
  line-height: 1.35;
  text-decoration: none;
}

.ah-services-vitrine-link > span:first-child {
  position: relative;
}

.ah-services-vitrine-link > span:first-child::after {
  position: absolute;
  inset-inline: 0;
  inset-block-end: -0.18rem;
  height: 1px;
  background: linear-gradient(90deg, #5657E6, #20C7D6);
  content: "";
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 180ms ease;
}

.ah-services-vitrine-link > span:last-child {
  transition: transform 180ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .ah-services-vitrine-link:hover > span:first-child::after,
  .ah-services-vitrine-link:focus-visible > span:first-child::after {
    transform: scaleX(1);
  }

  .ah-services-vitrine-link:hover > span:last-child,
  .ah-services-vitrine-link:focus-visible > span:last-child {
    transform: translateX(0.18rem);
  }
}

@media (hover: none) {
  .ah-services-vitrine-link > span:first-child::after {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ah-services-vitrine-link > span:first-child::after,
  .ah-services-vitrine-link > span:last-child {
    transition: none;
  }
}
