/*
 * DevKeel application styles — Deep Water Navigation
 */

/* ── Turbo Frame loading states ── */
turbo-frame[busy] { opacity: 0.6; pointer-events: none; transition: opacity 0.2s ease; }

/* ── Typography (moved from inline <style> for CSP compliance) ── */
body { font-family: 'DM Sans', system-ui, sans-serif; }
code, pre, .font-mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }

/* ── Ocean surface / wave background ── */
.ocean-surface {
  position: relative;
  overflow: hidden;
}

.ocean-surface::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 120% 40% at 50% 100%, rgba(37, 99, 235, 0.18) 0%, transparent 70%),
    radial-gradient(ellipse 80% 30% at 20% 90%, rgba(14, 165, 233, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 25% at 80% 95%, rgba(6, 182, 212, 0.08) 0%, transparent 50%);
}

/* ── Water caustic light pattern ── */
.caustics {
  position: relative;
  overflow: hidden;
}

.caustics::before,
.caustics::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.caustics::before {
  opacity: 0.6;
  background:
    radial-gradient(ellipse 25% 20% at 15% 25%, rgba(147, 197, 253, 0.15) 0%, transparent 100%),
    radial-gradient(ellipse 20% 30% at 45% 60%, rgba(96, 165, 250, 0.10) 0%, transparent 100%),
    radial-gradient(ellipse 30% 15% at 70% 20%, rgba(147, 197, 253, 0.12) 0%, transparent 100%),
    radial-gradient(ellipse 15% 25% at 85% 75%, rgba(96, 165, 250, 0.08) 0%, transparent 100%),
    radial-gradient(ellipse 20% 20% at 30% 80%, rgba(147, 197, 253, 0.10) 0%, transparent 100%);
  animation: caustic-shift 8s ease-in-out infinite alternate;
}

.caustics::after {
  opacity: 0.5;
  background:
    radial-gradient(ellipse 18% 22% at 25% 40%, rgba(96, 165, 250, 0.12) 0%, transparent 100%),
    radial-gradient(ellipse 22% 18% at 60% 30%, rgba(147, 197, 253, 0.09) 0%, transparent 100%),
    radial-gradient(ellipse 25% 20% at 80% 55%, rgba(96, 165, 250, 0.10) 0%, transparent 100%),
    radial-gradient(ellipse 20% 15% at 10% 70%, rgba(147, 197, 253, 0.08) 0%, transparent 100%);
  animation: caustic-shift 10s ease-in-out infinite alternate-reverse;
}

@keyframes caustic-shift {
  0% { opacity: 0.4; transform: scale(1) translateY(0); }
  50% { opacity: 0.7; transform: scale(1.03) translateY(-6px); }
  100% { opacity: 0.45; transform: scale(0.97) translateY(4px); }
}

/* ── Hero glow — focal light behind headline ── */
.hero-glow {
  position: relative;
}

.hero-glow::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -55%);
  width: 600px;
  height: 350px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(37, 99, 235, 0.15) 0%, rgba(14, 165, 233, 0.06) 40%, transparent 70%);
  filter: blur(40px);
  pointer-events: none;
}

/* ── Depth card — glass panel with accent line ── */
.depth-card {
  position: relative;
  background: linear-gradient(145deg, rgba(37, 99, 235, 0.07), rgba(14, 165, 233, 0.03), rgba(37, 99, 235, 0.02));
  border: 1px solid rgba(37, 99, 235, 0.12);
  transition: border-color 0.4s ease, box-shadow 0.4s ease, transform 0.4s ease;
}

.depth-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 24px;
  right: 24px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(96, 165, 250, 0.4), transparent);
}

.depth-card:hover {
  border-color: rgba(37, 99, 235, 0.30);
  box-shadow:
    0 8px 32px rgba(37, 99, 235, 0.10),
    0 0 0 1px rgba(37, 99, 235, 0.06),
    inset 0 1px 0 rgba(96, 165, 250, 0.08);
  transform: translateY(-3px);
}

/* ── Deep gradient — ocean depth layers ── */
.deep-gradient {
  background:
    radial-gradient(ellipse 90% 50% at 15% 85%, rgba(37, 99, 235, 0.12) 0%, transparent 55%),
    radial-gradient(ellipse 70% 60% at 85% 15%, rgba(14, 165, 233, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse 50% 50% at 50% 50%, rgba(6, 182, 212, 0.05) 0%, transparent 65%);
}

/* ── Sonar ring animation for step numbers ── */
.sonar-ring {
  position: relative;
  box-shadow: 0 0 20px rgba(37, 99, 235, 0.15);
}

.sonar-ring::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 9999px;
  border: 1px solid rgba(37, 99, 235, 0.30);
  animation: sonar-pulse 3s ease-out infinite;
}

@keyframes sonar-pulse {
  0% { opacity: 0.6; transform: scale(1); }
  70% { opacity: 0; transform: scale(1.5); }
  100% { opacity: 0; transform: scale(1.5); }
}

/* ── Tool card — frosted glass ── */
.tool-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: all 0.35s ease;
}

.tool-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(37, 99, 235, 0.30);
  box-shadow: 0 4px 30px rgba(37, 99, 235, 0.12);
  transform: translateY(-2px);
}

/* ── Gradient text — vivid ocean spectrum ── */
.gradient-text {
  color: #7dd3fc; /* fallback */
  background: linear-gradient(135deg, #f0f9ff, #bae6fd, #38bdf8, #2563eb, #60a5fa, #e0f2fe);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-shift 6s ease-in-out infinite alternate;
}

@keyframes gradient-shift {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

/* ── Current drift — floating ambient light (more visible) ── */
.current-drift-1 {
  position: absolute;
  width: 500px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(37, 99, 235, 0.18) 0%, transparent 70%);
  filter: blur(80px);
  animation: drift 12s ease-in-out infinite;
}

.current-drift-2 {
  position: absolute;
  width: 350px;
  height: 250px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(14, 165, 233, 0.12) 0%, transparent 70%);
  filter: blur(60px);
  animation: drift 16s ease-in-out infinite reverse;
}

@keyframes drift {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(30px, -20px) rotate(1deg); }
  50% { transform: translate(-15px, 15px) rotate(-1deg); }
  75% { transform: translate(20px, 8px) rotate(0.5deg); }
}

/* ── Wave shape divider ── */
.wave-shape {
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  overflow: hidden;
  line-height: 0;
}

.wave-shape svg {
  display: block;
  width: 100%;
  height: 40px;
}

/* ── Gentle wave border — decorative section separator ── */
.wave-divider {
  position: relative;
}

.wave-divider::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(37, 99, 235, 0.20) 20%,
    rgba(14, 165, 233, 0.30) 50%,
    rgba(37, 99, 235, 0.20) 80%,
    transparent 100%
  );
}

/* ── Keel comparison panel ── */
.keel-comparison {
  border: 1px solid rgba(255, 255, 255, 0.06);
}


/* ── Pull quote decoration ── */
.pull-quote {
  position: relative;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.pull-quote::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(96, 165, 250, 0.5), transparent);
}

/* ── Fade-in on scroll (CSS-only with intersection observer polyfill via animation) ── */
.fade-up {
  opacity: 0;
  transform: translateY(20px);
  animation: fade-up-in 0.6s ease-out forwards;
}

.fade-up-delay-1 { animation-delay: 0.1s; }
.fade-up-delay-2 { animation-delay: 0.2s; }
.fade-up-delay-3 { animation-delay: 0.3s; }
.fade-up-delay-4 { animation-delay: 0.4s; }
.fade-up-delay-5 { animation-delay: 0.5s; }

@keyframes fade-up-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Logo glow on transparent nav ── */
.logo-glow {
  filter: drop-shadow(0 0 8px rgba(96, 165, 250, 0.3));
}

/* ── Ripple on interaction ── */
.ripple-hover {
  position: relative;
  overflow: hidden;
}

.ripple-hover::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at var(--ripple-x, 50%) var(--ripple-y, 50%), rgba(37, 99, 235, 0.08) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.ripple-hover:hover::before {
  opacity: 1;
}

/* ── Blog content typography ── */
.blog-content {
  color: #d1d5db; /* gray-300 */
  font-size: 1.125rem;
  line-height: 1.8;
}

.blog-content h1,
.blog-content h2,
.blog-content h3,
.blog-content h4 {
  color: #ffffff;
  font-weight: 600;
  margin-top: 2em;
  margin-bottom: 0.75em;
  line-height: 1.3;
}

.blog-content h1 { font-size: 2rem; }
.blog-content h2 { font-size: 1.5rem; }
.blog-content h3 { font-size: 1.25rem; }

.blog-content p {
  margin-bottom: 1.25em;
}

.blog-content a {
  color: #60a5fa; /* blue-400 */
  text-decoration: none;
  transition: color 0.2s;
}

.blog-content a:hover {
  color: #93c5fd; /* blue-300 */
}

.blog-content strong {
  color: #ffffff;
  font-weight: 600;
}

.blog-content code {
  color: #93c5fd;
  background: rgba(30, 58, 138, 0.3);
  padding: 0.15em 0.4em;
  border-radius: 0.25rem;
  font-size: 0.875em;
}

.blog-content pre {
  background: rgba(3, 7, 18, 0.8);
  border: 1px solid rgba(37, 99, 235, 0.12);
  border-radius: 0.75rem;
  padding: 1.25rem;
  overflow-x: auto;
  margin: 1.5em 0;
}

.blog-content pre code {
  background: none;
  padding: 0;
  font-size: 0.875rem;
  color: #d1d5db;
}

.blog-content blockquote {
  border-left: 3px solid rgba(96, 165, 250, 0.4);
  padding-left: 1.25rem;
  margin: 1.5em 0;
  color: #9ca3af;
  font-style: italic;
}

.blog-content ul,
.blog-content ol {
  padding-left: 1.5em;
  margin-bottom: 1.25em;
}

.blog-content li {
  margin-bottom: 0.5em;
}

.blog-content hr {
  border: none;
  border-top: 1px solid rgba(37, 99, 235, 0.15);
  margin: 2em 0;
}

.blog-content img {
  max-width: 100%;
  border-radius: 0.75rem;
  margin: 1.5em 0;
}

/* ── Reduced motion preference ── */
@media (prefers-reduced-motion: reduce) {
  .caustics::before,
  .caustics::after,
  .current-drift-1,
  .current-drift-2,
  .sonar-ring::after,
  .gradient-text,
  .fade-up {
    animation: none;
  }

  .fade-up {
    opacity: 1;
    transform: none;
  }

  .gradient-text {
    background-size: 100% 100%;
  }
}

/* ── Cycle / Gate status badges ── */
.badge-pending    { background: #94A3B8; color: white; }
.badge-running    { background: #2563EB; color: white; }
.badge-passed     { background: #10B981; color: white; }
.badge-failed     { background: #EF4444; color: white; }
.badge-blocked    { background: #F59E0B; color: white; }
.badge-skipped    { background: #CBD5E1; color: #64748B; }
