.journey-essay-page {
  --journey-accent: var(--color-accent);
  --journey-accent-ink: var(--color-accent);
  --journey-accent-soft: var(--color-accent-soft);
  --journey-rail: #d8d8d8;
  --journey-route-width: 46px;
  padding-bottom: 32px;
}

.journey-icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.journey-essay-hero {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-block: 54px 46px;
}

.journey-essay-kicker {
  color: var(--journey-accent-ink);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 18px;
  text-transform: uppercase;
}

.journey-essay-hero h1 {
  max-width: 12ch;
  font-family: var(--font-hero);
  font-size: 46px;
  line-height: 48px;
  overflow-wrap: anywhere;
}

.journey-essay-hero__lead {
  max-width: 720px;
  color: var(--color-secondary);
  font-size: 16px;
  line-height: 26px;
}

.journey-essay-hero__note {
  color: var(--color-primary);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  line-height: 20px;
}

.journey-route-key {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-block: 22px 28px;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.journey-type-key {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.journey-type-key > span {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  line-height: 18px;
}

.journey-type-icon {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  background: #ffffff;
  border: 1.5px solid var(--color-primary);
  border-radius: 7px;
}

.journey-type-icon svg,
.journey-anchor__marker svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.journey-type-icon--build {
  color: #ffffff;
  background: var(--color-primary);
}

.journey-type-icon--startup {
  transform: rotate(45deg);
}

.journey-type-icon--startup svg {
  transform: rotate(-45deg);
}

.journey-type-icon--idea {
  border-radius: 999px;
}

.journey-chapter-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 18px;
}

.journey-chapter-nav a {
  display: grid;
  min-width: 0;
  min-height: 44px;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  color: var(--color-muted);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  line-height: 16px;
  text-decoration: none;
}

.journey-chapter-nav a span {
  color: var(--color-primary);
  font-size: 12px;
}

.journey-chapter-nav a:hover span,
.journey-chapter-nav a:focus-visible span {
  color: var(--journey-accent-ink);
}

.journey-essay {
  position: relative;
}

.journey-chapter {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 72px 0 72px 64px;
  border-bottom: 1px solid var(--color-border);
  scroll-margin-top: 24px;
}

.journey-chapter__route {
  position: absolute;
  top: -1px;
  bottom: -1px;
  left: 0;
  width: var(--journey-route-width);
  height: calc(100% + 2px);
  overflow: visible;
  pointer-events: none;
}

.journey-chapter__route path {
  fill: none;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.journey-route__rail {
  stroke: var(--journey-rail);
  stroke-width: 14;
}

.journey-route__line {
  stroke: var(--color-primary);
  stroke-width: 2;
  stroke-dasharray: 0.03 0.045;
}

.journey-route__progress {
  stroke: var(--journey-accent);
  stroke-width: 3.5;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 720ms ease;
}

.journey-enhanced .journey-route__progress {
  stroke-dashoffset: 1;
}

.journey-enhanced .journey-chapter.is-revealed .journey-route__progress {
  stroke-dashoffset: 0;
}

.journey-chapter__header {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 14px;
}

.journey-chapter__number {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--journey-accent-ink);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  line-height: 18px;
  text-transform: uppercase;
}

.journey-chapter__number span {
  color: var(--color-muted);
}

.journey-chapter h2 {
  max-width: 17ch;
  font-family: var(--font-hero);
  font-size: 30px;
  line-height: 34px;
  overflow-wrap: anywhere;
}

.journey-chapter__header > p:not(.journey-chapter__number) {
  color: var(--color-secondary);
  font-size: 15px;
  line-height: 24px;
}

.journey-chapter__header .journey-chapter__bridge {
  padding-left: 14px;
  color: var(--color-primary);
  border-left: 3px solid var(--journey-accent);
  font-weight: 600;
}

.journey-anchor {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  background: #ffffff;
  border: 1px solid var(--color-border-strong);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgb(0 0 0 / 0.06);
  scroll-margin-top: 24px;
  transition: border-color var(--transition), box-shadow var(--transition), transform 420ms ease;
}

.journey-enhanced .journey-anchor {
  transform: translateY(8px);
}

.journey-enhanced .journey-chapter.is-revealed .journey-anchor {
  transform: translateY(0);
}

.journey-anchor:hover,
.journey-anchor:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 16px 34px rgb(0 0 0 / 0.09);
}

.journey-anchor__marker {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
  display: inline-grid;
  width: 48px;
  height: 48px;
  place-items: center;
  color: var(--color-primary);
  background: #ffffff;
  border: 2px solid var(--color-primary);
  border-radius: 12px;
  box-shadow: none;
}

.journey-anchor__marker svg {
  width: 25px;
  height: 25px;
}

.journey-anchor__marker--build {
  color: #ffffff;
  background: var(--color-primary);
}

.journey-anchor__marker--startup {
  transform: rotate(45deg);
}

.journey-anchor__marker--startup svg {
  transform: rotate(-45deg);
}

.journey-entry-meta {
  display: flex;
  min-height: 48px;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: center;
  color: var(--color-muted);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  line-height: 16px;
  text-transform: uppercase;
  padding-right: 58px;
}

.journey-entry-meta > span:first-child {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding-inline: 8px;
  color: #ffffff;
  background: var(--color-primary);
  border: 1px solid var(--color-primary);
  border-radius: 5px;
}

[data-entry-type="startup"] .journey-entry-meta > span:first-child {
  color: var(--color-primary);
  background: #ffffff;
  border-style: double;
  border-width: 3px;
}

[data-entry-type="idea"] .journey-entry-meta > span:first-child {
  color: var(--color-primary);
  background: #ffffff;
  border-radius: 999px;
}

.journey-anchor h3 {
  color: var(--color-primary);
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 32px;
  overflow-wrap: anywhere;
}

.journey-anchor h3 a {
  text-decoration-thickness: 1px;
  text-decoration-color: transparent;
  text-underline-offset: 5px;
  transition: color var(--transition), text-decoration-color var(--transition);
}

.journey-anchor h3 a:hover,
.journey-anchor h3 a:focus-visible {
  color: var(--journey-accent-ink);
  text-decoration-color: currentColor;
}

.journey-anchor > p {
  color: var(--color-secondary);
  font-size: 15px;
  line-height: 24px;
}

.journey-anchor__media {
  aspect-ratio: 16 / 9;
  margin: 4px 0 0;
  overflow: hidden;
  background: var(--color-icon-bg);
  border: 1px solid var(--color-border);
  border-radius: 6px;
}

.journey-anchor__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.journey-anchor__link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  align-self: flex-start;
  gap: 8px;
  color: var(--color-primary);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  line-height: 18px;
  text-decoration: none;
}

.journey-anchor__link span {
  color: var(--journey-accent);
  font-size: 18px;
  transition: transform var(--transition);
}

.journey-anchor__link:hover span,
.journey-anchor__link:focus-visible span {
  transform: translate(2px, -2px);
}

.journey-trail {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--color-border);
  list-style: none;
}

.journey-trail li {
  position: relative;
  min-width: 0;
  border-bottom: 1px solid var(--color-border);
  scroll-margin-top: 24px;
}

.journey-trail a {
  display: flex;
  min-width: 0;
  min-height: 88px;
  flex-direction: column;
  gap: 5px;
  justify-content: center;
  padding-block: 15px;
  text-decoration: none;
}

.journey-trail strong {
  color: var(--color-primary);
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 21px;
  overflow-wrap: anywhere;
}

.journey-trail small {
  color: var(--color-secondary);
  font-size: 13px;
  line-height: 20px;
}

.journey-trail a:hover strong,
.journey-trail a:focus-visible strong {
  color: var(--journey-accent-ink);
}

.journey-anchor:target,
.journey-trail li:target,
.journey-threads article:target {
  outline: 2px solid var(--journey-accent);
  outline-offset: 5px;
  background: var(--journey-accent-soft);
}

.journey-chapter:target .journey-chapter__header {
  padding: 14px 16px;
  background: var(--journey-accent-soft);
  box-shadow: inset 3px 0 0 var(--journey-accent);
}

.journey-connection {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 0 16px 16px;
  background: linear-gradient(90deg, var(--journey-accent-soft), transparent 82%);
  border-left: 3px solid var(--journey-accent);
}

.journey-connection > span {
  color: var(--journey-accent-ink);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  line-height: 16px;
  text-transform: uppercase;
}

.journey-connection p {
  color: var(--color-secondary);
  font-size: 13px;
  line-height: 21px;
}

.journey-connection a {
  color: var(--color-primary);
  font-weight: 700;
  text-decoration-color: var(--journey-accent);
  text-underline-offset: 3px;
}

.journey-chapter__notes {
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.journey-chapter__notes summary {
  min-height: 48px;
  padding-block: 13px;
  color: var(--color-primary);
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  line-height: 20px;
}

.journey-chapter__notes p {
  padding: 0 0 16px 20px;
  color: var(--color-secondary);
  font-size: 13px;
  line-height: 21px;
}

.journey-chapter__transition {
  color: var(--color-primary);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  line-height: 22px;
}

.journey-chapter--current .journey-chapter__number::after {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  padding-inline: 7px;
  color: var(--color-primary);
  background: var(--journey-accent);
  border-radius: 4px;
  content: "NOW";
  font-size: 10px;
}

.journey-threads {
  display: flex;
  flex-direction: column;
  gap: 34px;
  padding-block: 76px;
  border-bottom: 1px solid var(--color-border);
}

.journey-threads__header {
  display: flex;
  max-width: 720px;
  flex-direction: column;
  gap: 15px;
}

.journey-threads h2,
.journey-conclusion h2 {
  font-family: var(--font-hero);
  font-size: 34px;
  line-height: 38px;
  overflow-wrap: anywhere;
}

.journey-threads__header > p:last-child,
.journey-conclusion > p:not(.journey-essay-kicker) {
  color: var(--color-secondary);
  font-size: 15px;
  line-height: 25px;
}

.journey-threads__list {
  display: grid;
  grid-template-columns: 1fr;
  border-top: 1px solid var(--color-border);
}

.journey-threads article {
  display: grid;
  min-width: 0;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 8px 12px;
  padding-block: 22px;
  border-bottom: 1px solid var(--color-border);
  scroll-margin-top: 24px;
}

.journey-threads article > span {
  grid-row: 1 / span 2;
  color: var(--journey-accent-ink);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
}

.journey-threads h3 {
  font-family: var(--font-display);
  font-size: 19px;
  line-height: 24px;
}

.journey-threads article p {
  color: var(--color-secondary);
  font-size: 13px;
  line-height: 21px;
}

.journey-conclusion {
  display: flex;
  max-width: 820px;
  flex-direction: column;
  gap: 18px;
  padding-block: 76px 42px;
}

.journey-conclusion__links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 8px;
}

@media (min-width: 640px) {
  .journey-essay-hero {
    padding-block: 64px 54px;
  }

  .journey-chapter-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .journey-chapter {
    padding-left: 72px;
  }

  .journey-threads__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 34px;
  }
}

@media (min-width: 900px) {
  .journey-essay-page {
    --journey-route-width: 104px;
    padding-bottom: 48px;
  }

  .journey-essay-hero {
    min-height: 410px;
    justify-content: center;
    gap: 22px;
    padding-block: 70px 64px;
  }

  .journey-essay-hero h1 {
    max-width: 760px;
    font-size: 68px;
    line-height: 70px;
  }

  .journey-essay-hero__lead {
    font-size: 17px;
    line-height: 28px;
  }

  .journey-route-key {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 44px;
    align-items: start;
    padding-block: 24px;
  }

  .journey-type-key {
    padding-top: 4px;
  }

  .journey-chapter-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px 24px;
  }

  .journey-chapter {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--journey-route-width) minmax(0, 1fr);
    gap: 30px 32px;
    align-items: start;
    padding: 112px 0;
  }

  .journey-chapter__route {
    left: 50%;
    transform: translateX(-50%);
  }

  .journey-chapter__header {
    width: calc((100% - var(--journey-route-width)) / 2 - 32px);
    grid-column: 1 / -1;
    margin-bottom: 22px;
  }

  .journey-chapter[data-side="right"] .journey-chapter__header {
    margin-left: auto;
    text-align: right;
  }

  .journey-chapter[data-side="right"] .journey-chapter__number {
    justify-content: flex-end;
  }

  .journey-chapter[data-side="right"] .journey-chapter__header h2 {
    margin-left: auto;
  }

  .journey-chapter[data-side="right"] .journey-chapter__bridge {
    padding-right: 14px;
    padding-left: 0;
    border-right: 3px solid var(--journey-accent);
    border-left: 0;
  }

  .journey-chapter[data-side="right"]:target .journey-chapter__header {
    box-shadow: inset -3px 0 0 var(--journey-accent);
  }

  .journey-chapter h2 {
    font-size: 44px;
    line-height: 48px;
  }

  .journey-chapter__header > p:not(.journey-chapter__number) {
    font-size: 16px;
    line-height: 26px;
  }

  .journey-anchor {
    grid-row: 2;
    padding: 24px;
  }

  .journey-chapter[data-side="left"] .journey-anchor {
    grid-column: 1;
  }

  .journey-chapter[data-side="right"] .journey-anchor {
    grid-column: 3;
  }

  .journey-anchor__marker {
    top: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 14px;
  }

  .journey-anchor__marker svg {
    width: 25px;
    height: 25px;
  }

  .journey-anchor h3 {
    font-size: 31px;
    line-height: 35px;
  }

  .journey-trail {
    grid-row: 2;
  }

  .journey-chapter[data-side="left"] .journey-trail {
    grid-column: 3;
  }

  .journey-chapter[data-side="right"] .journey-trail {
    grid-column: 1;
  }

  .journey-connection,
  .journey-chapter__notes {
    grid-row: 3;
  }

  .journey-chapter[data-side="left"] .journey-connection,
  .journey-chapter[data-side="right"] .journey-chapter__notes {
    grid-column: 3;
  }

  .journey-chapter[data-side="right"] .journey-connection,
  .journey-chapter[data-side="left"] .journey-chapter__notes {
    grid-column: 1;
  }

  .journey-chapter__transition {
    position: relative;
    z-index: 2;
    max-width: 640px;
    grid-column: 1 / -1;
    grid-row: 4;
    justify-self: center;
    padding: 18px 28px;
    background: #ffffff;
    text-align: center;
  }

  .journey-threads {
    gap: 46px;
    padding-block: 106px;
  }

  .journey-threads h2,
  .journey-conclusion h2 {
    font-size: 48px;
    line-height: 52px;
  }

  .journey-threads__list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0 40px;
  }

  .journey-conclusion {
    gap: 22px;
    padding-block: 106px 70px;
  }
}

@media (max-width: 374px) {
  .journey-essay-hero h1 {
    font-size: 38px;
    line-height: 41px;
  }

  .journey-chapter-nav {
    grid-template-columns: 1fr;
  }

  .journey-type-key {
    gap: 8px;
  }

  .journey-type-key > span {
    gap: 6px;
    font-size: 12px;
  }

  .journey-type-icon {
    width: 30px;
    height: 30px;
  }

  .journey-chapter {
    padding-left: 56px;
  }

  .journey-anchor {
    padding: 16px;
  }

  .journey-anchor__marker {
    top: 16px;
    right: 16px;
    width: 42px;
    height: 42px;
  }

  .journey-anchor h3 {
    font-size: 25px;
    line-height: 29px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .journey-route__progress {
    stroke-dashoffset: 0 !important;
    transition: none !important;
  }

  .journey-anchor {
    transform: none !important;
  }
}
