/* Services carousel on the home page (after the team row on Anthropic's research page): a row of services inside the
   page margins, with round arrows and a counter underneath (services-carousel.js). Each card links to
   its service on the Services page. */

.v2 #main > .sc { padding-block: clamp(1.25rem, 2.5vw, 2rem) clamp(2rem, 4vw, 3rem); }
.v2 #main > .sc h2 { max-width: none; }
.sc-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem 2rem; margin-bottom: clamp(1.25rem, 2.5vw, 1.75rem); }
.sc-all { display: inline-flex; align-items: center; gap: .45rem; color: var(--forest); font-weight: 500; text-decoration: none; }
.sc-all svg, .sc-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform 250ms var(--ease-out, ease-out); }
.sc-all:hover svg { transform: translateX(4px); }

/* The row stays inside the page margins and scrolls sideways within them */
.sc-viewport {
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; cursor: grab; container-type: inline-size;
}
.sc-viewport::-webkit-scrollbar { display: none; }
.sc-viewport.is-dragging { cursor: grabbing; scroll-snap-type: none; }
.sc-viewport.is-gliding { scroll-snap-type: none; }
.sc-viewport.is-dragging a { pointer-events: none; }
.sc-viewport:focus-visible { outline: 2px solid var(--forest); outline-offset: 4px; border-radius: 4px; }
.sc-track { display: flex; width: max-content; list-style: none; margin: 0; padding: 0; }
/* Exactly four cards fit across the margins (three, two or one on smaller screens) */
.sc-item { --gap: 28px; flex: 0 0 calc((100cqw - 3 * var(--gap)) / 4); margin-right: var(--gap); scroll-snap-align: start; }
.sc-item a { position: relative; display: grid; gap: .6rem; align-content: start; height: 100%; padding-top: 1.25rem; border-top: 1px solid rgba(14, 37, 27, .14); color: var(--ink); text-decoration: none; }
.sc-item a::before { content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 2px; background: var(--forest); transform: scaleX(0); transform-origin: left; transition: transform 450ms cubic-bezier(.4, 0, .2, 1); }
.sc-item a:hover::before, .sc-item a:focus-visible::before { transform: scaleX(1); }
.sc-item a:focus-visible { outline: 2px solid var(--forest); outline-offset: 4px; border-radius: 4px; }
.sc-head { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: .9rem; align-items: start; }
.sc-mark { width: 40px; height: 40px; padding: 8px; border-radius: 10px; background: var(--forest); fill: none; stroke: var(--mint); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; transition: background-color 300ms, stroke 300ms; }
.sc-mark * { stroke-dasharray: 60; stroke-dashoffset: 0; }
.sc-item a:hover .sc-mark { background: var(--mint); stroke: var(--forest); }
.sc-item a:hover .sc-mark * { animation: sc-draw 700ms ease-out; }
@keyframes sc-draw { from { stroke-dashoffset: 60; } to { stroke-dashoffset: 0; } }
.sc-head b { display: block; padding-top: .1rem; font-size: 1.25rem; line-height: 1.15; font-weight: 500; letter-spacing: -0.02em; }
.sc-desc { display: block; margin-top: .45rem; font-size: .93rem; line-height: 1.55; color: var(--text-muted); }

/* The row rises in one card after another the first time it scrolls into view */
.sc-js .sc-item { opacity: 0; transform: translateX(24px); transition: opacity 500ms, transform 600ms var(--ease-out, ease-out); transition-delay: calc(var(--i) * 70ms); }
.sc-js .sc.is-in .sc-item { opacity: 1; transform: none; }

/* Arrows and counter under the row */
.sc-controls { display: flex; align-items: center; gap: 1rem; margin-top: 1.25rem; }
.sc-btn { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border: 1px solid rgba(14, 37, 27, .2); border-radius: 50%; background: transparent; color: var(--ink); cursor: pointer; transition: background-color 200ms, border-color 200ms, color 200ms, opacity 200ms; }
.sc-btn:hover:not(:disabled) { background: var(--forest); border-color: var(--forest); color: var(--paper); }
.sc-btn:disabled { opacity: .35; cursor: default; }
.sc-btn:focus-visible { outline: 2px solid var(--forest); outline-offset: 2px; }
.sc-count { min-width: 4.5rem; text-align: center; font-size: .85rem; letter-spacing: .06em; color: var(--text-muted); font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  .sc-js .sc-item { opacity: 1; transform: none; transition: none; }
  .sc-item a::before, .sc-mark, .sc-btn { transition: none; }
  .sc-item a:hover .sc-mark * { animation: none; }
}
@media (max-width: 1100px) { .sc-item { --gap: 22px; flex-basis: calc((100cqw - 2 * var(--gap)) / 3); } }
@media (max-width: 800px) { .sc-item { flex-basis: calc((100cqw - var(--gap)) / 2); } }
@media (max-width: 560px) { .sc-item { flex-basis: 85cqw; } }
/* White version of the row (home page): a clean white band, with a thicker mint line drawing in on hover */
.v2 #main > .sc.sc--white { background: var(--white); }
.sc--white .sc-item a::before { background: var(--mint); height: 3px; }
