/* ============================================================================
   Novera Studio — index.html maximalist overlay
   Scroll-driven D3 visuals · big display type · layered maximalism
   Loaded ONLY on the home page (public/index.html).
   Respects data-theme (light/dark) via existing --bg/--text/--accent tokens.
   ============================================================================ */

:root {
  --mxv-x: #1f4fe0;      /* brand strong blue (accent-strong) */
  --mxv-t: #5c8cff;      /* brand light blue */
  --mxv-o: #7f92b8;      /* brand steel */
  --mxv-line: var(--text);
}

body.dark :root { }

#mxv-root {
  position: relative;
  z-index: 2;
  --ink: var(--text);
  --card: var(--surface);
  --card-2: var(--surface-2);
  --line: rgba(23, 32, 46, 0.22);
  --line-strong: rgba(23, 32, 46, 0.85);
  --ghost: rgba(23, 32, 46, 0.09);
  --hard: var(--text);
}
[data-theme="dark"] #mxv-root {
  --line: rgba(232, 237, 246, 0.22);
  --line-strong: rgba(232, 237, 246, 0.85);
  --ghost: rgba(232, 237, 246, 0.10);
  --hard: #eef3ff;
}

/* ---- fixed ambient layers ---- */
.mxv-grain, .mxv-blobs, .mxv-gridlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.mxv-grain {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
  opacity: 0.05;
  z-index: 3;
}
[data-theme="dark"] .mxv-grain { mix-blend-mode: screen; opacity: 0.07; }
.mxv-blobs {
  filter: blur(70px) saturate(1.4);
  opacity: 0.55;
}
[data-theme="dark"] .mxv-blobs { opacity: 0.4; }
.mxv-blob { position: absolute; border-radius: 50%; }
.mxv-blob-1 { width: 46vw; height: 46vw; background: radial-gradient(circle at 40% 40%, var(--accent), transparent 68%); top: -12vw; left: -12vw; animation: mxv-float 26s ease-in-out infinite; }
.mxv-blob-2 { width: 40vw; height: 40vw; background: radial-gradient(circle at 60% 40%, var(--mxv-x), transparent 66%); top: 30vh; right: -14vw; animation: mxv-float 34s ease-in-out infinite reverse; }
.mxv-blob-3 { width: 38vw; height: 38vw; background: radial-gradient(circle at 50% 50%, var(--mxv-t), transparent 66%); bottom: -16vw; left: 18vw; animation: mxv-float 40s ease-in-out infinite; }
@keyframes mxv-float {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(4vw, -6vh, 0) scale(1.08); }
}
.mxv-gridlines {
  opacity: 0.35;
  z-index: 0;
}
[data-theme="dark"] .mxv-gridlines { opacity: 0.22; }
.mxv-gridlines .gl-y { position: absolute; top: 0; bottom: 0; width: 1px; background: linear-gradient(var(--line), transparent); }
.mxv-gridlines .gl-y:nth-child(1) { left: 8.333%; }
.mxv-gridlines .gl-y:nth-child(2) { left: 41.666%; }
.mxv-gridlines .gl-y:nth-child(3) { left: 75%; }
.mxv-gridlines .gl-x { position: absolute; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--line), transparent); }
.mxv-gridlines .gl-x:nth-child(4) { top: 18vh; }
.mxv-gridlines .gl-x:nth-child(5) { top: 74vh; }

.mxv-cursor {
  position: fixed; left: 0; top: 0; width: 520px; height: 520px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 18%, transparent), transparent 60%);
  pointer-events: none; z-index: 4; display: none;
  will-change: transform;
}
@media (hover: hover) and (pointer: fine) { .mxv-cursor { display: block; } }

/* ---- big display type ---- */
.mxv-display { font-weight: 900; letter-spacing: -0.035em; line-height: 0.95; text-transform: uppercase; }
.mxv-outline {
  color: transparent;
  -webkit-text-stroke: 1.6px var(--ghost);
  user-select: none;
}
.mxv-ghost-word {
  position: absolute;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.04em;
  line-height: 0.9;
  white-space: nowrap;
  pointer-events: none;
  color: transparent;
  -webkit-text-stroke: 1.4px var(--ghost);
  z-index: 0;
  will-change: transform;
  font-size: clamp(6rem, 18vw, 19rem);
}
.mxv-ghost-word b { font-weight: 900; -webkit-text-fill-color: transparent; }
.mxv-ghost-num {
  color: transparent;
  -webkit-text-stroke: 1.5px var(--line);
  font-weight: 900;
  font-size: clamp(4.5rem, 10vw, 8.5rem);
  line-height: 0.9;
  letter-spacing: -0.04em;
}

/* ---- marquee ---- */
.mxv-marquee {
  overflow: hidden;
  border-block: 2px solid var(--line-strong);
  background: var(--hard);
  color: var(--bg);
  padding-block: 10px;
  margin-block: var(--space-8);
  position: relative;
  z-index: 1;
  user-select: none;
}
[data-theme="dark"] .mxv-marquee { color: #0a111f; }
.mxv-marquee-track {
  display: flex;
  gap: 0;
  width: max-content;
  will-change: transform;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-size: clamp(1rem, 2vw, 1.6rem);
  line-height: 1;
}
.mxv-marquee-track > span { display: inline-flex; align-items: center; gap: 1.4rem; padding-right: 1.4rem; }
.mxv-marquee-track svg { width: 1em; height: 1em; flex: none; }

/* ---- hero ---- */
.mxv-hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(3rem, 7vw, 7rem) clamp(4rem, 8vw, 8rem);
}
.mxv-hero .mxv-ghost-word {
  top: 8%;
  right: 1%;
  font-size: clamp(7rem, 22vw, 24rem);
  opacity: 0.9;
}
.mxv-hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(2rem, 4vw, 4rem);
  align-items: center;
  position: relative;
  z-index: 1;
}
.mxv-hero-eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; font-size: 12px;
  color: var(--text-muted);
  padding: 8px 14px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}
.mxv-hero-eyebrow svg { width: 14px; height: 14px; color: var(--mxv-x); }
.mxv-hero h1 {
  font-size: clamp(2.7rem, 7.2vw, 5.6rem);
  margin: var(--space-5) 0 var(--space-5);
}
.mxv-hero h1 .slab {
  display: inline-block;
  background: linear-gradient(90deg, var(--accent), var(--mxv-x) 55%, var(--mxv-o));
  background-clip: text; -webkit-background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
  position: relative;
}
.mxv-hero-lead { max-width: 56ch; font-size: clamp(1.02rem, 1.3vw, 1.15rem); }
.mxv-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-6); position: relative; }
.mxv-actions .btn { position: relative; z-index: 1; font-weight: 800; }
.mxv-actions .btn-xl { padding: 16px 28px; font-size: 1.05rem; }
.mxv-proof {
  display: flex; flex-wrap: wrap; gap: 14px 26px;
  margin-top: var(--space-7);
  padding-top: var(--space-5);
  border-top: 2px dashed var(--line-strong);
}
.mxv-proof b { font-size: 1.35rem; display: flex; align-items: baseline; gap: 6px; letter-spacing: -0.02em; }
.mxv-proof small { color: var(--text-muted); display: block; margin-top: 2px; }
.mxv-proof .tick { color: var(--mxv-t); }

.mxv-visual { position: relative; z-index: 1; }
.mxv-chip {
  position: absolute;
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: 13px;
  padding: 9px 14px;
  border: 2px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: 4px 4px 0 var(--mxv-x);
  z-index: 2;
  will-change: transform;
  white-space: nowrap;
}
.mxv-chip svg { width: 14px; height: 14px; }

/* constellation canvas */
.mxv-const { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; opacity: 1; }

/* cinematic vignette above the constellation, below the hero copy */
.mxv-vignette {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(ellipse 120% 92% at 50% 42%, rgba(0,0,0,0) 46%, rgba(5,9,18,0.32) 78%, rgba(5,9,18,0.66) 100%);
}
[data-theme="dark"] .mxv-vignette {
  background: radial-gradient(ellipse 120% 92% at 50% 42%, rgba(2,4,10,0) 52%, rgba(2,4,10,0.45) 80%, rgba(2,4,10,0.76) 100%);
}

/* constellation bands inside the big navy sections (same sky as the hero) */
.mxv-band-host { position: relative; overflow: hidden; }
.mxv-band-host .mxv-const-band {
  position: absolute; inset: 0; z-index: 0; opacity: 0.8; pointer-events: none;
}
.mxv-band-host > .container { position: relative; z-index: 1; }
.mxv-band-host .mxv-const-band canvas { display: block; width: 100%; height: 100%; }

/* ---- sections, cards, ghosts ---- */
.mxv-sec { position: relative; overflow: hidden; padding-block: clamp(3rem, 8vh, 7rem); }
.mxv-sec-head { position: relative; z-index: 1; display: flex; flex-direction: column; gap: var(--space-3); margin-bottom: var(--space-7); }
.mxv-sec-head .kicker { display: inline-flex; align-items: center; gap: 12px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; font-size: 12px; color: var(--mxv-x); }
.mxv-sec-head .kicker span { color: var(--text-muted); }
.mxv-sec h2 { font-size: clamp(2rem, 5vw, 3.4rem); letter-spacing: -0.03em; line-height: 1.02; max-width: 20ch; }
.mxv-sec-head .lede { color: var(--text-muted); max-width: 58ch; }

.mxv-card {
  position: relative;
  background: var(--card);
  border: 2px solid var(--line-strong);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: 7px 7px 0 var(--line);
  overflow: hidden;
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.28s ease;
}
[data-theme="light"] .mxv-card { box-shadow: 7px 7px 0 rgba(23, 32, 46, 0.9); }
.mxv-card:hover { transform: translate(-3px, -3px); box-shadow: 12px 12px 0 var(--mxv-x); }
.mxv-card .tag {
  position: absolute; top: -2px; right: 16px;
  font-weight: 900; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 5px 12px; border-radius: 0 0 10px 10px; background: var(--hard); color: var(--bg);
}
.mxv-card .sticker {
  position: absolute; top: var(--space-4); right: -34px; transform: rotate(38deg);
  font-weight: 900; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 4px 38px; color: var(--bg);
}
.mxv-card-hover:hover { transform: translateY(-6px); }
.mxv-badge-price {
  display: inline-block; margin-top: var(--space-3);
  font-weight: 900; font-size: var(--font-2xl);
}
.mxv-badge-price small { font-weight: 700; color: var(--text-muted); font-size: var(--font-sm); }
.mxv-check { color: var(--success, #177e4d); display: inline-flex; align-items: center; }

/* steps with D3 connector */
.mxv-steps { position: relative; }
.mxv-steps-connector { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.mxv-steps-connector svg { width: 100%; height: 100%; overflow: visible; }
.mxv-step {
  position: relative; z-index: 1;
  counter-increment: mxstep;
  background: var(--card);
  border: 2px solid var(--line-strong);
  border-radius: var(--radius-lg);
  padding: var(--space-6) var(--space-5) var(--space-5);
  box-shadow: 6px 6px 0 var(--mxv-t);
}
.mxv-step .n {
  display: grid; place-items: center;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--hard); color: var(--bg);
  font-weight: 900; font-size: 1.1rem;
  margin-bottom: var(--space-4);
  border: 2px solid var(--line-strong);
}
.mxv-step h3 { margin-bottom: var(--space-2); }

/* D3 scrubbed cost bars */
.mxv-chart {
  margin-top: var(--space-6);
  background: var(--card);
  border: 2px solid var(--line-strong);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}
.mxv-chart svg { width: 100%; height: auto; display: block; }
.mxv-chart .axis-t { font-weight: 900; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; fill: var(--text-muted); }
.mxv-chart .bar-static { fill: var(--accent); }
.mxv-chart .bar-dynamic { fill: var(--mxv-x); }
.mxv-chart .bar-label { font-weight: 900; font-size: 15px; fill: var(--bg); }
.mxv-chart .bar-value { font-weight: 900; font-size: 13px; fill: var(--text-muted); }
.mxv-chart .grid-line { stroke: var(--line); stroke-width: 1; stroke-dasharray: 4 5; }
.mxv-chart .tickline { stroke: var(--line-strong); stroke-width: 1.5; }

/* portfolio cards inside grid keep existing .card styles; add tilt frame */
.mxv-portfolio .card { border: 2px solid var(--line-strong); border-radius: var(--radius-lg); box-shadow: 6px 6px 0 var(--mxv-o); }

/* FAQ items — maximalist shells */
.mxv-faq details {
  border: 2px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--card);
  margin-bottom: var(--space-3);
  box-shadow: 4px 4px 0 var(--line);
}
.mxv-faq summary { font-weight: 800; padding: var(--space-4); cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.mxv-faq summary::-webkit-details-marker { display: none; }
.mxv-faq .chev { transition: transform 0.25s ease; color: var(--mxv-x); display: inline-flex; }
.mxv-faq details[open] .chev { transform: rotate(180deg); }
.mxv-faq .mxv-faq-body { padding: 0 var(--space-4) var(--space-4); color: var(--text-muted); }

/* reveal targets */
.mxv-rev { opacity: 0; transform: translateY(30px); }

/* overlay tile band */
.mxv-tiles {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border: 2px solid var(--line-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-top: var(--space-7);
}
[data-theme="dark"] .mxv-tiles { color: #0a111f; }
.mxv-tiles > div {
  padding: var(--space-4); background: var(--hard); color: var(--bg);
  font-weight: 900; text-transform: uppercase; letter-spacing: 0.04em;
  font-size: clamp(0.7rem, 1vw, 0.85rem); line-height: 1.4;
  border-left: 2px solid var(--line-strong);
}
.mxv-tiles > div:first-child { border-left: 0; }
.mxv-tiles b { display: block; font-size: clamp(1rem, 1.6vw, 1.3rem); }

/* D3 rail — fixed right progress braid */
.mxv-rail { position: fixed; right: 18px; top: 50%; transform: translateY(-50%); height: 52vh; width: 26px; z-index: 40; pointer-events: none; display: none; }
.mxv-rail svg { width: 100%; height: 100%; overflow: visible; }
.mxv-rail .rpath { fill: none; stroke: var(--line); stroke-width: 2; stroke-dasharray: 3 6; }
.mxv-rail .rfill { fill: none; stroke: var(--mxv-x); stroke-width: 3; stroke-linecap: round; }
.mxv-rail .rdot { fill: var(--surface); stroke: var(--line-strong); stroke-width: 2; }
.mxv-rail .rdot.on { fill: var(--mxv-x); stroke: var(--mxv-x); }
@media (min-width: 1100px) { .mxv-rail { display: block; } }

/* ---- hero micro-animations (off when reduced-motion) ---- */
@media (prefers-reduced-motion: no-preference) {
  .mxv-clayer circle.pt {
    transform-box: fill-box; transform-origin: center;
    animation: mxv-twinkle 3.2s ease-in-out infinite;
  }
  @keyframes mxv-twinkle { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }

  .mxv-visual { animation: mxv-bob 9s ease-in-out infinite; }
  @keyframes mxv-bob {
    0%, 100% { transform: translate3d(0, 0, 0) rotate(0.001deg); }
    50% { transform: translate3d(0, -13px, 0); }
  }

  .mxv-rail .rdot.on { animation: mxv-rdot 1.5s ease-in-out infinite; }
  @keyframes mxv-rdot {
    0%, 100% { fill: var(--mxv-x); stroke: var(--mxv-x); }
    50% { fill: var(--mxv-t); stroke: var(--mxv-t); }
  }

  .mxv-ghost-word { animation: mxv-ghostfade 8s ease-in-out infinite; }
  @keyframes mxv-ghostfade { 0%, 100% { opacity: .5; } 50% { opacity: .8; } }

  .mxv-hero .btn-primary { position: relative; overflow: hidden; }
  .mxv-hero .btn-primary::after {
    content: ""; position: absolute; top: 0; left: -140%; width: 55%; height: 100%;
    background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.45), transparent);
    transform: skewX(-20deg);
    animation: mxv-shine 3.8s ease-in-out infinite;
  }
  @keyframes mxv-shine { 0% { left: -140%; } 60%, 100% { left: 170%; } }
}

/* responsive */
@media (max-width: 900px) {
  .mxv-hero-grid { grid-template-columns: 1fr; }
  .mxv-hero .mxv-ghost-word { top: 4%; right: -8%; font-size: 42vw; }
  .mxv-visual { max-width: 480px; }
  .mxv-chip { font-size: 12px; }
  .mxv-tiles { grid-template-columns: repeat(2, 1fr); }
  .mxv-tiles > div:nth-child(3) { border-left: 0; }
  .mxv-tiles > div:nth-child(n+3) { border-top: 2px solid var(--line-strong); }
}
@media (max-width: 560px) {
  .mxv-ghost-word { font-size: 34vw; }
  .mxv-ghost-num { font-size: 4rem; }
}