/* The phone feed (Gary, Nov 16, approved mock-up): scrolls like Instagram. The vertical trailers, then posts from the public
   boards, a Street Gonzo Shop item after every 5 posts, then the end of the line. Phones only; desktop never shows it.
   The rest of the homepage steps aside on phones once the feed has loaded (body.feed-ready), so if the feed can't load the
   old homepage is still there. */
.phone-feed { display:none; }
@media (max-width:767.98px) {
  .feed-ready .street-section, .feed-ready .videos-section, .feed-ready .shop-section, .feed-ready .fringe-section, .feed-ready .hire-section, .feed-ready .tips-section, .feed-ready .audio-section, .feed-ready .writing-section { display:none; }
  .has-feed .home-intro { min-height:calc(var(--sg-vh,100svh) - var(--header-h,65px) - 28px); margin-bottom:0; }
  body.has-feed .home-main > .phone-feed { display:block; position:relative; width:100vw; max-width:none; margin:0 calc(50% - 50vw); background:#000; color:#f2f2f2; font:15px/1.35 -apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif; }

  .ig-post { border-bottom:1px solid #222; padding-bottom:12px; }
  .ig-head { display:flex; align-items:center; gap:10px; padding:10px 12px; }
  .ig-av { width:34px; height:34px; border-radius:50%; overflow:hidden; background:#333; flex:none; box-shadow:0 0 0 2px #000, 0 0 0 3.5px #ff2a1f; }
  .ig-av img { width:100%; height:100%; object-fit:cover; display:block; }
  .ig-who { display:flex; flex-direction:column; line-height:1.2; min-width:0; flex:1; color:inherit; text-decoration:none; }
  .ig-who b { font-size:.92rem; }
  .ig-who small { color:#aaa; font-size:.78rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .ig-follow { border:0; border-radius:8px; background:#262626; color:#fff; font-weight:700; font-size:.85rem; padding:7px 14px; }
  .ig-follow.is-on { background:transparent; color:#aaa; box-shadow:inset 0 0 0 1px #444; }

  .ig-media { position:relative; display:block; width:100%; max-height:calc(var(--sg-vh,100svh) * .75); background:#111; overflow:hidden; }
  .ig-track { display:flex; height:100%; overflow-x:auto; scroll-snap-type:x mandatory; scrollbar-width:none; overscroll-behavior-x:contain; }
  .ig-track::-webkit-scrollbar { display:none; }
  .ig-track img { flex:0 0 100%; width:100%; height:100%; object-fit:cover; scroll-snap-align:center; display:block; }
  .ig-count { position:absolute; top:12px; right:12px; background:rgba(0,0,0,.7); color:#fff; font-size:.78rem; font-weight:600; padding:4px 9px; border-radius:12px; pointer-events:none; }
  .ig-dots { display:flex; justify-content:center; gap:4px; margin-top:8px; }
  .ig-dots i { width:6px; height:6px; border-radius:50%; background:#555; }
  .ig-dots i.on { background:#ff2a1f; }
  .ig-textcard { aspect-ratio:1; display:grid; place-items:center; padding:32px; background:radial-gradient(circle at 30% 20%,#3a0d0a,#0b0b0b 70%); border-block:1px solid #2a1210; text-decoration:none; }
  .ig-textcard p { margin:0; font-family:Anton,Impact,"Arial Narrow",sans-serif; font-size:2rem; line-height:1.05; text-transform:uppercase; color:#ff3b2b; text-shadow:0 0 10px rgba(255,42,31,.6); text-align:center; overflow-wrap:anywhere; }

  .ig-actions { display:flex; align-items:center; gap:14px; padding:8px 8px 2px; }
  .ig-btn { display:inline-flex; align-items:center; gap:5px; min-height:40px; padding:0 4px; border:0; background:none; color:#f2f2f2; font:700 .9rem/1 inherit; }
  .ig-btn:focus { outline:none; }
  .ig-btn:focus-visible { outline:2px solid #36c6d6; outline-offset:2px; border-radius:6px; }
  .ig-vote { display:inline-flex; align-items:center; gap:2px; }
  .ig-vote .ig-btn { padding:0 2px; }
  .ig-up.is-on { color:#ff3b2b; }
  .ig-down.is-on { color:#36c6d6; }
  .ig-save { margin-left:auto; }
  .ig-save.is-on svg path { fill:currentColor; }

  .ig-cap { margin:4px 12px 0; font-size:.92rem; overflow-wrap:anywhere; }
  .ig-cap a { color:inherit; text-decoration:none; }
  .ig-title { font-weight:700; color:#fff; }
  .ig-moretxt, .ig-viewall { color:#999; }
  .ig-viewall { display:block; margin:6px 12px 0; font-size:.9rem; text-decoration:none; }
  .ig-film { color:#ff3b2b !important; font-weight:700; }
  .ig-add { display:flex; align-items:center; gap:8px; margin:8px 12px 0; }
  .ig-add input { flex:1; min-width:0; min-height:36px; padding:6px 0; border:0; border-bottom:1px solid #333; background:none; color:#f2f2f2; font:inherit; font-size:.9rem; }
  .ig-add input:focus { outline:none; border-bottom-color:#ff3b2b; }
  .ig-add button { border:0; background:none; color:#ff3b2b; font-weight:700; font-size:.9rem; padding:6px 2px; }
  .ig-add button[hidden] { display:none; }
  .ig-mine { margin:6px 12px 0; font-size:.9rem; }
  .ig-time { margin:6px 12px 0; color:#777; font-size:.74rem; }
  .ig-time a { color:inherit; }

  .ig-ad .ig-media { aspect-ratio:1; }
  .ig-ad .ig-media img { width:100%; height:100%; object-fit:cover; display:block; }
  .ig-shopbar { display:flex; justify-content:space-between; align-items:center; gap:10px; padding:12px; background:#c2241a; color:#fff !important; font-weight:700; font-size:.9rem; text-decoration:none; }

  .ig-reel { aspect-ratio:4/5; }
  .ig-reel .feed-player { position:absolute; inset:0; display:grid; place-items:center; }
  .ig-reel .feed-player::before { content:""; width:34px; height:34px; border-radius:50%; border:3px solid rgba(255,255,255,.18); border-top-color:#ff3b2b; animation:feed-spin .9s linear infinite; }
  .ig-reel.is-loaded .feed-player::before { display:none; }
  .ig-reel.is-unavailable .feed-player::before { content:"This clip can’t play right now."; width:auto; height:auto; border:0; animation:none; color:#aaa; font-size:.9rem; }
  .ig-reel iframe { position:absolute; inset:0; width:100%; height:100%; border:0; pointer-events:none; }
  /* Gary, Nov 18: the first clip's first frame shows with the page, then the video plays over it */
  .ig-reel .feed-poster, .ig-reel video { position:absolute; inset:0; width:100%; height:100%; object-fit:contain; background:transparent; pointer-events:none; }
  .ig-reel .feed-poster { background:#000; }
  .ig-reel:has(.feed-poster) .feed-player::before { display:none; }
  .feed-sound { position:absolute; top:auto; right:12px; bottom:12px; z-index:2; min-height:34px; padding:5px 12px; border:1.5px solid rgba(255,255,255,.55); border-radius:18px; background:rgba(0,0,0,.6); color:#fff; font-size:.8rem; font-weight:700; }
  .feed-sound-on, .sound-on .feed-sound-off { display:none; }
  .sound-on .feed-sound-on { display:inline; }

  .ig-loading { margin:0; padding:28px 16px; text-align:center; color:#888; font-size:.9rem; }
  .ig-loading[hidden] { display:none; }
  .ig-toast { position:fixed; left:50%; bottom:calc(24px + env(safe-area-inset-bottom,0px)); z-index:1500; transform:translateX(-50%); padding:10px 16px; border-radius:20px; background:#222; color:#fff; font-size:.88rem; box-shadow:0 6px 20px rgba(0,0,0,.6); }

  /* The end of the line: glitching type, a blinking cursor, and a nudge to post. */
  .ig-end { min-height:70svh; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:26px; padding:40px max(16px, env(safe-area-inset-left,0px)); text-align:center; background:#000 repeating-linear-gradient(0deg, rgba(255,255,255,.03) 0 1px, transparent 1px 3px); }
  .ig-end[hidden] { display:none; }
  .feed-end-line { position:relative; margin:0; font-family:"Courier New",ui-monospace,monospace; font-size:2rem; font-weight:700; letter-spacing:.02em; color:#fff; text-shadow:0 0 8px rgba(255,255,255,.35); animation:feed-jitter 3.2s steps(1) infinite; }
  .feed-end-line::before, .feed-end-line::after { content:attr(data-text); position:absolute; inset:0; text-align:left; pointer-events:none; opacity:.8; }
  .feed-end-line::before { color:#ff2a1f; transform:translate(-2px,0); clip-path:inset(0 0 55% 0); animation:feed-slice 2.4s steps(1) infinite; }
  .feed-end-line::after { color:#36c6d6; transform:translate(2px,0); clip-path:inset(50% 0 0 0); animation:feed-slice 1.9s steps(1) infinite reverse; }
  .feed-cursor { animation:feed-blink 1s steps(1) infinite; }
  .ig-prompt { width:min(100%,340px); padding:18px; border:1.5px solid #ff3b2b; border-radius:10px; background:rgba(20,8,8,.92); box-shadow:0 0 18px rgba(255,42,31,.35); }
  .ig-prompt-k { margin:0; color:#36c6d6; font-size:.72rem; letter-spacing:.1em; text-transform:uppercase; font-weight:700; }
  .ig-prompt-t { margin:6px 0 14px; font-weight:700; }
  .ig-prompt-btn { display:inline-block; padding:10px 20px; border-radius:8px; background:#ff2a1f; color:#fff !important; font-weight:700; text-decoration:none; }
  .feed-top { color:#aaa; font-size:.9rem; }
}
@keyframes feed-spin { to { transform:rotate(360deg); } }
@keyframes feed-blink { 50% { opacity:0; } }
@keyframes feed-jitter { 0%,86%,100% { transform:none; } 88% { transform:translate(3px,-1px) skewX(-6deg); } 92% { transform:translate(-2px,1px); } }
@keyframes feed-slice { 0%,70%,100% { clip-path:inset(0 0 55% 0); } 74% { clip-path:inset(20% 0 40% 0); } 80% { clip-path:inset(60% 0 10% 0); } }
@media (prefers-reduced-motion:reduce) { .feed-end-line, .feed-end-line::before, .feed-end-line::after, .feed-cursor, .ig-reel .feed-player::before { animation:none; } }
/* Instagram-style buttons (Gary, Nov 16, approved mock-up): double-tap upvote, comments and send sheets, Sent and Saved. */
.ig-textcard { position:relative; }
.ig-burst { position:absolute; left:50%; top:50%; z-index:3; width:120px; height:120px; margin:-60px 0 0 -60px; pointer-events:none; animation:ig-burst .9s ease-out forwards; }
.ig-burst svg { width:100%; height:100%; fill:#ff3b2b; stroke:#fff; stroke-width:1.2; stroke-linejoin:round; filter:drop-shadow(0 4px 14px rgba(0,0,0,.55)); }
@keyframes ig-burst { 0% { transform:scale(.2); opacity:0; } 15% { transform:scale(1.15); opacity:1; } 30% { transform:scale(.95); } 45% { transform:scale(1); opacity:1; } 80% { transform:translateY(-10px) scale(1); opacity:1; } 100% { transform:translateY(-40px) scale(.9); opacity:0; } }
.ig-pill { position:absolute; left:50%; top:50%; z-index:3; transform:translate(-50%,-50%); padding:9px 18px; border-radius:10px; background:rgba(20,20,20,.88); color:#fff; font-weight:700; font-size:.95rem; pointer-events:none; animation:ig-pill 1.6s ease forwards; }
@keyframes ig-pill { 0% { opacity:0; transform:translate(-50%,-40%) scale(.9); } 12%, 75% { opacity:1; transform:translate(-50%,-50%) scale(1); } 100% { opacity:0; } }
.ig-saved { position:fixed; left:12px; right:12px; bottom:calc(16px + env(safe-area-inset-bottom,0px)); z-index:1500; display:flex; align-items:center; gap:12px; padding:10px 14px 10px 10px; border-radius:12px; background:#262626; color:#fff; box-shadow:0 8px 24px rgba(0,0,0,.6); animation:ig-saved-in .25s ease; transition:opacity .3s, transform .3s; }
.ig-saved.is-going { opacity:0; transform:translateY(20px); }
@keyframes ig-saved-in { from { opacity:0; transform:translateY(20px); } }
.ig-sthumb { flex:none; display:grid; place-items:center; width:40px; height:40px; border-radius:6px; overflow:hidden; background:#3a0d0a; color:#ff3b2b; font:700 .8rem Arial,sans-serif; }
.ig-sthumb img { width:100%; height:100%; object-fit:cover; }
.ig-swords { flex:1; min-width:0; display:flex; flex-direction:column; } .ig-swords b { font-size:.95rem; } .ig-swords small { color:#c9c9c9; font-size:.8rem; }
.ig-sall { flex:none; color:#fff; font-weight:700; text-decoration:none; font-size:.9rem; }
@media (prefers-reduced-motion:reduce) { .ig-burst, .ig-pill, .ig-sheet, .ig-sheet-back, .ig-saved { animation-duration:.01s; } }
/* Gary, Nov 16: a vote fills its arrow solid: green up, red down. */
.ig-up.is-on { color:#2fd35b !important; } .ig-down.is-on { color:#ff3b2b !important; }
.ig-up.is-on svg path, .ig-down.is-on svg path { fill:currentColor; }
.ig-cup.is-on { color:#2fd35b; }
.ig-burst svg { fill:#2fd35b; }
/* Gary, Nov 16 (his Instagram recordings): a tapped post opens on its own over the feed. */
html.ig-view-open, html.ig-view-open body { overflow:hidden; }
html.ig-view-open #sg-messenger { display:none !important; }
.ig-viewer { position:fixed; inset:0; z-index:1550; display:flex; flex-direction:column; background:#000; color:#f2f2f2; font:15px/1.35 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif; animation:ig-view-in .22s cubic-bezier(.2,.8,.2,1); }
.ig-viewer.is-closing { transform:translateX(100%); transition:transform .2s ease; }
@keyframes ig-view-in { from { transform:translateX(100%); } }
.ig-vbar { flex:none; display:flex; align-items:center; gap:6px; height:calc(52px + env(safe-area-inset-top,0px)); padding:env(safe-area-inset-top,0px) max(8px,env(safe-area-inset-right,0px)) 0 max(4px,env(safe-area-inset-left,0px)); border-bottom:1px solid #1d1d1d; background:#000; }
.ig-vbar b { font:700 17px Arial,Helvetica,sans-serif; }
.ig-vback { display:grid; place-items:center; width:42px; height:42px; padding:0; border:0; background:none; color:#f2f2f2; }
.ig-vbody { flex:1; overflow-y:auto; overscroll-behavior:contain; -webkit-overflow-scrolling:touch; padding-bottom:calc(24px + env(safe-area-inset-bottom,0px)); }
.ig-viewer .ig-post { border-bottom:0; }
.ig-viewer .ig-cap { white-space:pre-wrap; }
.ig-vboard { display:block; width:max-content; max-width:calc(100% - 24px); margin:14px 12px 0; padding:8px 16px; border:1px solid #3a3a3a; border-radius:999px; color:#e6e6e6; font-size:.85rem; font-weight:700; text-decoration:none; }
/* A crosspost: the original in a box, like on the board. */
.ig-source { display:grid; gap:6px; margin:0 12px; padding:12px; border:1px solid #333; border-radius:12px; background:#0d0d0d; color:#f2f2f2; text-decoration:none; }
.ig-source-board { font-size:.78rem; color:#36c6d6; }
.ig-source-title { font:700 1rem/1.25 Arial,Helvetica,sans-serif; }
.ig-source img { display:block; width:100%; height:auto; max-height:125vw; object-fit:cover; border-radius:8px; }
