/* Add-to-home-screen guide. Fleet-wide, framework-free companion to
   install-guide.js.

   Self-contained on purpose: the estate mixes hex tokens, HSL-triplet tokens
   and Tailwind 4 themes, so anything reading a repo's own --accent renders
   wrong somewhere. One override exists, --ig-accent, set either in CSS or via
   the script's data-accent attribute. Everything else is neutral.

   Reduced motion hides the phone demo and keeps the numbered steps: the
   animation is a nicety, the instructions are the content. */

:root { --ig-accent: #1f6feb; }

.ig-card {
  position: fixed; left: 12px; right: 12px; z-index: 59;
  bottom: calc(16px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 11px;
  padding: 12px 14px; border-radius: 13px;
  background: #10141c; color: #f5f7fa;
  box-shadow: 0 10px 30px -8px rgba(10, 16, 28, .55);
  font: 400 13px/1.35 system-ui, -apple-system, 'Segoe UI', sans-serif;
}
.ig-card[hidden] { display: none !important; }
.ig-card-icon { font-size: 19px; flex: none; }
.ig-card-text { flex: 1; }
.ig-card-cta {
  flex: none; border: 0; border-radius: 9px; padding: 8px 14px; cursor: pointer;
  background: var(--ig-accent); color: #fff; font: 600 13px system-ui, sans-serif;
}
.ig-card-x {
  flex: none; border: 0; background: none; color: inherit; opacity: .55;
  font-size: 19px; line-height: 1; cursor: pointer; padding: 0 2px;
}
.ig-card-x:hover { opacity: 1; }

/* Sits above a bottom tab bar where one exists. */
@media (max-width: 900px) {
  .ig-card { bottom: calc(76px + env(safe-area-inset-bottom)); }
}

.ig-backdrop {
  position: fixed; inset: 0; z-index: 80; display: flex;
  align-items: center; justify-content: center; padding: 16px;
  background: rgba(8, 12, 20, .55); backdrop-filter: blur(2px);
  font: 400 14px/1.4 system-ui, -apple-system, 'Segoe UI', sans-serif;
}
.ig-modal {
  position: relative; width: 100%; max-width: 360px; border-radius: 16px;
  padding: 22px 20px 18px; background: #fff; color: #111;
  box-shadow: 0 24px 60px -12px rgba(8, 12, 20, .45);
}
@media (prefers-color-scheme: dark) {
  .ig-modal { background: #151a23; color: #eef2f7; }
}
.ig-modal h2 { margin: 0 0 4px; font-size: 17px; font-weight: 700; }
.ig-sub { margin: 0 0 14px; font-size: 13px; opacity: .7; }
.ig-close {
  position: absolute; top: 10px; right: 12px; border: 0; background: none;
  font-size: 22px; line-height: 1; cursor: pointer; color: inherit; opacity: .5;
}
.ig-close:hover { opacity: 1; }

.ig-phone {
  position: relative; height: 190px; width: 170px; margin: 0 auto 16px;
  border: 2px solid currentColor; border-radius: 22px; opacity: .92;
  overflow: hidden; padding: 10px 8px;
}
.ig-scene { position: absolute; inset: 10px 8px; opacity: 0; }
.ig-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  border: 1px solid currentColor; border-radius: 9px; padding: 6px 8px;
  font-size: 11px; opacity: .85;
}
.ig-url { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ig-dots { font-weight: 700; }
.ig-tap { display: inline-block; animation: ig-tap 1.4s ease-in-out infinite; }
.ig-sheet {
  margin-top: 26px; border: 1px solid currentColor; border-radius: 10px;
  overflow: hidden; animation: ig-sheet .5s ease-out;
}
.ig-row {
  padding: 7px 9px; font-size: 11px; opacity: .55;
  border-bottom: 1px solid currentColor;
}
.ig-row:last-child { border-bottom: 0; }
.ig-hl { opacity: 1; font-weight: 700; color: var(--ig-accent); }
/* iOS scene furniture. Safari has put the address bar at the BOTTOM since
   iOS 15, and the sheet rises from it; drawing it at the top is the single
   thing that makes people look in the wrong place. */
.ig-ios { display: flex; flex-direction: column; height: 100%; }
.ig-fill { flex: 1; }
.ig-bar-bottom { margin-top: auto; }
.ig-aA { font-size: 9px; opacity: .55; flex: none; }
.ig-grab {
  width: 34px; height: 4px; border-radius: 2px; margin: 5px auto 7px;
  background: currentColor; opacity: .3;
}
.ig-ri {
  display: inline-block; width: 14px; margin-right: 7px;
  text-align: center; opacity: .8;
}
.ig-row { display: flex; align-items: center; }

.ig-home {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; height: 100%; gap: 8px;
}
.ig-icon {
  display: grid; place-items: center; width: 52px; height: 52px;
  border-radius: 13px; background: var(--ig-accent); color: #fff;
  font: 700 15px/1 system-ui, sans-serif; letter-spacing: .5px;
  animation: ig-drop .6s ease-out;
}
.ig-caption { font-size: 11px; opacity: .75; }

.ig-steps { margin: 0; padding: 0; list-style: none; display: grid; gap: 9px; }
.ig-steps li { display: flex; gap: 9px; font-size: 13px; }
.ig-num {
  flex: none; display: grid; place-items: center; width: 20px; height: 20px;
  border-radius: 50%; background: var(--ig-accent); color: #fff;
  font-size: 11px; font-weight: 700;
}

@keyframes ig-scene {
  0%, 5% { opacity: 0; transform: translateY(6px); }
  9%, 30% { opacity: 1; transform: translateY(0); }
  36%, 100% { opacity: 0; transform: translateY(-4px); }
}
@keyframes ig-tap { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.35); } }
@keyframes ig-sheet { from { transform: translateY(30%); } to { transform: translateY(0); } }
@keyframes ig-drop {
  0% { opacity: 0; transform: scale(.4); }
  60% { transform: scale(1.12); }
  100% { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .ig-phone { display: none; }
  .ig-scene, .ig-tap, .ig-sheet, .ig-icon { animation: none !important; }
}
