/* Existing wallpaper, font and glass header are shared with the approved cases.
   The service directory uses readable rows, not a second desktop or card grid. */
.services-page main { max-width: 1200px; }
.services-page .page-languages { margin-left: auto; }
.service-deeper { display: inline-flex; align-items: center; min-height: 44px; margin-top: 16px; color: var(--mint); }
.service-detail-hero { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(220px, 1fr); align-items: center; gap: 48px; padding: 76px 0 58px; }
.service-detail-hero > .service-demo { justify-self: center; margin: 0; }
.detail-copy h3:not(:first-child) { margin-top: 32px; }
.detail-copy p:last-child { margin-bottom: 0; }
.service-header-nav { display: flex; align-items: center; gap: 24px; }
.service-header-nav a { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; text-decoration: none; }
.service-header-nav a[aria-current] { color: var(--mint); }
.services-hero { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(250px, 1fr); align-items: start; gap: 72px; padding: 88px 0 76px; }
.services-intro h1 { max-width: 17ch; font-size: clamp(36px, 4.2vw, 54px); line-height: 1.12; }
.services-intro .lead { max-width: 54ch; }
.services-experience { max-width: 48ch; color: var(--muted); font-size: 13px; line-height: 1.6; margin: 28px 0 0; }
.services-index { border-left: 1px solid var(--edge); padding-left: 32px; margin-top: 7px; }
.services-index h2 { font-size: 16px; line-height: 1.5; font-weight: 500; margin: 0 0 16px; }
.services-index a { display: flex; align-items: flex-start; gap: 10px; padding: 12px 0; min-height: 44px; min-width: 0; font-size: 15px; line-height: 1.4; text-decoration: none; color: var(--muted); }
.services-index a svg { flex: 0 0 20px; }
.services-index a span { min-width: 0; overflow-wrap: break-word; }
.services-index a:hover, .service-label a:hover { color: var(--mint); }
.service-section { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.65fr); gap: 72px; padding: 58px 0; border-top: 1px solid var(--edge); scroll-margin-top: 30px; }
.service-label h2 { font-size: clamp(24px, 2.6vw, 30px); line-height: 1.25; margin-bottom: 22px; }
.service-label a { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; color: var(--muted); }
.service-illustration, .service-demo { display: block; width: min(100%, 310px); height: auto; aspect-ratio: 1; object-fit: contain; margin: 22px 0 0; pointer-events: none; user-select: none; }
.service-demo { position: relative; }
.service-demo > :first-child { display: block; width: 100%; height: auto; max-width: none; margin: 0; }
.service-overlay { display: none; position: absolute; inset: 0; width: 100%; height: 100%; }
@media (prefers-reduced-motion: no-preference) {
  .product-demo { --product-ease-out: cubic-bezier(.23, 1, .32, 1); }
  /* The cursor tip is part of the original artwork; anchor the pulse to it at every size. */
  .product-demo.is-playing::after {
    content: ""; position: absolute; left: 67.3%; top: 63.1%; width: 13%; aspect-ratio: 1;
    box-sizing: border-box; border: 2px solid #f2f5fa; border-radius: 50%; opacity: 0;
    animation: product-click 3s 280ms var(--product-ease-out) infinite;
  }
  @keyframes product-click {
    0% { opacity: 0; transform: translate(-50%, -50%) rotate(-14deg) scale(.22, .18); }
    4% { opacity: .85; }
    22%, 100% { opacity: 0; transform: translate(-50%, -50%) rotate(-14deg) scale(1, .78); }
  }
  .is-playing > .service-overlay { display: block; }
  .is-playing .pipe-pulse { animation: pipe-travel var(--pipe-period) var(--pipe-delay) linear infinite backwards; }
  .product-wave { --pipe-period: 3s; --pipe-delay: .48s; }
  .saas-inlet { --pipe-period: 5s; --pipe-delay: 0s; }
  .saas-outlet { --pipe-period: 5s; --pipe-delay: 3.18s; }
  @keyframes pipe-travel {
    0% { stroke-dashoffset: 25; opacity: 0; }
    3%, 23% { opacity: 1; }
    27%, 100% { stroke-dashoffset: -101; opacity: 0; }
  }
  /* Keep the casing fixed. The thumb follows the slanted glass track. */
  #websites .is-playing { --switch-cycle: 4.8s cubic-bezier(.77, 0, .175, 1) infinite; }
  .is-playing .switch-thumb { animation: switch-position var(--switch-cycle); }
  .is-playing .switch-on { animation: switch-mark var(--switch-cycle); }
  .is-playing .switch-off { animation: switch-dash var(--switch-cycle); }
  @keyframes switch-position {
    0%, 20%, 79%, 100% { transform: none; }
    31%, 68% { transform: translate(-152px, 36px); }
  }
  @keyframes switch-mark { 0%, 20%, 79%, 100% { opacity: 1; } 31%, 68% { opacity: 0; } }
  @keyframes switch-dash { 0%, 20%, 79%, 100% { opacity: 0; } 31%, 68% { opacity: 1; } }

  #branding .is-playing { --palette-cycle: 7.5s ease-in-out infinite alternate; }
  .is-playing .brand-ink { animation: palette-ink var(--palette-cycle); }
  .is-playing .brand-selection { animation: palette-choice var(--palette-cycle); }
  @keyframes palette-ink {
    0%, 12% { fill: #ecece9; } 19%, 43% { fill: #a3d9c5; }
    50%, 74% { fill: #edaa95; } 81%, 100% { fill: #c4b3df; }
  }
  @keyframes palette-choice {
    0%, 12% { transform: none; } 19%, 43% { transform: translateX(38px); }
    50%, 74% { transform: translateX(76px); } 81%, 100% { transform: translateX(114px); }
  }

  #apps .is-playing { --signal-cycle: 4.2s linear infinite; }
  .is-playing .tube-signal { animation: tube-current var(--signal-cycle); }
  .is-playing .screen-confirmation { animation: signal-received var(--signal-cycle); }
  @keyframes tube-current {
    0%, 12% { stroke-dashoffset: 25; opacity: 0; }
    16% { opacity: 1; } 49% { opacity: 1; }
    54%, 100% { stroke-dashoffset: -101; opacity: 0; }
  }
  @keyframes signal-received {
    0%, 52% { opacity: 0; } 59%, 79% { opacity: 1; } 92%, 100% { opacity: 0; }
  }

  .is-playing .saas-trend { animation: trace-trend 5s ease-in-out infinite; }
  .is-playing .saas-endpoint { animation: highlight-endpoint 5s ease-in-out infinite; }
  @keyframes trace-trend {
    0%, 25% { stroke-dashoffset: 102; opacity: 0; }
    31% { opacity: 1; }
    60%, 76% { stroke-dashoffset: 0; opacity: 1; }
    92%, 100% { stroke-dashoffset: 0; opacity: 0; }
  }
  @keyframes highlight-endpoint {
    0%, 56%, 92%, 100% { opacity: 0; }
    64%, 76% { opacity: 1; }
  }

  #crm-erp .is-playing { --crm-duration: 5.4s; }
  .is-playing .crm-stage { animation: crm-stage var(--crm-duration) ease-in-out infinite backwards; }
  .is-playing .crm-link { animation: crm-advance var(--crm-duration) ease-in-out infinite backwards; }
  .is-playing .crm-first-link { animation-delay: .5s; }
  .is-playing .crm-record { animation-delay: 1.2s; }
  .is-playing .crm-second-link { animation-delay: 1.7s; }
  .is-playing .crm-done { animation-delay: 2.4s; }
  @keyframes crm-stage {
    0%, 46%, 100% { opacity: 0; }
    8%, 32% { opacity: .9; }
  }
  @keyframes crm-advance {
    0% { stroke-dashoffset: 102; opacity: 0; }
    4% { opacity: .9; }
    15%, 31% { stroke-dashoffset: 0; opacity: .9; }
    45%, 100% { stroke-dashoffset: 0; opacity: 0; }
  }

  .is-playing .report-row { animation: report-selection 4.8s ease-in-out infinite; }
  .is-playing .report-segment { animation: report-selection 4.8s .45s ease-in-out infinite backwards; }
  .is-playing .report-trend { animation: trace-trend 4.8s ease-in-out infinite; }
  .is-playing .report-fill-window { animation: fill-report-bars 4.8s ease-in-out infinite; }
  @keyframes fill-report-bars {
    0%, 20%, 100% { transform: translateY(280px); }
    60%, 76% { transform: translateY(0); }
  }
  @keyframes report-selection {
    0%, 12%, 80%, 100% { opacity: 0; }
    25%, 62% { opacity: .84; }
  }

  .is-playing .shop-item { transform-origin: 643px 519px; animation: add-to-basket 4.6s ease-in-out infinite; }
  .is-playing .shop-receipt { animation: purchase-confirmed 4.6s ease-in-out infinite; }
  @keyframes add-to-basket {
    0%, 12% { opacity: 0; transform: none; }
    19% { opacity: 1; transform: none; }
    35% { opacity: 1; transform: translate(-155px, -72px) rotate(-8deg) scale(.87); animation-timing-function: ease-in; }
    57% { opacity: 1; transform: translate(-335px, 458px) rotate(7deg) scale(.57); }
    58%, 100% { opacity: 0; transform: translate(-335px, 458px) rotate(7deg) scale(.57); }
  }
  @keyframes purchase-confirmed {
    0%, 57%, 94%, 100% { opacity: 0; }
    65%, 82% { opacity: 1; }
  }

  #systems .is-playing { --component-cycle: 4.8s ease-in-out infinite backwards; }
  .is-playing .system-token { animation: apply-token var(--component-cycle); }
  .is-playing .system-button { animation: apply-token var(--component-cycle); animation-delay: .55s; }
  .is-playing .system-slider { animation: adjust-component-slider var(--component-cycle); }
  .is-playing .system-range-fill { animation: adjust-component-fill var(--component-cycle); }
  .is-playing .system-toggle { animation: flip-component-switch var(--component-cycle); }
  @keyframes adjust-component-slider {
    0%, 10%, 96%, 100% { transform: none; }
    30%, 44% { transform: translate(-125px, 24.5px); }
    65%, 77% { transform: translate(74px, -14.5px); }
  }
  @keyframes adjust-component-fill {
    0%, 10%, 96%, 100% { stroke-dashoffset: 35; }
    30%, 44% { stroke-dashoffset: 68.5; }
    65%, 77% { stroke-dashoffset: 15.5; }
  }
  @keyframes flip-component-switch {
    0%, 17%, 62%, 100% { transform: none; }
    29%, 50% { transform: translate(-113px, 22px); }
  }
  @keyframes apply-token {
    0%, 9%, 75%, 100% { opacity: 0; }
    20%, 58% { opacity: 1; }
  }
}
.service-description h3 { margin: 0 0 18px; font-size: 24px; line-height: 1.35; letter-spacing: -.02em; }
.service-description p, .services-domains p, .services-process p, .services-contact p { max-width: 65ch; font-size: 16px; line-height: 1.75; color: #d4e2da; margin: 0 0 24px; }
.service-description h4 { margin: 26px 0 12px; font-size: 14px; }
.service-description ul { padding-left: 20px; margin: 0 0 26px; color: #d4e2da; line-height: 1.75; font-size: 15px; }
.service-description li + li { margin-top: 5px; }
.service-description li::marker { color: var(--muted); }
.service-description .service-outcome { border-left: 2px solid #b7f8db70; padding-left: 20px; margin: 0; font-size: 15px; }
.service-outcome span { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 600; color: var(--white); }
.services-domains, .services-process, .services-contact { border-top: 1px solid var(--edge); padding: 58px 0; }
.services-domains ul { display: flex; flex-wrap: wrap; gap: 12px 28px; padding: 0; margin: 24px 0; list-style: none; font-size: 16px; }
.services-domains > a { display: inline-flex; align-items: center; min-height: 44px; color: var(--mint); font-size: 14px; }
.services-process ol { display: grid; grid-template-columns: 1fr 1fr; gap: 32px 60px; padding-left: 24px; margin: 32px 0 0; }
.services-process li { padding-left: 8px; }
.services-process li::marker { color: var(--muted); font-size: 14px; }
.services-process h3 { margin: 0 0 12px; font-size: 19px; }
.services-process p { font-size: 15px; margin: 0; }
.services-contact { padding: 64px 0 88px; }
.services-contact h2 { max-width: 24ch; font-size: clamp(28px, 3.5vw, 40px); }
.services-contact p { max-width: 58ch; }
@media (max-width: 900px) {
  .services-hero { gap: 36px; grid-template-columns: minmax(0, 1.5fr) minmax(200px, 1fr); padding-top: 56px; }
  .services-index { padding-left: 24px; }
  .service-section { gap: 36px; }
}
@media (max-width: 800px) {
  .service-detail-hero { grid-template-columns: 1fr; gap: 24px; padding: 40px 0 32px; }
  .services-page .page-header { flex-wrap: wrap; }
  .service-header-nav { order: 3; width: 100%; gap: 24px; }
  .services-page .page-languages { margin-left: 0; }
  .services-hero { grid-template-columns: 1fr; padding: 40px 0; gap: 36px; }
  .services-intro h1 { max-width: 22ch; font-size: clamp(34px, 6vw, 48px); }
  .services-index { border-left: 0; border-top: 1px solid var(--edge); padding: 24px 0 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
  .services-index h2 { grid-column: 1 / -1; }
  .services-index a { font-size: 14px; }
  .service-section { grid-template-columns: 1fr; gap: 24px; padding: 38px 0; }
  .service-label h2 { margin-bottom: 8px; }
  .service-illustration, .service-demo { width: 200px; max-width: 70%; margin: 12px 0 0; }
  .service-description h3 { font-size: 21px; }
  .services-domains, .services-process { padding: 40px 0; }
  .services-process ol { grid-template-columns: 1fr; gap: 24px; }
  .services-contact { padding: 44px 0 60px; }
}
@media (max-width: 370px) {
  .service-header-nav { gap: 14px; }
  .service-header-nav a { font-size: 13px; }
  .services-index { grid-template-columns: 1fr; }
}
