/* ============================================================
   Corlatis — styles.css
   Custom styles complementing Tailwind CDN
   ============================================================ */

/* ---- CSS Variables ---- */
:root {
  --brand-blue: #1e6eb0;
  --brand-teal: #00bfa0;
  --bg: #0c1420;
  --surface-2: #182436;
}

/* ---- Base ---- */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg);
  overflow-x: hidden;
}

/* ---- Gradient Text ---- */
.gradient-text {
  background: linear-gradient(135deg, var(--brand-blue) 0%, var(--brand-teal) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---- Buttons ---- */
.btn-primary {
  background: linear-gradient(135deg, var(--brand-blue) 0%, var(--brand-teal) 100%);
  color: #fff;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.btn-primary:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: transparent;
  color: var(--brand-teal);
  border: 1.5px solid rgba(0, 191, 160, 0.35);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
.btn-secondary:hover {
  border-color: var(--brand-teal);
  background: rgba(0, 191, 160, 0.07);
  transform: translateY(-1px);
}

/* ---- Nav ---- */
.nav {
  background: rgba(12, 20, 32, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  opacity: 0;
  animation: nav-in 0.5s ease 0.1s forwards;
}

@keyframes nav-in {
  to { opacity: 1; }
}

/* ---- Hexagonal background grid ---- */
.hex-grid {
  position: absolute;
  inset: 0;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='52' viewBox='0 0 60 52'%3E%3Cpath d='M30 2 L56 17 L56 47 L30 52 L4 47 L4 17 Z' fill='none' stroke='rgba(30,110,176,0.10)' stroke-width='1'/%3E%3C/svg%3E");
  background-size: 60px 52px;
  mask-image: radial-gradient(ellipse at 60% 40%, rgba(0,0,0,0.4) 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 60% 40%, rgba(0,0,0,0.4) 0%, transparent 70%);
  pointer-events: none;
}

/* Noise texture overlay */
.hex-grid::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.025'/%3E%3C/svg%3E");
  opacity: 0.4;
  pointer-events: none;
}

/* Hero ambient glow */
#hero::before {
  content: '';
  position: absolute;
  top: -20%;
  right: -10%;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(0, 191, 160, 0.13) 0%, transparent 65%);
  pointer-events: none;
}

#hero::after {
  content: '';
  position: absolute;
  bottom: -10%;
  left: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(30, 110, 176, 0.12) 0%, transparent 65%);
  pointer-events: none;
}

/* ---- Hero entrance animations ---- */
.hero-eyebrow {
  animation: slide-up 0.6s ease 0.3s forwards;
}
.hero-headline {
  animation: slide-up 0.7s ease 0.45s forwards;
}
.hero-sub {
  animation: slide-up 0.6s ease 0.65s forwards;
}
.hero-ctas {
  animation: slide-up 0.6s ease 0.8s forwards;
}
.hero-mark {
  animation: fade-in 1s ease 0.6s forwards;
}

@keyframes slide-up {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---- Logo float ---- */
.logo-float {
  animation: float 6s ease-in-out infinite, logo-pulse 4s ease-in-out infinite;
}

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

@keyframes logo-pulse {
  0%, 100% { filter: drop-shadow(0 0 30px rgba(0, 191, 160, 0.12)); }
  50% { filter: drop-shadow(0 0 70px rgba(0, 191, 160, 0.28)); }
}

/* ---- Scroll reveal ---- */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-child {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease calc(var(--delay, 0s)), transform 0.5s ease calc(var(--delay, 0s));
}
.visible .reveal-child {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Service cards ---- */
.service-card {
  transition: border-color 0.35s ease, transform 0.35s ease, box-shadow 0.35s ease;
}
.service-card:hover {
  border-color: rgba(0, 191, 160, 0.45);
  transform: translateY(-6px);
  box-shadow:
    0 0 0 1px rgba(0, 191, 160, 0.15),
    0 20px 40px -12px rgba(0, 0, 0, 0.6),
    0 0 80px -24px rgba(0, 191, 160, 0.22);
}

/* ---- Process step ghost numbers ---- */
.process-step {
  isolation: isolate;
}
.process-step::before {
  content: attr(data-step);
  position: absolute;
  top: -1.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Outfit', sans-serif;
  font-size: 9rem;
  font-weight: 800;
  line-height: 1;
  opacity: 0.035;
  color: #fff;
  pointer-events: none;
  z-index: -1;
  user-select: none;
  white-space: nowrap;
}

/* ---- Stat cards ---- */
.stat-card {
  transition: border-color 0.3s ease;
}
.stat-card:hover {
  border-color: rgba(0, 191, 160, 0.2);
}

/* ---- Mobile menu ---- */
.mobile-menu.open {
  display: flex;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

/* ---- Focus visible global ---- */
:focus-visible {
  outline: 2px solid var(--brand-teal);
  outline-offset: 2px;
}

/* ---- Screen reader only ---- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
.focus\:not-sr-only:focus {
  position: static;
  width: auto;
  height: auto;
  padding: inherit;
  margin: inherit;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .hero-eyebrow,
  .hero-headline,
  .hero-sub,
  .hero-ctas,
  .hero-mark {
    animation: none;
    opacity: 1;
  }

  .nav {
    animation: none;
    opacity: 1;
  }

  .logo-float {
    animation: none;
    filter: drop-shadow(0 0 30px rgba(0, 191, 160, 0.15));
  }

  .reveal,
  .reveal-child {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .btn-primary:hover,
  .btn-secondary:hover,
  .service-card:hover {
    transform: none;
  }
}
