/* ============================================================
   Nóvellum — animations.css
   Particle field, circle stats, process waves, timeline,
   phone mockup, typewriter, flying icons.
   ============================================================ */

/* ── STACKING ──
   Canvas sits fixed behind everything at z-index:3, just above the noise
   texture (body::after, z-index:2). Header/sticky-tg/exit-overlay/mobile-nav
   already carry their own inline z-index (50/100/200/90) which is well
   above the canvas — only main/footer need raising here so page content
   isn't painted behind it. */
body > main,
body > footer {
  position: relative;
  z-index: 10;
}

/* ── PARTICLE CANVAS (DNA Capital style — full-viewport background) ──
   Fixed across the whole site (hero included); sections render above it
   via the z-index stack above. Top/height are set inline by animations.js. */
#novellum-canvas {
  position: fixed !important;
  inset: 0 !important;
  z-index: 3 !important;
  pointer-events: none !important;
  opacity: 0.8;
}

/* ── HERO TRUST STRIP ── */
.hero-trust-strip {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid rgba(212,184,134,.10);
  align-items: flex-start;
}
.hero-trust-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 0;
  border: none !important;
  background: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .5s ease, transform .5s ease;
}
.hero-trust-item.vis {
  opacity: 1;
  transform: none;
}
.hero-trust-item span:first-child {
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-soft);
}
.hero-trust-item span:last-child {
  font-size: 13px;
  font-weight: 600;
  color: var(--bronze);
}

/* ── PROCESS WAVE CANVAS ── */
#process { position: relative; }
#process-wave {
  position: absolute;
  bottom: 0; left: 0; width: 100%;
  height: 140px;
  pointer-events: none;
  z-index: 0;
  display: block;
}
#process > .container { position: relative; z-index: 1; }

/* ── TIMELINE SIDE (hairline + dots) ── */
.tl-side-wrapper { position: relative; padding-left: 26px; }
.tl-hairline {
  position: absolute;
  left: 7px; top: 10px; bottom: 10px;
  width: 1px;
  background: linear-gradient(180deg,
    rgba(212,184,134,.0),
    rgba(212,184,134,.38) 20%,
    rgba(212,184,134,.38) 80%,
    rgba(212,184,134,.0));
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 1.4s cubic-bezier(.4,0,.2,1);
}
.tl-hairline.is-visible { transform: scaleY(1); }
.tl-dot {
  position: absolute;
  left: 2px;
  width: 11px; height: 11px;
  border-radius: 50%;
  border: 1.5px solid rgba(212,184,134,.22);
  background: transparent;
  transition: background .4s ease, border-color .4s ease, box-shadow .4s ease;
}
.tl-dot.is-visible {
  background: rgba(212,184,134,.55);
  border-color: rgba(212,184,134,.70);
  box-shadow: 0 0 0 4px rgba(212,184,134,.10);
}

/* ── PHONE MOCKUP VERTICAL (hero — Origin style) ── */
.phone-v-wrap {
  position: relative;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
}
.phone-v-frame {
  background: #0d0d0d;
  border-radius: 48px;
  border: 9px solid #1e1e1e;
  box-shadow:
    0 0 0 1px rgba(255,255,255,.08),
    0 50px 100px rgba(0,0,0,.75),
    inset 0 1px 0 rgba(255,255,255,.06);
  overflow: hidden;
  position: relative;
}
.phone-v-notch {
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 100px; height: 28px;
  background: #0d0d0d;
  border-radius: 0 0 20px 20px;
  z-index: 5;
}
.phone-v-statusbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 32px 22px 4px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,.5);
  letter-spacing: .02em;
}
.phone-v-fade {
  /* short fade so it blends the screen's bottom edge smoothly */
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 60px;
  background: linear-gradient(
    to top,
    var(--bg, #1A2E28) 0%,
    transparent 100%
  );
  border-radius: 0 0 40px 40px;
  pointer-events: none;
  z-index: 4;
}
.hero-visual {
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  min-height: auto !important;
}
@media (max-width: 900px) {
  .phone-v-wrap { max-width: 300px; }
  .phone-v-frame { border-radius: 36px; border-width: 7px; }
}

/* ── SHIMMER CTA BUTTON (traveling light point along the border frame) ──
   A small dot travels along the button's own border outline (CSS motion
   path pinned to border-box) rather than orbiting in a circle, so it
   visually hugs the rectangle/pill shape of the button. */
.button--anim {
  position: relative;
  overflow: visible;
}
.button--anim::after {
  content: '' !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 7px !important;
  height: 7px !important;
  margin: -3.5px !important;
  border-radius: 50% !important;
  background: #D4B886 !important;
  box-shadow: 0 0 8px 2px rgba(212,184,134,.75) !important;
  offset-path: border-box !important;
  offset-distance: 0% !important;
  animation: borderTravel 2.5s linear infinite !important;
  opacity: .95 !important;
  pointer-events: none !important;
  z-index: 2 !important;
}
@keyframes borderTravel {
  from { offset-distance: 0%; }
  to   { offset-distance: 100%; }
}

/* ── 3D PHONE (#demo) ── */
.phone-3d-outer {
  width: 100%;
  max-width: 720px;
  margin: 40px auto 48px;
  perspective: 1400px;
  opacity: 0;
  transition: opacity .6s ease .2s;
}
.phone-3d-outer.on { opacity: 1; }
.phone-3d-scene {
  transform: rotateX(22deg) rotateY(-10deg) rotateZ(4deg);
  transform-style: preserve-3d;
  transition: transform .7s cubic-bezier(.34,1.2,.64,1);
}
.phone-3d-outer:hover .phone-3d-scene {
  transform: rotateX(14deg) rotateY(-5deg) rotateZ(2deg);
}
.phone-3d-body {
  background: #111;
  border-radius: 40px;
  border: 8px solid #222;
  box-shadow:
    0 70px 140px rgba(0,0,0,.85),
    0 0 0 1px rgba(255,255,255,.07),
    inset 0 0 0 1px rgba(255,255,255,.04);
  position: relative;
  overflow: hidden;
}
.phone-3d-side-btn {
  position: absolute;
  right: -11px;
  width: 4px; height: 38px;
  background: #2a2a2a; border-radius: 0 3px 3px 0;
}
.phone-3d-side-btn.t1 { top: 20%; }
.phone-3d-side-btn.t2 { top: 34%; }
.phone-3d-vol-btn {
  position: absolute;
  left: -11px; top: 26%;
  width: 4px; height: 56px;
  background: #2a2a2a; border-radius: 3px 0 0 3px;
}
.phone-3d-screen { background: #0F1F1C; }
.p3d-status {
  display: flex; justify-content: space-between;
  padding: 14px 20px 8px;
  font-size: 12px; font-weight: 600; color: rgba(255,255,255,.5);
}
.p3d-content { padding: 0 20px 20px; }
.p3d-eyebrow {
  font-size: 9px; letter-spacing: .12em; text-transform: uppercase;
  color: rgba(244,239,229,.3); margin-bottom: 8px;
}
.p3d-revenue {
  font-size: 36px; font-weight: 800; color: #F4EFE5;
  letter-spacing: -.025em; line-height: 1;
}
.p3d-delta { font-size: 13px; font-weight: 600; margin-top: 4px; margin-bottom: 2px; }
.p3d-delta.pos { color: #4caf6e; }
.p3d-metrics {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; margin: 12px 0;
}
.p3d-metric {
  background: rgba(255,255,255,.04);
  border-radius: 8px; padding: 10px;
}
.p3d-metric-label {
  font-size: 8px; letter-spacing: .1em; text-transform: uppercase;
  color: rgba(244,239,229,.3); margin-bottom: 3px;
}
.p3d-metric-val { font-size: 22px; font-weight: 800; color: #F4EFE5; }
.p3d-metric-delta { font-size: 10px; font-weight: 600; color: #4caf6e; margin-top: 2px; }
.p3d-bars { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.p3d-bar-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 10px; color: rgba(244,239,229,.4);
}
.p3d-track {
  flex: 1; height: 2px; background: rgba(255,255,255,.08);
  border-radius: 1px; overflow: hidden;
}
.p3d-fill { height: 100%; background: var(--bronze, #D4B886); border-radius: 1px; }
@media (max-width: 768px) {
  .phone-3d-outer { max-width: 340px; }
  .phone-3d-scene { transform: rotateX(15deg) rotateY(-6deg) rotateZ(3deg); }
  .phone-3d-body { border-radius: 28px; border-width: 6px; }
  .p3d-revenue { font-size: 26px; }
}

/* ── PHONE MOCKUP (#demo) ── */
.demo-intro {
  display: flex;
  gap: 36px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.demo-text { flex: 1 1 280px; }
.phone-frame {
  flex-shrink: 0;
  width: 220px;
  height: 440px;
  border-radius: 32px;
  border: 8px solid #1e1e1e;
  background: #111;
  box-shadow: 0 40px 80px rgba(0,0,0,.62), 0 0 0 1px rgba(255,255,255,.06);
  position: relative;
  overflow: hidden;
  transform: translateY(40px);
  opacity: 0;
  transition: transform .85s cubic-bezier(.34,1.2,.64,1), opacity .6s ease;
}
.phone-frame.is-visible { transform: translateY(0); opacity: 1; }
.phone-notch {
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 72px; height: 18px;
  background: #1e1e1e;
  border-radius: 0 0 12px 12px;
  z-index: 2;
}
.phone-screen {
  position: absolute;
  inset: 0;
  background: #080e0c;
  padding: 26px 13px 12px;
  overflow: hidden;
  color: rgba(244,239,229,.85);
  font-family: inherit;
}
.ph-label {
  font-size: 7px;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: rgba(244,239,229,.3);
  margin-bottom: 3px;
}
.ph-val {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.03em;
  color: #F4EFE5;
  line-height: 1;
}
.ph-delta { font-size: 10px; font-weight: 600; color: #4caf6e; margin-top: 3px; }
.ph-bar-track {
  height: 2px;
  background: rgba(212,184,134,.10);
  border-radius: 2px;
  overflow: hidden;
  margin: 7px 0 2px;
}
.ph-bar-fill {
  height: 100%;
  background: var(--bronze);
  border-radius: 2px;
  width: 0%;
  transition: width 1.4s cubic-bezier(.4,0,.2,1) .9s;
}
.phone-frame.is-visible .ph-bar-fill { width: 76%; }
.ph-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 10px;
}
.ph-metric {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 6px;
  padding: 6px 7px;
}
.ph-metric-val {
  font-size: 13px;
  font-weight: 800;
  color: #F4EFE5;
  letter-spacing: -.01em;
}
.ph-metric-sub { font-size: 9px; font-weight: 600; margin-top: 1px; color: #4caf6e; }
.ph-focus {
  margin-top: 10px;
  border-top: 1px solid rgba(255,255,255,.06);
  padding-top: 8px;
}
.ph-focus-item {
  font-size: 8.5px;
  color: rgba(244,239,229,.55);
  padding: 3px 0;
  border-bottom: 1px solid rgba(255,255,255,.04);
  line-height: 1.4;
}
.ph-focus-item:last-child { border-bottom: none; }
.ph-footer {
  position: absolute;
  bottom: 8px; left: 13px; right: 13px;
  font-size: 6.5px;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: rgba(244,239,229,.16);
  text-align: center;
  border-top: 1px solid rgba(255,255,255,.05);
  padding-top: 6px;
}

/* ── DEMO OPEN BUTTON ── */
.btn-demo-open {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 8px;
  color: rgba(244,239,229,.65);
  letter-spacing: .13em;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 700;
  padding: 10px 20px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: border-color .25s ease, color .25s ease;
  text-decoration: none;
  margin-top: 18px;
}
.btn-demo-open::before {
  content: '';
  position: absolute;
  top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(212,184,134,.08), transparent);
  transition: left .48s ease;
}
.btn-demo-open:hover { border-color: rgba(212,184,134,.32); color: rgba(244,239,229,.9); }
.btn-demo-open:hover::before { left: 100%; }

/* ── SECTION TYPEWRITER (data-typewriter) ── */
.section-typewriter,
[data-typewriter] {
  color: #D4B886 !important;
}
.section-typewriter {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #D4B886 !important;
  margin-bottom: 16px;
  min-height: 18px;
  display: inline-block;
  border-right: 2px solid rgba(212,184,134,.6);
  padding-right: 2px;
  animation: cursorBlink .8s step-end infinite;
}
@keyframes cursorBlink {
  0%, 100% { border-color: rgba(212,184,134,.6); }
  50% { border-color: transparent; }
}

/* ── SECTION TYPEWRITER (legacy) ── */
.section-tw-line {
  display: inline;
  font-size: 13px;
  color: var(--text-muted);
  transition: opacity .22s ease;
}
.section-tw-wrap {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  min-height: 1.5em;
}
.tw-cursor2 {
  display: inline-block;
  width: 2px;
  height: .82em;
  background: var(--bronze);
  margin-left: 2px;
  vertical-align: middle;
  animation: cur-blink .85s steps(1) infinite;
}

/* ── FLYING TOOL PILLS ── */
.tools-orbit {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 32px;
}
.tool-pill {
  font-size: 11px;
  padding: 5px 13px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 6px;
  color: rgba(244,239,229,.42);
  background: rgba(0,0,0,.06);
  white-space: nowrap;
  opacity: 0;
  transform: translateX(var(--tx, 0px)) translateY(var(--ty, 0px));
  transition:
    opacity .55s ease var(--delay, 0s),
    transform .7s cubic-bezier(.34,1.56,.64,1) var(--delay, 0s),
    border-color .3s ease,
    color .3s ease;
}
.tool-pill.fly-in { opacity: 1; transform: translateX(0) translateY(0); }
.tool-pill:hover { border-color: rgba(212,184,134,.28); color: rgba(244,239,229,.72); }

/* ── ICONS ORBIT (#products Nóvellum Analytics — circular layout) ──
   Desktop: icons sit on a horizontal ellipse around a center hub, partially
   bleeding past the container edge (ventriloc.ca style). Mobile: orbit
   rotated 90° — icons distributed along the vertical axis so nothing
   overflows the viewport width. */
.icons-orbit {
  position: relative;
  max-width: 600px;
  height: 280px;
  margin: 40px auto 0;
  overflow: visible;
}
.orbit-hub {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 56px; height: 56px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(212,184,134,.08);
  border: 1px solid rgba(212,184,134,.25);
  box-shadow: 0 0 30px rgba(212,184,134,.15);
  z-index: 2;
}
.icons-orbit .src-icon {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(212,184,134,.15);
  border-radius: 10px;
  background: rgba(212,184,134,.05);
  backdrop-filter: blur(8px);
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: transform 1s cubic-bezier(.34,1.3,.64,1), opacity .7s ease;
  pointer-events: none;
  z-index: 1;
}
.icons-orbit .src-icon.flown {
  opacity: 1;
  transform: translate(calc(-50% + var(--dx, 0px)), calc(-50% + var(--dy, 0px)));
  animation: orbit-float-d 4.5s ease-in-out var(--delay, 0s) infinite;
}
.src-text-icon {
  font-size: 12px;
  font-weight: 800;
  color: rgba(212,184,134,.7);
}
@keyframes orbit-float-d {
  0%, 100% { transform: translate(calc(-50% + var(--dx, 0px)), calc(-50% + var(--dy, 0px))) scale(1); }
  50% { transform: translate(calc(-50% + var(--dx, 0px)), calc(-50% + var(--dy, 0px) - 8px)) scale(1.06); }
}
@keyframes orbit-float-m {
  0%, 100% { transform: translate(calc(-50% + var(--mx, 0px)), calc(-50% + var(--my, 0px))) scale(1); }
  50% { transform: translate(calc(-50% + var(--mx, 0px)), calc(-50% + var(--my, 0px) - 8px)) scale(1.06); }
}
@media (max-width: 768px) {
  .icons-orbit { height: 380px; max-width: 280px; }
  .icons-orbit .src-icon.flown {
    transform: translate(calc(-50% + var(--mx, 0px)), calc(-50% + var(--my, 0px)));
    animation-name: orbit-float-m;
  }
}

/* ── CARD ALIGNMENT ── */
.how-grid .card,
.how-grid .card h3,
.how-grid .card p { text-align: left; }
.snap-card { text-align: left; }

/* ── REDUCED MOTION ── */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  #novellum-canvas,
  #process-wave { display: none; }
}

/* ── MOBILE ── */
@media (max-width: 768px) {
  .phone-frame-h { border-radius: 16px; border-width: 5px; }
  .phone-frame { width: 180px; height: 360px; border-radius: 26px; }
  .ph-val { font-size: 17px; }
}

/* ── TYPEWRITER MOBILE LAYOUT FIX ──
   Character-by-character typing was changing the element's rendered width
   on each keystroke, shifting whatever sits next to it. Reserving a fixed
   block of space and disabling reflow keeps neighbors in place while the
   typing animation keeps running. */
@media (max-width: 768px) {
  .typewriter-word {
    display: inline-block;
    min-width: 11ch;
    white-space: nowrap;
  }
  .section-typewriter,
  [data-typewriter] {
    display: block;
    width: 100%;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: break-word;
    min-height: 2.6em;
    overflow: hidden;
  }
}

/* ── RESPONSIVE AUDIT (320px–430px) ── */
@media (max-width: 480px) {
  .hero-trust-strip { gap: 16px; }
  .nav-cta a.button, .nav-cta button.button { min-height: 44px; }
  .sticky-tg-close { min-width: 44px; min-height: 44px; }
  .accordion-header { min-height: 44px; }
  .calc-field input[type=range] { min-height: 44px; }
}

/* ── PARTNER CASES / CARD TEXT UNIFORMITY (index.html + partners.html) ── */
.partner-case p,
.partners-cases .card p,
[class*="card"] p,
[class*="case"] p {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-muted);
}
.partner-case h3,
[class*="card"] h3,
[class*="case"] h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}
