/* ============================================================
   Blackstone AI — landing page styles
   Dark · violet primary · teal accent · multi-mesh · glass
   ============================================================ */

:root {
  /* color tokens (overridable by Tweaks via JS) */
  --primary: #7c3aed;
  --primary-soft: #a78bfa;
  --accent: #2dd4bf;

  --bg-0: #ffffff;
  /* deepest */
  --bg-1: #cecae2;
  /* base */
  --ink: #110c1f;
  /* primary text */
  --ink-dim: #7c7690;
  /* secondary text */
  --ink-faint: #9992b3;
  /* tertiary */

  --glass-bg: rgba(255, 255, 255, 0.045);
  --glass-bg-2: rgba(255, 255, 255, 0.07);
  --glass-brd: rgba(255, 255, 255, 0.10);
  --glass-hi: rgba(255, 255, 255, 0.55);
  --glass-blur: 22px;

  --mesh-strength: 1;
  /* tweakable */
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;

  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "Hanken Grotesk", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --maxw: 1240px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg-0);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

::selection {
  background: color-mix(in oklab, var(--primary) 55%, transparent);
  color: #fff;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.0;
  margin: 0;
  text-wrap: balance;
}

h1 {
  line-height: 0.95;
}

h2 {
  line-height: 1.04;
}

p {
  margin: 0;
  text-wrap: pretty;
}

a {
  color: inherit;
  text-decoration: none;
}

.mono {
  font-family: var(--font-mono);
}

/* ============================================================
   MESH GRADIENT BACKGROUND
   ============================================================ */
.bg-root {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(120% 90% at 50% -10%, color-mix(in oklab, var(--primary) 22%, transparent), transparent 60%),
    var(--bg-0);
  overflow: hidden;
}

.bg-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: calc(0.5 * var(--mesh-strength));
  will-change: transform;
}

.bg-blob.b1 {
  width: 60vw;
  height: 60vw;
  left: -10vw;
  top: -10vw;
  background: radial-gradient(circle at 30% 30%, var(--primary), transparent 65%);
  animation: drift1 26s ease-in-out infinite;
}

.bg-blob.b2 {
  width: 55vw;
  height: 55vw;
  right: -12vw;
  top: 5vh;
  background: radial-gradient(circle at 60% 40%, #c026d3, transparent 65%);
  animation: drift2 32s ease-in-out infinite;
}

.bg-blob.b3 {
  width: 50vw;
  height: 50vw;
  left: 10vw;
  bottom: -20vh;
  background: radial-gradient(circle at 50% 50%, var(--accent), transparent 62%);
  opacity: calc(0.32 * var(--mesh-strength));
  animation: drift3 30s ease-in-out infinite;
}

.bg-blob.b4 {
  width: 45vw;
  height: 45vw;
  right: 5vw;
  bottom: -10vh;
  background: radial-gradient(circle at 50% 50%, #6d28d9, transparent 65%);
  animation: drift1 36s ease-in-out infinite reverse;
}

@keyframes drift1 {

  0%,
  100% {
    transform: translate(0, 0) scale(1)
  }

  33% {
    transform: translate(8vw, 6vh) scale(1.12)
  }

  66% {
    transform: translate(-5vw, 3vh) scale(0.95)
  }
}

@keyframes drift2 {

  0%,
  100% {
    transform: translate(0, 0) scale(1)
  }

  33% {
    transform: translate(-7vw, 5vh) scale(1.08)
  }

  66% {
    transform: translate(4vw, -4vh) scale(1.05)
  }
}

@keyframes drift3 {

  0%,
  100% {
    transform: translate(0, 0) scale(1)
  }

  50% {
    transform: translate(6vw, -6vh) scale(1.15)
  }
}

/* fine grain + vignette overlay */
.bg-grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: 0.04;
  mix-blend-mode: overlay;
}

.bg-vignette {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(130% 120% at 50% 40%, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
}

@media (prefers-reduced-motion: reduce) {
  .bg-blob {
    animation: none !important;
  }
}

/* ============================================================
   LAYOUT
   ============================================================ */
.wrap {
  width: min(var(--maxw), 92vw);
  margin-inline: auto;
}

section {
  position: relative;
}

.sec-pad {
  padding: clamp(80px, 12vh, 160px) 0;
}

/* glass surface */
.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-brd);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -20px 40px rgba(124, 58, 237, 0.05),
    0 24px 60px rgba(0, 0, 0, 0.05);
  border-radius: var(--radius-lg);
}

/* cursor-follow highlight (set --mx/--my in JS) */
.glow-card {
  position: relative;
  overflow: hidden;
}

.glow-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 0%),
      color-mix(in oklab, var(--primary) 28%, transparent), transparent 60%);
  opacity: 0;
  transition: opacity .4s ease;
}

.glow-card:hover::before {
  opacity: 1;
}

/* ============================================================
   TYPOGRAPHY HELPERS
   ============================================================ */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--primary-soft);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: currentColor;
  opacity: .6;
}

.grad-text {
  background: linear-gradient(100deg, var(--primary) 10%, #c026d3 55%, #d3267f 105%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lead {
  color: var(--ink-dim);
  font-size: clamp(17px, 1.5vw, 21px);
  max-width: 56ch;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 16px;
  padding: 15px 26px;
  border-radius: 999px;
  cursor: pointer;
  border: 0;
  transition: transform .25s cubic-bezier(.2, .7, .2, 1), box-shadow .25s, background .25s;
  position: relative;
}

.btn-primary {
  background: linear-gradient(180deg, color-mix(in oklab, var(--primary) 85%, white 8%), var(--primary));
  color: #fff;
  box-shadow: 0 8px 24px color-mix(in oklab, var(--primary) 45%, transparent), inset 0 1px 0 rgba(255, 255, 255, .3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px color-mix(in oklab, var(--primary) 55%, transparent), inset 0 1px 0 rgba(255, 255, 255, .4);
}

.btn-ghost {
  background: var(--glass-bg-2);
  color: var(--ink);
  border: 1px solid var(--glass-brd);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.btn-ghost:hover {
  transform: translateY(-2px);
  border-color: color-mix(in oklab, var(--primary-soft) 50%, transparent);
}

.btn .arr {
  transition: transform .25s;
}

.btn:hover .arr {
  transform: translateX(4px);
}

/* ============================================================
   GLASS ICON TILE (3D-ish)
   ============================================================ */
.gicon {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.18);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), inset 0 -10px 20px rgba(0, 0, 0, 0.25), 0 14px 30px rgba(0, 0, 0, 0.05);
  display: grid;
  place-items: center;
  overflow: hidden;
  flex: none;
}

.gicon::after {
  /* glossy sweep */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255, 255, 255, .35) 0%, transparent 38%);
  opacity: .7;
}

.gicon .blob {
  position: absolute;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  filter: blur(8px);
  opacity: .85;
}

.gicon .glyph {
  position: relative;
  z-index: 2;
}

/* ============================================================
   CHIPS
   ============================================================ */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .02em;
  padding: 9px 15px;
  border-radius: 999px;
  background: var(--glass-bg-2);
  border: 1px solid var(--glass-brd);
  color: var(--ink-dim);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.chip .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

/* ============================================================
   REVEAL ANIMATION
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .8s cubic-bezier(.2, .7, .2, 1), transform .8s cubic-bezier(.2, .7, .2, 1);
}

.reveal.in {
  opacity: 1;
  transform: none;
}

.reveal.d1 {
  transition-delay: .08s;
}

.reveal.d2 {
  transition-delay: .16s;
}

.reveal.d3 {
  transition-delay: .24s;
}

.reveal.d4 {
  transition-delay: .32s;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ============================================================
   DEVICE FRAMES
   ============================================================ */
.phone {
  width: 100%;
  aspect-ratio: 9/19;
  border-radius: 38px;
  padding: 10px;
  background: linear-gradient(160deg, #211b39, #0d0a1c);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 40px 80px rgba(0, 0, 0, .08);
  position: relative;
}

.phone::before {
  content: "";
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: 36%;
  height: 7px;
  border-radius: 99px;
  background: #0a0814;
  z-index: 3;
}

.phone .screen {
  width: 100%;
  height: 100%;
  border-radius: 29px;
  overflow: hidden;
  background: #0a0814;
}

.browser {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #0d0a1c;
  box-shadow: 0 40px 90px rgba(0, 0, 0, .08), inset 0 1px 0 rgba(255, 255, 255, .18);
}

.browser .bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.browser .bar i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .18);
  display: block;
}

.browser .url {
  flex: 1;
  margin-left: 10px;
  height: 22px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.05);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-faint);
  display: flex;
  align-items: center;
  padding: 0 12px;
}

image-slot {
  display: block;
}

/* ============================================================
   MISC ANIMATIONS
   ============================================================ */
.rot-word {
  animation: wordIn .55s cubic-bezier(.2, .8, .2, 1);
}

@keyframes wordIn {
  from {
    opacity: 0;
    transform: translateY(0.35em) rotateX(-40deg);
    filter: blur(6px);
  }

  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

.scroll-dot {
  width: 1px;
  height: 34px;
  background: linear-gradient(var(--ink-faint), transparent);
  position: relative;
  overflow: hidden;
}

.scroll-dot::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 10px;
  background: var(--primary-soft);
  animation: scrollDot 1.8s ease-in-out infinite;
}

@keyframes scrollDot {
  0% {
    transform: translateY(-12px);
    opacity: 0;
  }

  40% {
    opacity: 1;
  }

  100% {
    transform: translateY(34px);
    opacity: 0;
  }
}

.int-line {
  animation: dash 1.4s linear infinite;
}

@keyframes dash {
  to {
    stroke-dashoffset: -20;
  }
}

@media (prefers-reduced-motion: reduce) {

  .scroll-dot::after,
  .int-line {
    animation: none !important;
  }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 860px) {
  body {
    font-size: 17px;
  }

  #integrate .wrap,
  #internal .wrap {
    grid-template-columns: 1fr !important;
  }

  header nav {
    display: none !important;
  }
}

/* ============================================================
   FOOTER
   ============================================================ */
.foot-link {
  color: var(--ink-dim);
  transition: color .2s;
}

.foot-link:hover {
  color: var(--ink);
}

/* ============================================================
   SAGE MODE STYLING & TRANSITIONS
   ============================================================ */
body.sage-active {
  --primary: #00D639 !important;
  --primary-soft: #73f090 !important;
  --accent: #00843D !important;
  --bg-0: #050806 !important;
  --ink: #ffffff !important;
  --ink-dim: #99cfad !important;
  --ink-faint: #00D639 !important;
  background-color: #050806 !important;
  color: #ffffff !important;
}

/* Global transition overrides for smooth page theme transitions */
body, section, header, nav, a, button, .glass, .chip, h1, h2, h3, p, img, .phone, .screen, .browser, .btn, .rot-word {
  transition: background-color 0.8s cubic-bezier(0.2, 0.8, 0.2, 1),
              color 0.8s cubic-bezier(0.2, 0.8, 0.2, 1),
              border-color 0.8s cubic-bezier(0.2, 0.8, 0.2, 1),
              box-shadow 0.8s cubic-bezier(0.2, 0.8, 0.2, 1),
              filter 0.8s cubic-bezier(0.2, 0.8, 0.2, 1),
              opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1),
              transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Specific section background variations in Sage mode */
body.sage-active #top,
body.sage-active #make,
body.sage-active #internal,
body.sage-active footer {
  background-color: #050806 !important;
}

body.sage-active section:nth-of-type(odd),
body.sage-active #contact {
  background-color: #0b120c !important;
  border-bottom-color: rgba(0, 214, 57, 0.05) !important;
}

body.sage-active #integrate {
  background: linear-gradient(180deg, #050806 0%, #002b11 50%, #050806 100%) !important;
  border-bottom-color: rgba(0, 214, 57, 0.15) !important;
  border-top: 1px solid rgba(0, 214, 57, 0.1) !important;
}

body.sage-active #start {
  background: linear-gradient(135deg, #004c22 0%, #050806 100%) !important;
  border-top: 1px solid rgba(0, 214, 57, 0.15) !important;
}

/* Background decorative green shapes in Sage mode */
body.sage-active #make::before {
  content: "";
  position: absolute;
  top: 10%;
  right: -10%;
  width: 450px;
  height: 450px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 214, 57, 0.12) 0%, transparent 70%);
  filter: blur(50px);
  pointer-events: none;
  z-index: 1;
}
body.sage-active #make::after {
  content: "";
  position: absolute;
  bottom: -15%;
  left: -15%;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 132, 61, 0.15) 0%, transparent 70%);
  filter: blur(60px);
  pointer-events: none;
  z-index: 1;
}

/* Background blob overrides in Sage mode */
body.sage-active .bg-root {
  background: #050806 !important;
}
body.sage-active .bg-blob.b1 {
  background: radial-gradient(circle at 30% 30%, #004c22, transparent 65%) !important;
}
body.sage-active .bg-blob.b2 {
  background: radial-gradient(circle at 60% 40%, #00220c, transparent 65%) !important;
}
body.sage-active .bg-blob.b3 {
  background: radial-gradient(circle at 50% 50%, #133c1f, transparent 62%) !important;
}
body.sage-active .bg-blob.b4 {
  background: radial-gradient(circle at 50% 50%, #003014, transparent 65%) !important;
}

/* Sage custom gradient text override */
body.sage-active .grad-text {
  background: linear-gradient(100deg, #73f090 10%, #00D639 55%, #00843D 105%) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  color: transparent !important;
}

/* Glass card overrides in Sage mode (Bubble Glass Shadows) */
body.sage-active .glass {
  background: #050806 !important;
  border-color: rgba(0, 214, 57, 0.15) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6),
              0 0 0 1px rgba(0, 214, 57, 0.08) !important;
  border-radius: 24px !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* Glass icon overrides in Sage mode (Vibrant flat glowing square) */
body.sage-active .gicon {
  background: radial-gradient(circle at center, #00D639 0%, #00843D 100%) !important;
  box-shadow: 0 0 24px rgba(0, 214, 57, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.25) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 20px !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
body.sage-active .gicon::after {
  display: none !important; /* disable default glossy sweep */
}
body.sage-active .gicon .blob {
  display: none !important; /* disable default background blobs */
}

/* Pill chips overrides in Sage mode */
body.sage-active .chip {
  background: rgba(0, 214, 57, 0.08) !important;
  border: 1px solid rgba(0, 214, 57, 0.2) !important;
  color: #99cfad !important;
  border-radius: 20px !important;
  font-family: var(--font-mono) !important;
}

/* Phone mockup overrides in Sage mode */
body.sage-active .phone {
  background: linear-gradient(160deg, #0b120c, #050806) !important;
  border-color: rgba(0, 214, 57, 0.15) !important;
}
body.sage-active .phone .screen {
  background: #050806 !important;
}

/* Browser mockup overrides in Sage mode */
body.sage-active .browser {
  background: #050806 !important;
  border-color: rgba(0, 214, 57, 0.15) !important;
}

/* Sage button styles */
.btn-sage {
  background: #00D639 !important;
  color: #050806 !important;
  font-weight: 700;
  box-shadow: none !important;
  border: 1px solid #00D639 !important;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease !important;
}
.btn-sage:hover {
  transform: translateY(-2px);
  background: #050806 !important;
  color: #00D639 !important;
  border-color: #00D639 !important;
  box-shadow: none !important;
}

body.sage-active .btn-sage {
  background: linear-gradient(180deg, #0b0f0c, #050806) !important;
  color: #73f090 !important;
  border: 1px solid rgba(0, 214, 57, 0.3) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
}
body.sage-active .btn-sage:hover {
  background: linear-gradient(180deg, #132c18, #0b0f0c) !important;
  color: #99ffb0 !important;
  border-color: rgba(0, 214, 57, 0.5) !important;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

/* Fullscreen Circular transition wipe */
.sage-transition-overlay {
  position: fixed;
  border-radius: 50%;
  background: radial-gradient(circle at center, #73f090 0%, #132c18 70%, #050806 100%);
  pointer-events: none;
  z-index: 99999;
  transform: scale(0);
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease-out;
  transform-origin: center;
}
.sage-transition-overlay.active {
  transform: scale(1);
}
.sage-transition-overlay.fade-out {
  opacity: 0;
}