/* Framed app screens, their pop-outs and the light/dark switch. Shared by the home page and the
   guides; markup from lib/phones.js, geometry from data/app-shots.json. */

/* height: fit-content keeps a flex or grid parent from stretching the phone taller than its image,
   which would throw off every percentage position inside it. */
.phone { position: relative; margin: 0; height: fit-content; container-type: inline-size; }
.phone__img { display: block; width: 100%; height: auto; filter: drop-shadow(0 3.2cqw 5.5cqw rgba(42, 47, 107, .22)) drop-shadow(0 .6cqw 1.2cqw rgba(42, 47, 107, .10)); }

/* A pop-out, as on the App Store pages: a rounded piece of the screen lifted straight up off the
   place it came from, 1.18x, never tilted, with the store's soft navy shadow (ShotsKit: y 34, blur
   70, 26% against a phone 1147 px wide). The image carries its own rounded corners, so the shadow
   follows them. */
.pop { position: absolute; display: block; z-index: 1; transform: translateY(0);
  transition: transform 260ms var(--ease-out, cubic-bezier(.23, 1, .32, 1)); }
.pop img { display: block; width: 100%; height: auto;
  filter: drop-shadow(0 3cqw 6cqw rgba(42, 47, 107, .26)) drop-shadow(0 .5cqw 1cqw rgba(42, 47, 107, .08)); }
html[data-shots="dark"] .pop img { filter: drop-shadow(0 3cqw 6cqw rgba(4, 5, 20, .55)) drop-shadow(0 .5cqw 1cqw rgba(4, 5, 20, .3)); }

/* Hover: the piece lifts a touch further off the screen. Pointer devices only (a tap would leave
   it stuck), short and ease-out, and none at all for reduced motion. */
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  :is(.shot, .g-art):hover .pop { transform: translateY(-1.2cqw); }
}

/* A card on its own, outside a phone (the home page's routines card). */
.pop-cell { display: block; transition: transform 320ms var(--ease-out, cubic-bezier(.23, 1, .32, 1)); }
.pop-cell img { display: block; width: 100%; height: auto;
  filter: drop-shadow(0 14px 22px rgba(42, 47, 107, .2)) drop-shadow(0 3px 6px rgba(42, 47, 107, .1)); }
html[data-shots="dark"] .pop-cell img { filter: drop-shadow(0 14px 22px rgba(4, 5, 20, .5)) drop-shadow(0 3px 6px rgba(4, 5, 20, .3)); }

/* Theme: both images are in the markup; one shows. */
.t-dark { display: none !important; }
html[data-shots="dark"] .t-dark { display: block !important; }
html[data-shots="dark"] .t-light { display: none !important; }
/* Switching light and dark swaps every screen at once; a short fade with a touch of blur reads as
   one screen changing rather than two images swapping. Reduced motion keeps the fade, drops the blur. */
/* On the wrappers, which carry no filter of their own: the images' drop-shadows would not blend with
   the blur and would flicker. */
html.shots-switching :is(.phone, .pop-cell) { animation: shots-in 220ms var(--ease-out, cubic-bezier(.23, 1, .32, 1)); }
@keyframes shots-in { from { opacity: .4; filter: blur(2px); } }
@media (prefers-reduced-motion: reduce) { @keyframes shots-in { from { opacity: .4; } } }

/* The switch: a two-segment control with a sliding thumb. */
.shots-toggle { position: relative; display: inline-grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 999px;
  background: rgba(255, 255, 255, .72); border: 1px solid rgba(42, 47, 107, .1); box-shadow: 0 6px 20px -10px rgba(42, 47, 107, .35);
  -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4); isolation: isolate; }
.shots-toggle button { position: relative; z-index: 1; appearance: none; border: 0; background: none; cursor: pointer; padding: 8px 18px; min-width: 76px;
  font: 600 14px/1.2 var(--rounded, ui-rounded, "Nunito", system-ui, sans-serif); color: #4A4F78; border-radius: 999px;
  transition: color 200ms ease, transform 160ms var(--ease-out, cubic-bezier(.23, 1, .32, 1)); -webkit-tap-highlight-color: transparent; }
.shots-toggle button:active { transform: scale(.97); }
.shots-toggle button[aria-checked="true"] { color: #fff; }
.shots-toggle button:focus-visible { outline: 2px solid #5560F2; outline-offset: 2px; }
.shots-toggle__thumb { position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 999px;
  background: linear-gradient(135deg, #5560F2, #8A62E6); box-shadow: 0 4px 12px -4px rgba(85, 96, 242, .6);
  transition: transform 240ms var(--ease-in-out, cubic-bezier(.77, 0, .175, 1)); }
.shots-toggle[data-on="dark"] .shots-toggle__thumb { transform: translateX(100%); background: linear-gradient(135deg, #191B36, #3A3F7A); box-shadow: 0 4px 12px -4px rgba(25, 27, 54, .6); }
@media (prefers-reduced-motion: reduce) { .shots-toggle__thumb, .shots-toggle button, .pop, .pop-cell { transition: none; } }
