.services { background: var(--canvas); }
.service-card-head { position: relative; padding-bottom: 18px; }
.service-number { position: absolute; top: 0; left: 0; color: var(--muted); font: .875rem/1 Arial, sans-serif; }
.service-icon { width: 53px; height: 53px; margin-bottom: 20px; padding: 13px; border-radius: 50%; background: var(--mint-soft); color: var(--ink); stroke-width: 1.5; }
.service-heading { display: block; }
.service-heading h3 { font-size: clamp(1.875rem, 3.5vw, 2.875rem); font-weight: 800; letter-spacing: -.6px; line-height: 1.35; margin-bottom: 9px; }
.service-heading > span { display: block; color: var(--muted); font-size: 1.0625rem; line-height: 1.7; min-height: 0; }
.service-content { display: flex; flex-direction: column; flex: 1; }
.service-content > p { font-size: 1rem; line-height: 1.9; color: var(--muted); margin-bottom: 22px; }
.inline-list { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; font-size: .75rem; color: var(--ink); margin-bottom: 25px; }
.inline-list li { background: var(--tint); border-radius: 99px; padding: 5px 12px; }
.inline-list li::before { content: "✓"; color: var(--accent); margin-inline-end: 8px; font-weight: 700; }
.service-content .text-link { font-size: .9375rem; margin-top: auto; justify-content: space-between; padding-top: 18px; border-top: 1px solid var(--line); gap: 26px; width: fit-content; }

/* Services always stay in the document; these are ordinary jump links. */
/* Underlined section tabs, aligned with the content, so they read as part of this section
   rather than a second copy of the pill-shaped site navigation. */
.chapter-controls { display: flex; margin-bottom: 28px; }
.chapter-navigation { display: flex; gap: clamp(20px, 3vw, 40px); width: 100%; overflow-x: auto; scrollbar-width: none; box-shadow: inset 0 -1px 0 var(--line); }
.chapter-navigation::-webkit-scrollbar { display: none; }
.chapter-navigation a { display: block; flex-shrink: 0; padding: 12px 0 14px; white-space: nowrap; color: var(--muted); font-size: .9375rem; }
.chapter-navigation a:hover, .chapter-navigation a:focus-visible { color: var(--ink); }
@media (max-width: 480px) { .chapter-navigation { gap: 20px; } .chapter-navigation a { font-size: .875rem; } }
.services .service-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
.services .service-row { display: grid; min-width: 0; grid-template-columns: 1fr 1fr; align-items: center; gap: clamp(32px, 5vw, 80px); padding: 76px 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; overflow: visible; background: transparent; }
.service-copy { min-width: 0; }

.service-detail { margin-bottom: 28px; }
.service-detail h4 { margin: 20px 0 7px; font-size: 1rem; font-weight: 750; }
.service-detail p { font-size: .9375rem; color: var(--muted); line-height: 1.9; }

.service-demo { min-width: 0; margin: 0; padding: 24px; background: var(--surface); border-radius: 28px; }
.service-row:nth-child(2) .service-demo { background: #e8e5f0; }
.service-row:nth-child(3) .service-demo { background: #e1eae5; }
.service-row:nth-child(4) .service-demo { background: #efe9dc; }
.service-demo-screen { overflow: hidden; min-height: 340px; background: white; border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: 0 20px 36px #25331c12; }
.demo-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px; border-bottom: 1px solid var(--line); font-size: .75rem; }
.demo-nav > span { font-size: .5625rem; color: var(--muted); }
.demo-hero { padding: 36px 28px; background: var(--surface-light); }
.demo-kicker { font-size: .625rem; color: var(--accent); }
.demo-hero strong { display: block; font-size: clamp(1.4375rem, 2.5vw, 2.125rem); line-height: 1.25; margin-block: 14px 22px; }
.demo-action { display: inline-block; padding: 10px 16px; background: var(--ink); color: var(--mint); border-radius: 7px; font-size: .625rem; }
.demo-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; padding: 20px; }
.demo-tiles span { border-top: 2px solid var(--line-olive); padding-top: 12px; font-size: .6875rem; }
.service-demo figcaption { margin-top: 20px; color: var(--muted); font-size: .6875rem; text-align: center; }
.demo-products { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 22px; }
.demo-products > div { min-width: 0; }
.demo-products b, .demo-products small { display: block; font-size: .6875rem; margin-top: 10px; }
.demo-products small { color: var(--muted); font-size: .5625rem; margin-top: 3px; }
.product-shape { display: block; height: 160px; background: #f1ede5; position: relative; border-radius: 8px; }
.product-shape::before { content: ''; position: absolute; width: 54px; height: 90px; bottom: 22px; left: calc(50% - 27px); border-radius: 12px 12px 25px 25px; background: #a5afa0; box-shadow: inset -12px 0 18px #77897050; }
.shape-two { background: #e9eeec; }
.shape-two::before { width: 75px; height: 70px; left: calc(50% - 38px); border-radius: 6px 6px 30px 30px; background: #c5b49d; }
.demo-cart { display: flex; justify-content: space-between; gap: 12px; padding: 15px 22px; background: #f7f6f3; font-size: .5625rem; }
.demo-workspace { display: grid; grid-template-columns: 80px 1fr; min-height: 285px; }
.demo-sidebar { padding: 24px 16px; background: var(--surface-light); color: var(--muted); font-size: .625rem; line-height: 3.6; }
.demo-tasks { padding: 28px 18px; }
.demo-tasks > b { font-size: 1rem; }
.demo-tasks > span { display: flex; align-items: center; gap: 7px; border-bottom: 1px solid var(--line); padding-block: 20px; font-size: .625rem; }
.demo-tasks small { margin-inline-start: auto; color: var(--accent); font-size: .5rem; }
.demo-tasks i { width: 5px; height: 5px; background: var(--ink); border-radius: 50%; flex-shrink: 0; }
.demo-flow { display: grid; justify-items: center; padding: 24px; gap: 6px; }
.demo-flow span { width: 80%; padding: 14px; border: 1px solid #d3dccb; background: #f2f5ec; border-radius: 9px; text-align: center; font-size: .75rem; }
.demo-flow i { color: #91aba0; font-style: normal; }
.demo-flow-note { padding: 0 20px 22px; font-size: .625rem; text-align: center; color: var(--muted); }
@media (min-width: 981px) {
  .services .service-row:nth-child(even) .service-copy { grid-column: 2; grid-row: 1; }
  .services .service-row:nth-child(even) .service-demo { grid-column: 1; grid-row: 1; }
}
@media (max-width: 980px) {
  .services .service-row { grid-template-columns: minmax(0, 1fr); padding-block: 45px; gap: 30px; }
  .service-demo { width: 100%; max-width: 580px; justify-self: center; }
}
@media (max-width: 480px) {
  .service-demo { padding: 14px; border-radius: 20px; }
  .service-demo-screen { min-height: 0; }
  .demo-nav { padding: 14px 12px; }
  .demo-hero { padding: 26px 20px; }
  .demo-products { padding: 14px; }
  .product-shape { height: 135px; }
  .demo-workspace { grid-template-columns: 60px 1fr; }
  .demo-sidebar { padding: 22px 10px; }
  .demo-tasks { padding: 24px 12px; }
  .demo-tasks > span { font-size: .5625rem; }
}

@media (max-width: 700px) {
  .service-icon { margin-bottom: 22px; }
  .inline-list { margin-bottom: 22px; }
  .service-content .text-link { padding-top: 16px; }
}

/* Horizontal chapters: pinned and driven by vertical scroll on desktop, swiped on smaller screens.
   assets/services.js adds .is-pinned or .is-swipe; without it (or with reduced motion) the list stays vertical. */
.chapter-navigation { position: relative; isolation: isolate; }
.chapter-navigation a { position: relative; z-index: 1; transition: color .25s; }
.chapter-indicator { position: absolute; z-index: 0; bottom: 0; left: 0; height: 2px; width: var(--indicator-width, 0px); border-radius: 2px; background: var(--ink); opacity: 0; pointer-events: none; transform: translateX(var(--indicator-x, 0px)); transition: opacity .2s; }
.chapter-navigation.has-current .chapter-indicator { opacity: 1; }
.chapter-navigation a[aria-current] { color: var(--ink); font-weight: 650; }
/* A compact copy of the section heading; only shown while the chapters are pinned to the top. */
.chapter-title { display: none; }
.services-window { min-width: 0; }
@media (prefers-reduced-motion: no-preference) {
  .services-chapters.is-swipe .service-list { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none; align-items: start; }
  .services-chapters.is-swipe .service-list::-webkit-scrollbar { display: none; }
  /* Each card leaves a sliver of the next one in view, so it is clear the row can be swiped. */
  .services-chapters.is-swipe .service-row { flex: 0 0 calc(100% - 36px); scroll-snap-align: start; scroll-snap-stop: always; border-top: 0; padding-top: 24px; transition: opacity .2s; }
}
@media (min-width: 981px) and (prefers-reduced-motion: no-preference) {
  .services-scroll-scene.is-pinned { height: var(--chapters-height); view-timeline: --chapters block; }
  /* Pinned to the very top: the site navigation steps aside here and the section title takes its place. */
  .is-pinned .services-chapters { position: sticky; top: 0; min-height: 100svh; display: flex; flex-direction: column; padding-block: 28px 16px; }
  .is-pinned .chapter-controls { align-items: end; justify-content: space-between; gap: 32px; margin-bottom: 20px; box-shadow: inset 0 -1px 0 var(--line); }
  .is-pinned .chapter-navigation { width: auto; box-shadow: none; }
  .is-pinned .chapter-title { display: block; padding-bottom: 12px; font-size: 1.375rem; font-weight: 800; letter-spacing: -.3px; line-height: 1.4; white-space: nowrap; opacity: 0; transform: translateY(8px); transition: opacity .3s, transform .4s var(--ease); }
  .is-pinned .chapter-title span { color: var(--muted); font-weight: 650; }
  .is-pinned.is-focused .chapter-title { opacity: 1; transform: none; }
  .is-pinned .services-window { overflow: clip; }
  .services .is-pinned .service-list { display: flex; gap: 64px; transform: translateX(var(--chapter-x, 0px)); will-change: transform; }
  .services .is-pinned .service-row { flex: 0 0 100%; padding: 22px 0; gap: 60px; border-top: 0; }
  .services .is-pinned .service-row:nth-child(n) .service-copy { grid-column: 1; grid-row: 1; }
  .services .is-pinned .service-row:nth-child(n) .service-demo { grid-column: 2; grid-row: 1; }
  .services .is-pinned .service-icon { display: none; }
  .services .is-pinned .service-heading h3 { font-size: 2.375rem; margin-bottom: 7px; }
  .services .is-pinned .service-card-head { padding-bottom: 12px; }
  .services .is-pinned .service-heading > span { font-size: .9375rem; }
  .services .is-pinned .service-content > p { font-size: .875rem; line-height: 1.75; margin-bottom: 10px; }
  .is-pinned .service-detail { margin-bottom: 16px; }
  .is-pinned .service-detail h4 { margin: 12px 0 5px; font-size: .875rem; }
  .is-pinned .service-detail p { font-size: .875rem; line-height: 1.75; }
  .services .is-pinned .inline-list { margin-bottom: 14px; font-size: .6875rem; }
  .services .is-pinned .service-content .text-link { padding-top: 12px; }
  .is-pinned .service-demo-screen { min-height: 300px; }
  @supports ((animation-timeline: scroll()) and (animation-range: 0% 100%)) {
    .is-pinned .service-list { animation: chapter-travel linear both; animation-timeline: --chapters; animation-range: contain 0% contain 100%; }
  }
}
/* Rest ranges match `holds` in assets/services.js; each move eases in and out like a page turn. */
@keyframes chapter-travel {
  0%, 4% { transform: translateX(0); animation-timing-function: cubic-bezier(.65, 0, .35, 1); }
  26%, 36% { transform: translateX(var(--chapter-one)); animation-timing-function: cubic-bezier(.65, 0, .35, 1); }
  58%, 68% { transform: translateX(var(--chapter-two)); animation-timing-function: cubic-bezier(.65, 0, .35, 1); }
  90%, 100% { transform: translateX(var(--chapter-three)); }
}
@media print {
  .services-scroll-scene.is-pinned { height: auto; }
  .is-pinned .services-chapters { position: static; min-height: 0; }
  .services .service-list { display: grid !important; transform: none !important; animation: none !important; }
  .services .service-row { flex: none; opacity: 1 !important; }
}
