/* ═══════════════════════════════════════════════════════════════
   Vantix experience layer — modern motion, a11y tools, convert dock
   Loaded after landing.css / user-effects.css. Brand tokens stay
   in app.css (accent / paper / ink).
   ═══════════════════════════════════════════════════════════════ */

:root {
  --tj-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --tj-ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
  --tj-motion-fast: 180ms;
  --tj-motion: 420ms;
  --tj-motion-slow: 720ms;
  --tj-dock-h: 0px;
}

/* Stronger default focus for keyboard users */
:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--tj-accent) 70%, #fff);
  outline-offset: 3px;
}

html.a11y-focus-strong :focus-visible {
  outline-width: 4px;
  outline-offset: 4px;
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--tj-accent) 28%, transparent);
}

html.a11y-underline a:not(.btn):not(.nav-link):not(.navbar-brand) {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

html.a11y-large {
  font-size: 112.5%;
}

html.a11y-xlarge {
  font-size: 125%;
}

html.a11y-spacing body {
  letter-spacing: 0.02em;
  word-spacing: 0.06em;
  line-height: 1.7;
}

html.a11y-contrast {
  --tj-bg: #000000;
  --tj-card: #0a0a0a;
  --tj-text: #ffffff;
  --tj-muted: #f0f0f0;
  --tj-border: #ffffff;
  --tj-accent: #ffe566;
  --tj-accent-2: #ffd400;
  --tj-on-accent: #000000;
}

html.a11y-contrast body.page-public-shell {
  --ld-ink: #ffffff;
  --ld-muted: #f5f5f5;
  --ld-paper: #000000;
  --ld-paper-2: #0a0a0a;
  --ld-charcoal: #000000;
  --tj-border: #ffffff;
  background: #000;
  color: #fff;
}

html.a11y-contrast .ld-hero {
  background: #000 !important;
  border-bottom: 2px solid #fff;
}

html.a11y-reduce-motion *,
html.a11y-reduce-motion *::before,
html.a11y-reduce-motion *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
  scroll-behavior: auto !important;
}

/* Native reveal — replaces endless AOS fade spam */
[data-reveal] {
  opacity: 0;
  transform: translate3d(0, 18px, 0);
  transition:
    opacity var(--tj-motion-slow) var(--tj-ease-out),
    transform var(--tj-motion-slow) var(--tj-ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}

[data-reveal="left"] { transform: translate3d(-18px, 0, 0); }
[data-reveal="right"] { transform: translate3d(18px, 0, 0); }
[data-reveal="scale"] { transform: scale(0.97); }

[data-reveal].is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ── Hero atmosphere (no stock-photo collage) ───────────────── */
body.page-public-shell .ld-hero {
  background:
    radial-gradient(120% 80% at 85% 10%, color-mix(in srgb, var(--tj-accent) 28%, transparent), transparent 55%),
    radial-gradient(90% 70% at 10% 90%, color-mix(in srgb, var(--tj-accent-2) 18%, transparent), transparent 50%),
    linear-gradient(155deg, #0a0d13 0%, #121821 48%, #0c1018 100%) !important;
}

body.page-public-shell .ld-hero-glow {
  opacity: 0.55;
  filter: blur(40px);
  animation: tj-glow-breathe 8s var(--tj-ease-soft) infinite;
}

@keyframes tj-glow-breathe {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.06); }
}

body.page-public-shell .tj-starfield--hero {
  opacity: 0.35;
}

body.page-public-shell .tj-stars--fine,
body.page-public-shell .tj-stars--medium,
body.page-public-shell .tj-stars--large {
  animation-duration: 120s, 180s, 240s;
  animation-name: tj-stars-drift;
}

@keyframes tj-stars-drift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-3%, -4%, 0); }
}

/* Product stage — business-logical demo in the hero */
.ld-product-stage {
  position: relative;
  width: min(100%, 520px);
  margin-inline: auto;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    rgba(8, 12, 18, 0.72);
  box-shadow:
    0 30px 60px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  overflow: hidden;
  backdrop-filter: blur(12px);
}

.ld-product-chrome {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ld-product-chrome i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  display: inline-block;
}

.ld-product-chrome i:nth-child(1) { background: #ff5f57; }
.ld-product-chrome i:nth-child(2) { background: #febc2e; }
.ld-product-chrome i:nth-child(3) { background: #28c840; }

.ld-product-chrome span {
  margin-inline-start: 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.ld-product-tabs {
  display: flex;
  gap: 0.35rem;
  padding: 0.65rem 0.75rem 0;
}

.ld-product-tab {
  flex: 1 1 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  padding: 0.4rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  min-height: 2.25rem;
  transition: background var(--tj-motion-fast) var(--tj-ease-soft),
    color var(--tj-motion-fast) var(--tj-ease-soft),
    border-color var(--tj-motion-fast) var(--tj-ease-soft);
}

.ld-product-tab[aria-selected="true"] {
  background: color-mix(in srgb, var(--tj-accent) 28%, transparent);
  border-color: color-mix(in srgb, var(--tj-accent) 55%, white);
  color: #fff;
}

.ld-product-panel {
  padding: 0.9rem 1rem 1.1rem;
  min-height: 210px;
}

.ld-product-panel[hidden] { display: none !important; }

.ld-product-row {
  display: grid;
  grid-template-columns: 1.1fr 0.7fr 0.7fr;
  gap: 0.5rem;
  align-items: center;
  padding: 0.55rem 0.65rem;
  margin-bottom: 0.4rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.88);
  opacity: 0;
  transform: translateY(8px);
}

.ld-product-panel.is-active .ld-product-row {
  animation: tj-row-in 520ms var(--tj-ease-out) forwards;
}

.ld-product-panel.is-active .ld-product-row:nth-child(1) { animation-delay: 40ms; }
.ld-product-panel.is-active .ld-product-row:nth-child(2) { animation-delay: 120ms; }
.ld-product-panel.is-active .ld-product-row:nth-child(3) { animation-delay: 200ms; }
.ld-product-panel.is-active .ld-product-row:nth-child(4) { animation-delay: 280ms; }

@keyframes tj-row-in {
  to { opacity: 1; transform: none; }
}

.ld-product-row .pos { color: #3dd68c; font-weight: 700; }
.ld-product-row .neg { color: #ff7b72; font-weight: 700; }
.ld-product-meta {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.55);
  margin-top: 0.55rem;
}

.ld-meter {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
  margin: 0.75rem 0 0.35rem;
}

.ld-meter > span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--tj-accent), color-mix(in srgb, var(--tj-accent) 40%, #fff));
}

.ld-product-panel.is-active .ld-meter > span {
  animation: tj-meter-fill 900ms var(--tj-ease-out) forwards;
}

@keyframes tj-meter-fill {
  to { width: var(--meter, 68%); }
}

.ld-hero-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-top: 1.25rem;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
}

.ld-hero-proof span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.ld-hero-proof i { color: var(--ld-gold-soft); }

/* Kill old float on globe if still present */
.ld-hero-visual img { animation: none !important; }

/* Try / curiosity strip */
.ld-try {
  background: var(--ld-paper);
  border-block: 1px solid var(--tj-border);
}

.ld-try-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.ld-try-card {
  position: relative;
  padding: 1.15rem 1.2rem 1.25rem;
  border-radius: 16px;
  border: 1px solid var(--tj-border);
  background: linear-gradient(180deg, color-mix(in srgb, var(--tj-accent) 6%, var(--ld-paper)), var(--ld-paper));
  min-height: 100%;
  transition:
    transform var(--tj-motion) var(--tj-ease-out),
    border-color var(--tj-motion) var(--tj-ease-out),
    box-shadow var(--tj-motion) var(--tj-ease-out);
}

.ld-try-card:hover,
.ld-try-card:focus-within {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--tj-accent) 45%, var(--tj-border));
  box-shadow: 0 16px 36px rgba(15, 18, 28, 0.08);
}

.ld-try-kicker {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ld-gold-deep);
  margin-bottom: 0.45rem;
}

.ld-try-card h3 {
  font-size: 1.1rem;
  font-weight: 800;
  margin: 0 0 0.45rem;
}

.ld-try-card p {
  margin: 0 0 0.9rem;
  color: var(--ld-muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.ld-try-card .plan-btn,
.ld-try-card .btn {
  min-height: 2.35rem;
}

@media (max-width: 767.98px) {
  .ld-try-grid { grid-template-columns: 1fr; }
  .ld-product-tabs { flex-wrap: wrap; }
}

/* Convert dock — anonymous curiosity → signup */
.tj-convert-dock {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 1080;
  padding: 0.65rem clamp(0.75rem, 3vw, 1.25rem);
  background: color-mix(in srgb, var(--tj-card) 88%, transparent);
  border-top: 1px solid var(--tj-border);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  transform: translateY(110%);
  transition: transform var(--tj-motion) var(--tj-ease-out);
}

.tj-convert-dock.is-visible {
  transform: translateY(0);
}

.tj-convert-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
}

.tj-convert-copy {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--tj-text);
  margin: 0;
}

.tj-convert-copy small {
  display: block;
  font-weight: 500;
  color: var(--tj-muted);
  margin-top: 0.15rem;
}

.tj-convert-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

body.has-convert-dock {
  --tj-dock-h: 4.75rem;
  padding-bottom: var(--tj-dock-h);
}

#scrollTopBtn {
  bottom: calc(1.25rem + var(--tj-dock-h)) !important;
}

.theme-fab {
  bottom: calc(5.5rem + var(--tj-dock-h)) !important;
}

/* Accessibility FAB + panel */
.a11y-fab {
  position: fixed;
  inset-inline-start: 1rem;
  bottom: calc(1.25rem + var(--tj-dock-h));
  z-index: 1095;
}

.a11y-fab-btn {
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  border: 1px solid var(--tj-border);
  background: var(--tj-card);
  color: var(--tj-text);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
  display: inline-grid;
  place-items: center;
  font-size: 1.25rem;
}

.a11y-fab-btn[aria-expanded="true"] {
  background: var(--tj-accent-2);
  color: #fff;
  border-color: var(--tj-accent-2);
}

.a11y-panel {
  position: absolute;
  inset-inline-start: 0;
  bottom: calc(100% + 0.55rem);
  width: min(22rem, calc(100vw - 2rem));
  padding: 1rem;
  border-radius: 16px;
  border: 1px solid var(--tj-border);
  background: var(--tj-card);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
  color: var(--tj-text);
}

.a11y-panel[hidden] { display: none !important; }

.a11y-panel h2 {
  font-size: 1rem;
  font-weight: 800;
  margin: 0 0 0.25rem;
}

.a11y-panel-lead {
  font-size: 0.8rem;
  color: var(--tj-muted);
  margin: 0 0 0.85rem;
}

.a11y-options {
  display: grid;
  gap: 0.45rem;
}

.a11y-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  text-align: start;
  border: 1px solid var(--tj-border);
  background: transparent;
  color: inherit;
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
  min-height: 2.75rem;
  font-size: 0.88rem;
  font-weight: 600;
}

.a11y-option[aria-pressed="true"] {
  border-color: var(--tj-accent-2);
  background: color-mix(in srgb, var(--tj-accent) 14%, transparent);
}

.a11y-option .a11y-state {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--tj-muted);
}

.a11y-option[aria-pressed="true"] .a11y-state {
  color: var(--tj-accent-2);
}

.a11y-panel-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.85rem;
  font-size: 0.8rem;
}

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

/* Accessibility statement page — interactive tools block */
.a11y-tools-card {
  border-radius: 16px;
  border: 1px solid var(--tj-border);
  background: var(--tj-card);
  padding: 1.25rem 1.35rem;
  margin-bottom: 1.25rem;
}

.a11y-tools-card h2 {
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0 0 0.35rem;
}

@media (max-width: 575.98px) {
  .a11y-fab { inset-inline-start: 0.65rem; }
  .tj-convert-copy { font-size: 0.85rem; }
}
