/* Landing journey navigation — approved desktop pill translated from Figma. */

/* A single dissolve, never a cross-fade. The old surface sits on top at full
   opacity and dissolves off the new one, which is already fully painted
   underneath. Previously BOTH sides animated - old 1>0 over 180ms while new
   0>1 over 260ms - so their combined opacity dipped below 1 mid-transition and
   the page background flashed through, with a blur pulse on top of it. That
   double-fade is what read as "flashy" (Tarak 2026-07-28). */
@keyframes journey-page-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes journey-chrome-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

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

.site-header { view-transition-name: journey-header; }
main { view-transition-name: none; }

/* Transition the captured viewport, never the document-sized main element.
   Interpolating main's geometry turns a semantic jump into a high-speed camera
   move and exposes empty space between distant sections. */
::view-transition-group(root),
::view-transition-group(journey-header) {
  animation: none;
}

::view-transition-group(journey-navigation),
::view-transition-group(journey-header) {
  z-index: 3;
}

::view-transition-group(journey-navigation) {
  animation-duration: 320ms;
  animation-delay: 30ms;
  animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

::view-transition-old(root) {
  z-index: 2;
  animation: journey-page-out 220ms cubic-bezier(0.4, 0, 0.2, 1) both;
  mix-blend-mode: normal;
}

/* No animation: the destination is simply present beneath the outgoing
   snapshot. Nothing to fade in means nothing can flash. */
::view-transition-new(root) {
  z-index: 1;
  animation: none;
  opacity: 1;
  mix-blend-mode: normal;
}

/* The stable chrome is excluded from the viewport crossfade. Hold the old
   snapshot until the new surface has resolved, then reveal the live elements
   without a disappear/reappear cycle. */
/* The header DISAPPEARS, then resolves - it never cross-fades. Old and new
   used to overlap (out 0-180ms, in 20-260ms), so for ~160ms both snapshots sat
   at partial opacity and the page showed straight through the bar. Leaving a
   dark landing section for a light answer object, that reads as broken rather
   than as a transition (Tarak 2026-07-28).

   Sequential timings mean there is never a frame with two headers on screen:
   the old one is fully gone before the new one begins. The gap is deliberate -
   a bar that is briefly absent is calmer than one that is briefly transparent. */
::view-transition-old(journey-header) {
  animation: journey-chrome-out 130ms cubic-bezier(0.4, 0, 1, 1) both;
}

::view-transition-new(journey-header) {
  animation: journey-chrome-in 200ms cubic-bezier(0, 0, 0.2, 1) 140ms both;
}

::view-transition-old(journey-navigation) {
  animation: journey-chrome-out 180ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

::view-transition-new(journey-navigation) {
  animation: journey-chrome-in 240ms cubic-bezier(0.22, 1, 0.36, 1) 20ms both;
}

.journey-nav {
  --journey-bg: #0a0a0a;
  --journey-fg: #f8f7f2;
  --journey-border: #343430;
  --journey-muted: #96958f;
  --journey-geometry-duration: 260ms;
  --journey-content-out-duration: 90ms;
  --journey-content-in-duration: 140ms;
  --journey-theme-duration: 180ms;
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 1000;
  width: 560px;
  height: 52px;
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0) scale(var(--journey-scale, 1));
  color: var(--journey-fg);
  font-family: var(--x-mono, "IBM Plex Mono", monospace);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.085em;
  line-height: 1;
  text-transform: uppercase;
  view-transition-name: journey-navigation;
  transition:
    width var(--journey-geometry-duration) cubic-bezier(0.22, 1, 0.36, 1),
    opacity 220ms ease,
    transform 260ms cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear 0s;
}

.journey-nav[hidden] { display: none; }

.journey-nav[data-visible="false"] {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transform: translateX(-50%) translateY(10px) scale(var(--journey-scale, 1));
  transition-delay: 0s, 0s, 0s, 240ms;
}

.journey-nav[data-motion="navigating"],
.journey-nav[data-motion="committing"] { cursor: progress; }

/* A direct handoff captures source and destination geometry as two snapshots;
   the view-transition group performs the visible morph. Resolve the live
   destination geometry immediately so a second CSS transition cannot lag it. */
.journey-nav[data-travel="direct"] {
  --journey-geometry-duration: 0ms;
}

/* The selected destination is click feedback, not page motion. Resolve it
   before the viewport snapshot so the pill never trails the page transition. */
.journey-nav[data-motion="navigating"] .journey-tabs > button,
.journey-nav[data-motion="navigating"] .journey-solution-tab > button,
.journey-nav[data-motion="committing"] .journey-tabs > button,
.journey-nav[data-motion="committing"] .journey-solution-tab > button {
  transition-duration: 0ms;
}

.journey-nav[data-theme="paper"] {
  --journey-bg: #f8f7f2;
  --journey-fg: #0a0a0a;
  --journey-border: #d9d6ce;
  --journey-muted: #75746f;
}

.journey-shell {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--journey-border);
  border-radius: 999px;
  background: var(--journey-bg);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.24);
  transition:
    background-color var(--journey-theme-duration) ease,
    border-color var(--journey-theme-duration) ease,
    color var(--journey-theme-duration) ease,
    box-shadow var(--journey-theme-duration) ease;
}

.journey-nav[data-motion="navigating"] .journey-shell,
.journey-nav[data-motion="committing"] .journey-shell {
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.28);
}

.journey-nav button,
.journey-nav a {
  appearance: none;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  letter-spacing: inherit;
  text-decoration: none;
  text-transform: inherit;
}

.journey-nav button:focus-visible,
.journey-nav a:focus-visible {
  position: relative;
  z-index: 4;
  outline: 2px solid var(--journey-fg);
  outline-offset: -4px;
}

.journey-arrow {
  position: absolute;
  top: 0;
  z-index: 3;
  width: 44px;
  height: 50px;
  padding: 0;
  font-size: 15px !important;
  line-height: 50px !important;
  text-align: center;
  transition:
    opacity 160ms ease,
    background-color 160ms ease,
    right var(--journey-geometry-duration) cubic-bezier(0.22, 1, 0.36, 1);
}

.journey-arrow-up { left: 0; border-right: 1px solid var(--journey-border) !important; }
.journey-arrow-down { right: 126px; border-left: 1px solid var(--journey-border) !important; }

.journey-arrow:hover:not(:disabled),
.journey-cta:hover,
.journey-tabs > button:hover,
.journey-solution-tab > button:hover {
  background: color-mix(in srgb, var(--journey-fg) 10%, transparent);
}

.journey-arrow:disabled {
  cursor: default;
  opacity: 0.26;
}

.journey-center {
  position: absolute;
  top: 0;
  left: 44px;
  right: 172px;
  z-index: 2;
  height: 50px;
  min-width: 0;
  overflow: hidden;
  transition: right var(--journey-geometry-duration) cubic-bezier(0.22, 1, 0.36, 1);
}

.journey-compact,
.journey-tabs,
.journey-current {
  width: 100%;
  height: 100%;
}

.journey-compact,
.journey-tabs {
  position: absolute;
  inset: 0;
}

.journey-compact {
  opacity: 1;
  transform: translateX(0);
  visibility: visible;
  transition:
    opacity var(--journey-content-out-duration) ease,
    transform var(--journey-geometry-duration) cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear 0s;
}

.journey-current {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 18px;
  font-weight: 500 !important;
}

.journey-current-dot,
.journey-stage-dot {
  display: block;
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border: 1px solid var(--journey-muted);
  border-radius: 50%;
  background: var(--journey-bg);
  transition: background-color var(--journey-theme-duration) ease, border-color var(--journey-theme-duration) ease;
}

.journey-current-dot { background: var(--journey-fg); border-color: var(--journey-fg); }

.journey-tabs {
  display: flex;
  opacity: 0;
  pointer-events: none;
  transform: translateX(12px);
  visibility: hidden;
  transition:
    opacity var(--journey-content-in-duration) ease,
    transform var(--journey-geometry-duration) cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear var(--journey-geometry-duration);
}

.journey-index-track { display: none; }

.journey-cta {
  position: absolute;
  top: 0;
  left: 432px;
  z-index: 2;
  display: flex;
  width: 126px;
  height: 50px;
  align-items: center;
  justify-content: center;
  border-left: 1px solid var(--journey-border) !important;
  opacity: 1;
  visibility: visible;
  text-transform: none !important;
  transition:
    opacity var(--journey-content-in-duration) ease 110ms,
    background-color 160ms ease,
    visibility 0s linear 0s;
}

.journey-nav[data-terminal] { width: 434px; }
.journey-nav[data-terminal] .journey-center { right: 44px; }
.journey-nav[data-terminal] .journey-arrow-down { right: 0; }
.journey-nav[data-terminal] .journey-cta {
  display: none;
}

.journey-nav[data-expanded="true"] {
  width: 560px;
}

.journey-nav[data-expanded="true"] .journey-center {
  right: 44px;
}

.journey-nav[data-expanded="true"] .journey-arrow-down {
  right: 0;
}

.journey-nav[data-expanded="true"] .journey-compact {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-10px);
  visibility: hidden;
  transition-delay: 0s, 0s, var(--journey-content-out-duration);
}

.journey-nav[data-expanded="true"] .journey-tabs {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
  visibility: visible;
  transition-delay: var(--journey-content-out-duration), 0s, 0s;
}

.journey-nav[data-expanded="true"] .journey-cta {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition-delay: 0s, 0s, var(--journey-content-out-duration);
}

.journey-tabs > button,
.journey-solution-tab > button {
  height: 50px;
  padding: 0;
  border-right: 1px solid var(--journey-border) !important;
  white-space: nowrap;
  transition:
    background-color 160ms ease,
    color 160ms ease;
}

.journey-tabs > button:nth-child(1) { flex: 0 0 100px; }
.journey-tabs > button:nth-child(2) { flex: 0 0 118px; }
.journey-solution-tab {
  display: flex;
  flex: 0 0 124px;
  min-width: 0;
}
.journey-solution-tab > button { width: 124px; }
.journey-tabs > button:last-child { flex: 0 0 130px; border-right: 0 !important; }

.journey-tabs > button[aria-current="step"],
.journey-solution-tab > button[aria-current="step"] {
  background: var(--journey-fg);
  color: var(--journey-bg);
  font-weight: 500;
}

.journey-index-track {
  position: relative;
  align-items: stretch;
  height: 50px;
}

.journey-index-track-expanded {
  display: flex;
  flex: 0 0 0;
  width: 0;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity var(--journey-content-in-duration) ease,
    visibility 0s linear 180ms;
}

.journey-index-track button {
  position: relative;
  z-index: 2;
  display: flex;
  flex: 1 1 20%;
  min-width: 0;
  height: 50px;
  align-items: flex-start;
  justify-content: center;
  padding: 12px 0 0;
}

.journey-index-track button > span:last-child {
  position: absolute;
  top: 31px;
  left: 50%;
  display: none;
  transform: translateX(-50%);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.journey-track-line {
  position: absolute;
  z-index: 1;
  top: 15px;
  left: 10%;
  right: 10%;
  height: 1px;
  background: var(--journey-muted);
  opacity: 0.65;
}

.journey-index-track button[aria-current="step"] .journey-stage-dot {
  border-color: var(--journey-fg);
  background: var(--journey-fg);
}

.journey-index-track button[aria-current="step"] > span:last-child { display: block; }

.journey-nav[data-mode="index"] .journey-current { display: none; }
.journey-nav[data-mode="index"] .journey-index-track-compact { display: flex; }

.journey-nav[data-mode="index"][data-expanded="true"] {
  width: min(783px, calc(100vw - 32px));
}

.journey-nav[data-mode="index"][data-expanded="true"] .journey-center {
  right: 44px;
}

.journey-nav[data-mode="index"][data-expanded="true"] .journey-tabs > button:nth-child(1) { flex-basis: 86px; }
.journey-nav[data-mode="index"][data-expanded="true"] .journey-tabs > button:nth-child(2) { flex-basis: 100px; }
.journey-nav[data-mode="index"][data-expanded="true"] .journey-solution-tab { flex-basis: 392px; }
.journey-nav[data-mode="index"][data-expanded="true"] .journey-solution-tab > button { width: 103px; flex: 0 0 103px; }
.journey-nav[data-mode="index"][data-expanded="true"] .journey-tabs > button:last-child { flex-basis: 117px; }
.journey-nav[data-mode="index"][data-expanded="true"] .journey-index-track-expanded {
  display: flex;
  flex: 0 0 289px;
  width: 289px;
  opacity: 1;
  visibility: visible;
  transition-delay: 100ms, 0s;
}

.journey-nav[data-terminal][data-expanded="true"] { width: 560px; }

.journey-status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 980px) {
  .journey-nav { --journey-scale: 0.9; transform-origin: 50% 100%; }
}

@media (max-width: 900px) {
  .journey-nav { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  .journey-nav,
  .journey-center,
  .journey-shell,
  .journey-compact,
  .journey-tabs { transition: none; }

  ::view-transition-old(root),
  ::view-transition-new(root),
  ::view-transition-old(journey-header),
  ::view-transition-new(journey-header),
  ::view-transition-old(journey-navigation),
  ::view-transition-new(journey-navigation) { animation: none; }
}
