/* ==========================================================================
   MyLocalDev — lab overlays: X-Ray, Demolition, console, jump list.
   These are tools that float over the page, so they may carry shadows.
   ========================================================================== */

/* ---------- X-Ray ---------- */
html.xray-on main,
html.xray-on header.site-header,
html.xray-on footer.site-footer,
html.xray-on section,
html.xray-on nav,
html.xray-on form,
html.xray-on article,
html.xray-on aside,
html.xray-on fieldset { outline: 2px dashed var(--mint) !important; outline-offset: -2px !important; }
html.xray-on [data-xray-layout="grid"] { outline: 2px solid var(--yellow) !important; outline-offset: -2px !important; }
html.xray-on [data-xray-layout="flex"] { outline: 2px dotted #ff8ad8 !important; outline-offset: -2px !important; }
html.xray-on .reveal { opacity: 1 !important; transform: none !important; }

.xray-layer { position: fixed; inset: 0; z-index: 90; pointer-events: none; overflow: hidden; }
.xray-pill {
  position: absolute; left: 0; top: 0; max-width: calc(100vw - 16px);
  padding: 2px 8px; font: 800 13px/1.5 var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--mint-ink); background: var(--mint);
}
.xray-pill.is-grid { background: var(--yellow); color: var(--black); }
.xray-pill.is-flex { background: #ff8ad8; color: #2a0620; }
.xray-legend {
  position: fixed; left: 50%; top: calc(var(--hdr-h) + 10px); z-index: 95; transform: translateX(-50%);
  display: flex; flex-wrap: wrap; justify-content: center; gap: 0.35rem 1rem; width: max-content; max-width: calc(100vw - 2rem);
  padding: 0.5rem 0.9rem; background: var(--black); color: #fff; font: 700 13px/1.4 var(--font); pointer-events: none;
  box-shadow: 0 14px 40px -12px rgba(0, 0, 0, 0.7); /* taste-skill-ignore: floating overlay or real terminal */
}
.xray-legend span { display: inline-flex; align-items: center; gap: 0.45rem; }
.xray-legend i { width: 16px; height: 0; border-top: 3px dashed var(--mint); }
.xray-legend i.g { border-top: 3px solid var(--yellow); }
.xray-legend i.f { border-top: 3px dotted #ff8ad8; }

.xray-exit, .rebuild-btn {
  position: fixed; left: 50%; bottom: max(1.25rem, env(safe-area-inset-bottom)); z-index: 300; transform: translateX(-50%);
  min-height: 56px; padding: 0 1.6rem; border: 0; border-radius: 0; max-width: calc(100vw - 2rem); white-space: nowrap;
  font: 900 1.0625rem/1.2 var(--font); text-transform: uppercase; letter-spacing: -0.02em;
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.75); /* taste-skill-ignore: floating overlay or real terminal */
}
.xray-exit { background: var(--mint); color: var(--mint-ink); }
.rebuild-btn { background: var(--yellow); color: var(--black); animation: rebuild-in 0.4s var(--ease) both; }
@keyframes rebuild-in { from { opacity: 0; transform: translate(-50%, 16px); } }

/* ---------- Demolition ---------- */
html.demolished main, html.demolished .site-footer { pointer-events: none; user-select: none; }
html.demolishing .reveal { transition: none !important; }
.debris-canvas { position: fixed; inset: 0; z-index: 250; width: 100vw; height: 100dvh; pointer-events: none; display: none; }
html.demolishing .debris-canvas, html.demolished .debris-canvas { display: block; }
.demo-piece { will-change: transform; }
.shake { animation: shake 0.45s cubic-bezier(.36, .07, .19, .97) both; }
@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 1px, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, -1px, 0); }
  40%, 60% { transform: translate3d(4px, 1px, 0); }
}

/* ---------- Console (a real terminal: monospace belongs here) ---------- */
.terminal { position: fixed; inset: 0; z-index: 500; display: grid; place-items: center; padding: max(1rem, env(safe-area-inset-top)) 1rem max(1rem, env(safe-area-inset-bottom)); }
.terminal-backdrop { position: absolute; inset: 0; background: rgba(10, 10, 10, 0.8); }
.terminal-window {
  position: relative; display: flex; flex-direction: column;
  width: min(780px, 100%); height: min(540px, 100%); overflow: hidden;
  background: #0b0b0b; box-shadow: 0 30px 90px -20px rgba(0, 0, 0, 0.85); /* taste-skill-ignore: floating overlay or real terminal */
  animation: term-in 0.22s var(--ease);
}
@keyframes term-in { from { opacity: 0; transform: translateY(10px) scale(0.985); } }
.terminal-bar { display: flex; align-items: center; gap: 0.75rem; padding: 0.35rem 0.4rem 0.35rem 0.9rem; background: var(--mint); color: var(--mint-ink); }
.terminal-bar .frame-dots i { background: var(--mint-ink); opacity: 0.35; }
.terminal-bar h2 { flex: 1; min-width: 0; font: 800 0.9375rem/1.3 var(--font-mono); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } /* taste-skill-ignore: floating overlay or real terminal */
.terminal-body { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; font-family: var(--font-mono); font-size: 0.9375rem; line-height: 1.55; } /* taste-skill-ignore: floating overlay or real terminal */
.matrix-canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 0.6s; pointer-events: none; }
.terminal.matrix .matrix-canvas { opacity: 0.55; }
.terminal-output { position: relative; flex: 1; min-height: 0; overflow-y: auto; padding: 1rem 1rem 0.25rem; color: #e6e6e6; overscroll-behavior: contain; }
.terminal-output .line { white-space: pre-wrap; overflow-wrap: anywhere; }
.terminal-output .cmd { color: #fff; }
.terminal-output .cmd .p, .terminal-output .ok, .terminal-output a { color: var(--mint); }
.terminal-output .muted { color: var(--muted); }
.terminal-output .warn { color: var(--yellow); }
.terminal-output .err { color: var(--danger); }
.terminal-input-row { position: relative; display: flex; align-items: center; gap: 0.6rem; padding: 0.4rem 1rem 0.9rem; }
.terminal-input-row .prompt { color: var(--mint); flex: none; }
.terminal-input-row input { flex: 1; min-width: 0; min-height: 44px; padding: 0; border: 0; background: transparent; color: #fff; font: inherit; caret-color: var(--mint); outline: none; }
@media (max-width: 560px) {
  .terminal { padding: 0; align-items: stretch; }
  .terminal-window { width: 100%; height: 100%; }
  .terminal-body { font-size: 0.875rem; }
  .terminal-input-row input { font-size: 16px; }
}

/* ---------- Jump list (command palette) ---------- */
.palette { width: min(640px, calc(100vw - 24px)); max-height: min(560px, calc(100svh - 96px)); margin: 12vh auto auto; padding: 0; border: 0; background: var(--yellow); color: var(--black); box-shadow: 0 30px 90px -20px rgba(0, 0, 0, 0.8); } /* taste-skill-ignore: floating overlay or real terminal */
.palette::backdrop { background: rgba(10, 10, 10, 0.72); }
.palette[open] { animation: term-in 0.2s var(--ease); }
.palette-box { display: flex; flex-direction: column; max-height: inherit; }
.palette input { width: 100%; min-height: 64px; padding: 0 22px; border: 0; background: var(--black); color: #fff; font: 800 1.25rem/1 var(--font); outline: none; }
.palette input::placeholder { color: #bdbdbd; }
.palette input:focus-visible { box-shadow: inset 0 0 0 3px var(--mint); } /* taste-skill-ignore: floating overlay or real terminal */
.palette-list { flex: 1; min-height: 0; overflow-y: auto; list-style: none; padding: 8px; overscroll-behavior: contain; }
.palette-list li { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 48px; padding: 8px 14px; cursor: pointer; font-weight: 800; }
.palette-list li span:last-child { font-size: 0.875rem; font-weight: 700; color: #4f4800; white-space: nowrap; }
.palette-list li[aria-selected="true"] { background: var(--black); color: var(--yellow); }
.palette-list li[aria-selected="true"] span:last-child { color: #fff; }
.palette-list .empty { cursor: default; font-weight: 700; }
.palette-foot { padding: 10px 18px 14px; font-size: 0.875rem; font-weight: 700; color: #4f4800; }
.palette-foot kbd { background: rgba(0, 0, 0, 0.12); }
