/* ============================================================
   STREaMLiNE — brand tokens & custom styles
   Tailwind CDN handles utilities; this file handles everything
   Tailwind can't: pseudoelements, animations, CSS art, JIT gaps
   ============================================================ */

:root {
  --bg-deep: #060a14;
  --bg-surface: #0d1526;
  --border: #1e2d4a;
  --cyan: #06B6D4;
  --cyan-dim: rgba(6, 182, 212, 0.15);
  --amber: #F59E0B;
  --text-muted: #94a3b8;
  --font-sans: 'Outfit', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

/* ── Global ── */
html {
  font-size: 17px;
  overflow-x: hidden;
}

::selection {
  background-color: rgba(6, 182, 212, 0.3);
  color: #fff;
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #2d4070; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg-deep);
  overflow-x: hidden;
}

/* ── Nav ── */
#nav {
  transition: background 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease;
  border-bottom: 1px solid transparent;
}

#nav.scrolled {
  background: rgba(6, 10, 20, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--border);
}

/* ── Hero ── */
#hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 5rem;
  padding-bottom: 4rem;
  text-align: center;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, #0d2040 0%, var(--bg-deep) 70%);
  z-index: 0;
}

.dot-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(30, 45, 74, 0.9) 1px, transparent 1px);
  background-size: 32px 32px;
  z-index: 1;
  mask-image: radial-gradient(ellipse at 50% 30%, black 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, black 20%, transparent 75%);
}

.hero-content {
  position: relative;
  z-index: 10;
  max-width: 56rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.hero-content > * {
  animation: fadeUp 0.8s ease both;
}

.hero-content > *:nth-child(1) { animation-delay: 0.08s; }
.hero-content > *:nth-child(2) { animation-delay: 0.22s; }
.hero-content > *:nth-child(3) { animation-delay: 0.38s; }
.hero-content > *:nth-child(4) { animation-delay: 0.56s; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-dashboard {
  position: relative;
  max-width: 680px;
  margin: 0 auto;
  animation: fadeUp 0.8s ease 0.62s both;
}

.hero-dashboard-card {
  background: rgba(13, 21, 38, 0.85);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
  backdrop-filter: blur(8px);
  animation: float 6s ease-in-out infinite;
}

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

.hero-glow {
  position: absolute;
  bottom: -50px;
  left: 50%;
  transform: translateX(-50%);
  width: 70%;
  height: 90px;
  background: radial-gradient(ellipse, rgba(6, 182, 212, 0.12) 0%, transparent 70%);
  filter: blur(24px);
  pointer-events: none;
  z-index: 0;
}

.stat-bar-inner {
  height: 100%;
  border-radius: 9999px;
  transition: width 1.5s ease;
}

.terminal-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: #475569;
}

.terminal-line.done { color: #64748b; }

/* Scroll caret */
.scroll-caret {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  animation: fadeUp 1s ease 1.8s both;
  opacity: 0.4;
}

.scroll-caret-inner {
  width: 24px;
  height: 40px;
  border: 2px solid var(--border);
  border-radius: 12px;
  display: flex;
  justify-content: center;
  padding-top: 6px;
}

.scroll-dot {
  width: 4px;
  height: 8px;
  background: var(--cyan);
  border-radius: 2px;
  animation: scrollBounce 2.2s ease-in-out infinite;
}

@keyframes scrollBounce {
  0%, 100% { transform: translateY(0); opacity: 1; }
  60%       { transform: translateY(8px); opacity: 0.2; }
}

/* ── Pain section ── */
.pain-card {
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.pain-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(245, 158, 11, 0.06);
}

/* ── Why STREaMLiNE — CSS tech visual ── */
.why-visual-wrap {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  height: 420px;
}

.why-visual {
  width: 100%;
  height: 100%;
  background: linear-gradient(145deg, #0d1e38 0%, #060a14 55%, #071220 100%);
  position: relative;
  overflow: hidden;
}

/* Grid overlay */
.why-visual::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 44px 44px;
  opacity: 0.25;
  mask-image: radial-gradient(ellipse at 50% 50%, black 40%, transparent 85%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 50%, black 40%, transparent 85%);
}

/* Cyan glow blob */
.why-visual::after {
  content: '';
  position: absolute;
  top: -30%;
  left: 10%;
  width: 60%;
  height: 70%;
  background: radial-gradient(ellipse, rgba(6, 182, 212, 0.1) 0%, transparent 65%);
  border-radius: 50%;
  filter: blur(8px);
}

.why-orb {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -60%);
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.18) 0%, transparent 70%);
  box-shadow: 0 0 60px rgba(6, 182, 212, 0.12);
  animation: pulse-orb 4s ease-in-out infinite;
}

@keyframes pulse-orb {
  0%, 100% { opacity: 0.7; transform: translate(-50%, -60%) scale(1); }
  50%       { opacity: 1;   transform: translate(-50%, -60%) scale(1.12); }
}

.why-stat-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(6, 10, 20, 0.92);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  padding: 1rem 1.5rem;
  display: flex;
  gap: 2rem;
  align-items: center;
}

.why-stat-divider {
  width: 1px;
  height: 32px;
  background: var(--border);
}

/* ── What section — connector ── */
.connector-line {
  display: none;
}

@media (min-width: 768px) {
  .connector-line {
    display: block;
    position: absolute;
    top: 56px;
    left: calc(16.67% + 20px);
    right: calc(16.67% + 20px);
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(6,182,212,0.25), transparent);
    z-index: 0;
  }
}

.process-icon-ring {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(6, 182, 212, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  position: relative;
  z-index: 1;
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.process-card:hover .process-icon-ring {
  background: rgba(6, 182, 212, 0.15);
  border-color: rgba(6, 182, 212, 0.5);
  box-shadow: 0 0 24px rgba(6, 182, 212, 0.1);
}

/* ── Industry cards ── */
.industry-card {
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.industry-card:hover {
  transform: translateY(-5px);
  border-color: rgba(6, 182, 212, 0.25);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.industry-thumb {
  height: 192px;
  position: relative;
  overflow: hidden;
}

.industry-thumb-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(6, 10, 20, 0.95) 0%, rgba(6, 10, 20, 0.4) 60%, transparent 100%);
}

/* Industry-specific gradient backgrounds */
.ind-engineering {
  background: linear-gradient(135deg, #0f1f3d 0%, #0a1428 60%, #051020 100%);
}

.ind-engineering::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      -45deg,
      transparent 0px,
      transparent 12px,
      rgba(6,182,212,0.04) 12px,
      rgba(6,182,212,0.04) 13px
    );
}

.ind-finance {
  background: linear-gradient(135deg, #061e28 0%, #041418 60%, #020e10 100%);
}

.ind-finance::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 70% 30%, rgba(6,182,212,0.08) 0%, transparent 50%);
}

.ind-healthcare {
  background: linear-gradient(135deg, #061828 0%, #041020 60%, #020a14 100%);
}

.ind-healthcare::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 30% 60%, rgba(6,182,212,0.07) 0%, transparent 50%);
}

.ind-legal {
  background: linear-gradient(135deg, #14101e 0%, #0e0c18 60%, #080810 100%);
}

.ind-legal::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 60% 40%, rgba(139,92,246,0.06) 0%, transparent 50%);
}

.ind-startups {
  background: linear-gradient(135deg, #061428 0%, #040e1e 60%, #020812 100%);
}

.ind-startups::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 80%, rgba(6,182,212,0.07) 0%, transparent 45%),
    radial-gradient(circle at 80% 20%, rgba(6,182,212,0.05) 0%, transparent 40%);
}

.ind-education {
  background: linear-gradient(135deg, #061a14 0%, #041210 60%, #020a08 100%);
}

.ind-education::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 50% 30%, rgba(16,185,129,0.07) 0%, transparent 50%);
}

/* ── Form ── */
input, textarea {
  font-family: var(--font-sans);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus, textarea:focus {
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}

/* ── Scroll reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-card {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-card.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Shimmer on hero stat cards ── */
.stat-card {
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: -120%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.025), transparent);
  animation: shimmer 4s ease-in-out infinite;
}

@keyframes shimmer {
  0%   { left: -120%; }
  100% { left: 200%; }
}

/* ── Mobile responsiveness ── */
@media (max-width: 640px) {
  html {
    font-size: 15px;
  }

  .hero-content {
    width: 100%;
    padding: 0 1rem;
  }

  /* Stat cards: stack to single column on very small screens */
  .hero-dashboard-card .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
  }

  .hero-dashboard-card .stat-card {
    padding: 0.625rem;
  }

  .hero-dashboard-card .stat-card .text-2xl {
    font-size: 1.1rem;
  }

  /* Terminal lines: prevent horizontal overflow */
  .terminal-line {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Why stat bar: wrap stats on mobile */
  .why-stat-bar {
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: space-around;
  }

  .why-stat-divider {
    display: none;
  }

  /* Industries grid: full-width cards on mobile */
  .industry-thumb {
    height: 140px;
  }
}

/* iOS Safari viewport fix — use small viewport height */
@supports (min-height: 100svh) {
  #hero {
    min-height: 100svh;
  }
}
