/* ─────────────────────────────────────────────────────────────
   NATURAL BRINE — Intent Isolation Funnel
   ───────────────────────────────────────────────────────────── */

/* 1. RESET & NORMALIZATION */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* 2. CUSTOM PROPERTIES */
:root {
  --panel-transition: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  --content-transition: 0.38s cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --sky: #0ea5e9;
  --sky-light: #38bdf8;
  --amber: #f59e0b;
  --amber-light: #fbbf24;
}

/* 3. BASE LAYOUT */
html, body {
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}

/* 4. ENTRANCE KEYFRAMES */
@keyframes panelEnterLeft {
  from { opacity: 0; transform: translateX(-48px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes panelEnterRight {
  from { opacity: 0; transform: translateX(48px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes pulseRing {
  0%   { transform: scale(1);   opacity: 0.7; }
  100% { transform: scale(2.8); opacity: 0; }
}
@keyframes subtleDrift {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}

/* 5. FUNNEL CONTAINER */
#funnel-container {
  display: flex;
  flex-direction: row;
  height: 100vh;
  height: 100svh;
  width: 100vw;
  overflow: hidden;
  position: relative;
}

/* 6. PANEL BASE */
.panel {
  flex: 1 1 0%;
  flex-basis: 0%;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  overflow: hidden;
  cursor: pointer;
  outline: none;
  transition:
    flex-grow var(--panel-transition),
    flex-basis var(--panel-transition),
    box-shadow var(--panel-transition);
}

/* Panel entrance animations */
#panel-industrial {
  animation: panelEnterLeft 0.8s var(--ease-out-expo) both;
  animation-delay: 0.05s;
}
#panel-culinary {
  animation: panelEnterRight 0.8s var(--ease-out-expo) both;
  animation-delay: 0.15s;
}

/* 7. BACKGROUND TEXTURE PATTERNS */
.panel-industrial::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(14, 165, 233, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(14, 165, 233, 0.04) 1px, transparent 1px);
  background-size: 52px 52px;
  z-index: 0;
  pointer-events: none;
}

.panel-culinary::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(245, 158, 11, 0.075) 1.5px, transparent 1.5px);
  background-size: 26px 26px;
  z-index: 0;
  pointer-events: none;
}

/* 8. HOVER EXPANSION — more dramatic 70/30 split */
#funnel-container[data-hovered="industrial"] #panel-industrial {
  flex-grow: 1.4;
  flex-basis: 0%;
  box-shadow: inset -60px 0 120px rgba(14, 165, 233, 0.07);
}
#funnel-container[data-hovered="industrial"] #panel-culinary {
  flex-grow: 0.6;
  flex-basis: 0%;
}
#funnel-container[data-hovered="culinary"] #panel-culinary {
  flex-grow: 1.4;
  flex-basis: 0%;
  box-shadow: inset 60px 0 120px rgba(245, 158, 11, 0.07);
}
#funnel-container[data-hovered="culinary"] #panel-industrial {
  flex-grow: 0.6;
  flex-basis: 0%;
}

/* 9. PANEL CONTENT TRANSITIONS */
.panel-content {
  transition:
    opacity var(--content-transition),
    transform var(--panel-transition);
  will-change: opacity, transform;
  animation: fadeUp 0.7s var(--ease-out-expo) both;
}
#panel-industrial .panel-content { animation-delay: 0.3s; }
#panel-culinary  .panel-content { animation-delay: 0.4s; }

/* Active panel: pops forward */
#funnel-container[data-hovered="industrial"] #panel-industrial .panel-content {
  opacity: 1;
  transform: translateX(0) scale(1.02);
}
#funnel-container[data-hovered="culinary"] #panel-culinary .panel-content {
  opacity: 1;
  transform: translateX(0) scale(1.02);
}
/* Inactive panel: recedes */
#funnel-container[data-hovered="industrial"] #panel-culinary .panel-content {
  opacity: 0.45;
  transform: translateX(-14px) scale(0.96);
}
#funnel-container[data-hovered="culinary"] #panel-industrial .panel-content {
  opacity: 0.45;
  transform: translateX(14px) scale(0.96);
}

/* 10. WATERMARK TEXT */
.panel-watermark {
  position: absolute;
  bottom: -0.15em;
  font-size: clamp(5rem, 16vw, 14rem);
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  z-index: 1;
  letter-spacing: -0.02em;
  transition: opacity var(--panel-transition);
}
.panel-industrial .panel-watermark {
  right: -0.05em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(14, 165, 233, 0.1);
}
.panel-culinary .panel-watermark {
  left: -0.05em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(245, 158, 11, 0.1);
}
/* Watermark fades on active panel hover */
#funnel-container[data-hovered="industrial"] #panel-industrial .panel-watermark,
#funnel-container[data-hovered="culinary"]   #panel-culinary  .panel-watermark {
  opacity: 0.5;
}
#funnel-container[data-hovered="industrial"] #panel-culinary .panel-watermark,
#funnel-container[data-hovered="culinary"]   #panel-industrial .panel-watermark {
  opacity: 0.3;
}

/* 11. BRAND BADGE */
.brand-badge {
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04),
    0 8px 32px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  animation: fadeIn 0.6s ease both;
  animation-delay: 0.6s;
}

/* Live pulse indicator on badge */
.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  position: relative;
  flex-shrink: 0;
  display: block;
}
.pulse-dot::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1.5px solid #22c55e;
  animation: pulseRing 2.2s ease-out infinite;
  opacity: 0;
}

/* 12. PANEL BACKGROUND OVERLAYS */
.panel-industrial .panel-bg-overlay {
  background:
    radial-gradient(ellipse at 20% 50%, rgba(14, 165, 233, 0.1) 0%, transparent 60%),
    linear-gradient(135deg, rgba(14, 165, 233, 0.06) 0%, transparent 50%),
    linear-gradient(to bottom, rgba(2, 6, 23, 0.4) 0%, transparent 35%);
  z-index: 1;
}
.panel-culinary .panel-bg-overlay {
  background:
    radial-gradient(ellipse at 80% 50%, rgba(245, 158, 11, 0.1) 0%, transparent 60%),
    linear-gradient(225deg, rgba(245, 158, 11, 0.06) 0%, transparent 50%),
    linear-gradient(to bottom, rgba(2, 6, 23, 0.4) 0%, transparent 35%);
  z-index: 1;
}

/* 13. DECORATIVE GEO ACCENTS */
.panel-industrial .panel-accent-geo {
  background: radial-gradient(ellipse at bottom right, rgba(14, 165, 233, 0.18) 0%, transparent 65%);
  width: 600px;
  height: 600px;
  bottom: -80px;
  right: -80px;
  position: absolute;
  pointer-events: none;
  z-index: 1;
}
.panel-culinary .panel-accent-geo {
  background: radial-gradient(ellipse at bottom left, rgba(245, 158, 11, 0.18) 0%, transparent 65%);
  width: 600px;
  height: 600px;
  bottom: -80px;
  left: -80px;
  position: absolute;
  pointer-events: none;
  z-index: 1;
}

/* 14. PANEL DIVIDER */
#panel-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(100, 116, 139, 0.35) 15%,
    rgba(100, 116, 139, 0.35) 85%,
    transparent 100%
  );
  z-index: 20;
  pointer-events: none;
  transition: opacity 0.4s ease;
  animation: fadeIn 0.5s ease both;
  animation-delay: 0.7s;
}
#funnel-container[data-hovered] #panel-divider { opacity: 0; }

/* 15. PATH HINT */
#path-hint {
  position: absolute;
  bottom: 1.75rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  color: rgba(100, 116, 139, 0.55);
  font-size: 0.6rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  pointer-events: none;
  white-space: nowrap;
  animation: fadeIn 0.6s ease both;
  animation-delay: 1s;
  transition: opacity 0.35s ease;
}
#funnel-container[data-hovered] #path-hint { opacity: 0; }

/* 16. STAT CHIPS */
.stat-chip {
  font-size: 0.65rem;
  color: rgba(148, 163, 184, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.1);
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  letter-spacing: 0.04em;
  transition: color 0.2s, border-color 0.2s;
  white-space: nowrap;
}
#funnel-container[data-hovered="industrial"] #panel-industrial .stat-chip {
  color: rgba(56, 189, 248, 0.65);
  border-color: rgba(56, 189, 248, 0.2);
}
#funnel-container[data-hovered="culinary"] #panel-culinary .stat-chip {
  color: rgba(251, 191, 36, 0.65);
  border-color: rgba(251, 191, 36, 0.2);
}

/* 17. CTA BUTTON */
.cta-btn {
  position: relative;
  overflow: hidden;
  letter-spacing: 0.01em;
  transform: translateZ(0);
}
.cta-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0);
  transition: background 0.2s ease;
}
.cta-btn:hover::after   { background: rgba(255, 255, 255, 0.1); }
.cta-btn:active::after  { background: rgba(0, 0, 0, 0.08); }
.cta-btn:focus-visible  {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 3px;
}

/* CTA arrow micro-animation on hover */
.cta-arrow {
  transition: transform 0.2s var(--ease-out-expo);
}
.cta-btn:hover .cta-arrow { transform: translateX(4px); }

/* 18. EYEBROW */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.eyebrow::before {
  content: '';
  display: inline-block;
  width: 18px;
  height: 1.5px;
  background: currentColor;
  opacity: 0.7;
  flex-shrink: 0;
}

/* 19. PANEL FOCUS RING */
.panel:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.3);
  outline-offset: -2px;
}

/* 20. TRANSITION OVERLAY */
#transition-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
}
#transition-overlay.active {
  opacity: 1;
  pointer-events: auto;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* 21. MOBILE — STACKED LAYOUT */
@media (max-width: 767px) {
  html, body {
    height: auto;
    overflow: auto;
    overflow-x: hidden;
  }
  #funnel-container {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
    min-height: 100svh;
    overflow-y: auto;
    overflow-x: hidden;
  }
  .panel,
  #funnel-container[data-hovered="industrial"] #panel-industrial,
  #funnel-container[data-hovered="industrial"] #panel-culinary,
  #funnel-container[data-hovered="culinary"]   #panel-culinary,
  #funnel-container[data-hovered="culinary"]   #panel-industrial {
    flex-grow: 1 !important;
    flex-basis: auto !important;
    box-shadow: none !important;
    min-height: 50vh;
    min-height: 50svh;
    width: 100%;
    align-items: center;
    text-align: center;
    animation: none !important;
  }
  #funnel-container[data-hovered="industrial"] #panel-industrial .panel-content,
  #funnel-container[data-hovered="industrial"] #panel-culinary .panel-content,
  #funnel-container[data-hovered="culinary"]   #panel-culinary .panel-content,
  #funnel-container[data-hovered="culinary"]   #panel-industrial .panel-content {
    opacity: 1 !important;
    transform: none !important;
  }
  .panel-content {
    animation: none !important;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    max-width: 100% !important;
    align-items: center;
  }
  .eyebrow, .stats-row { justify-content: center; }
  #panel-divider, #path-hint { display: none; }
  #mobile-badge-wrap {
    display: flex;
    justify-content: center;
    background: #020617;
    padding: 0.75rem 1rem;
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }
  .panel-watermark { font-size: clamp(4rem, 22vw, 8rem); }
  .panel-accent-geo { opacity: 0.5; }
}

/* 22. REDUCED MOTION */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
