/*
 * Global header & footer — premium UI (Lovable merge)
 */

/* ─── Skip link ───────────────────────────────────────────────────────────── */
.rj-skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.rj-skip-link:focus {
  left: 16px;
  top: 12px;
  width: auto;
  height: auto;
  z-index: 200;
  padding: 10px 16px;
  border-radius: var(--rj-r-sm);
  background: var(--rj-bg-2);
  border: 1px solid var(--rj-lime);
  color: var(--rj-lime-soft);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

/* ─── Header premium ─────────────────────────────────────────────────────── */
.rj-header--premium {
  position: sticky;
  top: 0;
  z-index: 50;
}

.rj-header--premium::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(184, 255, 59, 0.35) 25%,
    rgba(34, 211, 238, 0.25) 75%,
    transparent
  );
  opacity: 0.65;
  pointer-events: none;
}

.rj-header--on-hero.rj-header--transparent:not(.rj-header--scrolled) {
  background: transparent;
  border-bottom-color: transparent;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.rj-header--on-hero.rj-header--transparent:not(.rj-header--scrolled)::before {
  opacity: 0.35;
}

.rj-header--premium.rj-header--scrolled {
  background: rgba(5, 11, 20, 0.92);
  border-bottom-color: rgba(184, 255, 59, 0.12);
  box-shadow:
    0 8px 32px -12px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(184, 255, 59, 0.04);
}

.rj-header--premium .rj-brand__name {
  font-family: "Space Grotesk", var(--rj-f-body);
  font-weight: 600;
  letter-spacing: -0.03em;
}

.rj-header--premium .rj-brand__name span {
  color: var(--rj-text-muted);
  font-weight: 500;
}

.rj-brand__logo-img {
  display: block;
  height: 40px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
}

.rj-footer__brand-logo.rj-brand .rj-brand__logo-img {
  height: 36px;
}

.rj-header--premium .rj-brand__mark {
  box-shadow:
    0 0 0 1px rgba(184, 255, 59, 0.2),
    0 0 24px -6px rgba(184, 255, 59, 0.35);
}

/* RJ monogram — subtle dev-style motion */
.rj-brand__mark--animated {
  isolation: isolate;
}

.rj-brand__mark-orbit {
  position: absolute;
  inset: -2px;
  border-radius: 12px;
  padding: 1px;
  background: conic-gradient(
    from 0deg,
    rgba(184, 255, 59, 0.85),
    rgba(34, 211, 238, 0.5),
    rgba(167, 139, 250, 0.35),
    rgba(184, 255, 59, 0.15),
    rgba(184, 255, 59, 0.85)
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
  animation: rj-brand-orbit 8s linear infinite;
  opacity: 0.75;
  pointer-events: none;
}

@keyframes rj-brand-orbit {
  to { transform: rotate(360deg); }
}

.rj-brand__mark-scan {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(184, 255, 59, 0.55), transparent);
  box-shadow: 0 0 8px rgba(184, 255, 59, 0.35);
  animation: rj-brand-scan 3.2s ease-in-out infinite;
  pointer-events: none;
  z-index: 2;
}

@keyframes rj-brand-scan {
  0%, 100% { top: 8%; opacity: 0; }
  8% { opacity: 1; }
  50% { top: 82%; opacity: 1; }
  58% { opacity: 0; }
}

.rj-brand__mark-dot {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--rj-lime, #c8ff3d);
  box-shadow: 0 0 6px rgba(184, 255, 59, 0.8);
  z-index: 3;
  animation: rj-brand-dot-pulse 2s ease-in-out infinite;
}

@keyframes rj-brand-dot-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.82); }
}

.rj-brand__mark--animated .rj-brand__mark-inner {
  animation: rj-brand-glow 3.5s ease-in-out infinite;
}

@keyframes rj-brand-glow {
  0%, 100% { text-shadow: 0 0 10px rgba(184, 255, 59, 0.35); }
  50% { text-shadow: 0 0 16px rgba(184, 255, 59, 0.65), 0 0 24px rgba(34, 211, 238, 0.25); }
}

.rj-brand:hover .rj-brand__mark-orbit {
  opacity: 1;
  animation-duration: 4s;
}

.rj-brand:hover .rj-brand__mark--animated .rj-brand__mark-inner {
  color: #e8ffb8;
}

@media (prefers-reduced-motion: reduce) {
  .rj-brand__mark-orbit,
  .rj-brand__mark-scan,
  .rj-brand__mark-dot,
  .rj-brand__mark--animated .rj-brand__mark-inner {
    animation: none !important;
  }

  .rj-brand__mark-dot {
    opacity: 1;
  }
}

.rj-header__cta-glow.rj-btn-primary {
  box-shadow: 0 0 28px -8px rgba(184, 255, 59, 0.45);
}

.rj-header__cta-glow.rj-btn-primary:hover {
  box-shadow: 0 0 36px -6px rgba(184, 255, 59, 0.55);
}

.rj-header--premium .rj-nav__link.is-active::after {
  box-shadow: 0 0 10px rgba(184, 255, 59, 0.45);
}

/* ─── Premium nav links ─────────────────────────────────────────────────── */
.rj-header--premium .rj-nav {
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.1);
  background: rgba(8, 14, 24, 0.35);
}

.rj-header--premium .rj-nav__link {
  font-family: "Space Grotesk", var(--rj-f-body);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
  padding: 8px 13px;
  border-radius: 10px;
}

.rj-header--premium .rj-nav__link:hover {
  color: var(--rj-text);
  background: rgba(184, 255, 59, 0.06);
  border-color: rgba(184, 255, 59, 0.12);
}

.rj-header--premium .rj-nav__item--mega.is-mega-open > .rj-nav__link,
.rj-header--premium .rj-nav__item--mega:hover > .rj-nav__link {
  color: var(--rj-lime-soft);
  background: rgba(184, 255, 59, 0.08);
  border-color: rgba(184, 255, 59, 0.2);
  box-shadow: 0 0 20px -10px rgba(184, 255, 59, 0.45);
}

.rj-header--premium .rj-nav__link.is-active {
  color: var(--rj-text);
  background: rgba(15, 23, 42, 0.65);
  border-color: rgba(148, 163, 184, 0.18);
}

.rj-header--premium .rj-mega-menu {
  border-color: rgba(184, 255, 59, 0.18);
  box-shadow:
    0 32px 64px -24px rgba(0, 0, 0, 0.65),
    0 0 0 1px rgba(184, 255, 59, 0.08),
    0 0 40px -20px rgba(34, 211, 238, 0.25);
}

.rj-header--premium .rj-mega-menu__foot {
  border-top-color: rgba(184, 255, 59, 0.1);
}

.rj-header--premium .rj-mega-service-link:hover {
  background: rgba(184, 255, 59, 0.05);
}

.rj-header--premium .rj-mega-service-link__title {
  font-family: "Space Grotesk", var(--rj-f-body);
  letter-spacing: -0.02em;
}

.rj-header--premium .rj-mega-link:hover .rj-mega-link__icon {
  border-color: rgba(184, 255, 59, 0.35);
  color: var(--rj-lime-soft);
}

/* ─── Mobile drawer ───────────────────────────────────────────────────────── */
.rj-drawer--premium {
  background: rgba(5, 11, 20, 0.98);
  border-left: 1px solid rgba(184, 255, 59, 0.1);
  box-shadow: -24px 0 60px rgba(0, 0, 0, 0.45);
}

.rj-drawer--premium .rj-drawer__link.is-active,
.rj-drawer--premium .rj-drawer__link:focus-visible {
  color: var(--rj-lime-soft);
  border-color: rgba(184, 255, 59, 0.2);
  background: rgba(184, 255, 59, 0.06);
}

.rj-drawer__footer-note {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--rj-text-dim);
  text-align: center;
  line-height: 1.5;
}

.rj-drawer__footer .rj-btn {
  box-shadow: none;
}

.rj-btn--full {
  width: 100%;
  justify-content: center;
}

/* ─── Footer premium ──────────────────────────────────────────────────────── */
.rj-footer--premium {
  position: relative;
  margin-top: clamp(64px, 8vw, 96px);
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(34, 211, 238, 0.06), transparent 55%),
    linear-gradient(180deg, rgba(5, 11, 20, 0.4) 0%, rgba(5, 11, 20, 0.95) 100%);
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.rj-footer--premium::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(184, 255, 59, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(184, 255, 59, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.35), transparent 70%);
  pointer-events: none;
}

.rj-footer--premium > .rj-container {
  position: relative;
  z-index: 1;
}

.rj-footer__newsletter--premium {
  position: relative;
  overflow: hidden;
  border-color: rgba(184, 255, 59, 0.14);
  backdrop-filter: blur(14px);
}

.rj-footer__newsletter--premium::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    135deg,
    rgba(184, 255, 59, 0.25),
    rgba(34, 211, 238, 0.15) 50%,
    transparent 70%
  );
  -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;
}

.rj-footer__newsletter--premium h3 {
  font-family: "Space Grotesk", var(--rj-f-body);
  font-weight: 600;
  letter-spacing: -0.03em;
}

.rj-footer--premium .rj-footer__social-link {
  transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.rj-footer--premium .rj-footer__social-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -8px rgba(184, 255, 59, 0.35);
}

.rj-footer__divider {
  margin-block: 2.5rem 2rem;
  opacity: 0.7;
  height: 1px;
  border: none;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(184, 255, 59, 0.25) 20%,
    rgba(34, 211, 238, 0.2) 80%,
    transparent
  );
}

.rj-footer--premium .rj-footer__col-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-family: "Space Grotesk", var(--rj-f-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--rj-text-muted);
}

.rj-footer--premium .rj-footer__col-title::before {
  content: "";
  width: 14px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--rj-lime), rgba(34, 211, 238, 0.6));
  flex-shrink: 0;
}

.rj-footer--premium .rj-footer__links {
  gap: 6px;
}

.rj-footer--premium .rj-footer__link {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 2px 0;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--rj-text-muted);
  text-decoration: none;
  transition: color 0.18s ease, transform 0.18s ease;
}

.rj-footer--premium .rj-footer__link:hover {
  color: var(--rj-lime-soft);
  transform: translateX(3px);
}

.rj-footer__trust {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
}

.rj-footer__trust li {
  font-size: 11px;
  line-height: 1.3;
  color: var(--rj-text-dim);
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(15, 23, 42, 0.45);
}

.rj-footer__trust strong {
  color: var(--rj-lime-soft);
  font-weight: 600;
}

.rj-footer--premium .rj-footer__availability {
  margin-top: 20px;
}

.rj-footer--premium .rj-footer__bottom {
  border-top-color: rgba(148, 163, 184, 0.1);
}

.rj-footer--premium .rj-footer__bottom-links a:hover {
  color: var(--rj-lime-soft);
}

.rj-footer--premium .rj-footer__credit a {
  color: var(--rj-text-muted);
  text-decoration: none;
}

.rj-footer--premium .rj-footer__credit a:hover {
  color: var(--rj-lime-soft);
}

/* ─── Header search ─────────────────────────────────────────────────────── */
.rj-header-search {
  position: relative;
}

.rj-header-search__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--rj-r-sm);
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(5, 11, 20, 0.5);
  color: var(--rj-text-muted);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.rj-header-search__toggle:hover,
.rj-header-search.is-open .rj-header-search__toggle {
  border-color: rgba(184, 255, 59, 0.35);
  color: var(--rj-lime-soft);
}

.rj-header-search__panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(360px, calc(100vw - 24px));
  padding: 12px;
  border-radius: var(--rj-r-md);
  border: 1px solid rgba(184, 255, 59, 0.2);
  background: rgba(5, 11, 20, 0.96);
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(12px);
  z-index: 60;
}

.rj-header-search__panel[hidden] {
  display: none !important;
}

.rj-header-search__form {
  display: flex;
  gap: 8px;
}

.rj-header-search__input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border-radius: var(--rj-r-sm);
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.6);
  color: var(--rj-text);
  font-size: 14px;
}

@media (max-width: 1024px) {
  .rj-header--premium .rj-header__cta-secondary {
    display: none;
  }
}

/* ─── Sticky mobile CTA bar ─────────────────────────────────────────────── */
.rj-mobile-cta {
  display: none;
}

@media (max-width: 767px) {
  .rj-mobile-cta {
    display: flex;
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom, 12px));
    z-index: 45;
    gap: 8px;
    padding: 6px;
    border-radius: 14px;
    background: rgba(5, 11, 20, 0.92);
    border: 1px solid rgba(184, 255, 59, 0.2);
    box-shadow: 0 12px 40px -12px rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(12px);
  }

  body.rj-has-mobile-cta {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }

  .rj-mobile-cta__btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
  }

  .rj-mobile-cta__btn:active {
    transform: scale(0.98);
  }

  .rj-mobile-cta__btn--primary {
    background: var(--rj-lime);
    color: #050b14;
    box-shadow: 0 4px 20px -6px rgba(184, 255, 59, 0.55);
  }

  .rj-mobile-cta__btn--secondary {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.25);
    color: var(--rj-text);
  }

  .rj-mobile-cta__btn--secondary:hover {
    border-color: rgba(184, 255, 59, 0.35);
    color: var(--rj-lime-soft);
  }
}

@media (min-width: 768px) {
  .rj-mobile-cta {
    display: none !important;
  }
}

/* Flash notices (newsletter redirect) */
.rj-flash {
  position: fixed;
  top: calc(var(--rj-header-height, 72px) + 12px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 9998;
  max-width: min(520px, calc(100vw - 24px));
  padding: 12px 44px 12px 16px;
  border-radius: 12px;
  font-size: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 14, 24, 0.92);
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.rj-flash--success {
  border-color: rgba(184, 255, 59, 0.35);
}

.rj-flash--error {
  border-color: rgba(255, 100, 100, 0.35);
}

.rj-flash p {
  margin: 0;
}

.rj-flash__cta {
  margin: 10px 0 0;
}

.rj-flash__cta .rj-btn {
  width: 100%;
  justify-content: center;
}

.rj-flash__close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  color: var(--rj-text-muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
}

.rj-form-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* Cookie consent */
.rj-cookie-consent {
  position: fixed;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 9997;
  width: min(640px, calc(100vw - 20px));
  padding: 0;
}

body.rj-has-mobile-cta .rj-cookie-consent {
  bottom: calc(76px + env(safe-area-inset-bottom, 0px));
}

.rj-cookie-consent__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(184, 255, 59, 0.18);
}

.rj-cookie-consent__text {
  margin: 0;
  font-size: 0.85rem;
  color: var(--rj-text-muted);
  flex: 1 1 220px;
}

.rj-cookie-consent__text a {
  color: var(--rj-accent);
  text-decoration: underline;
}

.rj-cookie-consent__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rj-cookie-consent__actions .rj-btn {
  padding: 8px 14px;
  font-size: 0.8rem;
}