@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --ink: #14181F;
  --ink-soft: #454B57;
  --paper: #F2F1EC;
  --paper-raised: #FBFAF7;
  --line: #DBD9D0;
  --accent: #3652E0;
  --accent-soft: #E7EBFC;
  --signal: #F5A623;
  --success: #1D9E75;
  --danger: #D8402E;
  --dk-bg: #0E1116;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font-family: 'Inter', sans-serif; color: var(--ink); background: var(--paper);
  -webkit-font-smoothing: antialiased; position: relative;
}
h1, h2, h3, .display { font-family: 'Space Grotesk', sans-serif; }
.mono { font-family: 'JetBrains Mono', monospace; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.section { border-top: 1px solid var(--line); }
.section.raised { background: rgba(251,250,247,0.55); backdrop-filter: blur(4px); }
.section-inner { max-width: 1080px; margin: 0 auto; padding: 56px 24px; }

/* --- Animated background --- */
.bg-layer { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.35; }
.grid-overlay {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(20,24,31,0.045) 1px, transparent 1px), linear-gradient(90deg, rgba(20,24,31,0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, black 30%, transparent 90%);
}
.progress-bar { position: fixed; top: 0; left: 0; height: 3px; background: linear-gradient(90deg, var(--accent), var(--signal)); z-index: 100; width: 0; transition: width .1s linear; }
.page-shell { position: relative; z-index: 1; }

@keyframes blob1 { 0%,100% { transform: translate(0,0) scale(1); } 33% { transform: translate(40px,-30px) scale(1.08); } 66% { transform: translate(-25px,25px) scale(0.95); } }
@keyframes blob2 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-45px,30px) scale(1.1); } }
@keyframes blob3 { 0%,100% { transform: translate(0,0) scale(1); } 40% { transform: translate(30px,20px) scale(0.9); } 70% { transform: translate(-20px,-25px) scale(1.05); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulseDot { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes floatY { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes ringPulse { 0% { transform: scale(0.82); opacity: 0.55; } 70% { transform: scale(1.4); opacity: 0; } 100% { opacity: 0; } }

.reveal { opacity: 0; }
.reveal.in { animation: fadeUp .7s cubic-bezier(.16,1,.3,1) forwards; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); display: inline-block; animation: pulseDot 2s infinite; }
.float { animation: floatY 5s ease-in-out infinite; }
.gradient-text {
  background: linear-gradient(90deg, var(--accent), #7C3AED, var(--signal), var(--accent));
  background-size: 300% auto; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 6s linear infinite;
}

/* --- Buttons --- */
.btn-primary, .btn-ghost {
  padding: 12px 22px; border-radius: 6px; font-weight: 600; font-size: 14px; border: none;
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-family: inherit;
  transition: transform .18s cubic-bezier(.16,1,.3,1), box-shadow .18s, background .18s;
}
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(20,24,31,0.22); }
.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
.btn-ghost:hover { background: rgba(20,24,31,0.06); transform: translateY(-2px); }

/* --- Cards --- */
.card { background: rgba(251,250,247,0.75); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: 12px; padding: 24px; transition: transform .25s cubic-bezier(.16,1,.3,1), box-shadow .25s, border-color .25s; }
.card-hover:hover { transform: translateY(-6px); box-shadow: 0 18px 36px rgba(20,24,31,0.10); border-color: var(--accent); }
.icon-box { width: 36px; height: 36px; border-radius: 8px; background: var(--accent-soft); display: flex; align-items: center; justify-content: center; margin-bottom: 16px; transition: transform .4s cubic-bezier(.16,1,.3,1); }
.card-hover:hover .icon-box { transform: rotate(-8deg) scale(1.1); }
.thumb { width: 100%; aspect-ratio: 16/9; border-radius: 8px; object-fit: cover; background: var(--paper); margin-bottom: 14px; }

/* --- Nav --- */
.nav { border-bottom: 1px solid var(--line); position: sticky; top: 0; background: rgba(242,241,236,0.85); backdrop-filter: blur(10px); z-index: 30; }
.nav-inner { max-width: 1080px; margin: 0 auto; padding: 16px 24px; display: flex; align-items: center; justify-content: space-between; }
.brand { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 20px; display: flex; align-items: center; gap: 8px; }
.brand-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--signal); }
.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-link { position: relative; font-size: 14px; font-weight: 500; color: var(--ink); padding: 6px 2px; }
.nav-link::after { content: ''; position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: var(--accent); transition: width .25s cubic-bezier(.16,1,.3,1); }
.nav-link:hover::after, .nav-link.active::after { width: 100%; }
.nav-link.active { color: var(--accent); }
.menu-btn { display: none; background: none; border: none; cursor: pointer; }
.mobile-menu { display: none; border-top: 1px solid var(--line); padding: 12px 24px 20px; flex-direction: column; gap: 4px; }
.mobile-menu.open { display: flex; animation: fadeUp .25s; }
.mobile-menu a { padding: 10px 4px; font-size: 15px; font-weight: 500; }

/* --- Hero / terminal --- */
.hero { padding: 64px 24px 56px; max-width: 1080px; margin: 0 auto; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; }
.terminal { background: var(--dk-bg); border-radius: 12px; padding: 20px 22px; min-height: 190px; border: 1px solid #262B33; box-shadow: 0 30px 60px rgba(20,24,31,0.18); }
.terminal-dots { display: flex; gap: 6px; margin-bottom: 16px; }
.terminal-dots span { width: 9px; height: 9px; border-radius: 50%; background: #4A515C; display: inline-block; }
.terminal-line { font-size: 13px; line-height: 1.9; }
.terminal-line .ok { color: #3DD68C; }
.terminal-line .cmd { color: #C7CCD4; }
.cursor { animation: blink 1s step-end infinite; }

/* --- Marquee --- */
.marquee-wrap { overflow: hidden; mask-image: linear-gradient(90deg, transparent, black 10%, black 90%, transparent); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.marquee-track { display: flex; width: max-content; animation: marquee 22s linear infinite; }
.marquee-wrap:hover .marquee-track { animation-play-state: paused; }
.marquee-item { padding: 8px 26px; font-size: 13px; color: var(--ink-soft); white-space: nowrap; border-right: 1px solid var(--line); }

/* --- Flagship pillars --- */
.pillar-card { position: relative; padding-top: 30px; }
.pillar-bar { position: absolute; top: 0; left: 20px; right: 20px; height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--pc), transparent); opacity: 0.8; }
.pillar-icon { width: 52px; height: 52px; border-radius: 14px; display: flex; align-items: center; justify-content: center; position: relative; background: color-mix(in srgb, var(--pc) 14%, transparent); margin-bottom: 18px; }
.pillar-icon::after { content: ''; position: absolute; inset: -6px; border-radius: 18px; border: 1.5px solid var(--pc); opacity: 0; animation: ringPulse 2.8s ease-out infinite; }
.pillar-card:hover .pillar-icon::after { animation-duration: 1.4s; }
.pillar-card:hover { border-color: var(--pc); box-shadow: 0 20px 40px -12px color-mix(in srgb, var(--pc) 35%, transparent); }
.pillar-tag { font-size: 11px; padding: 4px 10px; border-radius: 20px; background: color-mix(in srgb, var(--pc) 12%, transparent); color: var(--pc); border: 1px solid color-mix(in srgb, var(--pc) 30%, transparent); }
.pillar-eyebrow { font-size: 11px; font-weight: 600; margin-bottom: 6px; letter-spacing: 0.4px; color: var(--pc); }

/* --- Category tabs --- */
.cat-tab { background: none; border: 1px solid var(--line); padding: 8px 16px; border-radius: 20px; font-size: 13px; font-weight: 500; color: var(--ink-soft); cursor: pointer; transition: all .2s; font-family: inherit; }
.cat-tab.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.cat-tab:hover:not(.active) { border-color: var(--ink); color: var(--ink); }

/* --- Testimonial carousel --- */
.carousel { text-align: center; max-width: 640px; margin: 0 auto; position: relative; min-height: 200px; }
.carousel-quote { font-size: 17px; line-height: 1.6; font-style: italic; margin: 0 0 16px; }
.carousel-dots { display: flex; gap: 6px; justify-content: center; margin-top: 18px; }
.carousel-dots button { border: none; background: var(--line); border-radius: 4px; height: 7px; width: 7px; cursor: pointer; transition: all .3s; }
.carousel-dots button.active { width: 20px; background: var(--accent); }

/* --- Forms --- */
.field { margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 500; display: block; margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper-raised);
  font-family: inherit; font-size: 14px;
}
.field textarea { resize: vertical; }
.form-error { font-size: 13px; color: var(--danger); margin-bottom: 12px; }

/* --- Footer --- */
.footer { border-top: 1px solid var(--line); margin-top: 20px; }
.footer-inner { max-width: 1080px; margin: 0 auto; padding: 28px 24px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.footer-links { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-soft); }

/* --- Grid utilities --- */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }

@media (max-width: 860px) {
  .hide-mobile { display: none !important; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr !important; }
  .menu-btn { display: block !important; }
  .hero-grid { grid-template-columns: 1fr; }
}

/* ================= Additional animations ================= */

/* Cursor-glow spotlight that follows the mouse over the hero */
.cursor-glow {
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 50%), rgba(54,82,224,0.10), transparent 70%);
  transition: background .1s ease-out;
}

/* Tilt-on-hover for cards (JS sets --rx/--ry via mousemove) */
.tilt-card {
  transform: perspective(800px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--ty, 0));
  transition: transform .15s ease-out, box-shadow .25s;
}

/* Bounce-in entrance for pillar / icon elements */
@keyframes bounceIn {
  0% { opacity: 0; transform: scale(0.6) translateY(10px); }
  60% { opacity: 1; transform: scale(1.08) translateY(-2px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
.bounce-in { animation: bounceIn .6s cubic-bezier(.34,1.56,.64,1) both; }

/* Sweeping gradient border animation on the primary CTA */
@keyframes borderSweep { 0% { background-position: 0% 50%; } 100% { background-position: 200% 50%; } }
.btn-primary.sweep {
  background: linear-gradient(90deg, var(--ink), #2a3fb8, var(--ink), var(--ink));
  background-size: 300% 100%;
  animation: borderSweep 4s linear infinite;
}

/* Count-up number wrapper (JS animates the text content; CSS gives it a pop when it starts) */
@keyframes numberPop { 0% { transform: scale(0.85); opacity: .4; } 100% { transform: scale(1); opacity: 1; } }
.count-up.counting { animation: numberPop .3s ease-out; }

/* Underline sweep for nav-link active/hover state, richer than a flat line */
.nav-link::after { background: linear-gradient(90deg, var(--accent), var(--signal)); }

/* Soft image fade-in once loaded (progressive enhancement via JS adding .loaded) */
.thumb { opacity: 0; transition: opacity .5s ease; }
.thumb.loaded { opacity: 1; }

/* Ripple feedback on button press */
.btn-primary, .btn-ghost { position: relative; overflow: hidden; }
.ripple { position: absolute; border-radius: 50%; background: rgba(255,255,255,0.5); transform: scale(0); animation: rippleAnim .6s ease-out; pointer-events: none; }
.btn-ghost .ripple { background: rgba(20,24,31,0.15); }
@keyframes rippleAnim { to { transform: scale(3); opacity: 0; } }

/* Marquee item hover lift */
.marquee-item { transition: color .2s, transform .2s; }
.marquee-item:hover { color: var(--accent); transform: translateY(-2px); }

/* Slow continuous rotation, used on a small decorative accent in the hero */
@keyframes spinSlow { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.spin-slow { animation: spinSlow 12s linear infinite; }
