/*
 * Inflexity production stability layer
 * Loaded last on every page. It owns only layout/accessibility invariants;
 * page-specific artwork remains in the existing themed stylesheets.
 */
:root {
  --ifx-safe-top: env(safe-area-inset-top, 0px);
  --ifx-safe-right: env(safe-area-inset-right, 0px);
  --ifx-safe-bottom: env(safe-area-inset-bottom, 0px);
  --ifx-safe-left: env(safe-area-inset-left, 0px);
}

html { min-width: 320px; overflow-x: clip; }
body { min-width: 320px; overflow-x: clip; cursor: auto !important; }
a, button, input, select, textarea, label { cursor: auto; }
a, button, label, select, input[type="checkbox"], input[type="radio"] { cursor: pointer; }

/* The old decorative cursor must never obscure controls or follow the mouse. */
.cursor,
.cursor-dot,
.cursor-ring,
.mouse-follower,
[data-cursor],
[class*="custom-cursor"] { display: none !important; }

:focus-visible {
  outline: 3px solid rgba(145, 113, 255, .92) !important;
  outline-offset: 3px !important;
}

.skip-link {
  position: fixed !important;
  z-index: 100000 !important;
  top: 12px !important;
  left: 12px !important;
  transform: translateY(-180%) !important;
}
.skip-link:focus { transform: none !important; }

/* A reveal animation may enhance a page, but may never hide it permanently. */
.ifx-reveal-v8 { visibility: visible !important; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .ifx-reveal-v8 { opacity: 1 !important; transform: none !important; }
}

/* Public navigation is identical and usable on all public pages. */
body.ifx-surface-public .site-header {
  width: min(1440px, calc(100% - 32px)) !important;
  min-height: 72px;
  margin-inline: auto !important;
  padding-left: max(18px, var(--ifx-safe-left)) !important;
  padding-right: max(18px, var(--ifx-safe-right)) !important;
}
body.ifx-surface-public .site-header .nav { min-width: 0; }
body.ifx-surface-public .site-header .nav a { white-space: nowrap; }

/* Player Center: these rules deliberately win over all legacy profile themes. */
body.ifx-surface-profile {
  display: block !important;
  min-height: 100dvh !important;
}
body.ifx-surface-profile .profile-hub,
body.ifx-surface-profile .hub-app {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 100dvh !important;
  transform: none !important;
  perspective: none !important;
}
body.ifx-surface-profile .hub-sidebar.player-rail {
  position: fixed !important;
  z-index: 1200 !important;
  inset: 0 auto 0 0 !important;
  display: flex !important;
  width: 306px !important;
  height: 100dvh !important;
  max-height: none !important;
  transform: none !important;
  overflow: hidden auto !important;
}
body.ifx-surface-profile .hub-main.player-workspace {
  display: block !important;
  width: auto !important;
  min-width: 0 !important;
  min-height: 100dvh !important;
  margin: 0 0 0 306px !important;
  transform: none !important;
}
body.ifx-surface-profile .hub-top.player-topbar {
  position: sticky !important;
  z-index: 1100 !important;
  top: 0 !important;
  width: 100% !important;
  transform: none !important;
}
body.ifx-surface-profile .hub-content.player-stage {
  display: block !important;
  width: min(1480px, 100%) !important;
  min-width: 0 !important;
  min-height: calc(100dvh - 78px) !important;
  margin-inline: auto !important;
  padding: clamp(24px, 4vw, 68px) !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
}
body.ifx-surface-profile [data-profile-app],
body.ifx-surface-profile [data-profile-content] {
  min-width: 0 !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* Admin Center: one fixed sidebar and one scrollable workspace. */
body.ifx-surface-admin .ifx-admin-shell,
body.ifx-surface-admin [data-admin-shell] { min-width: 0 !important; }
body.ifx-surface-admin .ifx-admin-sidebar {
  max-height: 100dvh;
  overflow: hidden auto;
}
body.ifx-surface-admin .ifx-admin-main,
body.ifx-surface-admin main { min-width: 0; }

@media (max-width: 1100px) {
  body.ifx-surface-public .site-header { width: calc(100% - 20px) !important; }
  body.ifx-surface-profile .hub-sidebar.player-rail {
    width: min(340px, 88vw) !important;
    transform: translateX(-104%) !important;
    transition: transform .24s ease !important;
  }
  body.ifx-surface-profile.hub-menu-open .hub-sidebar.player-rail {
    transform: translateX(0) !important;
  }
  body.ifx-surface-profile .hub-main.player-workspace {
    width: 100% !important;
    margin-left: 0 !important;
  }
  body.ifx-surface-profile .hub-menu { display: inline-grid !important; }
}

/* Compact public masthead: the page content becomes visible without a full-screen intro. */
body:not([data-page="index"]):not(.vault-page) .page-hero,
body.has-page-world:not([data-page="index"]) .page-hero {
  min-height: 0 !important;
  display: block !important;
  padding: clamp(38px, 5vw, 66px) 0 clamp(24px, 3.5vw, 42px) !important;
}
body:not([data-page="index"]):not(.vault-page) .page-hero > .shell,
body.has-page-world:not([data-page="index"]) .page-hero > .shell {
  width: min(calc(100% - 40px), 1240px) !important;
  max-width: 1240px !important;
  margin-inline: auto !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}
body:not([data-page="index"]):not(.vault-page) .page-hero .breadcrumbs {
  margin: 0 0 11px !important;
  font-size: .64rem !important;
}
body:not([data-page="index"]):not(.vault-page) .page-hero .eyebrow {
  margin: 0 0 9px !important;
  font-size: .66rem !important;
}
body:not([data-page="index"]):not(.vault-page) .page-hero h1 {
  max-width: 900px !important;
  font-size: clamp(2.15rem, 4.6vw, 4.3rem) !important;
  line-height: .98 !important;
  letter-spacing: -.052em !important;
}
body:not([data-page="index"]):not(.vault-page) .page-hero p {
  max-width: 720px !important;
  margin: 14px 0 0 !important;
  font-size: clamp(.92rem, 1.4vw, 1.04rem) !important;
  line-height: 1.65 !important;
}
@media (max-width: 700px) {
  body:not([data-page="index"]):not(.vault-page) .page-hero,
  body.has-page-world:not([data-page="index"]) .page-hero { padding: 34px 0 24px !important; }
  body:not([data-page="index"]):not(.vault-page) .page-hero > .shell,
  body.has-page-world:not([data-page="index"]) .page-hero > .shell { width: calc(100% - 28px) !important; }
}

/* Editorial page rail: no repeated breadcrumb/category/oversized-card stack. */
body:not([data-page="index"]) .page-hero.page-hero--editorial,
body.has-page-world:not([data-page="index"]) .page-hero.page-hero--editorial {
  min-height: 0 !important;
  padding: clamp(24px, 3.2vw, 42px) 0 !important;
  border-bottom: 1px solid rgba(164,145,226,.13) !important;
  background: linear-gradient(90deg,rgba(9,12,21,.86),rgba(9,12,21,.42),transparent) !important;
  overflow: hidden !important;
}
body:not([data-page="index"]) .page-hero.page-hero--editorial::after,
body:not([data-page="index"]) .page-hero.page-hero--editorial::before { display: none !important; }
body:not([data-page="index"]) .page-hero.page-hero--editorial > .shell,
body.has-page-world:not([data-page="index"]) .page-hero.page-hero--editorial > .shell {
  display: grid !important;
  grid-template-columns: minmax(260px,.82fr) minmax(320px,1.18fr) !important;
  gap: clamp(28px,5vw,84px) !important;
  align-items: center !important;
  width: min(calc(100% - 40px),1240px) !important;
  max-width: 1240px !important;
  margin: auto !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}
body:not([data-page="index"]) .page-hero.page-hero--editorial h1 {
  max-width: 540px !important;
  margin: 0 !important;
  font-size: clamp(1.9rem,3.6vw,3.35rem) !important;
  line-height: 1 !important;
  letter-spacing: -.052em !important;
}
body:not([data-page="index"]) .page-hero.page-hero--editorial p {
  max-width: 670px !important;
  margin: 0 !important;
  padding-left: clamp(18px,2.5vw,34px) !important;
  border-left: 1px solid rgba(112,231,207,.32) !important;
  color: #a4adbd !important;
  font-size: clamp(.88rem,1.25vw,1rem) !important;
  line-height: 1.62 !important;
}
body:not([data-page="index"]) .page-hero.page-hero--editorial .actions {
  grid-column: 2 !important;
  margin: -18px 0 0 !important;
  padding-left: clamp(18px,2.5vw,34px) !important;
}
@media (max-width: 720px) {
  body:not([data-page="index"]) .page-hero.page-hero--editorial > .shell,
  body.has-page-world:not([data-page="index"]) .page-hero.page-hero--editorial > .shell {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
    width: calc(100% - 28px) !important;
  }
  body:not([data-page="index"]) .page-hero.page-hero--editorial p { padding-left: 16px !important; }
  body:not([data-page="index"]) .page-hero.page-hero--editorial .actions {
    grid-column: 1 !important;
    margin: 2px 0 0 !important;
    padding-left: 16px !important;
  }
}

@media (max-width: 700px) {
  body.ifx-surface-profile .hub-content.player-stage { padding: 20px 14px 42px !important; }
  body.ifx-surface-profile .hub-top.player-topbar { padding-inline: 14px !important; }
  body.ifx-surface-profile .hub-top.player-topbar > div:first-child { min-width: 0; }
  body.ifx-surface-profile .hub-top.player-topbar > div:first-child b {
    max-width: 42vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* The profile shell is also safe before/without the optional unified JS tag. */
body.profile-hub .hub-app { display: block !important; width: 100% !important; min-height: 100dvh !important; }
body.profile-hub .hub-sidebar.player-rail { position: fixed !important; z-index: 1200 !important; inset: 0 auto 0 0 !important; width: 306px !important; height: 100dvh !important; overflow: hidden auto !important; }
body.profile-hub .hub-main.player-workspace { width: auto !important; min-height: 100dvh !important; margin-left: 306px !important; }
body.profile-hub .hub-content.player-stage { display: block !important; width: min(1480px, 100%) !important; min-height: calc(100dvh - 78px) !important; opacity: 1 !important; visibility: visible !important; transform: none !important; }
@media (max-width: 1100px) {
  body.profile-hub .hub-sidebar.player-rail { width: min(340px, 88vw) !important; transform: translateX(-104%) !important; }
  body.profile-hub.hub-menu-open .hub-sidebar.player-rail { transform: translateX(0) !important; }
  body.profile-hub .hub-main.player-workspace { width: 100% !important; margin-left: 0 !important; }
}

