#how-we-ship.fj-journey {
  --fj-ink: #142938;
  --fj-copy: #435560;
  --fj-red: #d6001c;
  --fj-line: #cbd4d8;
  --fj-canvas: #f3f5f6;
  --fj-gutter: clamp(40px, 4.6vw, 84px);
  --fj-header-height: 0px;
  --fj-nav-height: 124px;
  position: relative;
  isolation: isolate;
  padding: clamp(16px, 1.8vw, 28px) 0 clamp(18px, 2vw, 36px);
  margin: 0;
  color: var(--fj-ink);
  background: var(--fj-canvas);
  font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  text-align: left;
  scroll-margin-top: var(--fj-header-height);
}

/* These masthead heights also protect native fragment targets without JavaScript. */
.lein-site #how-we-ship.fj-journey { --fj-header-height: 85px; }

#how-we-ship.fj-journey *, #how-we-ship.fj-journey *::before, #how-we-ship.fj-journey *::after {
  box-sizing: border-box;
}

#how-we-ship .fj-layout {
  width: min(1376px, calc(100% - var(--fj-gutter) * 2));
  margin-inline: auto;
}

#how-we-ship .fj-intro {
  position: sticky;
  z-index: 3;
  top: var(--fj-header-height);
  padding-top: clamp(15px, 2.4vh, 25px);
  background: var(--fj-canvas);
}

#how-we-ship .fj-title {
  margin: 0;
  color: var(--fj-ink);
  font-size: clamp(32px, 2.85vw, 44px) !important;
  line-height: 1.06;
  letter-spacing: -0.048em !important;
  font-weight: 660;
  text-transform: none;
}

#how-we-ship .fj-nav { margin-top: clamp(10px, 1.3vw, 21px); }

#how-we-ship .fj-stops {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  column-gap: clamp(12px, 1.7vw, 25px);
  padding: 0;
  margin: 0;
  border-bottom: 1px solid var(--fj-line);
}

#how-we-ship .fj-stops li {
  list-style: none;
  margin: 0;
  padding: 0;
}

#how-we-ship .fj-stops a {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 51px;
  padding: 6px 0 8px;
  color: var(--fj-copy);
  font-size: clamp(15px, 1.19vw, 18px);
  line-height: 1.25;
  font-weight: 510;
  letter-spacing: -0.018em;
  text-decoration: none;
}

#how-we-ship .fj-stops a[aria-current="step"] {
  color: var(--fj-ink);
  font-weight: 720;
}

#how-we-ship .fj-stops a[aria-current="step"]::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: -1px;
  height: 2px;
  background: var(--fj-red);
}

#how-we-ship a:focus-visible {
  outline: 2px solid var(--fj-red);
  outline-offset: 3px;
  border-radius: 3px;
}

#how-we-ship .fj-stops a:focus-visible { outline-offset: -3px; }

#how-we-ship .fj-stage {
  display: grid;
  grid-template-columns: minmax(0, 37fr) minmax(0, 63fr);
  column-gap: clamp(16px, 1.8vw, 30px);
  align-items: center;
  min-height: calc(100vh - var(--fj-header-height) - var(--fj-nav-height));
  min-height: calc(100svh - var(--fj-header-height) - var(--fj-nav-height));
  padding: clamp(17px, 2.7vh, 30px) 0;
  margin: 0;
  border: 0;
  background: transparent;
  scroll-margin-top: calc(var(--fj-header-height) + var(--fj-nav-height));
}

#how-we-ship .fj-stage:focus { outline: 0; }
#how-we-ship .fj-panel { display: contents; }

#how-we-ship .fj-story {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  max-width: 478px;
}

#how-we-ship .fj-story :is(h2, h3) {
  margin: 0;
  color: var(--fj-ink);
  font-size: clamp(39px, 4.3vw, 66px);
  line-height: 1.055;
  font-weight: 640;
  letter-spacing: -0.055em;
  text-transform: none;
  text-wrap: balance;
}

#how-we-ship .fj-story p {
  max-width: 41ch;
  margin: clamp(16px, 1.7vw, 25px) 0 0;
  color: var(--fj-copy);
  font-size: clamp(17px, 1.44vw, 21px);
  line-height: 1.5;
  font-weight: 440;
  letter-spacing: -0.017em;
}

#how-we-ship .fj-scene {
  position: relative;
  isolation: isolate;
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
  width: 100%;
  /* The whole still and its matched video fit a short laptop viewport. */
  max-width: calc(max(250px, 100svh - var(--fj-header-height) - var(--fj-nav-height) - 48px) * 4 / 3);
  aspect-ratio: 4 / 3;
  background: var(--fj-canvas);
}

#how-we-ship .fj-scene picture, #how-we-ship .fj-scene img, #how-we-ship .fj-scene video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  margin: 0;
  border-radius: 0;
  object-fit: contain;
}

#how-we-ship .fj-scene picture { z-index: 1; pointer-events: none; }
#how-we-ship .fj-scene video { z-index: 0; pointer-events: none; }
#how-we-ship .fj-scene video[data-show-frame] { z-index: 2; }

/* A short alpha ramp blends minor still/video color-management differences into the canvas. */
#how-we-ship .fj-scene :is(picture, video) {
  mask-image: linear-gradient(to right, transparent, #000 8px, #000 calc(100% - 8px), transparent),
              linear-gradient(to bottom, transparent, #000 8px, #000 calc(100% - 8px), transparent);
  mask-composite: intersect;
}

@media (hover: hover) {
  #how-we-ship .fj-stops a:hover { color: var(--fj-red); }
}

@media (max-width: 899px) {
  #how-we-ship.fj-journey {
    --fj-gutter: clamp(20px, 6.15vw, 32px);
    --fj-nav-height: 104px;
    padding-block: 12px clamp(24px, 5vw, 42px);
  }

  #how-we-ship .fj-intro { padding-top: 14px; }

  #how-we-ship .fj-title { font-size: clamp(29px, 4.8vw, 38px) !important; }

  #how-we-ship .fj-nav { margin-top: 7px; }

  #how-we-ship .fj-stops {
    display: flex;
    gap: clamp(22px, 3.8vw, 34px);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    mask-image: linear-gradient(to right, transparent, #000 var(--fj-fade-left, 0px), #000 calc(100% - var(--fj-fade-right, 0px)), transparent);
  }

  #how-we-ship .fj-nav[data-more-left] { --fj-fade-left: 16px; }
  #how-we-ship .fj-nav[data-more-right] { --fj-fade-right: 16px; }
  #how-we-ship .fj-stops::-webkit-scrollbar { display: none; }
  #how-we-ship .fj-stops li { flex: 0 0 auto; }

  #how-we-ship .fj-stops a {
    min-height: 45px;
    padding-block: 6px;
    font-size: 15px;
    white-space: nowrap;
  }

  #how-we-ship .fj-stops a[aria-current="step"]::after { bottom: 0; }

  #how-we-ship .fj-stage {
    grid-template-columns: minmax(0, 1fr);
    align-content: center;
    min-height: min(calc(100svh - var(--fj-header-height) - var(--fj-nav-height)), 590px);
    padding-block: 18px 30px;
    row-gap: 10px;
  }

  #how-we-ship .fj-scene {
    grid-column: 1;
    grid-row: 1;
    max-width: min(100%, 590px);
  }

  #how-we-ship .fj-story { grid-column: 1; grid-row: 2; max-width: 620px; }
  #how-we-ship .fj-story :is(h2, h3) { max-width: 22ch; font-size: clamp(33px, 5.5vw, 45px); }
  #how-we-ship .fj-story p { max-width: 52ch; margin-top: 12px; font-size: 17px; }
}

@media (max-width: 800px) {
  .lein-site #how-we-ship.fj-journey { --fj-header-height: 73px; }
}

@media (max-height: 570px) {
  #how-we-ship .fj-intro { padding-top: 5px; }
  #how-we-ship .fj-nav { margin-top: 0; }
}

/* Each article remains a real, normally scrolling fragment target. Only its
   visual panel is held in the shared viewport while a tall layout can fit it. */
@media screen and (prefers-reduced-motion: no-preference) {
  #how-we-ship[data-journey-ready] .fj-stage[data-active] .fj-story > :is(h2, h3, p) {
    animation: fj-copy-appears 440ms cubic-bezier(.32, 0, .24, 1) backwards;
  }
  #how-we-ship[data-journey-ready] .fj-stage[data-active] .fj-story > p {
    animation-delay: 55ms;
  }
  #how-we-ship.fj-journey[data-docked] { padding-top: 0; }
  #how-we-ship[data-docked] .fj-chapters { position: relative; }
  #how-we-ship[data-docked] .fj-stage {
    display: block;
    position: static;
    min-height: 0;
    height: var(--fj-step);
    padding: 0;
  }
  #how-we-ship[data-docked] .fj-stage:last-child {
    height: calc(var(--fj-step) + var(--fj-last-hold));
  }
  #how-we-ship[data-docked] .fj-panel {
    display: none;
    position: absolute;
    inset: 0 0 auto;
    width: 100%;
    height: var(--fj-window-height);
    grid-template-columns: minmax(0, 37fr) minmax(0, 63fr);
    column-gap: clamp(16px, 1.8vw, 30px);
    align-items: center;
    padding: clamp(17px, 2.7vh, 30px) 0;
  }
  #how-we-ship[data-docked] .fj-stage[data-active] > .fj-panel,
  #how-we-ship[data-docked][data-fitting] .fj-panel { display: grid; }
  #how-we-ship[data-window-position="pinned"] .fj-panel {
    position: fixed;
    inset: calc(var(--fj-header-height) + var(--fj-nav-height)) auto auto var(--fj-window-left);
    width: var(--fj-window-width);
  }
  #how-we-ship[data-window-position="after"] .fj-panel { top: auto; bottom: 0; }
  /* Measure intrinsic text heights in the same formatting context used on screen. */
  #how-we-ship[data-docked] .fj-story {
    display: flex;
    flex-direction: column;
  }
  #how-we-ship[data-docked]:not([data-fitting]) .fj-story { min-height: var(--fj-story-height); }
  #how-we-ship[data-docked] .fj-stage[data-active] .fj-scene {
    animation: fj-stage-appears 190ms ease-out both;
  }
}

@keyframes fj-copy-appears { from { opacity: 0; } to { opacity: 1; } }
@keyframes fj-stage-appears { from { opacity: .35; } to { opacity: 1; } }

@media screen and (max-width: 899px) and (prefers-reduced-motion: no-preference) {
  #how-we-ship[data-docked] .fj-panel {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: var(--fj-art-height) var(--fj-story-height);
    align-content: center;
    row-gap: 10px;
    padding: 10px 0 14px;
  }
  #how-we-ship[data-docked] .fj-scene {
    width: min(100%, calc(var(--fj-art-height) * 4 / 3));
    max-width: 590px;
  }
  #how-we-ship[data-docked] .fj-story { align-self: start; }
}

@media print {
  #how-we-ship .fj-intro { position: static; }
  #how-we-ship .fj-nav { display: none; }
  #how-we-ship .fj-stage { min-height: 0; break-inside: avoid; }
}
