/* ══════════════════════════════════════════════════════════════
   EditOffice — shared office layer
   Command index, stamps, filing motion.
   All selectors namespaced .eo- to avoid touching page styles.
   ══════════════════════════════════════════════════════════════ */

/* ── Reduced motion: kill all motion, keep end states ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── Stamp settle — for status badges + FILED marks ── */
@keyframes eo-stamp {
  0%   { transform: scale(1.28) rotate(-4deg); opacity: 0; }
  55%  { transform: scale(0.985) rotate(0.4deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}
.eo-stamp-in { animation: eo-stamp 0.34s ease-out both; }

/* ── Filing motion — form slides into the archive ── */
@keyframes eo-file-away {
  0%   { transform: none; opacity: 1; }
  100% { transform: translateY(42px) rotate(0.8deg) scale(0.985); opacity: 0; }
}
.eo-filing { animation: eo-file-away 0.42s ease-in both; pointer-events: none; }

/* ── Arrow micro-movement on hover ── */
.eo-arrow { display: inline-block; transition: transform 0.18s ease; }
a:hover .eo-arrow, button:hover .eo-arrow { transform: translateX(3px); }

/* ── Paper lift on focus (forms) ── */
.eo-paper-lift { transition: box-shadow 0.35s ease, transform 0.35s ease; }
.eo-paper-lift:focus-within {
  transform: translateY(-2px);
  box-shadow:
    0 2px 4px rgba(0,0,0,0.24),
    0 18px 56px rgba(0,0,0,0.62),
    0 56px 130px rgba(0,0,0,0.36);
}

/* ── Command index (palette) ── */
#eo-palette-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(4, 5, 8, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 14vh 20px 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease;
}
#eo-palette-overlay.open { opacity: 1; pointer-events: all; }
#eo-palette {
  width: 100%;
  max-width: 480px;
  background: #0c0f14;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-top: 2px solid rgba(185, 148, 88, 0.30);
  border-radius: 3px;
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.8), 0 8px 24px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  transform: translateY(-8px);
  transition: transform 0.16s ease;
}
#eo-palette-overlay.open #eo-palette { transform: none; }
#eo-palette-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
#eo-palette-head .eo-p-label {
  font-family: 'Fira Code', monospace;
  font-size: 0.52rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(240, 237, 232, 0.34);
  white-space: nowrap;
}
#eo-palette-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: #f0ede8;
  font-family: 'Fira Code', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  padding: 4px 0;
}
#eo-palette-input::placeholder { color: rgba(240, 237, 232, 0.28); }
#eo-palette-list { list-style: none; margin: 0; padding: 6px; max-height: 320px; overflow-y: auto; }
.eo-p-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 2px;
  cursor: pointer;
  border: 1px solid transparent;
}
.eo-p-item .eo-p-name {
  font-family: 'Fira Code', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(240, 237, 232, 0.72);
}
.eo-p-item .eo-p-hint {
  font-family: 'Fira Code', monospace;
  font-size: 0.56rem;
  letter-spacing: 0.06em;
  color: rgba(240, 237, 232, 0.26);
  white-space: nowrap;
}
.eo-p-item.active {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.09);
}
.eo-p-item.active .eo-p-name { color: #f0ede8; }
#eo-palette-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}
#eo-palette-foot span {
  font-family: 'Fira Code', monospace;
  font-size: 0.5rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(240, 237, 232, 0.22);
}
.eo-kbd {
  display: inline-block;
  font-family: 'Fira Code', monospace;
  font-size: 0.54rem;
  letter-spacing: 0.06em;
  color: rgba(240, 237, 232, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  padding: 1px 5px;
  line-height: 1.5;
}

/* ── ⌘K hint chip (bottom-right, desktop only) ── */
#eo-palette-hint {
  position: fixed;
  right: 18px;
  bottom: 16px;
  z-index: 900;
  background: rgba(10, 12, 16, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 2px;
  padding: 6px 10px;
  font-family: 'Fira Code', monospace;
  font-size: 0.52rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(240, 237, 232, 0.34);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
#eo-palette-hint:hover { color: rgba(240, 237, 232, 0.7); border-color: rgba(255, 255, 255, 0.2); }
@media (pointer: coarse), (max-width: 900px) { #eo-palette-hint { display: none; } }
