/* The social media page (Q248; the redesign, 10/27): only what this page adds to css/studio.css, which holds the
   header, menu, buttons, hero, sections, bento, logo strip, quotes, closing band and reveals (never restyled here).
   css/device-hero.css makes the hero a 3D phone and css/ig.css draws the Instagram screens. The two-act stage reads --p
   (0 to 1), which js/studio.js sets on each [data-sx-stage]; on phones, with reduced motion and without JavaScript it
   rests in place. The sx- names below were
   this page's before the shared system; the newer page-only names start with so-. */

/* Bento: pictures fill their tiles; phone screens sit from their top. */
.so-pic { display: block; width: 100%; height: 100%; }
.so-top { object-position: 50% 0; }

/* The platforms: the shared logo strip carrying their names as words. Each half holds the names twice so it is wider
   than the screen; the empty end gives the last name the same gap as the others, so the loop never jumps. */
.so-plat-w { font-size: clamp(24px, 2.6vw, 38px); font-weight: 500; line-height: 1.2; letter-spacing: -.01em; white-space: nowrap; color: rgba(255, 255, 255, .82); }
.so-plat-end { width: 0; }
@media (prefers-reduced-motion: no-preference) {
  .so-plat [data-sx-dup] { display: contents; }
}
@media (prefers-reduced-motion: reduce) {
  .so-plat .so-r2 { display: none; }
}

/* Get noticed, then booked (David 10/27: the page's showpiece): one scroll stage in two acts. The resting layout comes
   first (reduced motion, no JavaScript): the acts one after the other, each its words and then its phones, a fan at
   761 px and wider and a row to swipe under 760 px. With motion on a wide screen the stage pins both acts in one screen
   and plays them on --p (js/studio.js; data-sx-stage="enter" on .so-stage: 0 when its top comes up over the bottom of
   the screen, 1 when its end reaches the bottom of the screen; it pins from about .42). --a1: the fan sweeps in from
   both sides while the stage comes up, and settles just before it pins. --t: then the words change, the reel and the
   outer phones step away, and the inner pair turns over (half a turn each) to the comments and the messages, which
   finish the turn as they glide in. Each phone's place: --x and --y in phone widths and --r. */
.so-stage { --w: clamp(150px, 19.5vw, 290px); margin-top: clamp(72px, 8vw, 120px); text-align: center; overflow-x: clip; }
.so-act + .so-act { margin-top: clamp(72px, 8vw, 120px); }
.so-act-head .sx-lead { max-width: 38em; }
.so-act-note { margin-top: 12px; font-size: 13px; color: var(--soft); }
.so-fan { position: relative; margin-top: clamp(36px, 4vw, 56px); }
.so-phone {
  position: relative; width: var(--w); aspect-ratio: 9 / 19.5; border-radius: calc(var(--w) * .14); overflow: hidden;
  background: #000; box-shadow: 0 0 0 3px #fefffe;
}
@media (min-width: 761px) {
  .so-fan { height: calc(var(--w) * 2.5); }
  .so-fan--2 { height: calc(var(--w) * 2.3); }
  .so-phone {
    position: absolute; top: 0; left: 50%; margin-left: calc(var(--w) * -.5); z-index: var(--z);
    transform: translate(calc(var(--x) * var(--w)), calc(var(--y) * var(--w))) rotate(var(--r));
  }
  .so-phone--reel { --x: 0; --y: 0; --r: 0deg; --z: 3; }
  .so-phone--post-l { --x: -.82; --y: .07; --r: -6deg; --z: 2; }
  .so-phone--story { --x: .82; --y: .07; --r: 6deg; --z: 2; }
  .so-phone--profile { --x: -1.58; --y: .22; --r: -12deg; --z: 1; }
  .so-phone--post-r { --x: 1.58; --y: .22; --r: 12deg; --z: 1; }
  .so-phone--comments { --x: -.54; --y: -.01; --r: -3deg; --z: 1; }
  .so-phone--dm { --x: .54; --y: -.01; --r: 3deg; --z: 2; }
}
@media (min-width: 761px) and (prefers-reduced-motion: no-preference) {
  /* The phones take the screen's height into account, so the words and the whole fan fit one screen. */
  .sx-js .so-stage {
    --w: clamp(170px, min(19.5vw, (100vh - 300px) / 2.2), 290px);
    --a1: clamp(0, (var(--p, 1) - .04) / .36, 1);
    --t: clamp(0, (var(--p, 1) - .54) / .29, 1);
    --h1: clamp(0, (var(--t) - .04) / .28, 1);
    --h2: clamp(0, (var(--t) - .34) / .3, 1);
    --go: clamp(0, var(--t) / .5, 1);
    --f1: clamp(0, (var(--t) - .12) / .38, 1);
    --f2: clamp(0, (var(--t) - .5) / .38, 1);
    height: 240vh; margin-top: clamp(12px, 2vw, 28px);
  }
  .sx-js .so-pin {
    position: sticky; top: 0; height: 100vh; display: grid; grid-template-rows: auto minmax(0, 1fr);
    padding-top: clamp(96px, 11vh, 120px); overflow: hidden;
  }
  .sx-js .so-act { display: contents; }
  .sx-js .so-act-head { grid-row: 1; grid-column: 1; }
  .sx-js .so-fan { grid-row: 2; grid-column: 1; height: auto; margin-top: clamp(20px, 3vh, 36px); perspective: 1800px; }
  .sx-js .so-act--1 .so-act-head { opacity: calc(1 - var(--h1)); transform: translateY(calc(var(--h1) * -24px)); }
  .sx-js .so-act--2 .so-act-head { opacity: var(--h2); transform: translateY(calc((1 - var(--h2)) * 24px)); }
  /* Act 1: each phone starts --sx out to its side (the reel from below) with a wider turn; when the act ends the
     leaving phones move by --gx or --gy and fade, and the inner pair turns edge on (--turn). */
  .sx-js .so-act--1 .so-phone {
    --out: calc(1 - var(--a1));
    transform: translate(calc(var(--x) * var(--w) + var(--out) * var(--sx) + var(--go) * var(--gx, 0) * var(--w)), calc((var(--y) + var(--out) * var(--sy) + var(--go) * var(--gy, 0)) * var(--w))) rotate(calc(var(--r) * (1 + var(--out) * 1.6))) rotateY(calc(var(--f1) * var(--turn, 0deg)));
    will-change: transform, opacity;
  }
  .sx-js .so-act--1 .so-phone--reel { --sx: 0vw; --sy: .5; --gy: .6; opacity: calc((.15 + var(--a1) * .85) * (1 - var(--go))); }
  .sx-js .so-act--1 .so-phone--profile { --sx: -60vw; --sy: .45; --gx: -.8; opacity: calc(1 - var(--go)); }
  .sx-js .so-act--1 .so-phone--post-r { --sx: 60vw; --sy: .45; --gx: .8; opacity: calc(1 - var(--go)); }
  .sx-js .so-act--1 .so-phone--post-l { --sx: -44vw; --sy: .3; --turn: 90deg; opacity: calc(1 - clamp(0, (var(--f1) - .9) * 10, 1)); }
  .sx-js .so-act--1 .so-phone--story { --sx: 44vw; --sy: .3; --turn: -90deg; opacity: calc(1 - clamp(0, (var(--f1) - .9) * 10, 1)); }
  /* Act 2: each phone finishes the turn where the inner pair stood (--x0, --y0, --r0) and glides to its place. */
  .sx-js .so-act--2 .so-phone {
    transform: translate(calc((var(--x0) + (var(--x) - var(--x0)) * var(--f2)) * var(--w)), calc((var(--y0) + (var(--y) - var(--y0)) * var(--f2)) * var(--w))) rotate(calc(var(--r0) + (var(--r) - var(--r0)) * var(--f2))) rotateY(calc((1 - var(--f2)) * var(--turn)));
    opacity: clamp(0, var(--f2) * 10, 1);
    will-change: transform, opacity;
  }
  .sx-js .so-act--2 .so-phone--comments { --x0: -.82; --y0: .07; --r0: -6deg; --turn: -90deg; }
  .sx-js .so-act--2 .so-phone--dm { --x0: .82; --y0: .07; --r0: 6deg; --turn: 90deg; }
}

/* Plans: three dark cards in the plan's own words (no prices on this page, David 10/27), the button at the foot. */
.sx-plan-grid { margin-top: 56px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; text-align: left; }
.sx-plan { display: flex; flex-direction: column; background: var(--card); border-radius: 32px; padding: 36px; }
.sx-plan h3 { font-weight: 400; font-size: clamp(28px, 2.5vw, 36px); line-height: 1.2; }
.sx-plan-tag { margin-top: 16px; font-size: 15.5px; }
.sx-plan ul { margin-top: 16px; list-style: none; display: grid; gap: 8px; font-size: 14px; color: #dcdcdc; }
.sx-plan li { position: relative; padding-left: 18px; }
.sx-plan li::before { content: ""; position: absolute; left: 0; top: .62em; width: 7px; height: 7px; border-radius: 50%; background: #fff; }
.sx-plan-media { margin-top: auto; padding-top: 26px; }
.sx-plan-media .sx-btn { width: 100%; }
.sx-plans-note { margin: 24px auto 0; max-width: 760px; font-size: 14px; color: var(--soft); }
.sx-plans-note a { color: #fff; }

/* Team: round photos with name and role; Rebecca's circle carries her initials until her photo comes in. */
.sx-team-grid { margin-top: 64px; display: flex; flex-wrap: wrap; justify-content: center; gap: 28px; }
.sx-person { width: clamp(200px, 18vw, 260px); }
.sx-person img, .so-monogram { width: 100%; height: auto; aspect-ratio: 1; border-radius: 50%; }
.sx-person img { object-fit: cover; object-position: 50% 20%; }
.so-monogram { display: grid; place-items: center; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); font-size: clamp(54px, 5.2vw, 76px); font-weight: 400; line-height: 1; letter-spacing: .02em; }
.sx-person h3 { margin-top: 18px; font-size: 18px; font-weight: 500; }
.sx-person p { font-size: 14px; }

/* What clients say: each review with the client's site on a phone in a tall frame that runs off the card's bottom
   edge (REV's video testimonials). The words take the spare height, so both frames meet the bottom. */
.so-quote { grid-template-rows: 1fr auto; }
.so-quote-words { justify-self: stretch; }
.so-quote-note { max-width: 30em; margin-inline: auto; }
.so-quote-link { display: inline-block; margin-top: 18px; font-size: 14px; text-underline-offset: 4px; }
.so-quote-phone { width: min(252px, 100%); aspect-ratio: 252 / 400; margin: 44px 0 -48px; border-radius: 40px 40px 0 0; overflow: hidden; box-shadow: 0 0 0 3px #fff; background: var(--card-2); }
.so-quote-phone img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; }

@media (max-width: 960px) {
  .sx-plan-grid { grid-template-columns: 1fr; max-width: 520px; margin-inline: auto; }
}
/* Phones: each act's phones in a row to swipe, the first one at the left edge of the text. */
@media (max-width: 760px) {
  .so-stage { --w: min(64vw, 260px); margin-top: 80px; }
  .so-act + .so-act { margin-top: 72px; }
  .so-fan {
    display: flex; gap: 16px; margin-top: 28px; padding: 6px var(--pad) 10px; overflow-x: auto; scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--pad); overscroll-behavior-x: contain; scrollbar-width: none;
  }
  .so-fan::-webkit-scrollbar { display: none; }
  .so-phone { flex: none; scroll-snap-align: start; }
}
@media (max-width: 640px) {
  .so-bento .so-top--house { object-position: 50% 8%; }
  .sx-plan { padding: 26px; border-radius: 26px; }
  .sx-team-grid { gap: 20px; }
  .sx-person { width: min(160px, calc(50% - 10px)); }
  .sx-person h3 { font-size: 16px; }
  .so-quote-phone { margin: 36px 0 -36px; border-radius: 32px 32px 0 0; }
}
