/* Features page, in the homepage's style: the board-grey page, rounded tiles, the frosted
   header, bold see-through text, and the Tahoe wallpaper behind the Macs. Loaded last, so it
   only restyles; the gallery controls and the feature pills keep their own motion. */

/* Header links: same weight and ink as the brand name, the current page in a soft pill. */
.bar-links { gap: 2px; margin-right: 6px; }
.bar-links a { font-size: 15px; font-weight: 500; letter-spacing: -.1px; color: var(--soft-ink);
  padding: 8px 14px; border-radius: 999px; transition: background-color .3s var(--ease), color .3s var(--ease); }
.bar-links a:hover { color: var(--ink); }
.bar-links a[aria-current="page"] { color: var(--ink); background: rgba(127, 127, 127, .14); }

/* Section, below the bento */
.features { background: var(--board); padding-top: clamp(60px, 8vw, 110px); }

/* Intro: bold, see-through, normal tracking, like the hero. */
.feature-intro { margin: 0 auto; padding-top: 0; padding-bottom: clamp(44px, 6vw, 80px); text-align: center; }
.feature-intro .eyebrow, .explore-heading .eyebrow { color: var(--soft-ink); font-size: 19px; font-weight: 600;
  letter-spacing: -.2px; margin-bottom: 10px; }
.feature-intro h2 { font-size: clamp(40px, 4.4vw, 60px); font-weight: 700; letter-spacing: -.8px; line-height: 1.12;
  color: var(--soft-ink); }
.feature-intro > p:last-child { margin-top: 16px; font-size: clamp(18px, 1.6vw, 22px); font-weight: 500;
  color: var(--sub); }

/* Highlights: rounded tiles on the Tahoe wallpaper, the Mac rising from the bottom. */
.showcase { width: min(1300px, calc(100% - 48px)); }
.showcase-track { border-radius: 30px; }
.showcase-slide { border-radius: 30px; min-height: 620px; background: var(--tile) center / cover no-repeat;
  background-image: url(assets/tahoe-wall-light.jpg); }
[data-theme="dark"] .showcase-slide { background-image: url(assets/tahoe-wall-dark.jpg); }
.showcase-copy { padding: 44px 48px 0; padding-right: 220px; }
.showcase-name { font-size: clamp(30px, 3.2vw, 44px); font-weight: 700; letter-spacing: -.6px; color: var(--title-ink); }
.showcase-copy h2 { margin-top: 4px; font-size: clamp(20px, 2vw, 26px); font-weight: 600; letter-spacing: -.3px;
  color: var(--title-ink); }
.showcase-copy a { top: 44px; right: 44px; padding: 13px 22px; border-radius: 999px; font-size: 16px; font-weight: 600;
  color: #1d1d1f; background: rgba(255, 255, 255, .92); transition: filter .4s var(--hover), transform .2s var(--ease); }
.showcase-copy a:hover { filter: brightness(1.03); }
.showcase-copy a:active { transform: scale(.97); }
.showcase-slide > img { width: min(76%, 900px); margin-top: 26px; filter: drop-shadow(0 24px 44px rgba(0, 20, 70, .35)); }

/* The little things: same tile look as the bento. */
.explore { margin-top: clamp(100px, 12vw, 160px); }
.explore-heading { text-align: center; margin-bottom: 34px; }
.explore-heading h2 { font-size: clamp(36px, 4vw, 54px); font-weight: 700; letter-spacing: -.7px; line-height: 1.1;
  color: var(--soft-ink); }
.explore { --pv-w: min(1300px, calc(100% - 48px)); }
.viewer { border-radius: 30px !important; overflow: hidden; background: var(--tile) center / cover no-repeat;
  background-image: url(assets/tahoe-wall-light.jpg); }
[data-theme="dark"] .viewer { background-image: url(assets/tahoe-wall-dark.jpg); }
.viewer .stage img { filter: drop-shadow(0 24px 44px rgba(0, 20, 70, .32)); }
.viewer .pills button[aria-expanded] span { letter-spacing: -.2px; }

.foot .credit { margin: 22px 0 0; font-size: 12px; color: var(--sub); text-align: center; }
.foot .credit a { color: inherit; }

@media (max-width: 760px) {
  .showcase-copy { padding: 28px 24px 0; }
  .showcase-copy a { position: static; display: inline-flex; margin-top: 16px; }
}

.feature-intro h2 { margin: 0; text-wrap: balance; }

/* The carousel moves itself frame by frame; the browser's own smooth scrolling fought it
   (each dot click stopped after a pixel). */
.showcase-track, .gallery-track { scroll-behavior: auto !important; }

/* The moving Tahoe behind the highlights and the feature viewer, following the theme. */
.showcase { position: relative; }
.showcase > .section-bg { position: absolute; left: 0; right: 0; top: 0; height: 620px; width: 100%;
  object-fit: cover; border-radius: 30px; z-index: 0; pointer-events: none; }
.showcase-track { position: relative; z-index: 1; }
.showcase-slide, [data-theme="dark"] .showcase-slide { background: transparent; background-image: none; height: 620px; }
.viewer { position: relative; }
.viewer > .section-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; pointer-events: none; }
.viewer > .viewer-in, .viewer > .stage { z-index: 1; }
.viewer, [data-theme="dark"] .viewer { background-image: none; }
@media (max-width: 760px) {
  .showcase > .section-bg, .showcase-slide { height: 490px; }
}

/* Highlights: the whole MacBook fits under the copy, base included. */
.showcase-slide > img { width: auto !important; height: calc(100% - 190px); max-width: 86%;
  margin: auto auto 26px !important; object-fit: contain; }
@media (max-width: 760px) { .showcase-slide > img { height: calc(100% - 200px); } }

/* Feature pills: frosted, so the Tahoe colours show through instead of flat grey. */
.viewer .pills li, .viewer .shut {
  background: rgba(255, 255, 255, .55) !important;
  -webkit-backdrop-filter: blur(22px) saturate(1.8); backdrop-filter: blur(22px) saturate(1.8);
}
[data-theme="dark"] .viewer .pills li, [data-theme="dark"] .viewer .shut {
  background: rgba(30, 30, 60, .28) !important;
}

/* No blur: over the video it came out flat grey. A plain see-through tint lets the Tahoe
   colours through instead. */
.viewer .pills li, .viewer .shut {
  -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
  background: rgba(255, 255, 255, .62) !important;
}
[data-theme="dark"] .viewer .pills li, [data-theme="dark"] .viewer .shut {
  background: rgba(255, 255, 255, .16) !important;
}

/* The pills sit above the pictures, which never take clicks. */
.viewer > .stage { z-index: 1; pointer-events: none; }
.viewer > .viewer-in { position: relative; z-index: 2; }

/* The buttons inside the pills had the browser's own grey button fill in dark mode. */
.viewer .pills button { background: transparent; }
/* The up/down arrows match the pills and the close button. */
.viewer .step { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; background: rgba(255, 255, 255, .62) !important; }
[data-theme="dark"] .viewer .step { background: rgba(255, 255, 255, .16) !important; }

/* Feature viewer pictures: smaller and to the right, so an open card never covers them,
   whatever the window width. The answers screenshot gets rounded corners like a window. */

.viewer .stage img[src*="answers-card"] { width: calc(var(--shot-w) * .82) !important;
  border-radius: 22px; box-shadow: 0 24px 50px rgba(0, 20, 70, .3); filter: none; }
#features { scroll-margin-top: 80px; }

/* Safari dropped the Macs from the highlight slides: rounded, clipped slides inside a scroller,
   over a playing video, with a big drop-shadow filter. Each slide gets its own layer, the
   clipping lives on the track only, and the drop-shadow filter is gone. */
.showcase-track { isolation: isolate; -webkit-transform: translateZ(0); transform: translateZ(0); }
.showcase-slide { overflow: visible; border-radius: 0; }
.showcase-slide > img { filter: none !important; -webkit-transform: translateZ(0); transform: translateZ(0); }

/* Customization: wallpaper swatches under the text, like Apple's colour picker. */
.viewer .swatches { display: flex; justify-content: center; gap: 14px; margin-top: 18px; }
.viewer .swatch { width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  background: var(--l) center / cover; box-shadow: 0 0 0 1px rgba(0, 0, 0, .12) inset;
  outline: 2px solid transparent; outline-offset: 3px; transition: outline-color .25s ease; }
[data-theme="dark"] .viewer .swatch { background-image: var(--d); box-shadow: 0 0 0 1px rgba(255, 255, 255, .18) inset; }
.viewer .swatch.on { outline-color: rgba(0, 0, 0, .55); }
[data-theme="dark"] .viewer .swatch.on { outline-color: rgba(255, 255, 255, .8); }
.viewer .swatch:focus-visible { outline-color: var(--blue); }

/* The swatches are buttons inside the pills, so the transparent pill-button rule above wiped
   their pictures. These win on specificity. */
.viewer .pills button.swatch { background: var(--l) center / cover no-repeat; }
[data-theme="dark"] .viewer .pills button.swatch { background: var(--d) center / cover no-repeat; }
/* Narrower windows: keep the Mac clear of an open card. */


/* The pill list was only as wide as its widest closed pill, so a card opening below it was cut
   off until the list caught up. Keep the list as wide as an open card. */
@media (min-width: 834px) { .viewer .pills { min-width: var(--card-w); } }

/* The Mac rests big. While a card is open it shrinks and slides right, out of the card's way,
   on the viewer's own spring; closing brings it back. */
@media (min-width: 834px) {
  .viewer .stage { --shot-x: 70%; --shot-w: 56%; --shot-y: 50%; transform-origin: 70% 50%;
    transition: translate var(--dur-pill) var(--spring-pill), scale var(--dur-pill) var(--spring-pill); }
  .viewer.active .stage { translate: 5.5% 0; scale: .78; }
}

/* Highlights: the Mac stops above the dots and play button instead of sitting under them. */
.showcase-slide > img { height: calc(100% - 280px); margin: auto auto 100px !important; }
@media (max-width: 760px) { .showcase-slide > img { height: calc(100% - 270px); margin-bottom: 90px !important; } }

/* Taller highlight slides, so the Mac is big enough to read what's on its screen. */
@media (min-width: 761px) {
  .showcase > .section-bg, .showcase-slide, [data-theme="dark"] .showcase-slide { height: 760px; min-height: 760px; }
  .showcase-slide > img { height: calc(100% - 250px); max-width: 92%; }
}

/* The ad blocking slide shows the shield symbol from the README bento instead of a Mac. */
.showcase-slide > img.symbol { height: 240px !important; width: auto !important; margin: auto !important; filter: none; }
