/* ============================================================
   EVERXP HERO — PHASE 2
   ============================================================ */

/* ---- Dark header wrapper (nav only now — hero is a sibling with its own bg) ---- */
.xp-dark-header {
  background-color: var(--xp-navy);
  position: relative;
  z-index: 100;
}

/* Subtle grid overlay texture */
.xp-dark-header::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}

.xp-dark-header .container {
  position: relative;
  z-index: 1;
}

/* ---- Navbar overrides on dark background ---- */
.xp-navbar .nav-link {
  color: rgba(255, 255, 255, 0.80) !important;
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  transition: color var(--ease-default), background-color var(--ease-default);
  white-space: nowrap;
}

.xp-navbar .nav-link:hover,
.xp-navbar .nav-link:focus {
  color: var(--xp-gold) !important;
  background-color: rgba(255, 255, 255, 0.06);
}

.xp-navbar .dropdown-menu {
  background-color: var(--xp-white);
  border: 1px solid var(--xp-border);
}

.xp-navbar .navbar-toggler {
  border-color: rgba(255, 255, 255, 0.3);
}

.xp-navbar .navbar-toggler-icon {
  filter: invert(1);
}

/* ---- Nav link hover: gold underline sweep ---- */
.xp-navbar .nav-link {
  position: relative;
}

.xp-navbar .nav-link::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: var(--space-3);
  right: var(--space-3);
  height: 2px;
  background: var(--xp-gold);
  border-radius: 1px;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.22s ease;
}

.xp-navbar .nav-link:hover::after,
.xp-navbar .nav-link:focus::after {
  transform: scaleX(1);
}

/* Dropdown toggles get a chevron nudge instead of underline */
.xp-navbar .dropdown-toggle::after {
  display: none; /* hide Bootstrap's default caret — we use the ::after pseudo */
}

.xp-navbar .nav-link.dropdown-toggle::before {
  content: '';
  position: absolute;
  bottom: 2px;
  left: var(--space-3);
  right: var(--space-3);
  height: 2px;
  background: var(--xp-gold);
  border-radius: 1px;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.22s ease;
}

.xp-navbar .nav-link.dropdown-toggle:hover::before,
.xp-navbar .nav-link.dropdown-toggle:focus::before,
.xp-navbar .nav-link.dropdown-toggle[aria-expanded="true"]::before {
  transform: scaleX(1);
}

/* ── Placeholder chrome while JS loads ── */
#xp-nav-root    { display: block; min-height: 64px; background: var(--xp-navy); }
#xp-footer-root { display: block; min-height: 180px; background: var(--xp-navy-dark); }

/* ── Content Library dropdown ── */
.xp-lib-dropdown {
  min-width: 360px !important;
  padding: var(--space-3) !important;
  border-radius: var(--radius-lg) !important;
  border: 1px solid var(--xp-border) !important;
  box-shadow: var(--shadow-xl) !important;
}

.xp-lib-header {
  padding: var(--space-3) var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--xp-border);
  margin-bottom: var(--space-2);
}

.xp-lib-header__title {
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: var(--weight-extrabold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--xp-navy);
  margin-bottom: var(--space-1);
}

.xp-lib-header__sub {
  display: block;
  font-size: var(--text-xs);
  color: var(--xp-muted);
  line-height: 1.45;
}

.xp-lib-item {
  display: flex !important;
  align-items: flex-start !important;
  gap: var(--space-3) !important;
  padding: var(--space-3) var(--space-3) !important;
  border-radius: var(--radius-md) !important;
  transition: background var(--ease-default) !important;
  color: inherit !important;
}

.xp-lib-item:hover {
  background: var(--xp-light) !important;
}

.xp-lib-item__icon {
  font-size: 1.35rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

.xp-lib-item__body {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.xp-lib-item__body strong {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--xp-navy);
  line-height: 1.2;
}

.xp-lib-item__body small {
  font-size: var(--text-xs);
  color: var(--xp-muted);
  line-height: 1.35;
  font-weight: var(--weight-normal);
}

/* ---- CTA button cluster — never wrap or shrink ---- */
.xp-navbar .ms-auto {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  flex-shrink: 0;
  gap: var(--space-2);
  margin-left: auto !important;
}

.xp-navbar .ms-auto .btn {
  white-space: nowrap;
  flex-shrink: 0;
}

/* ---- At 1200–1399px: tighten nav-link padding to gain space ---- */
@media (min-width: 1200px) and (max-width: 1399px) {
  .xp-navbar .nav-link {
    font-size: 0.8125rem;
    padding: var(--space-2) var(--space-2);
  }

  .xp-navbar .ms-auto .btn {
    padding: 0.45rem 0.9rem;
    font-size: 0.8125rem;
  }
}

/* ---- Collapsed nav (mobile/tablet <1200px) ---- */
@media (max-width: 1199px) {
  .xp-navbar .navbar-collapse {
    padding: var(--space-4) 0 var(--space-6);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: var(--space-3);
  }

  .xp-navbar .navbar-collapse .nav-link {
    padding: var(--space-3) var(--space-2);
    border-radius: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }

  .xp-navbar .navbar-collapse .dropdown-menu {
    background: rgba(255, 255, 255, 0.04);
    border: none;
    border-radius: 0;
    padding: 0;
  }

  .xp-navbar .navbar-collapse .dropdown-item {
    color: rgba(255, 255, 255, 0.65);
    padding: var(--space-2) var(--space-6);
    font-size: var(--text-sm);
  }

  .xp-navbar .navbar-collapse .dropdown-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--xp-white);
  }

  .xp-navbar .ms-auto {
    flex-direction: row;
    padding-top: var(--space-4);
    gap: var(--space-3);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: var(--space-3);
  }

  .xp-navbar .ms-auto .btn {
    flex: 1;
    text-align: center;
  }
}

/* ---- Hero section ---- */
.xp-hero {
  background: var(--xp-navy);
  padding: var(--space-16) 0 var(--space-24);
  position: relative;
  z-index: 1;
  overflow-x: hidden;
}

.xp-hero__row {
  min-height: 480px;
}

/* ---- Left column: messaging ---- */
.xp-hero__left {
  padding-top: var(--space-8);
  padding-right: var(--space-10);
}

.xp-hero__headline {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 4.5vw, 3.5rem);
  font-weight: var(--weight-black);
  line-height: var(--leading-tight);
  color: var(--xp-white);
  margin-bottom: var(--space-6);
  letter-spacing: -0.02em;
}

/* Rotating words in gold */
.xp-hero__typewriter {
  display: block;
  color: var(--xp-gold);
  position: relative;
  min-height: 1.25em;
}

.xp-tw-word {
  display: block;
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  white-space: nowrap;
}

.xp-tw-word.active {
  opacity: 1;
  transform: translateY(0);
}

.xp-tw-word.exit {
  opacity: 0;
  transform: translateY(-12px);
}

.xp-hero__sub {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  line-height: var(--leading-loose);
  color: rgba(255, 255, 255, 0.70);
  margin-bottom: var(--space-8);
  max-width: 520px;
}

.xp-hero__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-8);
}

.xp-hero__proof {
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.50);
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.xp-hero__proof i {
  color: var(--xp-gold);
  margin-right: 4px;
}

/* ---- Right column: campaign preview ---- */
.xp-hero__right {
  display: flex;
  align-items: center;
  justify-content: center;
}

.xp-campaign-preview {
  width: 100%;
  max-width: 440px;
  position: relative;
}

/* Live badge above browser */
.xp-campaign-live {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: rgba(255, 255, 255, 0.80);
}

.xp-campaign-score-badge {
  margin-left: auto;
  background: var(--xp-gold-glow);
  color: var(--xp-gold);
  border: 1px solid rgba(245, 197, 24, 0.30);
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
}

/* ---- Browser chrome ---- */
.xp-browser {
  background: var(--xp-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xl), 0 0 0 1px rgba(255,255,255,0.08);
}

.xp-browser__bar {
  background: #F0F2F5;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  border-bottom: 1px solid var(--xp-border);
}

.xp-browser__dots {
  display: flex;
  gap: 5px;
}

.xp-browser__dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--xp-border);
}

.xp-browser__dots span:nth-child(1) { background: #FF5F57; }
.xp-browser__dots span:nth-child(2) { background: #FFBD2E; }
.xp-browser__dots span:nth-child(3) { background: #28CA42; }

.xp-browser__url {
  flex: 1;
  background: var(--xp-white);
  border: 1px solid var(--xp-border);
  border-radius: var(--radius-full);
  padding: 3px 10px;
  font-family: var(--font-display);
  font-size: 11px;
  color: var(--xp-muted);
  text-align: center;
}

.xp-browser__body {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* ---- Content slots ---- */
.xp-slot {
  border: 1.5px dashed var(--xp-border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  position: relative;
  background: var(--xp-light);
  transition: border-color 0.3s ease;
}

.xp-slot.swapping {
  border-color: var(--xp-gold);
  background: #FFFDF0;
}

.xp-slot__tag {
  position: absolute;
  top: -10px;
  left: var(--space-3);
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: var(--weight-bold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.xp-tag--ai    { background: var(--xp-navy); color: var(--xp-white); }
.xp-tag--media { background: #7C3AED; color: var(--xp-white); }
.xp-tag--cta   { background: var(--xp-gold); color: var(--xp-navy-dark); }

/* Slot content: headline */
.xp-slot__content {
  padding-top: var(--space-2);
  min-height: 36px;
  transition: opacity 0.25s ease;
}

.xp-slot__content.fade-out { opacity: 0; }
.xp-slot__content.fade-in  { opacity: 1; }

.xp-fake-headline {
  height: 14px;
  background: linear-gradient(90deg, var(--xp-navy) 70%, transparent);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  width: 80%;
  opacity: 0.15;
}

.xp-fake-sub {
  height: 10px;
  background: var(--xp-muted);
  border-radius: var(--radius-sm);
  width: 55%;
  opacity: 0.15;
}

/* Slot content: text (rendered) */
.xp-slot__headline-text {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--xp-navy);
  line-height: 1.3;
  margin-bottom: 4px;
}

.xp-slot__sub-text {
  font-size: var(--text-xs);
  color: var(--xp-muted);
}

/* Slot content: media */
.xp-slot__content--media {
  min-height: 70px;
}

.xp-media-placeholder {
  width: 100%;
  height: 70px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  transition: background 0.3s ease;
}

/* Slot content: CTA */
.xp-slot__content--cta {
  display: flex;
  align-items: stretch;
  min-height: 44px;
}

.xp-cta-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 8px;
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  cursor: default;
  transition: background 0.3s ease, color 0.3s ease;
  text-decoration: none;
  width: 100%;
  text-align: center;
}

/* ---- Variant testing bar ---- */
.xp-variant-bar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-3);
  padding: 0 var(--space-1);
}

.xp-variant-label {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.50);
  margin-right: var(--space-1);
}

.xp-variant-pill {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: var(--weight-bold);
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.50);
  border: 1px solid rgba(255,255,255,0.12);
  transition: all 0.3s ease;
  cursor: default;
}

.xp-variant-pill.active {
  background: var(--xp-gold);
  color: var(--xp-navy-dark);
  border-color: var(--xp-gold);
  box-shadow: 0 0 0 3px var(--xp-gold-glow);
}

.xp-variant-winner {
  margin-left: auto;
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: var(--xp-gold);
  opacity: 0;
  transition: opacity 0.5s ease;
}

.xp-variant-winner.visible {
  opacity: 1;
}

/* ---- Hero section bottom curve ---- */
.xp-hero::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--xp-white);
  clip-path: ellipse(55% 100% at 50% 100%);
  pointer-events: none;
}

/* ---- Hero responsive (matches new collapse at 1200px) ---- */

/* Tablet / small desktop: single-column hero (Bootstrap col-xl-6 stacks here too) */
@media (max-width: 1199px) {
  .xp-hero {
    padding: var(--space-12) 0 var(--space-20);
  }

  .xp-hero__row {
    min-height: unset;
  }

  .xp-hero__right {
    margin-top: var(--space-10);
  }

  .xp-hero__left {
    padding-top: 0;
    padding-right: 0;
  }

  /* Centre every text element in the hero */
  .xp-hero__left .label-overline {
    display: block;
    text-align: center;
  }

  .xp-hero__headline {
    font-size: clamp(2rem, 5vw, 2.75rem);
    text-align: center;
  }

  /* Typewriter: span the full width so text-align:center works on abs children */
  .xp-hero__typewriter {
    display: block;
    text-align: center;
  }

  .xp-tw-word {
    left: 0;
    right: 0;
    width: 100%;
    text-align: center;
    white-space: normal;
  }

  .xp-hero__sub {
    text-align: center;
    width: 100%;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
  }

  .xp-hero__ctas {
    justify-content: center;
  }

  .xp-hero__proof {
    justify-content: center;
  }
}

/* Mobile */
@media (max-width: 575px) {
  .xp-hero {
    padding: var(--space-8) 0 var(--space-8);
  }

  .xp-hero__headline {
    font-size: 1.875rem;
  }

  /* Sub: prevent touching screen edges */
  .xp-hero__sub {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0 var(--space-2);
  }

  /* CTA buttons: side by side at 50% each, centred with equal edge inset */
  .xp-hero__ctas {
    flex-direction: row;
    align-items: stretch;
    justify-content: center;
    width: calc(100% - 2rem);
    margin-left: auto;
    margin-right: auto;
  }

  .xp-hero__ctas .btn {
    flex: 1;
    min-width: 0;
    text-align: center;
    white-space: nowrap;
    padding-left: var(--space-3);
    padding-right: var(--space-3);
  }

  /* Proof items: stay horizontal, wrap to 2 lines max */
  .xp-hero__proof {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: var(--space-1) var(--space-3);
    font-size: var(--text-xs);
  }

  /* Campaign preview: cap height to reduce hero scroll-y */
  .xp-campaign-preview {
    max-width: 100%;
    max-height: 260px;
  }

  /* Clip the right column so the capped preview doesn't show overflow */
  .xp-hero__right {
    width: 100%;
    overflow: hidden;
    max-height: 260px;
  }
}
