/* Auto-adapted from deploy/xcelerate-apex-landing/styles.css */
/* Match trading.xcelerate.trade + xcelerate.trade brand tokens (globals.css) */
:root {
  --bg: #020617;
  --bg-mid: #1e3a8a;
  --bg-end: #0f172a;
  --bg-elev: #111e31;
  --card: rgba(15, 23, 42, 0.55);
  --border: rgba(96, 165, 250, 0.32);
  --border-soft: rgba(96, 165, 250, 0.18);
  --text: #f8fafc;
  /* Was #94a3b8 — fails AA on blue mid-gradient (#1e3a8a ≈ 4.0:1). */
  --muted: #cbd5e1;
  --primary: #38bdf8;
  --btn-from: #3b82f6;
  --btn-to: #06b6d4;
  --btn-from-hover: #2563eb;
  --btn-to-hover: #0891b2;
  --radius: 16px;
  --shadow:
    0 0 0 1px rgba(59, 130, 246, 0.06) inset,
    0 12px 40px -32px rgba(59, 130, 246, 0.35);
  --font: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --max: 1120px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

.apex-root {
  scroll-behavior: smooth;
}

/* Skip link styles live in globals.css (.skip-link); keep apex cards/layout here. */
.apex-root {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  /* Same brand wash as trading.xcelerate.trade / xcelerate.trade */
  background-color: var(--bg);
  background-image: linear-gradient(135deg, #020617 0%, #1e3a8a 52%, #0f172a 100%);
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  line-height: 1.55;
}

img,
video {
  max-width: 100%;
  display: block;
}

a {
  color: var(--primary);
  /* 1.4.1 Use of Color — do not rely on color alone for links */
  text-decoration: underline;
  text-underline-offset: 0.18em;
  text-decoration-thickness: from-font;
}

a:hover {
  text-decoration-thickness: 2px;
}

.apex-wrap {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* Header — xc-topbar glass from trading */
.apex-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  background: rgba(15, 23, 42, 0.12);
  border-bottom: 1px solid rgba(96, 165, 250, 0.32);
  box-shadow:
    0 0 0 1px rgba(59, 130, 246, 0.06) inset,
    0 12px 40px -32px rgba(59, 130, 246, 0.22);
}

.apex-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
}

.apex-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.apex-brand:hover {
  text-decoration: none;
}

.apex-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(90deg, var(--btn-from), var(--btn-to));
  box-shadow: 0 0 24px rgba(59, 130, 246, 0.35);
  color: #fff;
  font-weight: 800;
  font-size: 1.05rem;
  line-height: 1;
  letter-spacing: 0;
}
.apex-brand-mark::before {
  content: "X";
}

.apex-nav {
  display: none;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.85rem;
  font-size: 0.92rem;
}

@media (min-width: 900px) {
  .apex-nav-desktop {
    display: flex;
  }
}

.apex-nav a {
  color: #cbd5e1;
  text-decoration: none;
  padding: 0.25rem 0.15rem;
}

.apex-nav a:hover {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.apex-nav a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  text-decoration: underline;
}

.apex-lang {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.2rem;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.45);
}

.apex-lang a {
  color: var(--muted);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
}

.apex-lang a[aria-current="page"] {
  color: #fff;
  background: linear-gradient(90deg, var(--btn-from), var(--btn-to));
}

/* Mobile: hamburger (drawer is portaled — see .apex-mobile-nav) */
.apex-menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  min-width: 2.5rem;
  min-height: 2.5rem;
  flex-shrink: 0;
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
}

.apex-menu-btn:hover,
.apex-menu-btn:focus-visible {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.apex-mobile-trigger {
  display: block;
  flex-shrink: 0;
  position: relative;
  z-index: 41;
}

@media (min-width: 900px) {
  .apex-mobile-trigger {
    display: none;
  }
}

/* Portaled to document.body — must NOT live under .apex-topbar (backdrop-filter
   creates a containing block on iOS so fixed = only header height). */
.apex-mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 9999;
  width: 100%;
  height: 100%;
  height: 100dvh;
}

.apex-mobile-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  margin: 0;
  background: rgba(2, 6, 23, 0.72);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.apex-mobile-drawer {
  position: absolute;
  top: max(0.75rem, env(safe-area-inset-top));
  right: max(0.75rem, env(safe-area-inset-right));
  bottom: max(0.75rem, env(safe-area-inset-bottom));
  display: flex;
  width: min(100% - 1.5rem, 20rem);
  flex-direction: column;
  overflow: hidden;
  border-radius: 1rem;
  border: 1px solid rgba(96, 165, 250, 0.28);
  background: rgba(15, 23, 42, 0.98);
  box-shadow: 0 24px 64px -20px rgba(2, 6, 23, 0.85);
}

.apex-mobile-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.apex-menu-btn-always {
  display: inline-flex !important;
}

.apex-mobile-lang-block {
  padding: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.apex-mobile-label {
  margin: 0 0 0.5rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(34, 211, 238, 0.9);
}

.apex-mobile-label-inline {
  margin: 0;
}

.apex-lang-drawer {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
}

.apex-mobile-links {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.15rem;
  overflow-y: auto;
  padding: 0.75rem 0.85rem 1.25rem;
}

.apex-mobile-links a {
  display: block;
  padding: 0.75rem 0.85rem;
  border-radius: 0.65rem;
  color: #e2e8f0;
  font-size: 0.95rem;
  font-weight: 550;
  text-decoration: none;
}

.apex-mobile-links a:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

/* Hero */
.apex-hero {
  padding: 3.5rem 0 2.5rem;
}

.apex-hero-grid {
  display: grid;
  gap: 2rem;
  align-items: center;
}

@media (min-width: 900px) {
  .apex-hero-grid {
    grid-template-columns: 1.15fr 0.85fr;
  }
}

.apex-neon-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  margin: 0 0 0.85rem;
  padding: 0.35rem 0.95rem;
  border-radius: 999px;
  border: 1px solid rgba(96, 165, 250, 0.55);
  background: rgba(15, 23, 42, 0.22);
  color: rgba(226, 232, 240, 0.92);
  backdrop-filter: blur(12px);
  box-shadow:
    0 0 0 1px rgba(59, 130, 246, 0.25) inset,
    0 18px 60px -44px rgba(59, 130, 246, 0.55);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.apex-neon-pill::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(120% 120% at 50% 0%, rgba(34, 211, 238, 0.22), transparent 60%);
  opacity: 0.9;
}

.apex-hero-title {
  margin: 0 0 1rem;
  font-size: clamp(1.35rem, 3.2vw, 2rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  background: none;
  box-decoration-break: unset;
  -webkit-box-decoration-break: unset;
}

.apex-hero-title-gradient {
  /* Solid color first — transparent + clip fails WCAG contrast checkers. */
  color: #e0f2fe;
  background: linear-gradient(90deg, #93c5fd 0%, #5eead4 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .apex-hero-title-gradient {
    /* Keep a real color underneath for tools that ignore fill; clip only when supported. */
    color: #e0f2fe;
    -webkit-text-fill-color: transparent;
  }
}

.apex-hero-lead {
  margin: 0 0 1.5rem;
  max-width: 38rem;
  color: var(--muted);
  font-size: 1.05rem;
}

.apex-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.apex-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0.7rem 1.2rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 650;
  font-size: 0.95rem;
  text-decoration: none !important;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.apex-btn:hover {
  transform: translateY(-1px);
}

.apex-btn-primary {
  color: #fff;
  background: linear-gradient(90deg, var(--btn-from), var(--btn-to));
  box-shadow: 0 10px 28px -12px rgba(59, 130, 246, 0.55);
}

.apex-btn-primary:hover {
  background: linear-gradient(90deg, var(--btn-from-hover), var(--btn-to-hover));
}

.apex-btn-ghost {
  color: #e2e8f0;
  border-color: rgba(96, 165, 250, 0.32);
  background: rgba(15, 23, 42, 0.16);
  backdrop-filter: blur(10px);
}

.apex-meta {
  color: var(--muted);
  margin: 0 0 1.25rem;
}

.apex-trust {
  margin: 0;
  color: #cbd5e1;
  font-size: 0.85rem;
}

.apex-hero-visual {
  position: relative;
  display: block;
  width: 100%;
  border: 0;
  padding: 0;
  margin: 0;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(96, 165, 250, 0.32);
  background: #000;
  box-shadow:
    0 0 0 1px rgba(59, 130, 246, 0.08) inset,
    0 20px 50px -28px rgba(30, 58, 138, 0.65);
  aspect-ratio: 16 / 9;
}

.apex-hero-visual video,
.apex-hero-visual img,
.apex-hero-visual iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* Posters can fill; uploaded/phone videos must not be cropped. */
.apex-hero-visual img {
  object-fit: cover;
}

.apex-hero-visual video {
  object-fit: contain;
  background: #000;
}

/* Explicit poster overlay — Safari often skips native poster= after metadata. */
.apex-hero-poster-btn {
  position: absolute;
  inset: 0;
  z-index: 2;
  margin: 0;
  padding: 0;
  border: 0;
  cursor: pointer;
  background: #000;
  display: block;
}

.apex-hero-poster-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.apex-hero-poster-play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 64px;
  height: 64px;
  margin: -32px 0 0 -32px;
  border-radius: 999px;
  background: rgba(8, 18, 40, 0.72);
  border: 2px solid rgba(125, 211, 252, 0.85);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.apex-hero-poster-play::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-35%, -50%);
  border-style: solid;
  border-width: 10px 0 10px 16px;
  border-color: transparent transparent transparent #e0f2fe;
}

.apex-hero-visual iframe {
  object-fit: unset;
  background: #000;
}

/* Sections */
section {
  padding: 2.75rem 0;
}

.apex-section-head {
  margin-bottom: 1.35rem;
}

.apex-section-head h2 {
  margin: 0 0 0.45rem;
  font-size: clamp(1.45rem, 2.6vw, 1.9rem);
  letter-spacing: -0.015em;
}

.apex-section-head p {
  margin: 0;
  max-width: 42rem;
  color: var(--muted);
}

.apex-grid {
  display: grid;
  gap: 1rem;
}

.apex-grid-2 {
  grid-template-columns: 1fr;
}

.apex-grid-3 {
  grid-template-columns: 1fr;
}

@media (min-width: 700px) {
  .apex-grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
  .apex-grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 960px) {
  .apex-grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

.apex-card {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1.15rem 1.2rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid rgba(96, 165, 250, 0.22);
  background: rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow:
    0 0 0 1px rgba(59, 130, 246, 0.05) inset,
    0 16px 40px -36px rgba(59, 130, 246, 0.35);
  color: inherit;
  text-decoration: none !important;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
  min-height: 100%;
}

a.apex-card:hover,
article.apex-card:hover {
  border-color: rgba(56, 189, 248, 0.55);
  background: rgba(15, 23, 42, 0.42);
  transform: translateY(-2px);
  box-shadow:
    0 0 0 1px rgba(59, 130, 246, 0.1) inset,
    0 18px 48px -28px rgba(59, 130, 246, 0.45);
}

.apex-card h3 a {
  color: inherit;
  text-decoration: none !important;
}

.apex-card h3 a:hover {
  color: #e0f2fe;
}

a.apex-thumb {
  display: block;
  color: inherit;
  text-decoration: none !important;
}

a.apex-card-cta {
  display: inline-block;
  text-decoration: none !important;
}

a.apex-card-cta:hover {
  color: #fff;
}

.apex-overview {
  padding: 0.5rem 0 1.75rem;
}

.apex-overview + .apex-overview {
  padding-top: 0;
}

.apex-overview-copy {
  max-width: 42rem;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.65;
}

.apex-overview-copy p {
  margin: 0 0 0.85rem;
}

.apex-overview-copy p:last-child {
  margin-bottom: 0;
}

.apex-card-kicker {
  margin: 0;
  color: #7dd3fc;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.apex-card h3 {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.3;
}

.apex-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  flex: 1;
}

.apex-card-cta {
  margin-top: 0.35rem;
  color: #e0f2fe;
  font-size: 0.88rem;
  font-weight: 650;
}

.apex-media-card {
  padding: 0;
  overflow: hidden;
  min-height: 100%;
  height: 100%;
  align-self: stretch;
}

.apex-media-card .apex-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  flex-shrink: 0;
  overflow: hidden;
  background: #0f172a;
}

/* Absolute media so intrinsic tall images cannot grow the thumb (Chrome quirk). */
.apex-media-card .apex-thumb img,
.apex-media-card .apex-thumb video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.apex-media-card .apex-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(2, 6, 23, 0.75));
  pointer-events: none;
}

.apex-play-badge {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  width: 52px;
  height: 52px;
  margin: -26px 0 0 -26px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.95), rgba(6, 182, 212, 0.92));
  box-shadow: 0 10px 30px rgba(2, 6, 23, 0.45);
}

.apex-play-badge::before {
  content: "";
  position: absolute;
  left: 20px;
  top: 16px;
  border-style: solid;
  border-width: 10px 0 10px 16px;
  border-color: transparent transparent transparent #fff;
}

.apex-media-card .apex-body {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1rem 1.1rem 1.2rem;
  flex: 1 1 auto;
  min-height: 0;
}

.apex-media-card .apex-body h3 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  min-height: 3.9em;
}

.apex-media-card .apex-body > p:not(.apex-card-kicker) {
  flex: 1 1 auto;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  margin: 0;
}

.apex-media-card .apex-card-cta {
  margin-top: auto;
}

/* Watch pages */
.apex-watch {
  padding: 2rem 0 3rem;
}

.apex-watch-player {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #000;
  box-shadow: var(--shadow);
}

.apex-watch-player video,
.apex-watch-player iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border: 0;
  display: block;
}

.apex-watch-player video {
  object-fit: contain;
  height: auto;
  max-height: none;
}

.apex-watch h1 {
  margin: 1.25rem 0 0.5rem;
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.apex-watch .meta {
  color: var(--muted);
  margin: 0 0 1.25rem;
}

/* Footer */
.apex-footer {
  margin-top: 2rem;
  padding: 2rem 0 2.5rem;
  border-top: 1px solid rgba(96, 165, 250, 0.18);
  background: rgba(15, 23, 42, 0.18);
  color: var(--muted);
  font-size: 0.9rem;
}

.apex-footer-grid {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 720px) {
  .apex-footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr;
  }
}

.apex-footer h3 {
  margin: 0 0 0.55rem;
  color: #e2e8f0;
  font-size: 0.92rem;
}

.apex-footer ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.apex-footer li {
  margin: 0.3rem 0;
}

.apex-social-label {
  margin: 1rem 0 0.5rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.9);
}

.apex-social {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.5rem;
}

.apex-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(96, 165, 250, 0.28);
  background: rgba(15, 23, 42, 0.45);
  color: #e2e8f0 !important;
  font-size: 0.8rem;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}

.apex-social a:hover {
  border-color: rgba(56, 189, 248, 0.55);
  color: #fff !important;
  background: rgba(15, 23, 42, 0.7);
}

.apex-share {
  margin-top: 1.25rem;
}

.apex-share-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(96, 165, 250, 0.28);
  background: rgba(15, 23, 42, 0.45);
  color: #e2e8f0;
  font-size: 0.8rem;
  font-weight: 650;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}

.apex-share-copy:hover {
  border-color: rgba(56, 189, 248, 0.55);
  color: #fff;
  background: rgba(15, 23, 42, 0.7);
}

.apex-footer a {
  color: #e2e8f0;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.apex-footer a:hover {
  color: #fff;
}

.apex-disclaimer {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-soft);
  font-size: 0.78rem;
  color: #cbd5e1;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
