/* Sensory-first VeriBiota palette using lavender trust + coral energy.
   We bias toward colors linked with trust (lavender), intelligence (deep navy),
   and emotional warmth (soft coral) per color-psychology research. */

/* Light scheme */
:root {
  --veri-lavender: #d9d0ff;
  --veri-iris: #7a6bb2;
  --veri-midnight: #110a26;
  --veri-coral: #ff9aa2;
  --veri-sage: #c2f0da;
  --veri-sun: #ffd082;

  /* Neutral surfaces + tokens for hero/cards */
  --vb-surface: #ffffff;
  --vb-surface-elevated: #f3eefc;
  --vb-surface-strong: #efe9ff;
  --vb-border-subtle: rgba(17, 10, 38, 0.08);
  --vb-text-strong: #0b081a;
  --vb-grid-color: rgba(17, 10, 38, 0.08);
  --vb-card-shadow: 0 18px 40px rgba(17, 10, 38, 0.12);

  /* Shared focus and motion tokens */
  --vb-focus: var(--veri-coral);
  --vb-focus-shadow: 0 0 0 4px rgba(255, 154, 162, 0.25);

  --md-primary-fg-color: var(--veri-lavender);
  --md-primary-fg-color--light: #efe9ff;
  --md-primary-fg-color--dark: #c2b1ff;
  --md-primary-bg-color: var(--veri-midnight);

  --md-accent-fg-color: var(--veri-coral);
  --md-accent-bg-color: #ffffff;
  --md-accent-bg-color--light: rgba(255, 255, 255, 0.7);

  --md-typeset-a-color: var(--veri-iris);

  /* Custom gradients for hero/feature callouts */
  --veri-gradient: linear-gradient(135deg, rgba(217,208,255,0.95), rgba(255,188,199,0.9));
  --veri-gradient-dark: linear-gradient(135deg, rgba(122,107,178,0.65), rgba(255,154,162,0.65));
}

/* Dark scheme overrides (maintain luminous accents for emotional resonance) */
[data-md-color-scheme="slate"] {
  --md-primary-fg-color: #7d70c6;
  --md-primary-fg-color--light: #a696ff;
  --md-primary-fg-color--dark: #4a3c7a;
  --md-accent-fg-color: var(--veri-sun);
  --md-typeset-a-color: var(--veri-lavender);

  --vb-surface: #050509;
  --vb-surface-elevated: #0b0b12;
  --vb-surface-strong: #0f0b18;
  --vb-border-subtle: rgba(255, 255, 255, 0.08);
  --vb-text-strong: #f6f4ff;
  --vb-grid-color: rgba(255, 255, 255, 0.06);
  --vb-card-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

/* Hero header + primary CTA region */
.md-header {
  background: var(--veri-gradient);
  box-shadow: inset 0 -1px 0 rgba(17, 10, 38, 0.1);
  position: relative;
  overflow: hidden;
}
[data-md-color-scheme="slate"] .md-header {
  background-image: var(--veri-gradient-dark);
}

/* Animated gradient shimmer to add modern polish */
@keyframes veriFlow {
  0% { transform: translateX(-30%); opacity: 0.5; }
  50% { transform: translateX(10%); opacity: 0.9; }
  100% { transform: translateX(40%); opacity: 0.5; }
}

.md-header::after {
  content: "";
  position: absolute;
  top: 10%;
  left: -20%;
  width: 140%;
  height: 200%;
  background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.35), transparent 60%);
  animation: veriFlow 10s ease-in-out infinite alternate;
  pointer-events: none;
}
[data-md-color-scheme="slate"] .md-header::after {
  background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.2), transparent 55%);
  opacity: 0.5;
}

/* Reduced motion opt-out for header shimmer and future flow lines */
@media (prefers-reduced-motion: reduce) {
  .md-header::after {
    animation: none !important;
  }
  .flow-line {
    animation: none !important;
  }
}

/* Page background with subtle vignette to keep focus on docs body */
.md-main {
  background:
    radial-gradient(circle at 10% 20%, rgba(255, 208, 130, 0.12), transparent 40%),
    radial-gradient(circle at 90% 0%, rgba(217, 208, 255, 0.25), transparent 55%),
    linear-gradient(180deg, #fdfbff 0%, #f9f2ff 50%, #fdfbff 100%);
}
[data-md-color-scheme="slate"] .md-main {
  background:
    radial-gradient(circle at 20% 0%, rgba(125, 112, 198, 0.3), transparent 40%),
    radial-gradient(circle at 80% 10%, rgba(255, 154, 162, 0.2), transparent 55%),
    linear-gradient(180deg, #080512 0%, #0d081a 100%);
}

/* Card glassmorphism effect for top-level sections */
.md-typeset > h1,
.md-typeset > h2 {
  position: relative;
  z-index: 1;
}

.md-content__inner {
  position: relative;
}

.md-content__inner::before {
  content: "";
  position: absolute;
  top: -2rem;
  left: 0;
  right: 0;
  margin: 0 auto;
  transform: none;
  width: min(100%, 1200px);
  height: calc(100% + 4rem);
  background: rgba(255, 255, 255, 0.7);
  border-radius: 32px;
  filter: blur(0);
  box-shadow: 0 35px 65px rgba(17, 10, 38, 0.08);
  z-index: 0;
  pointer-events: none;
}
[data-md-color-scheme="slate"] .md-content__inner::before {
  background: rgba(17, 10, 38, 0.55);
  box-shadow: 0 35px 65px rgba(0, 0, 0, 0.4);
}
.md-content__inner > * {
  position: relative;
  z-index: 1;
}

/* Floating nav tabs style */
.md-tabs {
  backdrop-filter: blur(16px);
  background: rgba(255, 255, 255, 0.65);
  border-radius: 16px;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  padding: 0.25rem 0.75rem;
  border: 1px solid rgba(17, 10, 38, 0.05);
}
[data-md-color-scheme="slate"] .md-tabs {
  background: rgba(17, 10, 38, 0.6);
  border-color: rgba(255, 255, 255, 0.1);
}

/* Sidebar nav cards */
.md-sidebar__scrollwrap {
  border-radius: 24px;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(12px);
  box-shadow: 0 20px 40px rgba(17, 10, 38, 0.08);
}
[data-md-color-scheme="slate"] .md-sidebar__scrollwrap {
  background: rgba(17, 10, 38, 0.5);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}

/* Emotional accent cards for blockquotes/admonitions */
.md-typeset blockquote {
  border-left: 4px solid var(--veri-iris);
  background: rgba(217, 208, 255, 0.35);
  border-radius: 0 12px 12px 0;
  padding: 0.75rem 1rem;
}
[data-md-color-scheme="slate"] .md-typeset blockquote {
  background: rgba(122, 107, 178, 0.25);
}

.md-typeset .admonition,
.md-typeset details {
  border-radius: 16px;
  border-width: 1px;
  border-color: rgba(17, 10, 38, 0.08);
  background-image: radial-gradient(circle at top right, rgba(255, 154, 162, 0.15), transparent 35%);
}
[data-md-color-scheme="slate"] .md-typeset .admonition,
[data-md-color-scheme="slate"] .md-typeset details {
  border-color: rgba(255, 208, 130, 0.25);
  background-image: radial-gradient(circle at top left, rgba(255, 208, 130, 0.18), transparent 35%);
}

.md-button--primary {
  background: linear-gradient(120deg, var(--veri-iris), var(--veri-coral));
  color: #fff;
  border: none;
  box-shadow: 0 8px 24px rgba(122, 107, 178, 0.35);
}
.md-button--secondary {
  background: rgba(17, 10, 38, 0.04);
  border: 1px solid rgba(17, 10, 38, 0.1);
  color: var(--veri-iris);
}
.md-button--primary:hover,
.md-button--secondary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(255, 154, 162, 0.25);
}

/* Global focus style with soft glow */
:focus-visible {
  outline: 2px solid var(--vb-focus);
  outline-offset: 3px;
  box-shadow: var(--vb-focus-shadow);
}

/* Hero layout + grid fade to keep text legible */
.hero-layout {
  display: grid;
  grid-template-columns: minmax(320px, 1.1fr) minmax(280px, 0.9fr);
  align-items: center;
  gap: clamp(1.5rem, 3vw, 2.5rem);
}

.hero-copy {
  max-width: 620px;
  color: var(--vb-text-strong);
  z-index: 1;
}

.hero-grid {
  position: relative;
  isolation: isolate;
}

.hero-grid::before {
  content: "";
  position: absolute;
  inset: -14%;
  background-image:
    linear-gradient(to right, var(--vb-grid-color) 1px, transparent 1px),
    linear-gradient(to bottom, var(--vb-grid-color) 1px, transparent 1px);
  background-size: 34px 34px, 34px 34px;
  mask-image: radial-gradient(circle at 65% 45%, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.35) 55%, transparent 80%);
  -webkit-mask-image: radial-gradient(circle at 65% 45%, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.35) 55%, transparent 80%);
  opacity: 0.65;
  z-index: 0;
}

@media (max-width: 960px) {
  .hero-layout {
    grid-template-columns: 1fr;
  }
  .hero-grid::before {
    mask-image: radial-gradient(circle at 50% 35%, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0.25) 55%, transparent 85%);
    -webkit-mask-image: radial-gradient(circle at 50% 35%, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0.25) 55%, transparent 85%);
  }
}

/* Metrics / KPI cards */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: clamp(0.85rem, 2vw, 1.25rem);
  margin: clamp(1.5rem, 2vw, 2rem) 0;
}

.metric-card {
  background: var(--vb-surface-elevated);
  border: 1px solid var(--vb-border-subtle);
  border-radius: 16px;
  padding: 1rem 1.25rem;
  box-shadow: var(--vb-card-shadow);
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.metric-card h3 {
  margin: 0;
  font-size: clamp(1.4rem, 3vw, 1.8rem);
  color: var(--vb-text-strong);
}

.metric-card p,
.metric-card span {
  margin: 0.25rem 0 0;
  opacity: 0.82;
}

.metric-card:hover,
.metric-card:focus-within {
  transform: translateY(-2px);
  box-shadow: 0 24px 42px rgba(17, 10, 38, 0.16);
}

@media (prefers-reduced-motion: reduce) {
  .metric-card:hover,
  .metric-card:focus-within {
    transform: none;
    box-shadow: var(--vb-card-shadow);
  }
}

/* Proof pills / tabs */
.proof-pills {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem;
  border-radius: 999px;
  background: rgba(17, 10, 38, 0.05);
  border: 1px solid var(--vb-border-subtle);
}
[data-md-color-scheme="slate"] .proof-pills {
  background: rgba(255, 255, 255, 0.05);
}

.proof-pill {
  position: relative;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: color 150ms ease, background-color 150ms ease, transform 200ms ease;
}

.proof-pill[aria-selected="true"],
.proof-pill.is-active {
  background: linear-gradient(135deg, rgba(122, 107, 178, 0.22), rgba(255, 154, 162, 0.18));
  border-color: rgba(122, 107, 178, 0.55);
  color: var(--vb-text-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.proof-pill:hover {
  transform: translateY(-1px);
}

@media (prefers-reduced-motion: reduce) {
  .proof-pill:hover {
    transform: none;
  }
}

/* CTA buttons for mid-page prompts */
.cta-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--vb-border-subtle);
  background: rgba(122, 107, 178, 0.08);
  color: var(--vb-text-strong);
  text-decoration: none;
  box-shadow: 0 12px 28px rgba(122, 107, 178, 0.12);
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.cta-ghost:hover,
.cta-ghost:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(122, 107, 178, 0.18);
}

@media (prefers-reduced-motion: reduce) {
  .cta-ghost:hover,
  .cta-ghost:focus-visible {
    transform: none;
  }
}

/* Hide duplicate site name in header (keep current page title) */
.md-header__title .md-header__ellipsis > .md-header__topic:first-child {
  display: none;
}

/* Footer legal line with trademark/licensing note */
.md-footer-meta__inner::after {
  content: " VeriBiota\2122 · Apache-2.0 open core; enterprise modules proprietary ";
  display: block;
  font-size: 12px;
  opacity: 0.75;
  margin-top: 0.25rem;
}
