/**
 * Lordfilm — interactive install guide (prototype, docs only).
 *
 * Reuses the site's own language: #09090c base, single accent #a0e868 → #6b9e3a,
 * Unbounded headings, Montserrat body, glass cards with 14px radius. No new palette,
 * no new radii, no second modal system — the markup follows the existing `.modal` idea.
 */

.ig-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(5, 5, 8, 0.76);
  backdrop-filter: blur(12px) saturate(130%);
  -webkit-backdrop-filter: blur(12px) saturate(130%);
  animation: igFade 0.22s ease both;
}

.ig-backdrop[hidden] {
  display: none !important;
}

/*
 * One vertical rhythm: the panel spaces its blocks with a single grid gap, so head /
 * choice / scene / step / actions all sit on the same step and nothing shifts between
 * steps.
 */
.ig-panel {
  position: relative;
  display: grid;
  align-content: start;
  gap: 14px;
  width: min(480px, 100%);
  max-height: min(90vh, 780px);
  overflow: hidden auto;
  scrollbar-gutter: stable;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 18px;
  background: radial-gradient(130% 180% at 50% -70%, rgba(255, 255, 255, 0.06), transparent 48%),
    linear-gradient(155deg, rgba(19, 19, 24, 0.98), rgba(8, 8, 11, 0.98));
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  animation: igRise 0.28s cubic-bezier(0.22, 0.78, 0.2, 1) both;
}

/* Re-rendered body: no entry animation, so switching steps does not replay the rise. */
.ig-panel--settled {
  animation: none;
}

.ig-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  min-height: 46px;
}

.ig-head h3 {
  margin: 0;
  font-family: "Unbounded", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-weight: 500;
  font-size: 15px;
  line-height: 1.3;
  color: #fff;
}

.ig-head p {
  margin: 6px 0 0;
  color: var(--muted, #979797);
  font-size: 12px;
  line-height: 1.5;
}

.ig-close {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: #cfd3da;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.ig-close:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
}

.ig-close svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
}

/*
 * Way in first, device second. Two wide cells with a mark and a second line, so the choice
 * reads as two products instead of two idle chips.
 */
.ig-track {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.ig-track button {
  appearance: none;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 8px 11px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.022);
  color: #a8adb7;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.24s ease, background 0.24s ease, color 0.24s ease, box-shadow 0.24s ease;
}

.ig-track button i {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: #c9cdd6;
}

.ig-track button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ig-track button svg .ig-fill {
  fill: currentColor;
  stroke: none;
}

.ig-track button span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.ig-track button b {
  font-family: "Unbounded", system-ui, sans-serif;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.05em;
}

.ig-track button small {
  color: var(--muted, #979797);
  font-size: 9px;
  letter-spacing: 0.04em;
}

.ig-track button:hover {
  border-color: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.ig-track button[aria-selected="true"] {
  border-color: rgba(160, 232, 104, 0.44);
  background: radial-gradient(130% 210% at 12% -70%, rgba(160, 232, 104, 0.14), transparent 48%),
    rgba(160, 232, 104, 0.05);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 8px 22px rgba(0, 0, 0, 0.3);
}

.ig-track button[aria-selected="true"] i {
  border-color: rgba(160, 232, 104, 0.4);
  background: rgba(160, 232, 104, 0.11);
  color: #a0e868;
}

.ig-track button[aria-selected="true"] small {
  color: #a0e868;
}

/* One track for the device choice, like the existing github tabs but tighter. */
.ig-seg {
  display: grid;
  /* The device count is written on the element, so four tabs cannot squeeze three. */
  grid-template-columns: repeat(var(--ig-seg-count, 3), minmax(0, 1fr));
  gap: 2px;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.ig-seg button {
  appearance: none;
  min-height: 34px;
  padding: 0 6px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #a8adb7;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.ig-seg button:hover {
  color: #fff;
}

.ig-seg button[aria-selected="true"] {
  background: rgba(160, 232, 104, 0.12);
  color: #eaffd3;
  box-shadow: inset 0 0 0 1px rgba(160, 232, 104, 0.32);
}

/* The box owns the aspect ratio, so swapping drawings cannot resize the panel. */
.ig-scene {
  display: grid;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  background: radial-gradient(120% 140% at 50% 0%, rgba(160, 232, 104, 0.04), transparent 60%),
    linear-gradient(165deg, rgba(255, 255, 255, 0.028), rgba(255, 255, 255, 0.01));
  contain: paint;
}

.ig-scene-inner {
  display: grid;
  aspect-ratio: 320 / 220;
}

.ig-step {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-height: 44px;
}

.ig-step-index {
  color: #a0e868;
  font-family: "Unbounded", system-ui, sans-serif;
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.06em;
}

.ig-step-text {
  margin: 0;
  color: #e2e5eb;
  font-size: 13px;
  line-height: 1.5;
}

.ig-replay {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.04);
  color: #a8adb7;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.ig-replay:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #a0e868;
}

.ig-replay svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/*
 * The two real actions, on screen at every step: take the build, or open the web version.
 * A visitor who has read the walkthrough still needs a button to press.
 */
.ig-hand {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 8px;
}

.ig-get,
.ig-go {
  min-height: 44px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-decoration: none;
  transition: transform 0.24s ease, background 0.24s ease, border-color 0.24s ease;
}

.ig-get svg,
.ig-go svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ig-get {
  border: 1px solid transparent;
  background: linear-gradient(90deg, #a0e868 0%, #6b9e3a 100%);
  color: #111;
}

.ig-get:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.ig-go {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: #e5e7eb;
}

.ig-go:hover {
  border-color: rgba(160, 232, 104, 0.3);
  background: rgba(160, 232, 104, 0.07);
  color: #fff;
}

/* Alone in the row it carries the step forward, so it gets the accent treatment. */
.ig-go[data-solo="1"] {
  border-color: rgba(160, 232, 104, 0.34);
  background: rgba(160, 232, 104, 0.09);
  color: #eaffd3;
}

/* Says why there is nothing to download, instead of leaving a missing button unexplained. */
.ig-hint {
  margin: 0;
  color: var(--muted, #979797);
  font-size: 11px;
  line-height: 1.5;
}

.ig-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ig-dots {
  display: flex;
  align-items: center;
  gap: 5px;
}

.ig-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  transition: width 0.28s cubic-bezier(0.22, 0.78, 0.2, 1), background 0.28s ease;
}

.ig-dots i[data-active="1"] {
  width: 20px;
  border-radius: 3px;
  background: #a0e868;
}

.ig-actions {
  display: flex;
  gap: 8px;
}

.ig-actions button {
  appearance: none;
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: #e5e7eb;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.ig-actions button:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
}

.ig-actions button[data-primary="1"] {
  border-color: transparent;
  background: linear-gradient(90deg, #a0e868 0%, #6b9e3a 100%);
  color: #111;
  font-weight: 700;
}

.ig-actions button[data-primary="1"]:hover {
  filter: brightness(1.04);
}

.ig-actions button:disabled {
  opacity: 0.35;
  cursor: default;
}

/* On the last step "back" gives way to the other way in — quiet, not dead. */
.ig-alt {
  border-style: dashed !important;
  background: transparent !important;
  color: #a8adb7 !important;
}

.ig-alt:hover {
  border-style: solid !important;
  border-color: rgba(160, 232, 104, 0.32) !important;
  background: rgba(160, 232, 104, 0.07) !important;
  color: #fff !important;
}

/* The site-side entry point: a quiet helper line under a card or CTA. */
.ig-open {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
  border: 0;
  background: none;
  color: #a8adb7;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: color 0.2s ease;
}

.ig-open span {
  width: 15px;
  height: 15px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(160, 232, 104, 0.42);
  border-radius: 50%;
  color: #a0e868;
  font-size: 9px;
  line-height: 1;
}

.ig-open:hover {
  color: #fff;
}

.ig-open u {
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.28);
  text-underline-offset: 3px;
}

.ig-open:hover u {
  text-decoration-color: #a0e868;
}

@keyframes igFade {
  from {
    opacity: 0;
  }
}

@keyframes igRise {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.985);
  }
}

/* Phone: bottom sheet, reachable with one thumb. */
@media (max-width: 560px) {
  .ig-backdrop {
    padding: 0;
    place-items: end stretch;
  }

  .ig-panel {
    width: 100%;
    max-height: 94vh;
    gap: 12px;
    border-radius: 18px 18px 0 0;
    padding: 8px 16px max(16px, env(safe-area-inset-bottom));
    animation-name: igSheetUp;
  }

  .ig-panel::before {
    content: "";
    display: block;
    width: 38px;
    height: 4px;
    margin: 2px auto 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
  }

  .ig-step {
    min-height: 60px;
  }

  .ig-nav {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 12px;
  }

  .ig-dots {
    justify-content: center;
  }

  .ig-actions {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
  }

  .ig-actions button {
    min-height: 44px;
  }
}

@keyframes igSheetUp {
  from {
    opacity: 0;
    transform: translateY(26px);
  }
}
