/* =========================================
   Ajay Kajla — brand overlay (logo, dark mode, motion, cursor, magnetic, kinetic hero)
   Loaded AFTER styles.css / styles-home.css / styles-pages.css
   ========================================= */

:root {
  /* Brand accents — keeps coral as default; magenta added from logo dot */
  --brand-magenta: #E0145C;
  --brand-magenta-ink: #B30E47;
  --brand-magenta-soft: #FDE8F0;

  /* Cursor */
  --cursor-size: 14px;
  --cursor-ring: 38px;

  /* Easings */
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);

  color-scheme: light;
}

/* ---------- DARK MODE ---------- */
html[data-theme="dark"] {
  --bg: #0A0B0F;
  --bg-section: #11131A;
  --ink: #F2F3F5;
  --ink-2: #9CA0A8;
  --ink-3: #6B7280;
  --border: rgba(255,255,255,.10);
  --border-strong: rgba(255,255,255,.20);
  --accent-soft: rgba(255,127,80,.10);
  --mint: rgba(34,197,94,.10);
  --lilac: rgba(124,58,237,.12);
  --sky: rgba(59,130,246,.10);
  --lemon: rgba(245,158,11,.10);
  --rose: rgba(244,63,94,.10);

  color-scheme: dark;
}
html[data-theme="dark"] body { background: var(--bg); color: var(--ink); }
html[data-theme="dark"] .nav { background: rgba(10,11,15,.7); }
html[data-theme="dark"] .nav.scrolled { border-color: var(--border); }
html[data-theme="dark"] .submenu { background: #14161E; border-color: var(--border); }
html[data-theme="dark"] .submenu a { color: var(--ink); }
html[data-theme="dark"] .submenu a:hover { background: rgba(255,255,255,.04); }
html[data-theme="dark"] .submenu-foot { border-color: var(--border); color: var(--ink-2); }
html[data-theme="dark"] .submenu-foot a { color: var(--ink); }
html[data-theme="dark"] .eyebrow { background: rgba(255,255,255,.04); border-color: var(--border); color: var(--ink-2); }
html[data-theme="dark"] .btn-primary { background: #fff; color: #0A0B0F; }
html[data-theme="dark"] .btn-primary:hover { background: #fff; }
html[data-theme="dark"] .btn-ghost { color: var(--ink); border-color: var(--border); }
html[data-theme="dark"] .btn-ghost:hover { border-color: var(--ink); background: rgba(255,255,255,.04); }
html[data-theme="dark"] .bg-bone { background: var(--bg-section); }
html[data-theme="dark"] .card,
html[data-theme="dark"] .stack-card,
html[data-theme="dark"] .case,
html[data-theme="dark"] .test,
html[data-theme="dark"] .step,
html[data-theme="dark"] .ps-col { background: rgba(255,255,255,.025); border-color: var(--border); color: var(--ink); }
html[data-theme="dark"] .test.peach,
html[data-theme="dark"] .test.mint,
html[data-theme="dark"] .test.lilac { background: rgba(255,255,255,.03); }
html[data-theme="dark"] .ps-col.dark { background: #050608; }
html[data-theme="dark"] .test .quote,
html[data-theme="dark"] h1, html[data-theme="dark"] h2, html[data-theme="dark"] h3, html[data-theme="dark"] h4 { color: var(--ink); }
html[data-theme="dark"] .hv-browser { background: #14161E; border-color: var(--border); box-shadow: 0 30px 80px -30px rgba(0,0,0,.7); }
html[data-theme="dark"] .hv-browser-bar { background: rgba(255,255,255,.03); border-color: var(--border); }
html[data-theme="dark"] .hv-url { background: rgba(255,255,255,.04); color: var(--ink-2); }
html[data-theme="dark"] .hv-float,
html[data-theme="dark"] .hv-prompt { background: #14161E; border-color: var(--border); color: var(--ink); box-shadow: 0 18px 40px -20px rgba(0,0,0,.7); }
html[data-theme="dark"] .hv-float-t { color: var(--ink); }
html[data-theme="dark"] .hv-float-s,
html[data-theme="dark"] .hv-prompt-text { color: var(--ink-2); }
html[data-theme="dark"] .nav-links a { color: var(--ink-2); }
html[data-theme="dark"] .nav-links a:hover,
html[data-theme="dark"] .nav-links a.active { color: var(--ink); }
html[data-theme="dark"] .logo-word em { color: var(--ink); }
html[data-theme="dark"] .tweaks-panel { background: #14161E; border-color: var(--border); color: var(--ink); }
html[data-theme="dark"] .tweaks-panel .sub,
html[data-theme="dark"] .tweaks-row > label { color: var(--ink-2); }
html[data-theme="dark"] .seg { border-color: var(--border); }
html[data-theme="dark"] .seg button { color: var(--ink-2); }
html[data-theme="dark"] .seg button[aria-pressed="true"] { background: #fff; color: #0A0B0F; }
html[data-theme="dark"] .swatches button { outline-color: var(--border); border-color: #14161E; }
html[data-theme="dark"] .swatches button[aria-pressed="true"] { outline-color: var(--ink); }
html[data-theme="dark"] .logo-mark img { filter: brightness(0) invert(1); transition: filter .3s var(--ease-out); }

/* ---------- LOGO ---------- */
.logo {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 18px; font-weight: 600; letter-spacing: -0.02em;
  line-height: 1;
}
.logo-mark {
  width: 28px; height: 32px;
  display: inline-grid; place-items: center;
  position: relative;
  transition: transform .35s var(--ease-out);
}
.logo-mark img {
  width: 100%; height: 100%; object-fit: contain;
  filter: brightness(0); /* render as ink */
  transition: filter .3s var(--ease-out);
}
.logo:hover .logo-mark { transform: rotate(-6deg) scale(1.08); }
.logo-word {
  font-family: var(--font-sans);
  font-weight: 600; letter-spacing: -0.025em;
  display: inline-flex; align-items: baseline;
}
.logo-word em {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  margin-left: 4px;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.foot-about .logo { font-size: 22px; }
.foot-about .logo-mark { width: 32px; height: 38px; }
.foot-about .logo-mark img { filter: brightness(0) invert(1); }
.foot-about .logo-word em { color: #fff; }

/* ---------- CUSTOM CURSOR ---------- */
.cursor-dot, .cursor-ring {
  position: fixed; top: 0; left: 0;
  pointer-events: none; z-index: 9999;
  will-change: transform;
  background: transparent;
  -webkit-backdrop-filter: invert(1) saturate(1.4);
  backdrop-filter: invert(1) saturate(1.4);
}
.cursor-dot {
  width: var(--cursor-size); height: var(--cursor-size);
  border-radius: 999px;
  transform: translate(-50%, -50%);
  transition: width .25s var(--ease-out), height .25s var(--ease-out), opacity .2s;
}
.cursor-ring {
  width: var(--cursor-ring); height: var(--cursor-ring);
  border-radius: 999px;
  -webkit-backdrop-filter: invert(1) saturate(1.2) brightness(1.05);
  backdrop-filter: invert(1) saturate(1.2) brightness(1.05);
  /* hollow ring effect via mask */
  -webkit-mask: radial-gradient(closest-side, transparent calc(50% - 1.5px), #000 calc(50% - 0.5px), #000 calc(50% + 0.5px), transparent calc(50% + 1.5px));
          mask: radial-gradient(closest-side, transparent calc(50% - 1.5px), #000 calc(50% - 0.5px), #000 calc(50% + 0.5px), transparent calc(50% + 1.5px));
  transform: translate(-50%, -50%);
  transition: width .3s var(--ease-out), height .3s var(--ease-out), opacity .2s;
}
.cursor-hover .cursor-dot { width: 8px; height: 8px; }
.cursor-hover .cursor-ring { width: 64px; height: 64px; }
.cursor-text .cursor-dot { width: 3px; height: 22px; border-radius: 1px; }
.cursor-text .cursor-ring { opacity: 0; }
.cursor-hidden .cursor-dot, .cursor-hidden .cursor-ring { opacity: 0; }

/* Fallback for browsers that don't support backdrop-filter */
@supports not (backdrop-filter: invert(1)) {
  .cursor-dot { background: #fff; mix-blend-mode: difference; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .cursor-ring {
    background: transparent;
    border: 1px solid rgba(255,255,255,.75);
    -webkit-mask: none; mask: none;
    mix-blend-mode: difference;
    -webkit-backdrop-filter: none; backdrop-filter: none;
  }
}

body[data-cursor="minimal"] .cursor-ring { display: none; }
body[data-cursor="off"] .cursor-dot,
body[data-cursor="off"] .cursor-ring { display: none; }
body[data-cursor="off"] { cursor: auto; }
body[data-cursor="dot"], body[data-cursor="minimal"], body[data-cursor="halo"] { cursor: none; }
body[data-cursor="dot"] a, body[data-cursor="dot"] button,
body[data-cursor="minimal"] a, body[data-cursor="minimal"] button,
body[data-cursor="halo"] a, body[data-cursor="halo"] button { cursor: none; }

@media (max-width: 940px) {
  .cursor-dot, .cursor-ring { display: none; }
  body[data-cursor] { cursor: auto; }
}

/* ---------- PAGE TRANSITION ---------- */
.page-veil {
  position: fixed; inset: 0;
  z-index: 9999;
  pointer-events: none;
  overflow: hidden;
  background: #09090F;
  transform: translateY(101%);
  will-change: transform;
}

/* Radial bloom layers */
.page-veil::before {
  content: "";
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse 65% 55% at 12% 88%, rgba(255,127,80,.22) 0%, transparent 55%),
    radial-gradient(ellipse 55% 45% at 88% 15%, rgba(224,20,92,.13) 0%, transparent 55%),
    radial-gradient(ellipse 40% 40% at 50% 50%, rgba(124,58,237,.08) 0%, transparent 60%);
  pointer-events: none;
}
/* Dot-grid texture */
.page-veil::after {
  content: "";
  position: absolute; inset: 0; z-index: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,.042) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

/* Outgoing: slide up from below */
.page-veil.show-cover {
  pointer-events: all;
  animation: veilCover .52s cubic-bezier(.76,0,.24,1) forwards;
}
/* Incoming: already on screen, slides up off top */
.page-veil.show-reveal {
  transform: translateY(0);
  animation: veilReveal .65s cubic-bezier(.76,0,.24,1) forwards;
}
/* Cold-load splash: visible from start */
.page-veil.splash {
  transform: translateY(0);
  pointer-events: all;
}
/* Splash exit sweep */
.page-veil.splash-exit {
  animation: veilReveal .78s cubic-bezier(.76,0,.24,1) forwards;
}

@keyframes veilCover {
  from { transform: translateY(101%); }
  to   { transform: translateY(0); }
}
@keyframes veilReveal {
  from { transform: translateY(0); }
  to   { transform: translateY(-101%); }
}

/* Interior */
.veil-inner {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}

/* Wordmark */
.veil-mark {
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  opacity: 0;
  transform: scale(.93) translateY(10px);
  transition: opacity .5s cubic-bezier(.22,.61,.36,1), transform .6s cubic-bezier(.22,.61,.36,1);
}
.page-veil.show-cover .veil-mark,
.page-veil.show-reveal .veil-mark,
.page-veil.splash .veil-mark {
  opacity: 1;
  transform: scale(1) translateY(0);
  transition-delay: .2s;
}
.veil-mark .vm-name {
  font-family: var(--font-display); font-style: italic;
  font-size: clamp(54px, 9.5vw, 144px);
  color: #fff; letter-spacing: -0.03em; line-height: 1;
  white-space: nowrap;
}
.veil-mark .vm-name em {
  font-style: normal;
  color: var(--accent, #FF7F50);
  margin-left: 0.22em;
}
.veil-mark .vm-tag {
  font-size: clamp(10px, 1.1vw, 13px);
  letter-spacing: 0.22em; text-transform: uppercase;
  color: rgba(255,255,255,.32);
  font-family: var(--font-sans);
  font-weight: 500;
}

/* Diagonal accent slash */
.veil-slash {
  position: absolute;
  width: 130%; height: 1px;
  left: -15%; top: 50%;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255,127,80,.0) 14%,
    rgba(255,127,80,.55) 40%,
    rgba(255,127,80,.85) 50%,
    rgba(255,127,80,.55) 60%,
    rgba(255,127,80,.0) 86%,
    transparent 100%
  );
  transform: rotate(-6deg);
  z-index: 1;
  opacity: 0;
  transition: opacity .55s cubic-bezier(.22,.61,.36,1);
}
.page-veil.show-cover .veil-slash,
.page-veil.show-reveal .veil-slash,
.page-veil.splash .veil-slash { opacity: 1; transition-delay: .12s; }

/* Corner bracket decorations */
.veil-corner {
  position: absolute; z-index: 1;
  width: 52px; height: 52px;
  border: 1.5px solid rgba(255,127,80,.22);
  opacity: 0;
  transition: opacity .5s cubic-bezier(.22,.61,.36,1);
}
.page-veil.show-cover .veil-corner,
.page-veil.show-reveal .veil-corner,
.page-veil.splash .veil-corner { opacity: 1; transition-delay: .28s; }
.veil-corner.tl { top: 28px; left: 28px; border-right: none; border-bottom: none; }
.veil-corner.tr { top: 28px; right: 28px; border-left: none; border-bottom: none; }
.veil-corner.bl { bottom: 36px; left: 28px; border-right: none; border-top: none; }
.veil-corner.br { bottom: 36px; right: 28px; border-left: none; border-top: none; }

/* Floating particles */
.veil-particles {
  position: absolute; inset: 0; z-index: 1;
  pointer-events: none; overflow: hidden;
}
.veil-particle {
  position: absolute; border-radius: 50%;
  opacity: 0;
  animation: vPartFloat var(--vp-dur, 3s) var(--vp-delay, 0s) ease-in-out infinite;
}
@keyframes vPartFloat {
  0%   { opacity: 0; transform: translateY(0) scale(.4); }
  20%  { opacity: .55; }
  80%  { opacity: .18; }
  100% { opacity: 0; transform: translateY(-90px) scale(1.1); }
}

/* Progress bar */
.veil-bar-wrap {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 3;
  height: 3px;
  background: rgba(255,255,255,.06);
  overflow: hidden;
}
.veil-bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, rgba(255,127,80,.7) 0%, #FF7F50 100%);
}
.page-veil.show-cover .veil-bar { animation: vBarFill .5s cubic-bezier(.22,.61,.36,1) .08s forwards; }
.page-veil.splash .veil-bar      { animation: vBarFill .85s cubic-bezier(.22,.61,.36,1) .05s forwards; }
@keyframes vBarFill {
  from { width: 0%; }
  to   { width: 100%; }
}

/* Page entry fade */
.page-enter {
  animation: pageEnter .7s cubic-bezier(.22,.61,.36,1) both;
}
@keyframes pageEnter {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ---------- KINETIC HERO ---------- */
.hero h1.kinetic {
  perspective: 1200px;
}
.hero h1.kinetic .word {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding-bottom: 0.18em;
  margin-bottom: -0.18em;
}
.hero h1.kinetic .word > span {
  display: inline-block;
  transform: translateY(110%) rotate(8deg);
  opacity: 0;
  transition: transform 1s var(--ease-out), opacity .6s var(--ease-out);
}
.hero h1.kinetic.in .word > span { transform: none; opacity: 1; }
.hero h1.kinetic .word > span:nth-child(2) { transition-delay: .04s; }
.hero h1.kinetic .word > span:nth-child(3) { transition-delay: .08s; }
.hero h1.kinetic .word > span:nth-child(4) { transition-delay: .12s; }
.hero h1.kinetic .word > span:nth-child(5) { transition-delay: .16s; }
.hero h1.kinetic .word > span:nth-child(6) { transition-delay: .2s; }
.hero h1.kinetic .word > span:nth-child(7) { transition-delay: .24s; }
.hero h1.kinetic .word > span:nth-child(8) { transition-delay: .28s; }
.hero h1.kinetic .word.w-1 > span { transition-delay: .08s; }
.hero h1.kinetic .word.w-2 > span { transition-delay: .14s; }
.hero h1.kinetic .word.w-3 > span { transition-delay: .20s; }
.hero h1.kinetic .word.w-4 > span { transition-delay: .26s; }
.hero h1.kinetic .word.w-5 > span { transition-delay: .32s; }
.hero h1.kinetic .word.w-6 > span { transition-delay: .38s; }

/* ---------- ROLE ROTATOR ---------- */
.role-rotator {
  display: inline-grid; vertical-align: baseline;
  height: 1.1em; overflow: hidden;
  position: relative;
}
.role-rotator .role {
  grid-area: 1/1;
  font-family: var(--font-display); font-style: italic;
  font-weight: 400;
  opacity: 0; transform: translateY(100%);
  transition: opacity .5s var(--ease-out), transform .6s var(--ease-out);
  white-space: nowrap;
}
.role-rotator .role.is-active { opacity: 1; transform: none; }
.role-rotator .role.was-active { opacity: 0; transform: translateY(-100%); }

/* ---------- MAGNETIC BUTTONS ---------- */
[data-magnetic] {
  transition: transform .4s var(--ease-out);
}
[data-magnetic] .arrow,
[data-magnetic] > * {
  transition: transform .3s var(--ease-out);
}

/* ---------- MARQUEE BAND (replace existing band with motion-driven version) ---------- */
.k-marquee {
  --speed: 40s;
  overflow: hidden;
  padding: 28px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: relative;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.k-marquee:hover .k-marquee-track { animation-play-state: paused; }
.k-marquee-track {
  display: inline-flex; align-items: center; gap: 48px;
  white-space: nowrap;
  animation: kMarquee var(--speed) linear infinite;
  font-family: var(--font-display); font-style: italic;
  font-size: clamp(32px, 4.6vw, 56px);
  letter-spacing: -0.02em;
  color: var(--ink);
}
.k-marquee-track .dot {
  width: 10px; height: 10px; border-radius: 999px;
  background: var(--accent);
  display: inline-block;
  flex: 0 0 auto;
}
.k-marquee-track .sans {
  font-family: var(--font-sans); font-style: normal;
  font-weight: 500;
  letter-spacing: -0.02em;
}
.k-marquee-track .word { display: inline-block; }
@keyframes kMarquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ---------- SCROLL-DRIVEN PARALLAX ---------- */
[data-parallax] { will-change: transform; }

/* Sticky pin sections */
.pin-stage {
  position: relative;
}
.pin-stage > .pin-inner {
  position: sticky;
  top: 96px;
}

/* ---------- BG NOISE ---------- */
body::after {
  content: "";
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.08 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  pointer-events: none;
  z-index: 9000;
  opacity: .35;
  mix-blend-mode: overlay;
}
html[data-theme="dark"] body::after { opacity: .25; }

/* ---------- HERO LAYOUT VARIANT — "stacked" ---------- */
body[data-hero-layout="stacked"] .hero-grid {
  grid-template-columns: 1fr !important;
  gap: 56px !important;
}
body[data-hero-layout="stacked"] .hero-grid > div:first-child {
  text-align: center;
}
body[data-hero-layout="stacked"] .hero-grid > div:first-child .lead { margin-left: auto; margin-right: auto; }
body[data-hero-layout="stacked"] .hero-grid > div:first-child .hero-ctas { justify-content: center; }
body[data-hero-layout="stacked"] .hero-grid > div:first-child .hero-trust { justify-content: center; }

body[data-hero-layout="editorial"] .hero h1.kinetic {
  font-size: clamp(56px, 9vw, 140px);
  line-height: .92;
  letter-spacing: -0.045em;
}
body[data-hero-layout="editorial"] .hero h1.kinetic .serif {
  font-size: 1.1em;
}

/* ---------- SCROLL PROGRESS BAR ---------- */
.scroll-progress {
  position: fixed; top: 0; left: 0;
  height: 2px; width: 0;
  background: var(--accent);
  z-index: 200;
  transition: background .3s;
  pointer-events: none;
}

/* ---------- AVAILABILITY PILL ---------- */
.avail-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px;
  background: rgba(34,197,94,.12);
  color: #15803D;
  font-size: 12px; font-weight: 500;
  border: 1px solid rgba(34,197,94,.24);
  margin-bottom: 14px;
}
.avail-pill .pulse {
  width: 7px; height: 7px; border-radius: 999px;
  background: #22C55E;
  position: relative;
}
.avail-pill .pulse::after {
  content: ""; position: absolute; inset: -3px;
  border-radius: 999px;
  background: #22C55E;
  opacity: .4;
  animation: pulseRing 1.6s ease-out infinite;
}
@keyframes pulseRing {
  0% { transform: scale(.6); opacity: .6; }
  100% { transform: scale(2.2); opacity: 0; }
}
html[data-theme="dark"] .avail-pill { color: #4ADE80; }

/* ---------- TWEAKS additions ---------- */
.tweaks-panel { width: 300px; }
.tweaks-panel .tweaks-row.split { display: grid; grid-template-columns: 1fr auto; align-items: center; }
.tweaks-panel .tweaks-row.split > label { margin-bottom: 0; }

/* ---------- REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .k-marquee-track { animation: none; }
  .cursor-dot, .cursor-ring { display: none; }
  body[data-cursor] { cursor: auto; }
}

/* ---------- STAT NUMBER MORPH ---------- */
.k-counter { font-variant-numeric: tabular-nums; }

/* ---------- SECTION HEADER REVEAL (split lines) ---------- */
.split-reveal .line {
  display: block;
  overflow: hidden;
}
.split-reveal .line > span {
  display: inline-block;
  transform: translateY(100%);
  transition: transform 1s var(--ease-out);
}
.split-reveal.in .line > span { transform: none; }
.split-reveal.in .line:nth-child(2) > span { transition-delay: .08s; }
.split-reveal.in .line:nth-child(3) > span { transition-delay: .16s; }
