/* =========================================================================
   CloudMint — site styles
   Handles: animated grid mesh backdrop, glow blobs, glow-card mouse-tracked
   border, hero text-reveal helpers, and other infinite-loop CSS keyframes
   GSAP doesn't need to own.
   ========================================================================= */

html {
  scroll-behavior: smooth;
}

/* ---------- Blog post body copy ---------- */
.prose {
  color: #334155; /* slate-700 */
  font-size: 1.0625rem;
  line-height: 1.75;
}

html.dark .prose {
  color: #cbd5e1; /* slate-300 */
}

.prose p {
  margin: 0 0 1.25em;
}

.prose h2 {
  font-size: 1.4rem;
  font-weight: 800;
  margin: 1.8em 0 0.7em;
  color: #0f172a; /* slate-900 */
}

html.dark .prose h2 {
  color: #ffffff;
}

.prose ul, .prose ol {
  margin: 0 0 1.25em;
  padding-left: 1.4em;
}

.prose li {
  margin: 0 0 0.5em;
}

.prose li::marker {
  color: #00F59B;
}

.prose strong {
  color: #0f172a;
  font-weight: 700;
}

html.dark .prose strong {
  color: #ffffff;
}

.prose code {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.85em;
  background: rgba(148, 163, 184, 0.15);
  padding: 0.15em 0.4em;
  border-radius: 0.3em;
}

.prose em {
  color: #00a884;
}

html.dark .prose em {
  color: #00F59B;
}

body {
  overflow-x: hidden;
}

/* ---------- Light-mode ambient wash ----------
   Dark mode gets its drama from the obsidian background + hero glows.
   Light mode was flat white everywhere else, so give the whole page (not
   just the hero) a soft, fixed mint/cyan color wash behind the cards.
   Hidden entirely in dark mode — that look is untouched. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -30;
  pointer-events: none;
  background:
    radial-gradient(900px circle at 10% -10%, rgba(0, 245, 155, 0.13), transparent 60%),
    radial-gradient(900px circle at 100% 0%, rgba(0, 210, 255, 0.13), transparent 60%),
    radial-gradient(1100px circle at 50% 110%, rgba(0, 210, 255, 0.08), transparent 60%);
}

html.dark body::before {
  content: none;
}

/* ---------- Native <select> popup: force readable option colors ----------
   Tailwind's dark: text/background utilities only style the closed select
   box — the browser renders the open dropdown's <option> list itself, so
   without this it can fall back to white-on-white (or the inverse) and the
   values become unreadable. Setting color-scheme + explicit option colors
   keeps the popup legible in both themes. */
select {
  color-scheme: light;
}

select option {
  background-color: #ffffff;
  color: #0f172a; /* slate-900 */
}

html.dark select {
  color-scheme: dark;
}

html.dark select option {
  background-color: #0b1120; /* obsidian-900 */
  color: #ffffff;
}

/* ---------- Animated grid mesh backdrop ---------- */
.grid-mesh {
  background-image:
    linear-gradient(to right, rgba(148, 163, 184, 0.12) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148, 163, 184, 0.12) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, black 40%, transparent 85%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, black 40%, transparent 85%);
  animation: mesh-drift 18s linear infinite;
}

html.dark .grid-mesh {
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
}

@keyframes mesh-drift {
  0%   { background-position: 0 0; }
  100% { background-position: 44px 44px; }
}

/* ---------- Glow blobs floating behind the hero ---------- */
.glow-blob {
  width: 32rem;
  height: 32rem;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.18;
  animation: blob-float 14s ease-in-out infinite;
}

.glow-blob--mint { background: #00F59B; }
.glow-blob--cyan { background: #00D2FF; animation-delay: -6s; }

html.dark .glow-blob { opacity: 0.35; }

@keyframes blob-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(4%, 6%) scale(1.08); }
  66%      { transform: translate(-3%, -4%) scale(0.95); }
}

/* ---------- Floating accent chip (hero) ---------- */
.float-chip {
  animation: chip-float 5s ease-in-out infinite;
}

@keyframes chip-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}

/* ---------- Hero staggered text reveal (GSAP animates hero-line-inner) ---------- */
.hero-line-inner {
  transform: translateY(110%);
}

/* ---------- Bento glow cards: mouse-tracked radial gradient border ---------- */
.glow-card {
  --mx: 50%;
  --my: 50%;
  isolation: isolate;
  transition: border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
  /* light mode: soft colored lift instead of flat white-on-white */
  box-shadow: 0 12px 28px -14px rgba(2, 6, 23, 0.10), 0 4px 12px -6px rgba(0, 210, 255, 0.10);
}

html.dark .glow-card {
  box-shadow: none;
}

.glow-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 36px -16px rgba(2, 6, 23, 0.14), 0 6px 16px -6px rgba(0, 245, 155, 0.16);
}

html.dark .glow-card:hover {
  box-shadow: none;
}

.glow-overlay {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.35s ease;
  background: radial-gradient(
    380px circle at var(--mx) var(--my),
    rgba(0, 245, 155, 0.16),
    rgba(0, 210, 255, 0.08) 45%,
    transparent 70%
  );
  pointer-events: none;
}

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

.glow-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: radial-gradient(
    380px circle at var(--mx) var(--my),
    rgba(0, 245, 155, 0.9),
    rgba(0, 210, 255, 0.5) 45%,
    transparent 70%
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

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

/* ---------- Pipeline step connectors ---------- */
.pipeline-step {
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  box-shadow: 0 10px 24px -14px rgba(2, 6, 23, 0.10);
}

html.dark .pipeline-step {
  box-shadow: none;
}

.pipeline-step:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 245, 155, 0.4);
  box-shadow: 0 16px 30px -14px rgba(0, 245, 155, 0.18);
}

html.dark .pipeline-step:hover {
  box-shadow: none;
}

/* ---------- Quote form card: colored lift in light mode ---------- */
#quote-form {
  box-shadow: 0 20px 45px -20px rgba(0, 168, 204, 0.16), 0 8px 20px -12px rgba(2, 6, 23, 0.08);
}

html.dark #quote-form {
  box-shadow: none;
}

/* ---------- Theme switcher (Light / Dark / System) ---------- */
.theme-btn.is-active {
  background: #ffffff;
  color: #00cf82; /* mint-600 */
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

html.dark .theme-btn.is-active {
  background: #0b1120; /* obsidian-900 */
  color: #00F59B; /* mint-500 */
}

/* ---------- Navbar hide/reveal-on-scroll ---------- */
#navbar.nav-hidden {
  transform: translateY(-130%);
}

/* ---------- Scrollbar polish (webkit) ---------- */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.35);
  border-radius: 999px;
}
