/* ============================================================
   STAR ENTERPRISES — PREMIUM SEAMLESS PAGE TRANSITIONS
   Ultra-smooth, fast, responsive page transition system.
   ============================================================ */

/* ---------- 0. Transition Backdrop ---------- */
html {
  background: #ffffff;
  scroll-behavior: smooth;
}

:root {
  --tr-duration: 0.22s;
  --tr-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --tr-ease-out: cubic-bezier(0, 0, 0.2, 1);
  --tr-ease-in: cubic-bezier(0.4, 0, 1, 1);
}

/* Hidden legacy veil */
.black-veil {
  display: none !important;
}

/* ---------- 1. Smooth Page Enter Animation ---------- */
body {
  animation: starPageIn 0.28s var(--tr-ease) both;
  will-change: opacity, transform;
}

@keyframes starPageIn {
  from {
    opacity: 0.88;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- 2. Page Exit Transition ---------- */
body.is-leaving {
  opacity: 0.82;
  transform: translateY(-3px);
  pointer-events: none;
  transition: opacity 0.18s var(--tr-ease-in), transform 0.18s var(--tr-ease-in);
}

/* ---------- 3. Glowing Top Route Bar ---------- */
.route-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  z-index: 99999;
  background: #0284c7;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.85), 0 0 4px rgba(2, 132, 199, 0.9);
  opacity: 0;
  pointer-events: none;
  border-radius: 0 3px 3px 0;
  transition: width 0.22s cubic-bezier(0.1, 0.8, 0.2, 1), opacity 0.15s ease;
}

.route-bar.is-on {
  opacity: 1;
}

.route-bar.is-done {
  width: 100% !important;
  opacity: 0;
  transition: width 0.12s ease-out, opacity 0.2s ease 0.1s;
}

/* ---------- 4. Fluid Interactive Micro-Transitions ---------- */
a {
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.btn {
  transition: background 0.2s ease,
              color 0.2s ease,
              border-color 0.2s ease,
              box-shadow 0.2s ease,
              opacity 0.15s ease !important;
}

.btn:active {
  opacity: 0.92 !important;
  transform: none !important;
}

.nav-links a,
.mobile-menu a,
.crumb a {
  transition: color 0.2s ease, background-color 0.2s ease;
}

.nav-links a:hover {
  transform: none;
}

.f-col a {
  transition: color 0.2s ease, padding-left 0.2s ease;
}

.f-col a:hover {
  transform: none;
  color: var(--brand-d, #025d92);
}

/* Cards & Panels: Calm, professional elevation */
.prod, .t-card, .feat, .step, .value, .office, .rel, .card, .spec-panel, .p-card, .metric-card {
  transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.24s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.2s ease,
              background-color 0.2s ease;
}

.prod:hover, .card:hover, .spec-panel:hover, .metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -10px rgba(11, 45, 91, 0.14), 0 2px 8px rgba(2, 132, 199, 0.06);
  border-color: var(--brand-bd, #b3def7);
}

.rel:hover, .office:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -8px rgba(11, 45, 91, 0.12);
}

/* Hero Terminal & Micro-elements — Calm & Clean */
.offer-card {
  transition: box-shadow 0.3s ease,
              border-color 0.3s ease !important;
}
.offer-card:hover {
  transform: none;
}
.float-chip {
  transition: box-shadow 0.25s ease,
              border-color 0.25s ease !important;
}
.float-chip:hover {
  transform: none !important;
  box-shadow: 0 12px 30px -4px rgba(11, 45, 91, 0.18) !important;
}
.hqp-pill, .oc-tab {
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease !important;
}
.hqp-pill:active, .oc-tab:active {
  transform: none !important;
}
.hero-bottom-ticker {
  transition: all 0.3s ease;
}
.hero-bottom-ticker:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(2, 132, 199, 0.12);
  border-color: var(--brand);
}

/* Table rows smooth highlight */
table.tbl tbody tr,
table.admin-table tbody tr {
  transition: background-color 0.18s ease;
}

/* Smooth Focus Rings */
:where(a, button, input, select, textarea):focus-visible {
  outline: 2px solid var(--brand, #0284c7);
  outline-offset: 2px;
  transition: outline-offset 0.15s ease;
}

/* ---------- 5. Native View Transitions (Supported Browsers) ---------- */
@view-transition {
  navigation: auto;
}

::view-transition-old(root) {
  animation: starViewOut 0.2s cubic-bezier(0.4, 0, 1, 1) both;
}

::view-transition-new(root) {
  animation: starViewIn 0.25s cubic-bezier(0, 0, 0.2, 1) both;
}

@keyframes starViewOut {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0.85; transform: scale(0.995); }
}

@keyframes starViewIn {
  from { opacity: 0; transform: scale(1.005); }
  to { opacity: 1; transform: scale(1); }
}

/* ---------- 6. Respect Reduced Motion Accessibility ---------- */
@media (prefers-reduced-motion: reduce) {
  body {
    animation: none !important;
  }
  body.is-leaving {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .route-bar {
    display: none !important;
  }
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none !important;
  }
  * {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
