/* ---------- Inspect panel ---------- */
#inspect {
  position: fixed; z-index: 15; top: 0; right: 0; bottom: 0; width: min(460px, 100%);
  padding: calc(14px + var(--safe-t)) max(16px, env(safe-area-inset-right, 0px)) calc(16px + var(--safe-b)) 22px;
  background: var(--bg-2); border-left: 1px solid var(--hud-line); box-shadow: -30px 0 60px -30px var(--shadow);
  transform: translateX(104%); transition: transform .32s cubic-bezier(.2,.8,.2,1); display: flex; flex-direction: column; gap: 16px;
  overflow-y: auto; overscroll-behavior: contain; user-select: text; -webkit-user-select: text;
}
#inspect.open { transform: none; }
.ins-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.ins-kicker { font: 600 11px/1 var(--f-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--hot); }
.ins-close { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--hud-line); background: transparent; color: var(--ink); cursor: inherit; font: 600 11px/1 var(--f-mono); letter-spacing: .08em; }
.ins-close:hover { border-color: var(--accent); color: var(--accent); }
.ins-hero { position: relative; flex: none; height: 230px; border-radius: 14px; overflow: hidden; }
.ins-hero svg, .ins-hero canvas, .ins-hero img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ins-hero img { object-fit: contain; max-width: none; }
.ins-gallery { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: -6px; }
.ins-gallery button { position: relative; aspect-ratio: 16 / 10; padding: 0; border: 0; border-radius: 8px; overflow: hidden; cursor: inherit; background: var(--bg); outline: 2px solid transparent; outline-offset: 2px; opacity: .6; transition: opacity .15s, outline-color .15s; }
.ins-gallery button:hover { opacity: 1; }
.ins-gallery button[aria-pressed="true"] { opacity: 1; outline-color: var(--accent); }
.ins-gallery img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.ins-team { margin: 0; font-size: 14px; line-height: 1.5; color: var(--ink-dim); }
.ins-title { margin: 0; font-family: var(--f-display); font-weight: 900; font-stretch: 118%; font-size: 36px; line-height: .98; text-transform: uppercase; text-wrap: balance; }
.ins-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--hud-line); border: 1px solid var(--hud-line); border-radius: 10px; overflow: hidden; }
.ins-facts div { background: var(--bg-2); padding: 10px 12px; display: grid; gap: 5px; }
.ins-facts dt { font: 600 9.5px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-dim); }
.ins-facts dd { margin: 0; font-size: 13.5px; font-weight: 600; line-height: 1.25; }
.ins-text p { margin: 0 0 10px; color: var(--ink); max-width: 62ch; }
.ins-h { margin: 6px 0 0; font: 600 11px/1 var(--f-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-dim); }
.ins-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.ins-list li { display: grid; grid-template-columns: 14px 1fr; gap: 10px; font-size: 14.5px; line-height: 1.45; }
.ins-list li::before { content: ""; width: 8px; height: 8px; margin-top: 7px; border-radius: 2px; background: var(--accent); transform: rotate(45deg); }
.ins-note { font-size: 13px; color: var(--ink-dim); border-top: 1px dashed var(--hud-line); padding-top: 12px; }
.params { display: grid; gap: 10px; padding: 12px; border-radius: 12px; border: 1px solid var(--hud-line); }
.param { display: grid; grid-template-columns: 112px 1fr 44px; gap: 10px; align-items: center; font: 600 11.5px/1 var(--f-mono); }
.param output { text-align: right; color: var(--ink-dim); font-variant-numeric: tabular-nums; }
.param input { width: 100%; accent-color: var(--accent); min-width: 0; }
.redline { display: grid; gap: 8px; }
.redline span { height: 12px; border-radius: 3px; background: var(--ink); opacity: .85; }

/* ---------- Interactive panel ---------- */
.ins-stack { display: grid; gap: 16px; }
#inspect.open .ins-sec { animation: sec-in .45s calc(var(--i) * 45ms + 80ms) cubic-bezier(.2,.8,.2,1) both; }
@keyframes sec-in { from { opacity: 0; transform: translateY(14px); } }
.ins-h small { font: 500 11px/1 var(--f-body); letter-spacing: 0; text-transform: none; color: color-mix(in srgb, var(--ink-dim) 75%, transparent); margin-left: 6px; }

/* hero: arrows, counter, full screen, zoom lens */
.ins-hero.zoomable { cursor: zoom-in; }
.ins-hero img { transition: transform .3s cubic-bezier(.2,.8,.2,1); }
.ins-hero.lens img { transform: scale(1.9); }
.ins-hero img.swap, .lightbox img.swap { animation: swap .35s cubic-bezier(.2,.8,.2,1); }
@keyframes swap { from { opacity: 0; transform: scale(1.04); } }
.hero-nav, .hero-full {
  position: absolute; z-index: 2; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.25); border-radius: 50%;
  background: rgba(16, 17, 20, .62); color: #fff; cursor: pointer; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .2s, transform .2s cubic-bezier(.2,.9,.3,1.4), background .2s;
}
.hero-nav { top: 50%; width: 40px; height: 40px; margin-top: -20px; }
.hero-nav.prev { left: 10px; } .hero-nav.next { right: 10px; }
.hero-nav svg { width: 20px; height: 20px; }
.hero-full { top: 10px; right: 10px; width: 34px; height: 34px; border-radius: 9px; }
.hero-full svg { width: 17px; height: 17px; }
.ins-hero:hover .hero-nav, .ins-hero:hover .hero-full, .ins-hero :focus-visible { opacity: 1; }
.hero-nav:hover, .hero-full:hover { background: var(--accent); transform: scale(1.1); }
.hero-nav.prev:hover svg { animation: nudge-l .4s; } .hero-nav.next:hover svg { animation: nudge-r .4s; }
@keyframes nudge-l { 50% { transform: translateX(-3px); } } @keyframes nudge-r { 50% { transform: translateX(3px); } }
.hero-count { position: absolute; z-index: 2; left: 10px; bottom: 10px; padding: 5px 8px; border-radius: 6px; background: rgba(16,17,20,.62); color: #fff; font: 600 11px/1 var(--f-mono); pointer-events: none; }
.hero-count b { color: var(--hot); }
@media (hover: none) { .hero-nav, .hero-full { opacity: 1; } }

/* facts, list, tools, teammates react to the cursor */
.ins-facts div { transition: background .2s; }
.ins-facts div:hover { background: color-mix(in srgb, var(--accent) 9%, var(--bg-2)); }
.ins-facts div:hover dt { color: var(--accent); }
.ins-list li { transition: color .2s; }
.ins-list li::before { transition: transform .35s cubic-bezier(.3,1.6,.5,1), background .2s; }
.ins-list li:hover::before { transform: rotate(225deg) scale(1.35); background: var(--hot); }
.ins-tools { display: flex; flex-wrap: wrap; gap: 6px; }
.tool {
  border: 1px solid var(--hud-line); border-radius: 8px; padding: 8px 11px; background: transparent; color: var(--ink); cursor: pointer;
  font: 600 11.5px/1 var(--f-mono); letter-spacing: .04em; transition: border-color .2s, background .2s, color .2s, transform .2s cubic-bezier(.2,.9,.3,1.4);
}
.tool:hover { border-color: var(--accent); transform: translateY(-2px); }
.tool:active { transform: scale(.95); }
.tool[aria-pressed="true"] { background: var(--hot); border-color: var(--hot); color: #fff; animation: tool-on .45s cubic-bezier(.3,1.6,.5,1); }
@keyframes tool-on { 40% { transform: scale(1.12); } }
.ins-team { display: flex; flex-wrap: wrap; gap: 6px; }
.mate { display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px 4px 4px; border: 1px solid var(--hud-line); border-radius: 999px; font-size: 13px; transition: border-color .2s, transform .2s cubic-bezier(.2,.9,.3,1.4); }
.mate i { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font: 700 9.5px/1 var(--f-mono); font-style: normal; transition: transform .4s cubic-bezier(.3,1.6,.5,1); }
.mate:hover, .mate:focus-visible { border-color: var(--accent); transform: translateY(-2px); }
.mate:hover i { transform: rotate(-12deg) scale(1.12); }
.param input { cursor: pointer; }

/* previous / share / next */
.ins-foot { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; padding-top: 6px; border-top: 1px dashed var(--hud-line); }
.ins-step, .ins-share {
  display: flex; align-items: center; gap: 8px; min-width: 0; padding: 10px 12px; border: 1px solid var(--hud-line); border-radius: 12px;
  background: transparent; color: var(--ink); cursor: pointer; text-align: left; font: 600 13px/1.2 var(--f-body);
  transition: border-color .2s, background .2s, transform .2s cubic-bezier(.2,.9,.3,1.4);
}
.ins-step.next { justify-content: flex-end; text-align: right; }
.ins-step span { display: grid; gap: 3px; min-width: 0; overflow: hidden; }
.ins-step small { font: 600 9.5px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-dim); }
.ins-step svg, .ins-share svg { width: 18px; height: 18px; flex: none; transition: transform .25s cubic-bezier(.3,1.6,.5,1); }
.ins-step:hover, .ins-share:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.ins-step:hover svg { transform: translateX(-3px); } .ins-step.next:hover svg { transform: translateX(3px); }
.ins-share { justify-content: center; padding: 10px 13px; }
.ins-share:hover svg { transform: rotate(-20deg) scale(1.15); }
.ins-step:active, .ins-share:active { transform: scale(.96); }

/* full-screen view */
.lightbox {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px 24px 76px;
  background: rgba(8, 9, 11, .92); opacity: 0; transition: opacity .25s ease;
}
.lightbox.show { opacity: 1; }
.lightbox img { max-width: min(1400px, 100%); max-height: 100%; object-fit: contain; border-radius: 10px; box-shadow: 0 30px 80px -20px #000; touch-action: pan-y; transform: scale(.96); transition: transform .3s cubic-bezier(.2,.8,.2,1); }
.lightbox.show img { transform: none; }
.lb-nav { position: fixed; top: 50%; width: 52px; height: 52px; margin-top: -26px; display: grid; place-items: center; border-radius: 50%; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.08); color: #fff; cursor: pointer; transition: background .2s, transform .2s cubic-bezier(.2,.9,.3,1.4); }
.lb-nav svg { width: 24px; height: 24px; }
.lb-nav.prev { left: max(16px, env(safe-area-inset-left, 0px)); } .lb-nav.next { right: max(16px, env(safe-area-inset-right, 0px)); }
.lb-nav:hover { background: var(--accent); transform: scale(1.08); }
.lb-bar { position: fixed; left: 0; right: 0; bottom: 0; background: linear-gradient(transparent, rgba(8, 9, 11, .96) 35%); display: flex; align-items: center; gap: 14px; padding: 14px max(16px, env(safe-area-inset-left, 0px)) calc(14px + var(--safe-b)); color: #ecebe4; }
.lb-title { font-family: var(--f-display); font-weight: 900; font-stretch: 118%; text-transform: uppercase; font-size: 18px; }
.lb-count { font: 600 12px/1 var(--f-mono); color: #9c9b94; margin-right: auto; }
.lightbox .ins-close { color: #ecebe4; border-color: rgba(255,255,255,.2); }

.ins-crown { display: inline-block; width: 34px; height: 28px; margin-right: 10px; vertical-align: -2px; transform: rotate(-8deg); }
.ins-crown svg { width: 100%; height: 100%; display: block; }

/* official link (card.link) + image credit */
.ins-link {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-radius: 12px; text-decoration: none;
  background: #f4c534; color: #17181b; font: 700 15px/1.2 var(--f-body); transition: transform .2s cubic-bezier(.2,.9,.3,1.4), background .2s;
}
.ins-link span { display: grid; gap: 4px; }
.ins-link small { font: 600 10px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; opacity: .7; }
.ins-link svg { width: 22px; height: 22px; flex: none; transition: transform .25s cubic-bezier(.3,1.6,.5,1); }
.ins-link:hover { transform: translateY(-2px); background: #ffd54d; }
.ins-link:hover svg { transform: translate(3px, -3px); }
.ins-link:active { transform: scale(.97); }
.ins-credit { margin: 0; font-size: 12px; color: var(--ink-dim); }

/* phones: full-size copy of an info card in the bottom sheet */
.sheet-card { padding: 18px; border-radius: 18px; background: var(--card); color: var(--card-ink); }
.sheet-card .info-body { padding: 0; gap: 14px; }
.sheet-card .big-name { font-size: 54px; }
.sheet-card .slots { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
.sheet-card .slot { font-size: 12px; overflow-wrap: anywhere; }
.sheet-card .legend { font-size: 14px; }
.sheet-card .kc { color: var(--card-ink); border-color: color-mix(in srgb, var(--card-ink) 28%, transparent); background: color-mix(in srgb, var(--card-ink) 6%, transparent); }
