/* readability pass: +2px on every font-size (applied) */
/* =========================================================================
   In-feed phone mock · shared shell for BOTH ad creatives
   static-ad/ (Variant A, single image post) and carousel/phone/ (Variant B)
   link this one file, so the iPhone, iOS and Instagram chrome can't drift.
   Brand tokens + fonts come from ../assets/funnel.css.
   ========================================================================= */

/* ---------------------------------- stage --------------------------------- */
.sa-page { min-height: 100svh; }
.sa { position: relative; min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 22px 16px 26px; overflow: hidden; }
.sa__glow { position: absolute; left: 50%; top: 50%; width: min(980px, 140vw); height: min(820px, 120vh); transform: translate(-50%, -50%);
  pointer-events: none; z-index: 0;
  background: radial-gradient(42% 46% at 50% 50%, rgba(59, 227, 107, 0.16), rgba(59, 227, 107, 0) 70%); }
.sa__eyebrow { position: relative; z-index: 1; margin: 0 0 16px; display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 13px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--text-3); }
.sa__eyebrow i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.stage { position: relative; z-index: 1; display: grid; place-items: center; }
.fit { position: relative; zoom: 1; }
.fit::after { content: ""; position: absolute; left: 50%; bottom: -26px; width: 420px; height: 60px; transform: translateX(-50%);
  background: rgba(0, 0, 0, .9); border-radius: 50%; filter: blur(26px); z-index: -1; }
.phone-wrap { position: relative; }
.hint { position: relative; z-index: 1; margin: 18px 0 0; font-family: var(--mono); font-size: 13px; font-weight: 600; letter-spacing: .16em;
  text-transform: uppercase; color: var(--text-3); display: inline-flex; align-items: center; gap: 10px; }
.hint svg { width: 16px; height: 16px; stroke: var(--accent); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* no-JS fallback sizing; phone.js replaces this with an exact fit */
@media (max-height: 960px) { .fit { zoom: .86; } }
@media (max-height: 860px) { .fit { zoom: .78; } }
@media (max-height: 760px) { .fit { zoom: .68; } }
@media (max-width: 430px) { .fit { zoom: .86; } }
@media (max-width: 380px) { .fit { zoom: .8; } }

/* entrance (JS only, always visible without JS, force-shown after 1.2s by phone.js) */
@media (prefers-reduced-motion: no-preference) {
  .js .fx { opacity: 0; transform: translateY(18px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
  .js .fx.is-in { opacity: 1; transform: none; }
  .js .fx-2 { transition-delay: .12s; }
  .js .fx-3 { transition-delay: .5s; }
}

/* ------------------------------ iPhone 17 shell ---------------------------- */
.iphone { --w: 392px; --r: 62px; position: relative; width: var(--w); aspect-ratio: 392 / 846; border-radius: var(--r); padding: 11px;
  background: linear-gradient(148deg, #6f6a63 0%, #100e0c 16%, #2a2622 34%, #7b756c 50%, #100e0c 66%, #3a3530 84%, #6f6a63 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .22),
    inset 0 0 0 2px rgba(0, 0, 0, .55),
    inset 0 2px 1px rgba(255, 255, 255, .18),
    0 60px 120px -30px rgba(0, 0, 0, .95),
    0 30px 60px -24px rgba(0, 0, 0, .85); }
.iphone::before { content: ""; position: absolute; inset: 8px; border-radius: calc(var(--r) - 8px); background: #000; z-index: 0; }
.iphone::after { content: ""; position: absolute; inset: 11px; border-radius: calc(var(--r) - 11px); z-index: 6; pointer-events: none;
  background: linear-gradient(128deg, rgba(255, 255, 255, .13) 0%, rgba(255, 255, 255, .04) 22%, rgba(255, 255, 255, 0) 38%); }
.btn-side { position: absolute; width: 3px; border-radius: 2px; background: linear-gradient(90deg, #4c4741, #8a837a, #3a3631); z-index: -1; }
.btn-side.mute { left: -3px; top: 132px; height: 30px; }
.btn-side.vup { left: -3px; top: 186px; height: 58px; }
.btn-side.vdn { left: -3px; top: 258px; height: 58px; }
.btn-side.pwr { right: -3px; top: 208px; height: 92px; }

.screen { position: relative; z-index: 1; height: 100%; border-radius: calc(var(--r) - 11px); overflow: hidden; background: #fff; color: #000;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Inter", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased; isolation: isolate; }
.screen a { color: inherit; }
.screen button { font-family: inherit; }

/* ------------------------------- iOS chrome -------------------------------- */
.status { position: absolute; z-index: 5; top: 0; left: 0; right: 0; height: 54px; background: #fff; display: flex; align-items: center;
  justify-content: space-between; padding: 6px 30px 0 34px; }
.status .clock { font-size: 18.5px; font-weight: 600; letter-spacing: -.01em; color: #000; width: 54px; text-align: center; }
.status .sys { display: flex; align-items: center; gap: 6px; }
.status .sys svg { display: block; }
.island { position: absolute; z-index: 7; top: 11px; left: 50%; transform: translateX(-50%); width: 116px; height: 33px; border-radius: 20px; background: #000; }
.island::after { content: ""; position: absolute; right: 12px; top: 50%; width: 11px; height: 11px; margin-top: -5.5px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #2b3a5a, #0b0f18 60%); box-shadow: inset 0 0 0 1.5px #151a24; }
.homebar { position: absolute; z-index: 9; left: 50%; bottom: 8px; width: 138px; height: 5px; margin-left: -69px; border-radius: 3px; background: #000; }

/* ------------------------------- the feed ---------------------------------- */
.feed { position: absolute; z-index: 1; top: 54px; left: 0; right: 0; bottom: 0; overflow-y: auto; overflow-x: hidden;
  overscroll-behavior: contain; scrollbar-width: none; padding-bottom: 96px; }
.feed::-webkit-scrollbar { display: none; }

.ig-top { height: 46px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px 0 14px; }
.ig-logo { font-family: "Snell Roundhand", "Segoe Script", "Brush Script MT", "Apple Chancery", cursive; font-size: 32px; font-weight: 700;
  line-height: 1; letter-spacing: -.01em; color: #000; transform: translateY(2px); }
.ig-top .icons { display: flex; align-items: center; gap: 22px; }
.ig-top .icons span { position: relative; display: block; }
.ig-ico { width: 24px; height: 24px; display: block; color: #000; }
.ig-badge { position: absolute; top: -6px; right: -8px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #ff3040;
  color: #fff; font-size: 13px; font-weight: 700; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px #fff; }

/* post header */
.post-head { height: 54px; display: flex; align-items: center; gap: 10px; padding: 0 6px 0 12px; }
.avatar-ring { width: 38px; height: 38px; border-radius: 50%; padding: 2px; flex: none;
  background: conic-gradient(from 200deg, #feda75, #fa7e1e, #d62976, #962fbf, #4f5bd5, #feda75); }
.avatar-ring img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 2px solid #fff; display: block; }
.post-head .who { flex: 1; min-width: 0; line-height: 1.2; }
.post-head .handle { display: block; font-size: 16px; font-weight: 600; color: #000; letter-spacing: -.005em; }
.post-head .spons { display: block; font-size: 14px; color: #737373; margin-top: 1px; }
.post-head .more { width: 40px; height: 40px; display: grid; place-items: center; border: 0; background: none; padding: 0; color: #000; }
.post-head .more svg { width: 24px; height: 24px; }

/* media slot (variant goes here) */
.post-media { position: relative; display: block; width: 100%; background: #070a09; overflow: hidden; }
.post-media--sq { aspect-ratio: 1 / 1; }
.post-media img { width: 100%; height: 100%; object-fit: cover; display: block; -webkit-user-drag: none; user-select: none; }

/* sponsored CTA strip: fills Instagram blue after a moment, like the real app */
.cta-strip { display: flex; align-items: center; justify-content: space-between; height: 44px; padding: 0 12px 0 14px; background: #fff;
  border-bottom: .5px solid #dbdbdb; font-size: 16px; font-weight: 600; color: #000; text-decoration: none;
  transition: background-color .6s ease, color .6s ease, border-color .6s ease; }
.cta-strip svg { width: 16px; height: 16px; flex: none; }
.cta-strip.is-lit { background: #0095f6; color: #fff; border-color: #0095f6; }
.cta-strip:hover { filter: brightness(.97); }

/* actions */
.actions { position: relative; display: flex; align-items: center; height: 42px; padding: 0 4px 0 6px; }
.actions .act { width: 40px; height: 40px; display: grid; place-items: center; border: 0; padding: 0; background: none; color: #000; cursor: pointer; }
.actions .act svg { width: 24px; height: 24px; }
.actions .spacer { flex: 1; }
.act.like .h-on { display: none; }
.act.like.is-on .h-on { display: block; }
.act.like.is-on .h-off { display: none; }
.act.like.is-on { color: #ff3040; }
.act.like.is-on svg { animation: likePop .45s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes likePop { 0% { transform: scale(.6); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }

/* caption */
.caption { margin: 2px 0 0; padding: 0 14px; font-size: 16px; line-height: 18px; color: #000; overflow-wrap: break-word; }
.caption b { font-weight: 600; }
.caption .full { display: none; white-space: pre-line; }
.caption.is-open .full { display: inline; }
.caption.is-open .short, .caption.is-open .morebtn { display: none; }
.caption .morebtn { border: 0; background: none; padding: 0; font-size: 16px; color: #737373; cursor: pointer; }
.comment-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px 0; font-size: 16px; color: #737373; }
.comment-row .me { width: 24px; height: 24px; border-radius: 50%; background: #dbdbdb; display: grid; place-items: center; overflow: hidden; flex: none; }
.comment-row .me svg { width: 24px; height: 24px; color: #fff; }

/* tab bar */
.tabbar { position: absolute; z-index: 4; left: 0; right: 0; bottom: 0; height: 83px; background: rgba(255, 255, 255, .97);
  border-top: .5px solid #dbdbdb; display: flex; align-items: flex-start; justify-content: space-around; padding: 12px 10px 0; }
.tabbar svg { width: 26px; height: 26px; color: #000; display: block; }
.tabbar .me { width: 27px; height: 27px; border-radius: 50%; background: #dbdbdb; overflow: hidden; display: grid; place-items: center; }
.tabbar .me svg { width: 27px; height: 27px; color: #fff; }

/* ------------------------------ the callout -------------------------------- */
.callout { position: absolute; left: calc(100% + 6px); width: 230px; pointer-events: none; z-index: 8; }
.callout--static { top: 465px; }   /* arrow tip lands on the CTA strip */
.callout--car { top: 304px; }      /* arrow tip lands on the carousel's next arrow */
.callout svg { width: 120px; height: 104px; display: block; overflow: visible; }
.callout .ln { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; stroke-dasharray: 170; stroke-dashoffset: 0; }
.callout .ar { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.callout .bubble { position: absolute; left: 92px; top: -46px; display: inline-block; white-space: nowrap; padding: 11px 16px 12px; border-radius: 14px;
  font-family: var(--display); font-size: 19px; font-weight: 800; font-stretch: 96%; letter-spacing: -.01em; color: var(--accent-ink);
  background: linear-gradient(180deg, var(--accent-2), var(--accent)); transform: rotate(-3deg); box-shadow: 0 18px 40px -16px var(--accent-glow); }
.js .callout .ln { stroke-dashoffset: 170; }
.js .callout .ar { opacity: 0; }
.js .callout .bubble { opacity: 0; transform: rotate(-3deg) translateY(8px); }
.js .callout.is-in .ln { stroke-dashoffset: 0; transition: stroke-dashoffset 1s cubic-bezier(.6, 0, .2, 1) .35s; }
.js .callout.is-in .ar { opacity: 1; transition: opacity .3s ease 1.15s; }
.js .callout.is-in .bubble { opacity: 1; transform: rotate(-3deg); transition: opacity .5s ease .2s, transform .6s var(--ease) .2s; }
@media (max-width: 900px) { .callout { display: none; } }

/* --------------------------------- footer ---------------------------------- */
.sa-page .foot { margin-top: 0; }

/* ----------------------------- reduced motion ------------------------------ */
@media (prefers-reduced-motion: reduce) {
  .cta-strip, .act.like.is-on svg { transition: none; animation: none; }
  .js .callout .ln { stroke-dashoffset: 0; transition: none; }
  .js .callout .ar, .js .callout .bubble { opacity: 1; transform: rotate(-3deg); transition: none; }
  .sa__eyebrow i { box-shadow: none; }
}

/* ---- mobile hardening (references/mobile.md) ---- */
*, *::before, *::after { box-sizing: border-box; }
img, svg, video, canvas, iframe { max-width: 100%; height: auto; }
p, li, td, th, blockquote, figcaption, h1, h2, h3, h4, h5, h6 { overflow-wrap: anywhere; }
table, pre { display: block; max-width: 100%; overflow-x: auto; }
@media (max-width: 700px) {
  [class*="row"], [class*="stack"] > *, [class*="item"], .it { flex-wrap: wrap; }
  .tag, [class*="badge"], [class*="pill"] { margin-left: 0; }
  [style*="grid-template-columns"], [class*="grid"] { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .tok-merge, .tok-link, code { white-space: normal; }
}
/* the phone is a fixed-size specimen: keep its own icon sizes after the hardening block */
.ig-ico, .actions .act svg, .post-head .more svg, .tabbar svg, .cta-strip svg { height: 24px; }
.cta-strip svg { height: 16px; }
.tabbar svg { height: 26px; }
.tabbar .me svg { height: 27px; }
.comment-row .me svg { height: 24px; }
.comment-row { flex-wrap: nowrap; }
