/* XPARO social layer: the search feed (/all_blogs), project profiles
   (/p/<slug>), single posts (/post/<id>) and the inbox (/inbox).
   Instagram-like: one centred column of posts, a sticky top bar, a tray of
   round tool "stories", bottom sheets for comments and sharing.
   Light by default; dark when the OS asks for it (unless <html> has
   .light) or when <html> has .dark. */

.ig-root {
  --ig-bg: #fafafa;
  --ig-surface: #ffffff;
  --ig-surface-2: #f2f2f2;
  --ig-fg: #0f0f10;
  --ig-muted: #6b6b70;
  --ig-line: #e3e3e6;
  --ig-accent: #ea580c;
  --ig-accent-fg: #ffffff;
  --ig-link: #0b63c4;
  --ig-like: #ff3040;
  /* XPARO's own ring: the logo's orange and teal */
  --ig-ring: conic-gradient(from 200deg, #ff7722, #ffb347, #2ab3b1, #257287, #ff7722);
  --ig-shadow: 0 10px 40px rgba(0, 0, 0, 0.18);
  --ig-radius: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not(.light) .ig-root {
    --ig-bg: #000000;
    --ig-surface: #0d0d0f;
    --ig-surface-2: #1c1c1f;
    --ig-fg: #f5f5f5;
    --ig-muted: #a8a8ad;
    --ig-line: #262629;
    --ig-link: #6cb4ff;
    --ig-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
    color-scheme: dark;
  }
}
:root.dark .ig-root {
  --ig-bg: #000000;
  --ig-surface: #0d0d0f;
  --ig-surface-2: #1c1c1f;
  --ig-fg: #f5f5f5;
  --ig-muted: #a8a8ad;
  --ig-line: #262629;
  --ig-link: #6cb4ff;
  --ig-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

/* style.css pins html and body to the viewport (overflow: hidden) and
   scrolls inside body; social pages scroll the window, like Instagram, so
   the browser bar can collapse on phones and the top bar stays sticky. */
html.ig-doc, html.ig-doc body, html:has(> body.ig-page), body.ig-page { height: auto; min-height: 100%; overflow: visible; }
html.ig-doc, html:has(> body.ig-page) { overflow-x: clip; }
/* the page keeps the site's own animated gradient (style.css .header--bg) behind glass panels */

.ig-root {
  background: var(--ig-bg);
  color: var(--ig-fg);
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  padding-bottom: 96px; /* clear of the site's bottom menu pill */
}
/* Resets at one-class specificity: they beat Bootstrap's bare a/button
   rules, and every .ig-* rule further down (same weight, later) beats them. */
.ig-root :where(*, *::before, *::after) { box-sizing: border-box; }
.ig-root :where(a) { color: inherit; text-decoration: none; }
/* Bootstrap colours and underlines a:hover at (0,1,1); links that need a colour set it with !important */
.ig-root a:hover, .ig-sheet-backdrop a:hover { color: inherit; text-decoration: none; }
.ig-root :where(button) { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; border-radius: 0; }
.ig-root :where(img, video) { display: block; max-width: 100%; }
.ig-root :where(:focus-visible) { outline: 2px solid var(--ig-accent); outline-offset: 2px; border-radius: 6px; }
.ig-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ig-icon { width: 24px; height: 24px; flex: none; }
.ig-icon-sm { width: 16px; height: 16px; flex: none; }

/* ------------------------------------------------------------ top bar */
.ig-top {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--ig-bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--ig-line);
}
.ig-top-row {
  max-width: 1010px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
}
.ig-brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 20px; letter-spacing: 0.02em; flex: none; }
.ig-brand img { width: 30px; height: 28px; }
.ig-brand span span { color: var(--ig-accent); }
@media (max-width: 560px) { .ig-brand-word { display: none; } }
.ig-search {
  flex: 1;
  min-width: 0;
  position: relative;
  display: flex;
  align-items: center;
}
.ig-search svg { position: absolute; left: 12px; color: var(--ig-muted); pointer-events: none; }
.ig-search input {
  width: 100%;
  height: 38px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--ig-surface-2);
  color: var(--ig-fg);
  padding: 0 36px 0 38px;
  font-size: 15px;
  outline: none;
}
.ig-search input:focus { border-color: var(--ig-accent); background: var(--ig-surface); }
.ig-search input::placeholder { color: var(--ig-muted); }
.ig-search-clear {
  position: absolute; right: 8px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--ig-muted) !important; color: var(--ig-bg) !important; font-size: 12px; line-height: 22px; text-align: center;
}
.ig-top-icons { display: flex; align-items: center; gap: 6px; flex: none; }
.ig-icon-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; }
.ig-icon-btn:hover { background: var(--ig-surface-2); }
.ig-badge {
  position: absolute; top: 3px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--ig-like); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
  border: 2px solid var(--ig-bg);
}
.ig-badge[hidden] { display: none; }

.ig-tabs-row {
  max-width: 1010px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px 8px;
  overflow-x: auto;
  scrollbar-width: none;
  transition: max-height 0.25s ease, padding 0.25s ease, opacity 0.2s ease;
  max-height: 60px;
}
.ig-tabs-row::-webkit-scrollbar { display: none; }
.ig-tab {
  flex: none; padding: 6px 14px; border-radius: 999px; font-weight: 600; font-size: 13px;
  background: var(--ig-surface-2); color: var(--ig-fg);
}
.ig-tab.is-on { background: var(--ig-fg); color: var(--ig-bg); }
.ig-tab-sep { flex: none; width: 1px; height: 20px; background: var(--ig-line); margin: 0 4px; }
.ig-chip { flex: none; padding: 5px 12px; border-radius: 999px; font-size: 13px; border: 1px solid var(--ig-line); }
.ig-chip.is-on { border-color: var(--ig-accent); color: var(--ig-accent); font-weight: 600; }

.ig-filters {
  max-width: 1010px; margin: 0 auto; padding: 0 16px 10px; display: none; flex-wrap: wrap; gap: 8px;
}
.ig-filters.is-open { display: flex; }
.ig-filter { display: flex; align-items: center; gap: 6px; border: 1px solid var(--ig-line); border-radius: 10px; padding: 4px 10px; background: var(--ig-surface); }
.ig-filter label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ig-muted); margin: 0; }
.ig-filter select, .ig-filter input { background: transparent; border: 0; color: var(--ig-fg); font-size: 13px; outline: none; }
.ig-filter select option { color: #000; }

/* ------------------------------------------------------------ layout */
.ig-layout {
  max-width: 1010px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  gap: 48px;
  padding: 16px 16px 0;
}
.ig-feed { width: 100%; max-width: 480px; min-width: 0; }
.ig-side { width: 300px; flex: none; display: none; }
@media (min-width: 1000px) {
  .ig-side { display: block; }
  .ig-side-inner { position: sticky; top: 120px; }
}
@media (max-width: 520px) {
  .ig-layout { padding: 8px 0 0; }
  .ig-feed { max-width: none; }
}

/* ------------------------------------------------------------ stories tray (tools) */
.ig-stories {
  display: flex; gap: 14px; overflow-x: auto; padding: 4px 4px 14px; margin-bottom: 8px;
  scroll-snap-type: x proximity; scrollbar-width: none; border-bottom: 1px solid var(--ig-line);
}
.ig-stories::-webkit-scrollbar { display: none; }
.ig-story { flex: none; width: 72px; display: flex; flex-direction: column; align-items: center; gap: 6px; scroll-snap-align: start; }
.ig-story-ring {
  width: 66px; height: 66px; border-radius: 50%; padding: 3px; background: var(--ig-ring);
  transition: transform 0.15s ease;
}
.ig-story:hover .ig-story-ring { transform: scale(1.05); }
.ig-story-ring span {
  width: 100%; height: 100%; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--ig-surface); border: 3px solid var(--ig-bg); font-size: 26px; overflow: hidden;
}
.ig-story-ring img { width: 100%; height: 100%; object-fit: cover; }
.ig-story-label { font-size: 12px; max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ig-fg); }
@media (max-width: 520px) { .ig-stories { padding-left: 12px; padding-right: 12px; } }

/* ------------------------------------------------------------ avatars */
.ig-avatar {
  flex: none; width: 34px; height: 34px; border-radius: 50%; padding: 2px; background: var(--ig-ring); display: block;
}
.ig-avatar > img, .ig-avatar > span {
  width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 2px solid var(--ig-surface);
  display: flex; align-items: center; justify-content: center; background: var(--ig-surface-2); font-weight: 700; font-size: 13px;
}
.ig-avatar.is-plain { background: var(--ig-line); }
.ig-avatar-lg { width: 150px; height: 150px; padding: 4px; }
.ig-avatar-lg > img, .ig-avatar-lg > span { border-width: 4px; font-size: 54px; }
@media (max-width: 640px) { .ig-avatar-lg { width: 86px; height: 86px; padding: 3px; } .ig-avatar-lg > span { font-size: 32px; } }
.ig-avatar-md { width: 44px; height: 44px; }
.ig-avatar-xs { width: 26px; height: 26px; padding: 1px; }
.ig-avatar-xs > span { font-size: 10px; border-width: 1px; }

/* ------------------------------------------------------------ post card */
.ig-post {
  background: var(--ig-surface);
  border: 1px solid var(--ig-line);
  border-radius: var(--ig-radius);
  margin: 0 0 18px;
  overflow: hidden;
}
@media (max-width: 520px) {
  .ig-post { border-radius: 0; border-left: 0; border-right: 0; margin-bottom: 10px; }
}
.ig-post-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.ig-post-who { min-width: 0; flex: 1; }
.ig-post-name { display: flex; align-items: center; gap: 6px; font-weight: 600; white-space: nowrap; overflow: hidden; }
.ig-post-name a { overflow: hidden; text-overflow: ellipsis; }
.ig-post-sub { font-size: 12px; color: var(--ig-muted); }
.ig-kind {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; padding: 1px 6px; border-radius: 4px;
  background: var(--ig-surface-2); color: var(--ig-muted);
}
.ig-follow-link { color: var(--ig-accent) !important; font-weight: 700; font-size: 13px; }
.ig-follow-link.is-following { color: var(--ig-muted) !important; font-weight: 600; }
.ig-more { width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.ig-more:hover { background: var(--ig-surface-2); }

/* actions */
.ig-actions { display: flex; align-items: center; gap: 4px; padding: 6px 8px 0; }
.ig-act { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; transition: transform 0.12s ease; }
.ig-act:hover { color: var(--ig-muted); }
.ig-act:active { transform: scale(0.85); }
.ig-act .on { display: none; }
.ig-act.is-on .on { display: block; }
.ig-act.is-on .off { display: none; }
.ig-like.is-on { color: var(--ig-like); }
.ig-like.is-pop { animation: ig-pop 0.35s ease; }
@keyframes ig-pop { 40% { transform: scale(1.3); } 100% { transform: scale(1); } }
.ig-spacer { flex: 1; }
.ig-body { padding: 2px 14px 12px; }
.ig-likes { font-weight: 600; margin: 2px 0 4px; }
.ig-likes.is-zero { font-weight: 400; color: var(--ig-muted); }
.ig-caption { white-space: pre-line; word-wrap: break-word; }
.ig-caption.is-clamped { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: normal; }
.ig-caption b { font-weight: 600; margin-right: 4px; }
.ig-caption-more { color: var(--ig-muted); }
.ig-title { display: block; font-weight: 700; font-size: 15px; margin-bottom: 2px; }
.ig-cta {
  display: inline-flex; align-items: center; gap: 6px; margin: 8px 0 2px; color: var(--ig-accent) !important; font-weight: 600;
}
.ig-progress { height: 4px; border-radius: 4px; background: var(--ig-surface-2); margin: 8px 0 2px; overflow: hidden; }
.ig-progress i { display: block; height: 100%; background: linear-gradient(90deg, #ff7722, #ffb347); }
.ig-view-comments { color: var(--ig-muted); margin-top: 6px; display: block; }
.ig-preview-comments { margin-top: 4px; }
.ig-preview-comments p { margin: 2px 0; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ig-preview-comments b { font-weight: 600; margin-right: 4px; }
.ig-time { display: block; margin-top: 6px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.03em; color: var(--ig-muted); }
.ig-add-comment { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--ig-line); padding: 6px 14px; }
.ig-add-comment input, .ig-add-comment textarea { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ig-fg); padding: 8px 0; outline: none; font-size: 14px; }
.ig-add-comment input::placeholder, .ig-add-comment textarea::placeholder { color: var(--ig-muted); }
.ig-add-comment button { color: var(--ig-accent); font-weight: 700; }
.ig-add-comment button:disabled { opacity: 0.4; cursor: default; }

/* blog cards: main media (image, GIF or video) */
.xp-media-wrap { position: relative; }
.ig-media { position: relative; display: block; aspect-ratio: 1 / 1; max-height: 620px; overflow: hidden; background: var(--ig-surface-2); user-select: none; -webkit-user-select: none; }
.ig-media img, .ig-media video { width: 100%; height: 100%; object-fit: cover; }
.ig-media.is-blank { aspect-ratio: 16 / 10; }
.ig-cover-blank {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; padding: 24px; text-align: center;
  background: linear-gradient(135deg, #ff7722 0%, #e85d20 40%, #257287 100%); color: #fff; font-weight: 800; font-size: 22px; line-height: 1.2;
}
.xp-media-badge {
  position: absolute; top: 10px; left: 10px; display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px;
  background: rgba(0, 0, 0, 0.62); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; pointer-events: none;
}
.xp-sound {
  position: absolute; right: 10px; bottom: 10px; width: 32px; height: 32px; border-radius: 50% !important; display: inline-flex !important;
  align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.62) !important; color: #fff !important;
}
.ig-burst {
  position: absolute; left: 50%; top: 50%; width: 96px; height: 96px; margin: -48px 0 0 -48px; color: #fff; pointer-events: none;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.35)); opacity: 0; transform: scale(0.3);
}
.ig-burst.is-on { animation: ig-burst 0.9s ease forwards; }
@keyframes ig-burst {
  15% { opacity: 1; transform: scale(1.15); }
  30% { transform: scale(0.95); }
  45%, 80% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1) translateY(-30px); }
}
.xp-blog-title { margin: 4px 0 4px; font-size: 16px; font-weight: 700; line-height: 1.3; color: var(--ig-fg); text-align: left; font-family: inherit; }
.xp-hook { margin: 0 0 6px; color: var(--ig-fg); opacity: 0.86; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.xp-tags { margin: 0 0 6px; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.xp-tags a { color: var(--ig-accent) !important; font-weight: 600; font-size: 13px; }
.xp-read-row { display: flex; align-items: center; gap: 14px; margin: 8px 0 2px; }
.xp-read { font-weight: 600; font-size: 13px; padding: 5px 12px !important; border-radius: 999px !important; border: 1px solid var(--ig-line) !important; }
.xp-read.is-primary { display: inline-flex; align-items: center; gap: 4px; border-color: transparent !important; color: var(--ig-accent) !important; padding-left: 0 !important; }
.ig-kind.is-draft { background: #f59e0b; color: #1c1917; }

/* the same card in a grid (project websites, "More from" under a blog) */
.xp-blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 20px; align-items: start; }
.xp-blog-grid .ig-post { margin: 0; border-radius: var(--ig-radius) !important; border: 1px solid var(--ig-line) !important; }
.ig-root.ig-inline { min-height: 0; padding-bottom: 0; background: transparent; }

/* the blog preview popup: an iframe of /blog/<slug>/preview and the card's buttons */
.xp-preview .ig-sheet { max-width: 760px; height: 92vh; max-height: 92vh; }
.xp-preview .ig-sheet-body { flex: 1; overflow: hidden; display: flex; }
.xp-preview-frame { flex: 1; width: 100%; border: 0; display: block; background: var(--ig-surface); }
.xp-preview .ig-sheet-foot { padding: 4px 8px; }
.xp-preview-bar { border: 0 !important; margin: 0 !important; border-radius: 0 !important; background: transparent !important; }
.xp-preview-bar .ig-actions { padding: 0; flex-wrap: wrap; }
.ig-likes.is-inline { margin: 0 0 0 6px; font-size: 13px; }
@media (max-width: 440px) { .xp-preview-bar .ig-likes.is-inline { display: none; } }
.ig-sheet-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* comments on the blog page itself */
.xp-comments { max-width: 720px; margin: 0 auto; padding: 8px 0 24px; }
.xp-comments h2 { font-size: 20px; font-weight: 800; margin: 0 0 8px; color: var(--ig-fg); }
.xp-comments [data-form] { margin-top: 10px; border-top: 1px solid var(--ig-line); padding-top: 10px; }
.ig-empty.is-small { padding: 28px 10px; }
.ig-comments-off { text-align: center; color: var(--ig-muted); margin: 6px 0; }
.ig-toast a { color: #ffb27a !important; font-weight: 700; margin-left: 8px; }

/* docs + ads (no social actions) */
.ig-plain-card { background: var(--ig-surface); border: 1px solid var(--ig-line); border-radius: var(--ig-radius); margin: 0 0 18px; overflow: hidden; }
.ig-plain-card .ig-sponsored { font-size: 12px; color: var(--ig-muted); padding: 10px 12px 0; }
.ig-plain-card .ig-ad-slot { padding: 8px 12px 12px; min-height: 120px; }
@media (max-width: 520px) { .ig-plain-card { border-radius: 0; border-left: 0; border-right: 0; } }
.ig-docs-cover { position: relative; aspect-ratio: 16 / 9; }
.ig-docs-cover img { width: 100%; height: 100%; object-fit: cover; }

/* carousels inside the feed (tools, suggested projects) */
.ig-strip { background: var(--ig-surface); border: 1px solid var(--ig-line); border-radius: var(--ig-radius); margin: 0 0 18px; padding: 12px 0; }
@media (max-width: 520px) { .ig-strip { border-radius: 0; border-left: 0; border-right: 0; } }
.ig-strip-head { display: flex; justify-content: space-between; align-items: baseline; padding: 0 14px 10px; font-weight: 600; }
.ig-strip-head a { color: var(--ig-link) !important; font-size: 13px; font-weight: 600; }
.ig-strip-track { display: flex; gap: 10px; overflow-x: auto; padding: 0 14px 4px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.ig-mini {
  flex: 0 0 170px; scroll-snap-align: start; border: 1px solid var(--ig-line); border-radius: 10px; padding: 16px 12px 12px;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; background: var(--ig-surface);
}
.ig-mini-icon { width: 64px; height: 64px; border-radius: 50%; background: var(--ig-surface-2); display: flex; align-items: center; justify-content: center; font-size: 30px; }
.ig-mini b { font-size: 13px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ig-mini small { font-size: 12px; color: var(--ig-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ig-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 16px; border-radius: 8px;
  background: var(--ig-accent) !important; color: var(--ig-accent-fg) !important; font-weight: 600; font-size: 14px; white-space: nowrap;
}
.ig-btn:hover { filter: brightness(1.07); }
.ig-btn.is-secondary, .ig-btn.is-following { background: var(--ig-surface-2) !important; color: var(--ig-fg) !important; }
.ig-btn.is-block { width: 100%; }
.ig-mini .ig-btn { margin-top: auto; width: 100%; }

/* account rows (search results, sidebar) */
.ig-accounts { margin-bottom: 16px; }
.ig-accounts h2, .ig-side h2 { font-size: 14px; font-weight: 600; color: var(--ig-muted); margin: 6px 0 10px; }
.ig-account { display: flex; align-items: center; gap: 12px; padding: 6px 0; }
.ig-account-text { min-width: 0; flex: 1; }
.ig-account-text b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ig-account-text small { display: block; color: var(--ig-muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ig-side-tools a { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.ig-side-tools span { width: 32px; height: 32px; border-radius: 8px; background: var(--ig-surface-2); display: inline-flex; align-items: center; justify-content: center; }
.ig-side-foot { margin-top: 20px; font-size: 12px; color: var(--ig-muted); }
.ig-side-foot a { margin-right: 8px; }

.ig-empty { text-align: center; padding: 60px 20px; color: var(--ig-muted); }
.ig-empty-icon { width: 64px; height: 64px; border: 2px solid var(--ig-fg); border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 12px; color: var(--ig-fg); }
.ig-empty h3 { color: var(--ig-fg); font-size: 20px; font-weight: 800; margin: 0 0 6px; }

.ig-loader { display: flex; justify-content: center; padding: 20px 0; min-height: 40px; }
.ig-loader i { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--ig-line); border-top-color: var(--ig-accent); animation: ig-spin 0.7s linear infinite; display: none; }
.ig-loader.is-on i { display: block; }
@keyframes ig-spin { to { transform: rotate(360deg); } }
.ig-end { text-align: center; color: var(--ig-muted); padding: 20px 0 40px; font-size: 13px; }
.ig-skeleton { height: 520px; border-radius: var(--ig-radius); margin-bottom: 18px; background: linear-gradient(90deg, var(--ig-surface-2), var(--ig-surface), var(--ig-surface-2)); background-size: 200% 100%; animation: ig-shimmer 1.2s infinite; }
@keyframes ig-shimmer { to { background-position: -200% 0; } }

/* ------------------------------------------------------------ sheets (comments, share, activity, menus) */
.ig-sheet-backdrop {
  position: fixed; inset: 0; z-index: 4000; background: rgba(0, 0, 0, 0.55); display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; transition: opacity 0.2s ease;
}
.ig-sheet-backdrop.is-open { opacity: 1; }
.ig-sheet {
  width: 100%; max-width: 560px; max-height: 86vh; display: flex; flex-direction: column; background: var(--ig-surface); color: var(--ig-fg);
  border-radius: 16px 16px 0 0; box-shadow: var(--ig-shadow); transform: translateY(40px); transition: transform 0.25s ease;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.ig-sheet-backdrop.is-open .ig-sheet { transform: none; }
@media (min-width: 700px) {
  .ig-sheet-backdrop { align-items: center; }
  .ig-sheet { border-radius: 14px; max-height: 80vh; }
}
.ig-sheet-grip { width: 40px; height: 4px; border-radius: 2px; background: var(--ig-line); margin: 8px auto 0; }
@media (min-width: 700px) { .ig-sheet-grip { display: none; } }
.ig-sheet-head { display: flex; align-items: center; justify-content: center; position: relative; padding: 12px 48px; border-bottom: 1px solid var(--ig-line); font-weight: 700; font-size: 16px; }
.ig-sheet-close { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.ig-sheet-close:hover { background: var(--ig-surface-2); }
.ig-sheet-body { overflow-y: auto; padding: 8px 16px 16px; flex: 1; overscroll-behavior: contain; }
.ig-sheet-foot { border-top: 1px solid var(--ig-line); padding: 8px 12px; }
.ig-menu button, .ig-menu a { display: block; width: 100%; text-align: center; padding: 14px; border-bottom: 1px solid var(--ig-line); font-size: 14px; }
.ig-menu .is-danger { color: var(--ig-like) !important; font-weight: 700; }

.ig-comment { display: flex; gap: 10px; padding: 10px 0; }
.ig-comment-body { flex: 1; min-width: 0; }
.ig-comment-body p { margin: 0; word-wrap: break-word; white-space: pre-line; }
.ig-comment-body b { font-weight: 600; margin-right: 4px; }
.ig-comment-team { font-size: 10px; font-weight: 700; color: var(--ig-accent); text-transform: uppercase; margin-left: 4px; }
.ig-comment-meta { display: flex; gap: 14px; font-size: 12px; color: var(--ig-muted); margin-top: 4px; }
.ig-comment-meta button { color: var(--ig-muted); font-weight: 600; font-size: 12px; }
.ig-replies { margin-left: 44px; }
.ig-replies-toggle { color: var(--ig-muted) !important; font-size: 12px; font-weight: 600; margin: 2px 0 4px 44px; display: flex; align-items: center; gap: 8px; }
.ig-replies-toggle::before { content: ""; width: 24px; height: 1px; background: var(--ig-muted); }
.ig-comment-form { display: flex; align-items: center; gap: 10px; }
.ig-comment-form input, .ig-comment-form textarea { flex: 1; min-width: 0; border: 1px solid var(--ig-line); border-radius: 22px; padding: 10px 14px; background: var(--ig-surface-2); color: var(--ig-fg); outline: none; font-size: 14px; }
.ig-comment-form input:focus, .ig-comment-form textarea:focus { border-color: var(--ig-accent); }
.ig-comment-form button { color: var(--ig-accent); font-weight: 700; }
/* comment boxes are textareas (they keep paragraphs): same look as the old one-line input */
.ig-add-comment textarea, .ig-comment-form textarea { resize: none; font: inherit; font-size: 14px; line-height: 1.4; max-height: 160px; overflow-y: auto; }
/* style.css paints every textarea white on see-through white with !important
   (the dark dashboard forms): on these light cards and sheets what you typed was invisible */
.ig-add-comment textarea, .ig-comment-form textarea, .xp-rate-text { color: var(--ig-fg) !important; -webkit-text-fill-color: var(--ig-fg); }
.ig-add-comment textarea { background: transparent !important; }
.ig-comment-form textarea, .xp-rate-text { background: var(--ig-surface-2) !important; }
.ig-comment-count { color: var(--ig-muted); font-size: 12px; white-space: nowrap; }
.ig-comment-count.is-over { color: #e5484d; }
.ig-reply-to { font-size: 12px; color: var(--ig-muted); padding: 0 4px 6px; display: flex; justify-content: space-between; }
.ig-quick-emoji { display: flex; justify-content: space-around; padding: 4px 0 8px; font-size: 22px; }

.ig-share-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 6px; padding: 14px 0; }
.ig-share-grid button, .ig-share-grid a { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; text-align: center; }
.ig-share-grid span { width: 56px; height: 56px; border-radius: 50%; background: var(--ig-surface-2); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 18px; }
.ig-send-list { border-top: 1px solid var(--ig-line); padding-top: 10px; }
.ig-send-list h3 { font-size: 13px; color: var(--ig-muted); font-weight: 600; margin: 4px 0 6px; }
.ig-send-row { display: flex; align-items: center; gap: 12px; padding: 6px 0; }
.ig-send-row .ig-account-text b { font-size: 14px; }

.ig-activity-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.ig-activity-row.is-unread { background: color-mix(in srgb, var(--ig-accent) 8%, transparent); border-radius: 8px; padding: 8px; margin: 0 -8px; }
.ig-activity-row p { margin: 0; flex: 1; min-width: 0; }
.ig-activity-row p small { color: var(--ig-muted); }
.ig-activity-row img.ig-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; flex: none; }

.ig-toast {
  position: fixed; left: 50%; bottom: 80px; transform: translate(-50%, 20px); z-index: 5000; background: #262626; color: #fff;
  padding: 10px 16px; border-radius: 10px; font-size: 14px; opacity: 0; transition: opacity 0.2s, transform 0.2s; pointer-events: none;
  max-width: calc(100vw - 32px);
}
.ig-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* the menu pill's "Ask here...." search on the feed */
.search-form .ig-ask { display: flex; align-items: center; gap: 8px; width: 100%; margin: 0; }
.search-form .ig-ask input { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; font-size: 14px; color: var(--xp-nav-fg); }
.search-form .ig-ask input::placeholder { color: var(--xp-nav-muted); opacity: 1; }
.search-form .ig-ask img { width: 30px; height: 30px; border-radius: 50%; }

@media (prefers-reduced-motion: reduce) {
  .ig-root *, .ig-sheet, .ig-sheet-backdrop { animation: none !important; transition: none !important; }
}


/* ============================================================
   The search feed, alive: glass on the site's gradient, motion
   ============================================================ */
@property --xp-a { syntax: '<angle>'; inherits: false; initial-value: 0deg; }

.ig-root {
  --xp-glass: rgba(255, 255, 255, 0.78);
  --xp-glass-card: rgba(255, 255, 255, 0.9);
  --xp-glass-line: rgba(255, 255, 255, 0.6);
  --xp-glow: 0 18px 50px -18px rgba(20, 10, 40, 0.55);
  --xp-grad: linear-gradient(120deg, #ff7722, #ff4f6d 45%, #2ab3b1);
}
@media (prefers-color-scheme: dark) {
  :root:not(.light) .ig-root { --xp-glass: rgba(14, 14, 18, 0.72); --xp-glass-card: rgba(14, 14, 18, 0.86); --xp-glass-line: rgba(255, 255, 255, 0.09); }
}
:root.dark .ig-root { --xp-glass: rgba(14, 14, 18, 0.72); --xp-glass-card: rgba(14, 14, 18, 0.86); --xp-glass-line: rgba(255, 255, 255, 0.09); }

.ig-root.is-feed { background: transparent; }
.xp-glass {
  background: var(--xp-glass) !important;
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  border: 1px solid var(--xp-glass-line) !important;
  box-shadow: var(--xp-glow);
}
.is-feed .ig-post, .is-feed .ig-plain-card, .is-feed .ig-strip {
  background: var(--xp-glass-card);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-color: var(--xp-glass-line);
  box-shadow: var(--xp-glow);
}
.is-feed .ig-top { border-bottom: 1px solid var(--xp-glass-line); border-left: 0 !important; border-right: 0 !important; border-top: 0 !important; animation: xp-drop-in .6s cubic-bezier(.16,1,.3,1) both; }
.is-feed .ig-stories { border-radius: 18px; padding: 14px 12px 12px; margin-bottom: 14px; border-bottom: 0; }
.is-feed .ig-side-inner { border-radius: 18px; padding: 16px; }
.is-feed .ig-empty { border-radius: 18px; padding: 40px 20px; margin-bottom: 18px; background: var(--xp-glass-card); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border: 1px solid var(--xp-glass-line); box-shadow: var(--xp-glow); color: var(--ig-muted); }
.xp-side-link { color: var(--ig-link) !important; font-weight: 600; font-size: 12px; }

/* search: one ✕ (ours), glowing ring and a panel on focus */
.ig-search input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.xp-search-wrap { position: relative; flex: 1; min-width: 0; }
.xp-search-wrap .ig-search { position: relative; z-index: 0; transition: transform .35s cubic-bezier(.16,1,.3,1); }
.xp-search-wrap .ig-search::before {
  content: ""; position: absolute; inset: -2px; border-radius: 12px; z-index: -1; opacity: 0;
  background: conic-gradient(from var(--xp-a), #ff7722, #ffb347, #2ab3b1, #257287, #ff4f6d, #ff7722);
  transition: opacity .3s ease;
}
.xp-search-wrap.is-focus .ig-search { transform: scale(1.015); }
.xp-search-wrap.is-focus .ig-search::before { opacity: 1; animation: xp-spin 2.6s linear infinite; }
.xp-search-wrap.is-focus .ig-search input { background: var(--ig-surface); border-color: transparent; box-shadow: 0 10px 30px -12px rgba(255, 119, 34, .55); }
.ig-search input::placeholder { transition: opacity .18s ease, transform .18s ease; }
.ig-search input.is-swap::placeholder { opacity: 0; }
.xp-search-panel {
  position: absolute; left: 0; right: 0; top: calc(100% + 10px); z-index: 60; border-radius: 18px; padding: 14px;
  opacity: 0; transform: translateY(-10px) scale(.98); transform-origin: 50% 0;
  transition: opacity .22s ease, transform .3s cubic-bezier(.16,1,.3,1);
}
.xp-search-panel.is-open { opacity: 1; transform: none; }
.xp-panel-block + .xp-panel-block { margin-top: 12px; }
.xp-panel-head { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ig-muted); margin-bottom: 8px; }
.xp-panel-head button { color: var(--ig-link) !important; font-size: 12px; text-transform: none; letter-spacing: 0; }
.xp-panel-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.xp-panel-chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px !important; border-radius: 999px !important;
  background: var(--ig-surface-2) !important; font-size: 13px; font-weight: 600;
  transition: transform .2s ease, background .2s ease, color .2s ease;
}
.xp-search-panel.is-open .xp-panel-chip { animation: xp-chip-in .4s cubic-bezier(.16,1,.3,1) both; animation-delay: calc(var(--i, 0) * 35ms + 60ms); }
.xp-panel-chip:hover { transform: translateY(-2px); background: var(--xp-grad) !important; color: #fff !important; }
.xp-panel-chip.is-tag { color: var(--ig-accent); }
.xp-panel-chip.is-recent { padding: 0 !important; overflow: hidden; }
.xp-panel-chip.is-recent > button { padding: 6px 4px 6px 12px; font-weight: 600; }
.xp-panel-chip .xp-x { padding: 6px 10px 6px 6px !important; color: var(--ig-muted); }
.xp-dim { position: fixed; inset: 0; z-index: 45; background: rgba(8, 6, 20, .35); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); opacity: 0; transition: opacity .25s ease; }
.xp-dim.is-on { opacity: 1; }
.is-feed .ig-top { z-index: 50; }

/* tabs: a pill that slides to the tab you pick */
.xp-tabs { position: relative; display: flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--ig-surface-2); flex: none; }
.xp-tab-ink { position: absolute; top: 3px; bottom: 3px; left: 0; width: 0; border-radius: 999px; background: var(--ig-fg);
  transition: transform .45s cubic-bezier(.34,1.56,.64,1), width .45s cubic-bezier(.34,1.56,.64,1); }
.xp-tabs .ig-tab { position: relative; z-index: 1; background: transparent !important; transition: color .25s ease; }
.xp-tabs .ig-tab.is-on { color: var(--ig-bg) !important; }
.xp-chips { display: contents; }
.ig-chip { transition: transform .2s ease, background .25s ease, color .25s ease, border-color .25s ease, box-shadow .25s ease; background: var(--ig-surface); }
.ig-chip:hover { transform: translateY(-1px); }
.ig-chip.is-on { background: var(--xp-grad) !important; color: #fff !important; border-color: transparent !important; box-shadow: 0 6px 18px -8px rgba(255, 79, 109, .8); }
.xp-press { animation: xp-press .32s cubic-bezier(.34,1.56,.64,1); }

/* results: summary, compact project and tool matches */
.xp-summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-radius: 14px; padding: 10px 14px; margin-bottom: 14px; font-size: 14px; }
.xp-summary q { font-weight: 700; color: var(--ig-accent); }
.xp-summary-clear { font-weight: 700; font-size: 13px; color: var(--ig-accent) !important; padding: 4px 10px !important; border-radius: 999px !important; background: var(--ig-surface-2) !important; }
.xp-match { margin-bottom: 14px; }
.xp-match h2 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #fff; text-shadow: 0 1px 8px rgba(0,0,0,.35); margin: 0 0 8px 4px; }
.xp-match-row { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 8px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.xp-match-row::-webkit-scrollbar { display: none; }
.xp-match-card { flex: 0 0 150px; scroll-snap-align: start; border-radius: 16px; padding: 14px 10px 10px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.xp-match-name { font-weight: 700; font-size: 13px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.xp-match-card small { color: var(--ig-muted); font-size: 12px; }
.xp-match-card .ig-btn { margin-top: auto; width: 100%; height: 30px; font-size: 13px; }
.xp-tool-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.xp-tool-chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; transition: transform .2s ease; }
.xp-tool-chip:hover { transform: translateY(-2px) scale(1.03); }

/* results swap and loading */
#search-results-grid > * { transition: opacity .18s ease, transform .18s ease; }
#search-results-grid.is-leaving > * { opacity: 0; transform: translateY(14px) scale(.98); }
.xp-skel { border-radius: 16px; padding: 14px; margin-bottom: 18px; }
.xp-skel i { display: block; border-radius: 10px; background: linear-gradient(90deg, var(--ig-surface-2) 25%, var(--ig-line) 50%, var(--ig-surface-2) 75%); background-size: 200% 100%; animation: ig-shimmer 1.1s infinite; }
.xp-skel .a { width: 45%; height: 14px; } .xp-skel .b { height: 320px; margin: 12px 0; } .xp-skel .c { width: 70%; height: 14px; } .xp-skel .d { width: 40%; height: 12px; margin-top: 8px; }
.xp-loader { display: flex; justify-content: center; gap: 8px; padding: 22px 0; min-height: 60px; }
.xp-loader i { width: 10px; height: 10px; border-radius: 50%; opacity: 0; }
.xp-loader.is-on i { opacity: 1; animation: xp-bounce .9s ease-in-out infinite; }
.xp-loader i:nth-child(1) { background: #ff7722; } .xp-loader i:nth-child(2) { background: #ff4f6d; animation-delay: .12s !important; } .xp-loader i:nth-child(3) { background: #2ab3b1; animation-delay: .24s !important; }
.is-feed .ig-end { display: flex; flex-direction: column; align-items: center; gap: 4px; border-radius: 18px; padding: 22px; margin: 6px 0 40px; color: var(--ig-fg); }
.is-feed .ig-end span { color: var(--ig-muted); font-size: 13px; }
.xp-check { width: 46px; height: 46px; fill: none; stroke: var(--ig-accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.xp-check circle { stroke-dasharray: 151; stroke-dashoffset: 151; }
.xp-check path { stroke-dasharray: 40; stroke-dashoffset: 40; }
.ig-end:not([hidden]) .xp-check circle { animation: xp-draw .7s ease forwards; }
.ig-end:not([hidden]) .xp-check path { animation: xp-draw .4s .6s ease forwards; }

/* stories: spinning rings that pop in */
.ig-story-ring { background: conic-gradient(from var(--xp-a), #ff7722, #ffb347, #2ab3b1, #257287, #ff4f6d, #ff7722) !important; animation: xp-spin 7s linear infinite; }
.ig-story:hover .ig-story-ring { animation-duration: 1.4s; transform: translateY(-3px) scale(1.07); }
.ig-story { animation: xp-pop-in .55s cubic-bezier(.34,1.56,.64,1) both; animation-delay: calc(var(--i, 0) * 45ms + 150ms); }

/* scroll-in: cards rise and tip up into place (static/js/social.js) */
.xp-rv { opacity: 0; transform: perspective(1000px) translateY(48px) rotateX(16deg) scale(.95); transform-origin: 50% 100%; }
.xp-rv.is-in { opacity: 1; transform: none; transition: opacity .6s ease var(--d, 0ms), transform .85s cubic-bezier(.16,1,.3,1) var(--d, 0ms); }

/* 3D tilt + glare on card media (mouse) */
.xp-media-wrap { transition: transform .45s cubic-bezier(.16,1,.3,1); transform-style: preserve-3d; }
.xp-media-wrap.is-tilt { transform: perspective(900px) rotateX(var(--rx, 0)) rotateY(var(--ry, 0)) scale(1.015); transition-duration: .12s; z-index: 2; }
.xp-media-wrap::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s ease;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, .3), transparent 55%); }
.xp-media-wrap.is-tilt::after { opacity: 1; }

/* like: a 3D heart flip, a ring and sparks */
.ig-act { position: relative; }
.ig-like.is-pop .on { animation: xp-heart3d .75s cubic-bezier(.2,.9,.3,1.3); }
.ig-like.is-pop::after { content: ""; position: absolute; inset: 8px; border-radius: 50%; border: 2px solid #ff3040; animation: xp-ring .6s ease-out forwards; pointer-events: none; }
.ig-like .on { fill: url(#xp-heart-grad); color: #ff3040; }
.xp-sparks { position: fixed; width: 0; height: 0; pointer-events: none; z-index: 6000; }
.xp-sparks i { position: absolute; width: 7px; height: 7px; margin: -3.5px; border-radius: 50%; background: var(--c); animation: xp-spark .7s cubic-bezier(.2,.8,.3,1) forwards; }
.xp-sparks i.is-heart { width: 22px; height: 22px; margin: -11px; background: none; color: var(--c); animation: xp-heart-fly 1s cubic-bezier(.2,.8,.3,1) forwards; }
.xp-sparks i.is-heart svg { width: 100%; height: 100%; fill: currentColor; }
.ig-burst { width: 120px; height: 120px; margin: -60px 0 0 -60px; color: #ff3040; }
.ig-burst use { fill: url(#xp-heart-grad); }
.ig-burst.is-on { animation: xp-burst3d 1s cubic-bezier(.2,.9,.3,1.2) forwards; }
[data-act="save"].is-pop .on { animation: xp-drop .55s cubic-bezier(.34,1.56,.64,1); }
[data-act="share"].is-fly svg { animation: xp-fly .7s cubic-bezier(.3,.7,.4,1); }
.xp-follow-pop { animation: xp-pop .5s cubic-bezier(.34,1.56,.64,1); }
.xp-roll { animation: xp-roll .35s ease; }
.ig-toast.is-on { transition: opacity .2s, transform .45s cubic-bezier(.34,1.56,.64,1); }

@keyframes xp-spin { to { --xp-a: 360deg; } }
@keyframes xp-drop-in { from { transform: translateY(-100%); opacity: 0; } }
@keyframes xp-pop-in { from { opacity: 0; transform: scale(.6) translateY(10px); } }
@keyframes xp-chip-in { from { opacity: 0; transform: translateY(8px) scale(.9); } }
@keyframes xp-press { 40% { transform: scale(.9); } }
@keyframes xp-bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes xp-draw { to { stroke-dashoffset: 0; } }
@keyframes xp-heart3d {
  0% { transform: perspective(240px) rotateY(0) scale(.3); }
  40% { transform: perspective(240px) rotateY(200deg) scale(1.4); }
  70% { transform: perspective(240px) rotateY(330deg) scale(.92); }
  100% { transform: perspective(240px) rotateY(360deg) scale(1); }
}
@keyframes xp-ring { from { transform: scale(.5); opacity: 1; } to { transform: scale(1.7); opacity: 0; } }
@keyframes xp-spark { from { transform: translate(0, 0) scale(1); opacity: 1; } to { transform: translate(var(--dx), var(--dy)) scale(0); opacity: 0; } }
@keyframes xp-heart-fly {
  0% { transform: translate(0, 0) scale(.3) rotate(0); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(1) rotate(var(--rot)); opacity: 0; }
}
@keyframes xp-burst3d {
  0% { opacity: 0; transform: perspective(700px) scale(.2) rotateY(-120deg); }
  25% { opacity: 1; transform: perspective(700px) scale(1.25) rotateY(25deg); }
  45% { transform: perspective(700px) scale(.95) rotateY(-12deg); }
  60% { transform: perspective(700px) scale(1.05) rotateY(0); }
  85% { opacity: 1; transform: perspective(700px) scale(1) rotateY(0); }
  100% { opacity: 0; transform: perspective(700px) translateY(-50px) scale(.8) rotateY(0); }
}
@keyframes xp-drop { 0% { transform: translateY(-12px) scaleY(1.2); } 60% { transform: translateY(2px) scaleY(.85); } 100% { transform: none; } }
@keyframes xp-fly { 0% { transform: none; } 45% { transform: translate(20px, -20px) rotate(-14deg); opacity: 0; } 46% { transform: translate(-14px, 14px); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes xp-pop { 40% { transform: scale(1.15); } }
@keyframes xp-roll { from { transform: translateY(8px); opacity: .2; } }

@media (prefers-reduced-motion: reduce) {
  .xp-rv { opacity: 1 !important; transform: none !important; }
  .ig-story-ring, .ig-story, .is-feed .ig-top, .xp-search-wrap.is-focus .ig-search::before { animation: none !important; }
  .xp-tab-ink, .xp-search-panel, #search-results-grid > * { transition: none !important; }
}

/* the site's gradient stays put behind the feed instead of stretching over its full length */
body.xp-feed-page { background-attachment: fixed; background-size: 300% 300%; }
@media (max-width: 520px) {
  .is-feed .ig-stories { margin: 0 8px 12px; }
  .xp-summary, .xp-match { margin-left: 8px; margin-right: 8px; }
  .is-feed .ig-empty, .is-feed .ig-end { margin-left: 8px; margin-right: 8px; }
}

/* ============================================================
   Ad screen listings in the feed (ads/_feed_card.html): their own
   card, a little billboard with the brand's warm edge
   ============================================================ */
.ig-post.xp-listing {
  position: relative;
  border: 1px solid transparent !important;
  background:
    linear-gradient(var(--xp-glass-card), var(--xp-glass-card)) padding-box,
    linear-gradient(135deg, #ff7722, #ff4f6d 50%, #2ab3b1) border-box !important;
}
.xp-ls-mark { width: 34px; height: 34px; border-radius: 10px; flex: none; display: inline-flex; align-items: center; justify-content: center;
  color: #fff; background: linear-gradient(135deg, #ff7722, #ff4f6d); box-shadow: 0 6px 16px -6px rgba(255, 79, 109, .7); }
.xp-ls-kicker { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ig-accent); }
.xp-live { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); animation: xp-live 1.8s ease-out infinite; }
@keyframes xp-live { to { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); } }
.xp-ls-price { flex: none; font-weight: 800; font-size: 13px; color: #fff; padding: 5px 12px; border-radius: 999px; background: linear-gradient(120deg, #ff7722, #ff4f6d); white-space: nowrap; }
.xp-ls-media { position: relative; }
.xp-ls-photos { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; aspect-ratio: 16 / 10; background: #000; scrollbar-width: none; }
.xp-ls-photos::-webkit-scrollbar { display: none; }
.xp-ls-photos img { flex: 0 0 100%; width: 100%; height: 100%; object-fit: cover; scroll-snap-align: center; }
.xp-ls-count { position: absolute; right: 10px; bottom: 10px; padding: 2px 9px; border-radius: 999px; background: rgba(0, 0, 0, .62); color: #fff; font-size: 11px; font-weight: 700; pointer-events: none; }
.xp-ls-meta { margin: 0 0 8px; color: var(--ig-muted); font-size: 13px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.xp-ls-meta a { color: var(--ig-fg); font-weight: 600; }
.xp-ls-stars { color: #f59e0b; font-weight: 800; }
.xp-ls-facts { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0 0 8px; }
.xp-ls-facts li { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--ig-surface-2); }
.xp-ls-review { margin: 0 0 6px; font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.xp-ls-cta { height: 34px; gap: 4px; background: linear-gradient(120deg, #ff7722, #ff4f6d) !important; box-shadow: 0 8px 20px -10px rgba(255, 79, 109, .9); transition: transform .2s ease, box-shadow .2s ease; }
.xp-ls-cta:hover { transform: translateY(-1px); box-shadow: 0 12px 24px -10px rgba(255, 79, 109, 1); }
.xp-listing .xp-read-row { gap: 10px; }
.xp-ls-bar { display: flex; align-items: center; gap: 12px; padding: 4px 6px; }
.xp-ls-bar span { flex: 1; font-size: 13px; color: var(--ig-muted); }
@media (max-width: 440px) { .xp-ls-bar span { display: none; } .xp-ls-bar .ig-btn { width: 100%; } }
@media (prefers-reduced-motion: reduce) { .xp-live { animation: none; } }

/* ============================================================
   Trending badge on blog cards, and project cards in the feed
   (social/_project_card.html), laid out like blog posts: swipe
   photos/videos, star rating with feedback, share, open the website.
   ============================================================ */
.ig-kind.is-trending { background: linear-gradient(120deg, #ff7722, #ff4f6d); color: #fff; }
.ig-kind.is-project { background: linear-gradient(120deg, #2ab3b1, #257287); color: #fff; }
.xp-pc-media { position: relative; background: #000; }
.xp-pc-slides { display: flex; cursor: pointer; overflow-x: auto; scroll-snap-type: x mandatory; aspect-ratio: 4 / 3; scrollbar-width: none; overscroll-behavior-x: contain; }
.xp-pc-slides::-webkit-scrollbar { display: none; }
.xp-pc-slide { position: relative; flex: 0 0 100%; margin: 0; scroll-snap-align: center; }
.xp-pc-slide img, .xp-pc-slide video { width: 100%; height: 100%; object-fit: cover; display: block; }
.xp-pc-slide figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 12px 26px; font-size: 12px; color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, .65)); }
.xp-pc-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border-radius: 50%; border: 0;
  background: rgba(0, 0, 0, .55); color: #fff; font-size: 20px; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.xp-pc-nav[hidden] { display: none; }
.xp-pc-nav.is-prev { left: 10px; } .xp-pc-nav.is-next { right: 10px; }
.xp-pc-count { position: absolute; top: 10px; right: 10px; padding: 2px 9px; border-radius: 999px; background: rgba(0, 0, 0, .62); color: #fff; font-size: 11px; font-weight: 700; pointer-events: none; }
.xp-pc-dots { position: absolute; left: 0; right: 0; bottom: 9px; display: flex; justify-content: center; gap: 5px; pointer-events: none; }
.xp-pc-dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, .5); transition: transform .2s ease, background .2s ease; }
.xp-pc-dots i.is-on { background: #fff; transform: scale(1.3); }
.xp-pc-caption { margin: 0 0 10px; color: var(--ig-fg); white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.xp-pc-people { display: flex; flex-wrap: wrap; gap: 18px; margin: 0 0 10px; }
.xp-pc-people small { display: block; margin-bottom: 4px; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ig-muted); }
.xp-pc-stack { display: flex; align-items: center; }
.xp-pc-stack a, .xp-pc-stack span { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--ig-surface); overflow: hidden; flex: none; background: var(--ig-surface-2); }
.xp-pc-stack a + a, .xp-pc-stack span { margin-left: -8px; }
.xp-pc-stack a:hover { position: relative; z-index: 1; transform: translateY(-2px); }
.xp-pc-stack img { width: 100%; height: 100%; object-fit: cover; display: block; }
.xp-pc-stack span { display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: var(--ig-muted); }
.xp-pc-rating { display: inline-flex; align-items: center; gap: 6px; margin-left: 4px; font-size: 13px; color: var(--ig-muted); }
.xp-pc-rating b { color: var(--ig-fg); }
/* a 5-star meter filled to the average (--r) */
.xp-pc-stars { --r: 0; font-size: 15px; letter-spacing: 1px; }
.xp-pc-stars::before { content: '\2605\2605\2605\2605\2605';
  background: linear-gradient(90deg, #f59e0b calc(var(--r) / 5 * 100%), var(--ig-line) 0);
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.xp-pc-rate { white-space: nowrap; }
/* the rating sheet */
.xp-rate-stars { display: flex; justify-content: center; gap: 6px; margin: 4px 0 6px; }
.xp-rate-stars button { font-size: 34px; line-height: 1; color: var(--ig-line); transition: transform .15s ease, color .15s ease; }
.xp-rate-stars button.is-on { color: #f59e0b; }
.xp-rate-stars button:hover { transform: scale(1.12); }
.xp-rate-label { text-align: center; min-height: 20px; margin: 0 0 10px; color: var(--ig-muted); font-size: 13px; }
.xp-rate-text { width: 100%; min-height: 90px; resize: vertical; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--ig-line); background: var(--ig-surface-2); color: var(--ig-fg); font: inherit; }
.xp-rate-foot { display: flex; align-items: center; gap: 10px; }
.xp-rate-foot small { flex: 1; color: var(--ig-muted); font-size: 12px; }
@media (prefers-reduced-motion: reduce) { .xp-pc-dots i, .xp-rate-stars button { transition: none; } }
