/* 🤖 "What kinds of apps can be built using CARLOS?": the apps carousel directly under the hero (enabled demo
   builds). Without JavaScript it is a flat row that scrolls sideways and snaps to each app, every app one link;
   home/apps.js adds .is-live, reveals previous, next and the dots, and turns the row into an endless ring
   with depth (it writes each slide's transform and opacity as the row scrolls). Scoped under .rw like
   sections.css, and coloured with its light-dark() tokens. Glanceable: the screenshot first, then the name,
   then one line. */
/* Widths are fractions of the content column (cqi), at the popped size: home/apps.js draws every card 1/1.13
   smaller until it pops, so the popped card has no transform and its text is sharp. At rest the middle app is
   about two fifths of the column on desktop, about three quarters of a phone's screen. */
.rw .rw-apps { --ap-w: 90cqi; --ap-gap: clamp(1rem, 2.6vw, 1.75rem); background: var(--rw-bg-2); overflow-x: clip; }
.rw .rw-apps .rw-wrap { container-type: inline-size; }
@media (min-width: 640px) { .rw .rw-apps { --ap-w: 63cqi; } }
@media (min-width: 1000px) { .rw .rw-apps { --ap-w: 44cqi; } }

.rw .ap-intro { max-width: 46rem; }
.rw .ap-intro h2 { max-width: 26ch; }
.rw .ap-sub { margin-top: 0.8rem; max-width: 60ch; color: var(--rw-ink-2); font-size: clamp(1.02rem, 1.7vw, 1.15rem); line-height: 1.55; text-wrap: pretty; }

/* The row runs from screen edge to screen edge (--ap-bleed is the margin beside the content column); the padding
   that brings it back also keeps the focus ring inside the scroller's clip. Without JavaScript the apps snap to the
   content column's left edge. With it (.is-live) the current app snaps to the middle, its neighbours peeking in on
   both sides, and home/apps.js adds copies at each end so the row never runs out. */
.rw .ap-track { --ap-bleed: calc((100vw - 100cqi) / 2); position: relative; display: flex; gap: var(--ap-gap); margin: clamp(1.5rem, 3vw, 2.25rem) calc(-1 * var(--ap-bleed)) 0; padding: 6px var(--ap-bleed) 0.9rem; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-padding-inline: var(--ap-bleed); scrollbar-width: thin; scrollbar-color: var(--rw-line) transparent; }
.rw .rw-apps.is-live .ap-track { scrollbar-width: none; }
.rw .rw-apps.is-live .ap-track::-webkit-scrollbar { display: none; }
/* Live, home/apps.js brings the row to rest itself, eased, on the exact middle of an app: the browser's own snap
   points differ by a pixel or more (WebKit's sometimes by far more), and re-snapping after a glide nudged the row. */
.rw .rw-apps.is-live .ap-track { will-change: scroll-position; scroll-behavior: auto; scroll-snap-type: none; }
/* The depth is decoration: under reduced motion the row stays flat whatever the script last wrote. */
@media (prefers-reduced-motion: reduce) { .rw .ap-slide { transform: none !important; opacity: 1 !important; } .rw .ap-slide.is-up .ap-shot { transform: none; } .rw .rw-apps.is-live .ap-slide.is-up, .rw .rw-apps.is-live .ap-slide.is-sinking { transition: none; } }
.rw .ap-track.is-dragging { scroll-snap-type: none; scroll-behavior: auto; }
/* The stage is for turning (home/apps.js): grab anywhere, screenshots included; a finger moving up or down still
   scrolls the page, and a vertical wheel is never caught (overflow-y: hidden above). Only the addresses are links. */
.rw .rw-apps.is-live .ap-track { cursor: grab; touch-action: pan-y; -webkit-user-select: none; user-select: none; }
.rw .rw-apps.is-live .ap-track.is-dragging, .rw .rw-apps.is-live .ap-track.is-dragging * { cursor: grabbing; }
.rw .rw-apps.is-live .ap-link { cursor: pointer; }
/* home/apps.js eases the glide itself; snapping waits until it lands on the next app. */
.rw .ap-track.is-gliding { scroll-snap-type: none; scroll-behavior: auto; }
@media (prefers-reduced-motion: no-preference) { .rw .ap-track { scroll-behavior: smooth; } }

.rw .ap-slide { position: relative; flex: 0 0 var(--ap-w); min-width: 0; scroll-snap-align: start; display: grid; align-content: start; }
.rw .ap-shot { display: block; aspect-ratio: 8 / 5; overflow: hidden; border: 1px solid var(--rw-line); border-radius: 10px; background: #ffffff; box-shadow: 0 22px 40px -30px light-dark(rgba(40, 30, 10, 0.45), rgba(0, 0, 0, 0.9)); transform-origin: 50% 60%; transition: transform 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out); }
.rw .ap-shot img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.rw .ap-slide:hover .ap-shot { transform: translateY(-2px); box-shadow: 0 26px 44px -28px light-dark(rgba(40, 30, 10, 0.5), rgba(0, 0, 0, 0.95)); }
/* The pop (home/apps.js): the app at rest in the middle comes forward as one card, 13% larger, over 0.32 s, with
   a deeper, softer shadow, and goes back in 0.2 s before the row moves on. Only these two classes carry a
   transition, so the cards never lag behind the row as it turns. It sits above its neighbours while forward. */
.rw .rw-apps.is-live .ap-slide { transform-origin: 50% 45%; }
.rw .rw-apps.is-live .ap-slide.is-up { z-index: 1; transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1); }
.rw .rw-apps.is-live .ap-slide.is-sinking { transition: transform 0.2s cubic-bezier(0.4, 0, 0.6, 1); }
.rw .ap-slide.is-up .ap-shot { box-shadow: 0 40px 64px -34px light-dark(rgba(40, 30, 10, 0.5), rgba(0, 0, 0, 1)), 0 10px 24px -14px light-dark(rgba(40, 30, 10, 0.18), rgba(0, 0, 0, 0.6)); transition-duration: 0.32s; }

.rw .ap-name { display: flex; align-items: center; gap: 0.6rem; margin-top: 0.85rem; }
/* Logos sit on white, as on the Apps page, so every brand colour reads in both themes. */
.rw .ap-logo { flex: none; display: grid; place-items: center; width: 30px; height: 30px; padding: 4px; border: 1px solid var(--rw-line-soft); border-radius: 8px; background: #ffffff; }
.rw .ap-logo.is-wordmark { width: 70px; padding: 0; border: 0; border-radius: 0; background: none; }
/* Without their white tile, dark-ink wordmarks need a light rendering on the dark theme. */
:root[data-theme="dark"] .rw .ap-logo.is-wordmark img { filter: brightness(0) invert(0.92); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .rw .ap-logo.is-wordmark img { filter: brightness(0) invert(0.92); } }
.rw .ap-logo img { display: block; width: 100%; height: 100%; object-fit: contain; }
.rw .ap-slide h3 { font-size: 1.15rem; }
/* A wordmark that spells the name (or part of it) sits in the heading in place of those letters. */
.rw .ap-slide h3.ap-spelled { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; }
.rw .ap-about { margin-top: 0.35rem; color: var(--rw-ink-2); font-size: 0.93rem; line-height: 1.5; text-wrap: pretty; }
/* The way out: the app's own address, the only link on the card. */
.rw .ap-link { justify-self: start; display: inline-flex; align-items: center; gap: 0.4rem; min-height: 44px; font: 400 0.8rem/1.4 var(--rw-mono); letter-spacing: 0.02em; text-decoration: none; }
.rw .ap-link svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.rw .ap-link:hover { text-decoration: underline; text-underline-offset: 0.22em; }
.rw .ap-link:focus-visible { outline: 2px solid var(--rw-acc); outline-offset: 2px; border-radius: 4px; }

/* Under the row: previous, the dots and next as one group centred on the page (so the dots sit under the middle
   app), "See all apps" at the end; on phones each on its own line, centred. */
.rw .ap-foot { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 0.75rem 1.5rem; margin-top: 0.6rem; }
.rw .ap-ctrl { grid-column: 2; display: flex; align-items: center; gap: 0.25rem; }
.rw .ap-ctrl[hidden], .rw .ap-dots[hidden] { display: none; }
.rw .ap-ctrl > button { display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--rw-line); border-radius: 99px; background: var(--rw-card); color: var(--rw-ink); cursor: pointer; transition: border-color 0.15s; }
.rw .ap-ctrl button:focus-visible { outline: 2px solid var(--rw-acc); outline-offset: 2px; }
.rw .ap-ctrl svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rw .ap-ctrl .ap-next svg { transform: scaleX(-1); }
/* The dots stay centred: the pause sits in an inset on the right, matched by the same inset on the left. */
.rw .ap-dotrow { position: relative; display: flex; justify-content: center; padding-inline: 40px; }
.rw .ap-dots { display: flex; }
.rw .ap-play { position: absolute; right: 0; top: 50%; translate: 0 -50%; display: grid; place-items: center; width: 40px; height: 44px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--rw-muted); cursor: pointer; }
.rw .ap-play[hidden] { display: none; }
.rw .ap-play svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.rw .ap-play .ap-ic-play { fill: currentColor; stroke-width: 1.2; }
.rw .ap-play .ap-ic-play, .rw .ap-play.is-stopped .ap-ic-pause { display: none; }
.rw .ap-play.is-stopped .ap-ic-play { display: block; }
.rw .ap-dots button { display: grid; place-items: center; width: 26px; height: 32px; padding: 0; border: 0; border-radius: 6px; background: none; cursor: pointer; }
.rw .ap-dots button::before { content: ""; width: 8px; height: 8px; border-radius: 99px; background: var(--rw-line); transition: width 0.2s var(--ease-out), background-color 0.2s, transform 0.16s var(--ease-out); }
.rw .ap-dots button[aria-current="true"]::before { width: 20px; background: var(--rw-acc); }
@media (pointer: coarse) { .rw .ap-dots button { width: 22px; height: 44px; } }
@media (max-width: 420px) { .rw .ap-ctrl > button { width: 40px; height: 40px; } .rw .ap-dotrow { padding-inline: 36px; } .rw .ap-play { width: 36px; } }
.rw .ap-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.rw .ap-foot .rw-more { grid-column: 3; justify-self: end; }
@media (max-width: 639px) {
  .rw .ap-foot { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .rw .ap-ctrl, .rw .ap-foot .rw-more { grid-column: 1; justify-self: center; }
}

/* Hover and press, the same feel on every control of the page: a soft tint (pointers only), a quick press-down,
   colour alone under reduced motion. Transform and colour only, so nothing beside a control moves; focus keeps
   its own ring. */
.rw .ap-ctrl > button, .rw .ap-play { transition: background-color 0.15s, border-color 0.15s, color 0.15s, transform 0.16s var(--ease-out); }
@media (hover: hover) {
  .rw .ap-ctrl > button:hover { background: color-mix(in srgb, var(--rw-ink) 7%, var(--rw-card)); border-color: color-mix(in srgb, var(--rw-ink) 32%, transparent); }
  .rw .ap-play:hover { background: color-mix(in srgb, var(--rw-ink) 8%, transparent); color: var(--rw-ink); }
  .rw .ap-dots button:hover::before { background: var(--rw-muted); transform: scale(1.3); }
  .rw .ap-dots button[aria-current="true"]:hover::before { background: var(--rw-acc); transform: scaleY(1.25); }
}
.rw .ap-ctrl > button:active, .rw .ap-play:active { transform: scale(0.94); transition-duration: 0.08s; background: color-mix(in srgb, var(--rw-ink) 13%, var(--rw-card)); }
.rw .ap-play:active { background: color-mix(in srgb, var(--rw-ink) 14%, transparent); }
.rw .ap-dots button:active::before { transform: scale(0.85); transition-duration: 0.08s; }
@media (prefers-reduced-motion: reduce) { .rw .ap-ctrl > button:active, .rw .ap-play:active, .rw .ap-dots button::before, .rw .ap-dots button:hover::before, .rw .ap-dots button:active::before { transform: none; } }
