/* Lunar Scale — shared design system. Tailwind (CDN) handles utility classes;
   this file holds tokens-as-CSS-vars, components, and motion that utilities
   don't express well. */

:root {
  --lunar-navy: #081020;
  --deep-space: #0f172a;
  --scale-blue: #315cff;
  --orbit-blue: #7ea8ff;
  --lunar-white: #f8fafc;
  --moon-mist: #f3f6fa;
  --moon-silver: #c7ccd6;
  --lunar-border: #dce3ec;
  --graphite: #1e293b;
  --slate-grey: #64748b;
  --growth-green: #18a66a;
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", sans-serif;
  color: var(--graphite);
  background: var(--lunar-white);
  /* Guard against any absolutely-positioned element (e.g. an open dropdown)
     ever spawning a horizontal scrollbar, which would cause layout oscillation. */
  overflow-x: clip;
}

h1, h2, h3, .font-display {
  font-family: "Manrope", sans-serif;
}

::selection {
  background: var(--scale-blue);
  color: #fff;
}

/* Focus visibility — every interactive element gets this, no exceptions */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--scale-blue);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: "Manrope", sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.85rem 1.6rem;
  border-radius: 12px;
  transition: transform 220ms var(--ease-spring), box-shadow 220ms var(--ease-spring), background-color 220ms var(--ease-spring), color 220ms var(--ease-spring), border-color 220ms var(--ease-spring);
  white-space: nowrap;
}
.btn:active {
  transform: translateY(1px) scale(0.99);
}
.btn-primary {
  background: var(--scale-blue);
  color: #fff;
  box-shadow: 0 1px 2px rgba(8, 16, 32, 0.1), 0 12px 24px -10px rgba(49, 92, 255, 0.55);
}
.btn-primary:hover {
  background: #2951e6;
  box-shadow: 0 1px 2px rgba(8, 16, 32, 0.12), 0 16px 32px -10px rgba(49, 92, 255, 0.65);
  transform: translateY(-1px);
}
.btn-secondary {
  background: transparent;
  color: var(--lunar-white);
  border: 1px solid rgba(248, 250, 252, 0.28);
}
.btn-secondary:hover {
  border-color: rgba(248, 250, 252, 0.55);
  background: rgba(248, 250, 252, 0.06);
  transform: translateY(-1px);
}
.btn-secondary.on-light {
  color: var(--graphite);
  border-color: var(--lunar-border);
}
.btn-secondary.on-light:hover {
  border-color: var(--slate-grey);
  background: var(--moon-mist);
}

/* Surfaces / depth system: base -> elevated -> floating */
.surface-elevated {
  background: #fff;
  border: 1px solid var(--lunar-border);
  box-shadow: 0 1px 2px rgba(8, 16, 32, 0.04), 0 12px 28px -14px rgba(8, 16, 32, 0.16);
  transition: transform 260ms var(--ease-spring), box-shadow 260ms var(--ease-spring), border-color 260ms var(--ease-spring);
}
.surface-elevated:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 8px rgba(8, 16, 32, 0.05), 0 24px 48px -20px rgba(8, 16, 32, 0.22);
  border-color: #c9d3e2;
}
.surface-floating {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(126, 168, 255, 0.18);
  backdrop-filter: blur(20px);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2), 0 30px 60px -20px rgba(0, 0, 0, 0.55);
}

/* Gradient accent line — the one signature gradient use, applied sparingly */
.accent-line {
  height: 2px;
  width: 48px;
  background: linear-gradient(90deg, var(--scale-blue) 0%, var(--orbit-blue) 100%);
  border-radius: 999px;
}

.gradient-text {
  background: linear-gradient(90deg, var(--scale-blue) 0%, var(--orbit-blue) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Subtle grain for the dark hero, keeps large navy fields from looking flat */
.grain::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.05;
  mix-blend-mode: overlay;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* Horizon signature animation in the hero — one orchestrated moment */
@keyframes horizon-glow {
  0%, 100% { opacity: 0.55; transform: scaleX(1); }
  50% { opacity: 0.9; transform: scaleX(1.03); }
}
.horizon-line {
  animation: horizon-glow 6s ease-in-out infinite;
  transform-origin: center;
}

/* ---- Lunar hero ambiance: starfield + moon glow (restrained, premium) ---- */
.starfield {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.starfield::before,
.starfield::after {
  content: "";
  position: absolute;
  inset: -20% 0 0 0;
  background-repeat: repeat;
  /* Two layers of fine star dots at different densities for depth. */
  background-image:
    radial-gradient(1.4px 1.4px at 20% 30%, rgba(255, 255, 255, 0.9), transparent),
    radial-gradient(1.2px 1.2px at 65% 15%, rgba(200, 220, 255, 0.75), transparent),
    radial-gradient(1px 1px at 40% 60%, rgba(255, 255, 255, 0.7), transparent),
    radial-gradient(1.6px 1.6px at 85% 45%, rgba(180, 205, 255, 0.7), transparent),
    radial-gradient(1px 1px at 10% 75%, rgba(255, 255, 255, 0.6), transparent),
    radial-gradient(1.2px 1.2px at 55% 80%, rgba(210, 225, 255, 0.6), transparent);
  background-size: 620px 620px;
}
.starfield::after {
  background-image:
    radial-gradient(1px 1px at 30% 20%, rgba(255, 255, 255, 0.6), transparent),
    radial-gradient(1px 1px at 75% 65%, rgba(190, 210, 255, 0.55), transparent),
    radial-gradient(1.3px 1.3px at 50% 40%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1px 1px at 15% 55%, rgba(220, 230, 255, 0.5), transparent);
  background-size: 400px 400px;
  animation: star-drift 90s linear infinite;
  opacity: 0.7;
}
@keyframes star-drift {
  from { transform: translateY(0); }
  to { transform: translateY(-400px); }
}
@keyframes star-twinkle {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 0.95; }
}
.starfield::before {
  animation: star-twinkle 7s ease-in-out infinite;
}
.moon-glow {
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(126, 168, 255, 0.28) 0%, rgba(49, 92, 255, 0.12) 35%, transparent 70%);
  filter: blur(6px);
}

/* Orbit-KI live indicator — a soft pulsing dot signalling real-time activity */
.orbit-pulse {
  position: relative;
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3fcb90;
}
.orbit-pulse::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #3fcb90;
  animation: orbit-ping 1.8s var(--ease-spring) infinite;
}
@keyframes orbit-ping {
  0% { transform: scale(1); opacity: 0.7; }
  70%, 100% { transform: scale(2.6); opacity: 0; }
}

/* Incoming-lead notifications in the hero mockup.
   The feed is a fixed-height, bottom-anchored, clipped window so adding or
   removing a row never changes the page's height (no scroll jump). A new row
   grows in at the bottom while the oldest collapses out at the top — the rest
   slide up smoothly via the animated height. */
#hero-feed {
  height: 194px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.hero-note {
  height: 58px;
  margin-top: 10px;
  flex: 0 0 auto;
  overflow: hidden;
  transition: height 480ms var(--ease-spring), opacity 340ms ease, margin-top 480ms var(--ease-spring);
}
.hero-note.is-collapsing {
  height: 0;
  margin-top: 0;
  opacity: 0;
}

/* Scroll reveal */

/* Industry tiles — branded visual cards (swap-ready for real project photos) */
.industry-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 15rem;
  padding: 1.5rem;
  border-radius: 20px;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(150deg, var(--tile-a) 0%, var(--tile-b) 100%);
  border: 1px solid rgba(126, 168, 255, 0.14);
  box-shadow: 0 1px 2px rgba(8, 16, 32, 0.06), 0 18px 40px -22px rgba(8, 16, 32, 0.5);
  transition: transform 320ms var(--ease-spring), box-shadow 320ms var(--ease-spring), border-color 320ms var(--ease-spring);
}
.industry-tile::after {
  /* fine grain for texture */
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.06;
  mix-blend-mode: overlay;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}
.industry-tile:hover {
  transform: translateY(-4px);
  border-color: rgba(126, 168, 255, 0.32);
  box-shadow: 0 4px 8px rgba(8, 16, 32, 0.08), 0 30px 60px -24px rgba(8, 16, 32, 0.62);
}
.industry-glow {
  position: absolute;
  top: -30%;
  right: -20%;
  width: 70%;
  height: 70%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(49, 92, 255, 0.35) 0%, rgba(126, 168, 255, 0.12) 40%, transparent 70%);
  filter: blur(4px);
  opacity: 0.8;
  transition: opacity 320ms var(--ease-spring), transform 320ms var(--ease-spring);
  pointer-events: none;
}
.industry-tile:hover .industry-glow {
  opacity: 1;
  transform: scale(1.08);
}
.industry-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 14px;
  color: var(--orbit-blue);
  background: rgba(126, 168, 255, 0.1);
  border: 1px solid rgba(126, 168, 255, 0.2);
  margin-bottom: auto;
}
.industry-body {
  position: relative;
  margin-top: 1.5rem;
}
.industry-eyebrow {
  font-family: "Manrope", sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(126, 168, 255, 0.85);
}
.industry-title {
  margin-top: 0.4rem;
  font-family: "Manrope", sans-serif;
  font-weight: 600;
  font-size: 1.25rem;
  color: #fff;
}
.industry-sub {
  margin-top: 0.4rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: rgba(199, 210, 228, 0.85);
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 700ms var(--ease-spring), transform 700ms var(--ease-spring);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* FAQ accordion — grid-rows trick, no JS height math needed */
.accordion-item[data-open="false"] .accordion-panel {
  grid-template-rows: 0fr;
}
.accordion-item[data-open="true"] .accordion-panel {
  grid-template-rows: 1fr;
}
.accordion-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 320ms var(--ease-spring);
}
.accordion-panel > div {
  overflow: hidden;
  min-height: 0;
}
.accordion-item[data-open="true"] .accordion-icon {
  transform: rotate(45deg);
}
.accordion-icon {
  transition: transform 260ms var(--ease-spring);
}

/* Header: transparent over the dark hero, navy-glass once scrolled (matches hero) */
#site-header {
  --nav-fg: #f8fafc;
  --nav-fg-muted: rgba(248, 250, 252, 0.72);
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background-color 300ms var(--ease-spring), border-color 300ms var(--ease-spring), box-shadow 300ms var(--ease-spring);
}
#site-header[data-scrolled="true"] {
  background: rgba(8, 16, 32, 0.72);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom-color: rgba(126, 168, 255, 0.14);
  box-shadow: 0 8px 30px -12px rgba(0, 0, 0, 0.6);
}
#site-header .nav-link {
  color: var(--nav-fg-muted);
  transition: color 200ms var(--ease-spring);
}
#site-header .nav-link:hover,
#site-header .nav-group:hover .nav-link,
#site-header .nav-group:focus-within .nav-link {
  color: var(--nav-fg);
}
#site-header .menu-icon-bar {
  background: #f8fafc;
}

/* Dropdown: dark lunar-glass panel, flicker-proof hover bridge.
   The bridge is a full-width invisible pad that keeps :hover alive across the
   gap between trigger and panel, so the panel never loses hover mid-transition. */
.nav-group::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 1.25rem;
}
.nav-dropdown {
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 200ms var(--ease-spring), transform 200ms var(--ease-spring), visibility 200ms;
  will-change: opacity, transform;
}
.nav-group:hover .nav-dropdown,
.nav-group:focus-within .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.nav-panel {
  background: rgba(13, 22, 42, 0.86);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid rgba(126, 168, 255, 0.16);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.3), 0 24px 50px -18px rgba(0, 0, 0, 0.7);
}
.nav-panel a {
  color: #cdd6e6;
}
.nav-panel a:hover {
  background: rgba(126, 168, 255, 0.1);
  color: #ffffff;
}
.nav-panel a .nav-panel-sub {
  color: #7f8da6;
}

/* Mobile nav panel */
#mobile-menu {
  transition: opacity 220ms var(--ease-spring), transform 220ms var(--ease-spring);
}
#mobile-menu[data-open="false"] {
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
}
#mobile-menu[data-open="true"] {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Form */
.field-label {
  font-family: "Manrope", sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--graphite);
}
.field-input {
  width: 100%;
  border: 1px solid var(--lunar-border);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  font-size: 0.95rem;
  background: #fff;
  color: var(--graphite);
  transition: border-color 200ms var(--ease-spring), box-shadow 200ms var(--ease-spring);
}
.field-input:hover {
  border-color: var(--moon-silver);
}
.field-input:focus {
  outline: none;
  border-color: var(--scale-blue);
  box-shadow: 0 0 0 3px rgba(49, 92, 255, 0.15);
}
.field-error {
  color: #c0362c;
  font-size: 0.82rem;
  min-height: 1.1em;
}
.field-input[aria-invalid="true"] {
  border-color: #c0362c;
}

/* Respect reduced motion everywhere */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .horizon-line, .reveal, .accordion-panel, .btn, .surface-elevated, #mobile-menu,
  .starfield::before, .starfield::after, .hero-note, .orbit-pulse::after {
    animation: none !important;
    transition: none !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
  .hero-note {
    opacity: 1;
    transform: none;
  }
  [data-parallax] {
    transform: none !important;
  }
}
