/* ============================================================
   prod-subnav - secondary nav for product pages.
   Defaults to a DARK style that visually merges into the dark
   product banner / hero immediately below.
   Pass class "prod-subnav--light" for pages with a light hero
   (e.g. Pricing.html).
   ============================================================ */

/* Sections anchored from the subnav need to clear both navs */
section[id="workflows"],
section[id="features"],
section[id="roles"],
section[id="ai"],
section[id="pricing"],
section[id="pos"] {
  scroll-margin-top: 120px;
}

.prod-subnav {
  --p-color: #F27A2E;
  --p-color-deep: #E8601A;
  position: sticky;
  top: 64px; /* directly under main nav */
  z-index: 49;
  /* Match the very top of .prod-hero / .feat-hero / .role-hero / .workflow-hero
     so the subnav reads as the top of the banner, with a faint product wash
     in the upper-right echoing the hero's radial. */
  background:
    radial-gradient(420px 80px at 88% 0%, color-mix(in oklab, var(--p-color) 22%, transparent) 0%, transparent 70%),
    linear-gradient(180deg, #1A1410 0%, #1A1410 100%);
  color: rgba(255,255,255,0.92);
  border-bottom: none;
  /* Soft drop shadow only - earlier 0 1px 0 rgba(255,255,255,0.04) inset
     was reading as a faint white line across dark sections (impact-band). */
  box-shadow: 0 8px 16px -10px rgba(0,0,0,0.4);
}
.prod-subnav::after {
  /* Subtle film-grain dots, matching .prod-hero::after - sells continuity. */
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.045) 1px, transparent 1px);
  background-size: 3px 3px;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0.4;
}

.prod-subnav-inner {
  position: relative;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--pad-x);
  height: 56px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.prod-subnav-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 700;
  font-size: 14.5px;
  letter-spacing: -0.008em;
  text-decoration: none;
  flex-shrink: 0;
}
.prod-subnav-mark {
  width: 26px; height: 26px;
  border-radius: 7px;
  display: grid; place-items: center;
  background: var(--p-grad, linear-gradient(135deg, var(--p-color), var(--p-color-deep)));
  color: #fff;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: -0.02em;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.06), 0 4px 10px rgba(0,0,0,0.3);
}
.prod-subnav-mark .it { font-style: italic; }
.prod-subnav-name { line-height: 1; }

.prod-subnav-divider {
  width: 1px; height: 20px;
  background: rgba(255,255,255,0.14);
  flex-shrink: 0;
}

.prod-subnav-links {
  display: flex;
  align-items: center;
  gap: 26px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
  min-width: 0;
  position: relative; /* anchors the sliding underline */
}
.prod-subnav-links::-webkit-scrollbar { display: none; }
.prod-subnav-link {
  position: relative;
  font-size: 13.5px;
  font-weight: 500;
  color: rgba(255,255,255,0.62);
  white-space: nowrap;
  padding: 18px 0;
  transition: color 150ms ease;
  text-decoration: none;
}
.prod-subnav-link:hover { color: #fff; }
.prod-subnav-link.active {
  color: #fff;
  font-weight: 600;
}
.prod-subnav-link.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--p-color, var(--tap-orange));
  border-radius: 2px 2px 0 0;
  box-shadow: 0 0 12px color-mix(in oklab, var(--p-color) 60%, transparent);
}

/* Sliding underline - driven by subnav.js scroll-spy. When the spy is
   active the per-link ::after is suppressed and a single animated bar
   slides between links as the user scrolls past sections. */
.prod-subnav-underline {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  width: 0;
  background: var(--p-color, var(--tap-orange));
  border-radius: 2px 2px 0 0;
  box-shadow: 0 0 12px color-mix(in oklab, var(--p-color) 60%, transparent);
  transform: translateX(0);
  transition:
    transform 320ms cubic-bezier(0.2, 0.9, 0.3, 1),
    width 320ms cubic-bezier(0.2, 0.9, 0.3, 1),
    opacity 200ms ease;
  opacity: 0;
  pointer-events: none;
  will-change: transform, width;
}
.prod-subnav.has-spy .prod-subnav-link.active::after { display: none; }
.prod-subnav--light .prod-subnav-underline { box-shadow: none; }

/* Subnav CTA is now a standard .btn.btn-primary - the class is kept
   only as a positional hook for the @media hide rule below. Visual
   styling lives in styles.css alongside every other primary button. */
.prod-subnav-cta {
  flex-shrink: 0;
  display: none !important;
}

/* ----- Page-following: when subnav sits directly above a dark hero,
        remove any micro-seam by extending the dark base into the hero ----- */
.prod-subnav + .prod-hero,
.prod-subnav + .feat-hero,
.prod-subnav + .role-hero,
.prod-subnav + .workflow-hero,
.prod-subnav + .activate-hero {
  margin-top: -1px; /* hide any anti-alias seam */
}

/* ============================================================
   LIGHT variant - for pages with a light hero (Pricing.html)
   ============================================================ */
.prod-subnav--light {
  background: rgba(255,255,255,0.88);
  backdrop-filter: saturate(140%) blur(20px);
  -webkit-backdrop-filter: saturate(140%) blur(20px);
  color: var(--tap-ink);
  border-bottom: 1px solid var(--tap-line);
  box-shadow: none;
}
.prod-subnav--light::after { display: none; }
.prod-subnav--light .prod-subnav-brand { color: var(--tap-ink); }
.prod-subnav--light .prod-subnav-mark {
  box-shadow: none;
}
.prod-subnav--light .prod-subnav-divider {
  background: var(--tap-line-strong);
  height: 18px;
}
.prod-subnav--light .prod-subnav-link { color: var(--tap-ink-2); }
.prod-subnav--light .prod-subnav-link:hover { color: var(--tap-ink); }
.prod-subnav--light .prod-subnav-link.active {
  color: var(--p-color-deep);
}
.prod-subnav--light .prod-subnav-link.active::after {
  box-shadow: none;
}

@media (max-width: 900px) {
  .prod-subnav-inner { padding: 0 24px; gap: 18px; }
  .prod-subnav-links { gap: 18px; }
  .prod-subnav-divider { display: none; }
}
@media (max-width: 640px) {
  .prod-subnav-cta { display: none; }
}
