/* ==========================================================================
   RootOS Global Components & Shell System (North American Enterprise)
   Header, Footer, Megamenu, Mobile Bar & Micro-Interactions Styles
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. Scroll Reveal Animation Engine (.root-reveal)
   -------------------------------------------------------------------------- */
.root-reveal, .root-card, .root-step-card, .root-compare-box, .root-pillar-card, .root-telemetry-hud, .root-escrow-card, .root-cluster-card, .root-case-card {
  opacity: 0;
  transform: translateY(28px) scale(0.98);
  filter: blur(5px);
  transition: opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.75s cubic-bezier(0.16, 1, 0.3, 1),
              filter 0.75s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform, filter;
}

.root-reveal.is-revealed,
.root-card.is-revealed,
.root-step-card.is-revealed,
.root-compare-box.is-revealed,
.root-pillar-card.is-revealed,
.root-telemetry-hud.is-revealed,
.root-escrow-card.is-revealed,
.root-cluster-card.is-revealed,
.root-case-card.is-revealed {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
}

.delay-1 { transition-delay: 0.12s; }
.delay-2 { transition-delay: 0.24s; }
.delay-3 { transition-delay: 0.36s; }
.delay-4 { transition-delay: 0.48s; }

/* --------------------------------------------------------------------------
   1. The Quantum Cursor (Desktop Only)
   -------------------------------------------------------------------------- */
@media (hover: hover) and (pointer: fine) {
  body.has-quantum-cursor {
    cursor: none;
  }
  body.has-quantum-cursor a,
  body.has-quantum-cursor button,
  body.has-quantum-cursor input,
  body.has-quantum-cursor select,
  body.has-quantum-cursor textarea,
  body.has-quantum-cursor .clickable {
    cursor: none !important;
  }
}

.quantum-cursor-main {
  position: fixed;
  top: 0;
  left: 0;
  width: 24px;
  height: 24px;
  pointer-events: none;
  z-index: 99999;
  transform: translate(-50%, -50%) rotate(45deg);
  border: 1.5px solid var(--root-cyan);
  background: rgba(0, 240, 255, 0.08);
  box-shadow: 0 0 15px var(--root-cyan-glow);
  transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              height 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              background 0.25s ease,
              border-color 0.25s ease,
              transform 0.15s ease-out;
  display: none;
}

.quantum-cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--root-cyan);
  box-shadow: 0 0 8px var(--root-cyan);
  pointer-events: none;
  z-index: 100000;
  transform: translate(-50%, -50%);
  display: none;
}

@media (hover: hover) and (pointer: fine) {
  .quantum-cursor-main,
  .quantum-cursor-dot {
    display: block;
  }
}

.quantum-cursor-main.is-hovering {
  width: 44px;
  height: 44px;
  background: rgba(0, 240, 255, 0.18);
  border-color: var(--root-cyan);
  box-shadow: 0 0 25px var(--root-cyan-glow);
}

.quantum-cursor-main.is-magnetic {
  border-radius: var(--radius-sm);
  transform: translate(-50%, -50%) rotate(0deg);
  border-color: var(--root-gold);
  box-shadow: 0 0 25px var(--root-gold-glow);
  background: rgba(212, 175, 55, 0.12);
}

/* --------------------------------------------------------------------------
   2. Blueprint Page Transition CAD Overlay
   -------------------------------------------------------------------------- */
.blueprint-transition-overlay {
  position: fixed;
  inset: 0;
  z-index: 99998;
  pointer-events: none;
  opacity: 0;
  background-color: rgba(5, 11, 20, 0.94);
  background-image: 
    linear-gradient(rgba(0, 240, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.08) 1px, transparent 1px);
  background-size: 32px 32px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: opacity 0.35s cubic-bezier(0.25, 1, 0.5, 1);
}

.blueprint-transition-overlay.is-active {
  opacity: 1;
  pointer-events: all;
}

.blueprint-grid-scanner {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--root-cyan), transparent);
  box-shadow: 0 0 15px var(--root-cyan);
  animation: scanGrid 1.2s ease-in-out infinite alternate;
}

@keyframes scanGrid {
  0% { top: 0%; opacity: 0.2; }
  100% { top: 100%; opacity: 0.9; }
}

/* --------------------------------------------------------------------------
   3. Glassmorphic Cards & Magnetic Parallax
   -------------------------------------------------------------------------- */
.root-card {
  position: relative;
  background: var(--root-card-glass);
  border: 1px solid var(--root-border-subtle);
  border-radius: var(--radius-lg);
  padding: 2.2rem;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.4s ease;
  overflow: hidden;
}

.root-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: radial-gradient(
    400px circle at var(--mouse-x, -500px) var(--mouse-y, -500px),
    rgba(0, 240, 255, 0.6),
    transparent 40%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.root-card:hover::before {
  opacity: 1;
}

.root-card:hover {
  border-color: rgba(0, 240, 255, 0.3);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6), 0 0 25px rgba(0, 240, 255, 0.08);
}

/* --------------------------------------------------------------------------
   4. Buttons & CTA System (The Sovereign Gold Standard)
   -------------------------------------------------------------------------- */
.root-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.95rem 2rem;
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: var(--radius-full);
  text-decoration: none;
  cursor: pointer;
  border: none;
  position: relative;
  overflow: hidden;
  letter-spacing: -0.01em;
  transition: var(--transition-snap);
}

.root-btn-gold {
  background: linear-gradient(135deg, #D4AF37 0%, #F4D06F 50%, #AA820A 100%);
  color: #070708;
  font-weight: 800;
  box-shadow: 0 4px 20px rgba(212, 175, 55, 0.35);
}

.root-btn-gold:hover {
  background: linear-gradient(135deg, #F4D06F 0%, #FFEAA7 50%, #D4AF37 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(212, 175, 55, 0.55);
}

.root-btn-cyan {
  background: rgba(0, 240, 255, 0.12);
  color: var(--root-cyan);
  border: 1px solid var(--root-cyan);
  box-shadow: 0 4px 20px rgba(0, 240, 255, 0.2);
}

.root-btn-cyan:hover {
  background: var(--root-cyan);
  color: var(--root-bg-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--root-cyan-glow);
}

.root-btn-glass {
  background: rgba(255, 255, 255, 0.05);
  color: var(--root-text-white);
  border: 1px solid var(--root-border-subtle);
  backdrop-filter: blur(8px);
}

.root-btn-glass:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   5. Dynamic Header & Megamenu Architecture (LTR)
   -------------------------------------------------------------------------- */
.root-header-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              background 0.3s ease,
              padding 0.3s ease;
  padding: 1.25rem 2rem;
}

.root-header-wrapper.is-scrolled {
  padding: 0.75rem 2rem;
  background: rgba(5, 11, 20, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0, 240, 255, 0.12);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.root-header-wrapper.is-hidden {
  transform: translateY(-100%);
}

.root-header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.root-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--root-text-white);
  font-weight: 900;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.root-logo-mark {
  width: 32px;
  height: 32px;
  border: 2px solid var(--root-cyan);
  transform: rotate(45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 12px var(--root-cyan-glow);
  position: relative;
}

.root-logo-mark::after {
  content: '';
  width: 10px;
  height: 10px;
  background: var(--root-cyan);
  box-shadow: 0 0 8px var(--root-cyan);
}

.root-nav-desktop {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.root-nav-item {
  position: relative;
}

.root-nav-link {
  color: var(--root-text-titanium);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.5rem 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: color 0.25s ease;
}

.root-nav-link:hover,
.root-nav-item:hover > .root-nav-link {
  color: var(--root-cyan);
}

/* Megamenu Matrix */
.root-megamenu {
  position: absolute;
  top: 100%;
  left: -200px;
  width: 950px;
  background: rgba(10, 15, 24, 0.96);
  border: 1px solid var(--root-border-glass);
  border-radius: var(--radius-lg);
  padding: 2.2rem;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), 0 0 35px rgba(0, 240, 255, 0.08);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(15px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  pointer-events: none;
}

.root-nav-item:hover .root-megamenu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: all;
}

.root-megamenu-col h4 {
  font-size: 0.82rem;
  text-transform: uppercase;
  color: var(--root-cyan);
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(0, 240, 255, 0.15);
  font-family: var(--font-mono);
}

.root-megamenu-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.root-megamenu-list a {
  color: var(--root-text-titanium);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  display: block;
  transition: all 0.2s ease;
  line-height: 1.4;
}

.root-megamenu-list a span {
  display: block;
  font-size: 0.75rem;
  color: var(--root-text-muted);
  margin-top: 2px;
}

.root-megamenu-list a:hover {
  color: var(--root-cyan);
  transform: translateX(4px);
}

/* --------------------------------------------------------------------------
   6. Authoritative 4-Column Footer (LTR)
   -------------------------------------------------------------------------- */
.root-footer {
  background: var(--root-bg-void);
  border-top: 1px solid rgba(0, 240, 255, 0.12);
  padding: 5rem 2rem 2.5rem;
  position: relative;
  z-index: 10;
}

.root-footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1.2fr;
  gap: 3.5rem;
  margin-bottom: 4rem;
}

.root-footer-col h3, .root-footer-col h4 {
  color: var(--root-text-white);
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.root-footer-manifesto {
  color: var(--root-text-muted);
  font-size: 0.95rem;
  line-height: 1.8;
  margin-top: 1rem;
}

.root-footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.root-footer-links a {
  color: var(--root-text-titanium);
  text-decoration: none;
  font-size: 0.92rem;
  transition: all 0.25s ease;
}

.root-footer-links a:hover {
  color: var(--root-cyan);
  padding-left: 5px;
}

.root-footer-escrow-badge {
  background: rgba(18, 24, 33, 0.9);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-top: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.root-footer-escrow-icon {
  font-size: 1.8rem;
  color: var(--root-gold);
}

.root-footer-escrow-text {
  font-size: 0.82rem;
  color: var(--root-text-titanium);
  line-height: 1.5;
}

.root-footer-bottom {
  max-width: 1400px;
  margin: 0 auto;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
  font-size: 0.85rem;
  color: var(--root-text-muted);
  font-family: var(--font-mono);
}

/* --------------------------------------------------------------------------
   7. Split Sticky Mobile Bar (Thumb Zone)
   -------------------------------------------------------------------------- */
.root-mobile-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 999;
  background: rgba(5, 11, 20, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(0, 240, 255, 0.2);
  padding: 0.85rem 1rem;
  gap: 0.75rem;
}

@media (max-width: 991px) {
  .root-mobile-bar {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
  }
  .root-footer {
    padding-bottom: 6rem;
  }
}

.root-mobile-btn-primary {
  background: linear-gradient(135deg, #D4AF37 0%, #F4D06F 100%);
  color: #050B14;
  font-weight: 800;
  font-size: 0.88rem;
  padding: 0.75rem 0.5rem;
  border-radius: var(--radius-md);
  text-align: center;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.root-mobile-btn-secondary {
  background: rgba(0, 240, 255, 0.12);
  color: var(--root-cyan);
  border: 1px solid var(--root-cyan);
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.75rem 0.5rem;
  border-radius: var(--radius-md);
  text-align: center;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --------------------------------------------------------------------------
   8. Form Luxury Elements & Validation Shake
   -------------------------------------------------------------------------- */
.root-form-group {
  margin-bottom: 1.5rem;
  position: relative;
}

.root-form-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--root-text-white);
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.root-form-input,
.root-form-select,
.root-form-textarea {
  width: 100%;
  background: rgba(10, 15, 24, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 0.95rem 1.25rem;
  color: var(--root-text-white);
  font-size: 0.95rem;
  font-family: inherit;
  transition: all 0.25s ease;
  outline: none;
}

.root-form-input:focus,
.root-form-select:focus,
.root-form-textarea:focus {
  border-color: var(--root-cyan);
  box-shadow: 0 0 18px var(--root-cyan-glow);
  background: rgba(14, 21, 33, 0.9);
}

.root-form-input.is-invalid,
.root-form-select.is-invalid,
.root-form-textarea.is-invalid {
  border-color: var(--root-danger) !important;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.35) !important;
  animation: inputShake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.root-form-input.is-valid {
  border-color: var(--root-success) !important;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.25) !important;
}

@keyframes inputShake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

.field-error-hint {
  display: none;
  font-size: 0.8rem;
  color: #F87171;
  margin-top: 0.4rem;
  padding: 0.35rem 0.75rem;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-xs);
  backdrop-filter: blur(8px);
}

.field-error-hint.is-visible {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* --------------------------------------------------------------------------
   9. Scroll-Velocity Data Streams
   -------------------------------------------------------------------------- */
.velocity-stream-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(0, 240, 255, 0.08);
  pointer-events: none;
  z-index: 1;
}

.velocity-stream-pulse {
  position: absolute;
  width: 3px;
  height: 40px;
  left: -1px;
  background: linear-gradient(180deg, transparent, var(--root-cyan), transparent);
  box-shadow: 0 0 12px var(--root-cyan);
  opacity: 0.7;
}

/* --------------------------------------------------------------------------
   10. Responsive Breakpoints
   -------------------------------------------------------------------------- */
@media (max-width: 1200px) {
  .root-footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
  }
}

@media (max-width: 991px) {
  .root-nav-desktop {
    display: none;
  }
  .root-footer-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}
