/* BuildCore motion: short transitions, stable navigation, accessible fallbacks. */
:root {
  --bc-motion-ease: cubic-bezier(.22, .61, .36, 1);
  --bc-motion-fast: 160ms;
  --bc-motion-page: 240ms;
}

.bc-sidebar .nav-item {
  position: relative;
  transition: color 180ms ease, background-color 180ms ease, transform 180ms var(--bc-motion-ease);
}
.bc-sidebar .nav-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: calc(50% - 10px);
  width: 3px;
  height: 20px;
  border-radius: 0 3px 3px 0;
  background: #f2763d;
  opacity: 0;
  transform: scaleY(.4);
  transition: opacity 180ms ease, transform 220ms var(--bc-motion-ease);
}
.bc-sidebar .nav-item.active::before {
  opacity: 1;
  transform: scaleY(1);
}

.btn,
.modal-close {
  transition: color var(--bc-motion-fast) ease, background-color var(--bc-motion-fast) ease,
    border-color var(--bc-motion-fast) ease, box-shadow 200ms ease,
    transform var(--bc-motion-fast) var(--bc-motion-ease);
}
.btn:active:not(:disabled),
.modal-close:active {
  transform: translateY(0) scale(.98);
}
.btn:focus-visible,
.modal-close:focus-visible,
.bc-sidebar .nav-item:focus-visible {
  outline: 2px solid #e9743c;
  outline-offset: 3px;
}
a.bc-metric,
a.flow-action-card,
.bc-project-card {
  transition: border-color 200ms ease, box-shadow 220ms ease,
    transform 220ms var(--bc-motion-ease);
}

.modal-backdrop {
  background: rgba(23, 33, 28, .38);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  animation: bc-backdrop-in 200ms ease both;
}
.modal {
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 18px;
  box-shadow: 0 32px 90px rgba(22, 34, 27, .2), 0 4px 18px rgba(22, 34, 27, .06);
  transform-origin: center 45%;
  animation: bc-dialog-in 240ms var(--bc-motion-ease) both;
}
.modal-header {
  background: #fbfbf8;
  border-bottom-color: #e8ebe4;
}
.modal-header h2 {
  color: #29392e;
  line-height: 1.35;
}
.modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 9px;
  color: #7e897f;
}
.modal-footer {
  background: #fbfbf8;
  border-top-color: #e8ebe4;
}
.modal-backdrop.is-closing {
  pointer-events: none;
  animation: bc-backdrop-out 160ms ease both;
}
.modal-backdrop.is-closing .modal {
  animation: bc-dialog-out 160ms ease both;
}
.toast {
  animation: bc-toast-in 220ms var(--bc-motion-ease) both;
}

@media (hover: hover) and (pointer: fine) {
  .bc-sidebar .nav-item:hover { transform: translateX(3px); }
  .btn:hover:not(:disabled) { transform: translateY(-1px); }
  .btn.primary:hover:not(:disabled) { box-shadow: 0 5px 14px rgba(202, 90, 42, .18); }
  .btn:active:not(:disabled) { transform: translateY(0) scale(.98); }
  .modal-close:hover { background: #edf0e8; color: #344c3a; }
  a.bc-metric:hover,
  a.flow-action-card:hover,
  .bc-project-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(38, 55, 42, .065);
    border-color: #cfd8ca;
  }
}

@keyframes bc-backdrop-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes bc-backdrop-out { to { opacity: 0; } }
@keyframes bc-dialog-in {
  from { opacity: 0; transform: translateY(16px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes bc-dialog-out { to { opacity: 0; transform: translateY(8px) scale(.99); } }
@keyframes bc-toast-in {
  from { opacity: 0; transform: translateY(9px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 650px) {
  .modal-backdrop { padding: 14px; }
  .modal { border-radius: 16px; max-height: calc(100dvh - 28px); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  .bc-sidebar .nav-item,
  .bc-sidebar .nav-item::before,
  .btn,
  .modal-close,
  a.bc-metric,
  a.flow-action-card,
  .bc-project-card { transition: none !important; }
  .modal-backdrop,
  .modal,
  .toast { animation: none !important; }
  .bc-sidebar .nav-item:hover,
  .btn:hover,
  .btn:active,
  a.bc-metric:hover,
  a.flow-action-card:hover,
  .bc-project-card:hover { transform: none !important; }
}
