/* SG Cards story. Every rule is scoped to #sgcards so other projects on the
   page cannot clash with it. The home page scrolls down to "Select Location",
   every store card in view flies in, then Mana Pro's popup opens and flips to
   its "More Info" side. Pieces are captures of the site (capture/sgcards-capture.mjs). */
#sgcards {
  --bg: #FFFFFF;
  --ink: #111111;
  --muted: #6B6B6B;
  --line: #ECECEC;
  --red: #EF3E36;
  --ui: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
  background: var(--bg); color: var(--ink); font-family: var(--ui);
}
#sgcards * { box-sizing: border-box; }

#sgcards .track { position: relative; height: 1700vh; } /* screen 1 + the carousel + screen 2 (Articles) */
#sgcards .pin { position: sticky; top: 0; height: 100vh; height: 100dvh; overflow: hidden; }
#sgcards .scaler { position: absolute; left: 50%; top: 50%; transform-origin: 0 0; }
#sgcards .stage { position: absolute; left: 0; top: 0; }
#sgcards .win { position: absolute; left: 0; top: 0; will-change: transform, opacity; }

#sgcards .hero { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px)); pointer-events: none; z-index: 40; }
#sgcards .eyebrow { font: 800 12px/1 var(--ui); letter-spacing: .14em; text-transform: uppercase; color: var(--red); }
#sgcards .hero h1 { font: 800 clamp(34px, 6vw, 76px)/1.02 var(--ui); letter-spacing: -.03em; margin: 14px auto 12px; text-wrap: balance; max-width: 13ch; }
#sgcards .hero p { margin: 0; color: var(--muted); font-size: clamp(15px, 1.4vw, 18px); }
#sgcards .hint { position: absolute; left: 50%; bottom: max(28px, env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; font: 600 12px var(--ui); color: var(--muted); letter-spacing: .08em; text-transform: uppercase; z-index: 40; }
#sgcards .hint i { width: 22px; height: 34px; border: 1.5px solid var(--line); border-radius: 12px; position: relative; }
#sgcards .hint i::after { content: ""; position: absolute; left: 50%; top: 7px; width: 4px; height: 7px; margin-left: -2px; border-radius: 2px; background: var(--red); animation: sg-wheel 1.6s ease-in-out infinite; }
@keyframes sg-wheel { 0%{transform:translateY(0);opacity:1} 70%{transform:translateY(10px);opacity:0} 100%{opacity:0} }
@media (prefers-reduced-motion: reduce) { #sgcards .hint i::after { animation: none; } }

/* frames */
#sgcards .browser { position: absolute; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 50px 90px -34px rgba(17,17,17,.28), 0 2px 6px rgba(17,17,17,.05); overflow: hidden; }
#sgcards .browser .bar { height: 44px; display: flex; align-items: center; gap: 14px; padding: 0 16px; border-bottom: 1px solid var(--line); background: #FAFAFA; }
#sgcards .dots { display: flex; gap: 7px; } #sgcards .dots i { width: 11px; height: 11px; border-radius: 50%; background: #E4E4E4; }
#sgcards .url { flex: 0 1 380px; margin: 0 auto; height: 26px; border-radius: 8px; background: #fff; border: 1px solid var(--line); font: 500 12px/24px var(--ui); color: var(--muted); text-align: center; }
#sgcards .phone { position: absolute; filter: drop-shadow(0 40px 46px rgba(0,0,0,.26)); }
/* the owner's phone image (shared/phone-frame.png, 941 × 1780) drawn over the screen. It
   has its own dark status bar; the see-through screen below it (703 × 1454 at 118, 246)
   shows the app's 390 × 797 page area. The screen element starts 47 px higher so its
   own status bar hides under the image's. */
#sgcards .phone::after { content: ""; position: absolute; inset: 0; background: url(../../shared/phone-frame.png?v=2) 0 0 / 100% 100% no-repeat; z-index: 70; pointer-events: none; }
#sgcards .phone .scr { position: absolute; left: 65.47px; top: 87.86px; width: 390px; height: 844px; background: #fff; border-radius: 0 0 58px 58px; overflow: hidden; }
#sgcards .phone .sb { position: relative; z-index: 5; height: 47px; display: flex; justify-content: space-between; align-items: center; padding: 8px 34px 0; font: 600 15px var(--ui); background: #fff; }
#sgcards .phone .sb i { display: flex; gap: 3px; align-items: flex-end; }
#sgcards .phone .sb i b { width: 4px; border-radius: 1px; background: var(--ink); display: block; }
#sgcards .phone .island { display: none; } /* the Dynamic Island is in the phone image */
#sgcards .phone .sb { visibility: hidden; } /* so is the status bar */
#sgcards .phone .homebar { position: absolute; bottom: 52px; left: 50%; width: 130px; height: 5px; margin-left: -65px; border-radius: 3px; background: var(--ink); z-index: 60; }

/* the page: a capture that scrolls under the site's own top bar */
#sgcards .content { position: absolute; overflow: hidden; background: #fff; }
#sgcards .pg { position: absolute; left: 0; top: 0; width: 100%; will-change: transform; }
#sgcards .pg img { display: block; width: 100%; height: auto; }
#sgcards .topbar { position: absolute; left: 0; top: 0; width: 100%; height: auto; display: block; }
#sgcards .topbar.stuck { box-shadow: 0 2px 8px rgba(0,0,0,.05); }

/* store cards fly in; they are cut off at the bottom edge of the window only */
#sgcards .fly { position: absolute; will-change: transform; }
#sgcards .card { position: absolute; border-radius: 12px; will-change: transform, opacity; }
#sgcards .card img { display: block; width: 100%; height: 100%; border-radius: 12px; }

/* the popup, over a dimmed and blurred page, as on the site */
#sgcards .pop { position: absolute; overflow: hidden; pointer-events: none; perspective: 1400px; }
#sgcards .dim { position: absolute; inset: 0; background: rgba(0,0,0,.45); }
#sgcards .side { position: absolute; display: block; backface-visibility: hidden; will-change: transform, opacity; filter: drop-shadow(0 8px 40px rgba(0,0,0,.16)); }
#sgcards .close { position: absolute; width: 36px; height: 36px; border-radius: 50%; background: #fff; display: grid; place-items: center; will-change: transform, opacity; }
#sgcards .close svg { width: 16px; height: 16px; fill: none; stroke: #111; stroke-width: 2; stroke-linecap: round; }

/* screen 2: the Articles page's cards, as on the site (rounded-xl, soft shadow) */
#sgcards .art { position: absolute; border-radius: 12px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.06); will-change: transform, opacity; }
#sgcards .art img { display: block; width: 100%; height: 100%; }

#sgcards .after { padding-block: 96px 120px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); position: relative; }
#sgcards .after .inner { max-width: 1080px; margin: 0 auto; }
#sgcards .after h2 { font: 800 clamp(28px, 4vw, 44px)/1.08 var(--ui); letter-spacing: -.03em; margin: 12px 0 40px; max-width: 18ch; text-wrap: balance; }
#sgcards .cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
#sgcards .cols h3 { font: 800 18px var(--ui); letter-spacing: -.01em; margin: 0 0 8px; }
#sgcards .cols p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.6; }
#sgcards .cols .k { font: 800 12px var(--ui); color: var(--red); letter-spacing: .1em; text-transform: uppercase; display: block; margin-bottom: 12px; padding-top: 14px; border-top: 1.5px solid var(--ink); }
@media (max-width: 760px) { #sgcards .cols { grid-template-columns: 1fr; gap: 28px; } }
/* phone view: this section's type is 2px smaller throughout (as in the other stories) */
@media (max-width: 699px) {
  #sgcards .after .eyebrow, #sgcards .cols .k { font-size: 10px; }
  #sgcards .after h2 { font-size: 26px; }
  #sgcards .cols h3 { font-size: 16px; }
  #sgcards .cols p { font-size: 13px; }
}
