.journey-page {
  --journey-edge: #29454f;
  --journey-ink: #071015;
  --journey-glow: #62f5ff;
}
.journey-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(20px, 4vw, 64px);
  padding: clamp(24px, 5vw, 70px);
  margin-block: 22px 38px;
  border: 1px solid var(--journey-edge);
  background: radial-gradient(ellipse at 75% 54%, #173944 0%, transparent 55%),
    repeating-linear-gradient(0deg, transparent 0 39px, #63dff512 39px 40px),
    repeating-linear-gradient(90deg, transparent 0 39px, #63dff512 39px 40px), var(--journey-ink);
}
.journey-intro h1 { font-size: clamp(2.5rem, 5.1vw, 5.8rem); line-height: .97; letter-spacing: -.055em; }
.journey-intro p:not(.eyebrow) { text-align: left; margin-block: 19px 24px; max-width: 46ch; }
.journey-hero-machine img { width: 100%; height: auto; filter: drop-shadow(0 18px 24px #000a); }
.journey-hero-machine figcaption { text-align: right; color: #b6cbd3; }
.journey-explorer {
  display: grid;
  grid-template-columns: minmax(158px, 1fr) minmax(0, 4fr);
  align-items: start;
  gap: clamp(18px, 4vw, 60px);
  margin-bottom: 75px;
  scroll-margin-top: 16px;
}
.journey-page .journey-nav {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  position: sticky;
  top: 16px;
  gap: 0;
  border-left: 1px solid var(--journey-edge);
}
.journey-page .journey-nav a {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: none;
  padding: 11px 15px;
  font-size: .95rem;
  color: #ccdde2;
}
.journey-nav a span { color: var(--journey-glow); font: 500 .875rem ui-monospace, monospace; }
.journey-page .journey-nav a:hover, .journey-page .journey-nav a[aria-current] {
  color: white;
  background: linear-gradient(90deg,#145061, #12303a55);
  box-shadow: inset 3px 0 var(--journey-glow);
}
.journey-chapter { padding: clamp(18px, 4vw, 46px); border: 1px solid var(--journey-edge); background: linear-gradient(145deg, #11232c, #0b1318 48%); }
.journey-chapter[hidden] { display: none; }
.journey-copy { max-width: 72ch; }
.journey-copy h2 { font-size: clamp(2rem, 4vw, 4rem); letter-spacing: -.035em; line-height: 1.04; }
.journey-copy p:last-child { text-align: left; margin-block: 18px 25px; }
.journey-start-year { text-align: left; color: var(--journey-glow); font: 700 clamp(4rem, 10vw, 8rem)/1 ui-monospace, monospace; letter-spacing: -.08em; }
.journey-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-block: 14px 26px; }
.journey-gallery figure { min-width: 0; background: #071015; border: 1px solid #25424c; }
.journey-gallery a { display: grid; place-items: center; aspect-ratio: 3 / 2; overflow: hidden; cursor: zoom-in; }
.journey-gallery img { display: block; width: 100%; height: 100%; min-height: 0; object-fit: contain; transition: transform .3s ease; }
.journey-gallery a:hover img { transform: scale(1.045); }
.journey-gallery figcaption { margin: 0; padding: 10px 12px; border-top: 1px solid #25424c; }
.journey-period { border-top: 1px solid var(--journey-edge); margin-top: 26px; padding-top: 18px; }
.journey-record summary { cursor: pointer; color: var(--journey-glow); }
.journey-viewer { position: fixed; inset: 0; margin: auto; width: min(940px, 94vw); max-height: 94dvh; padding: 14px; border: 1px solid var(--journey-edge); color: #eefaff; background: var(--journey-ink); }
.journey-viewer::backdrop { background: #020609df; }
.journey-viewer img { display: block; margin: auto; width: 100%; height: min(69dvh, 660px); object-fit: contain; }
.journey-viewer button { color: inherit; background: #102c36; border: 1px solid #447583; padding: 8px 12px; cursor: pointer; font: inherit; }
.journey-close { position: absolute; top: 18px; right: 18px; }
.journey-viewer-bar { display: flex; gap: 10px; align-items: center; justify-content: space-between; margin-top: 12px; }
.journey-viewer-bar p { text-align: center; }
@media (max-width: 780px) {
  .journey-hero, .journey-explorer { grid-template-columns: minmax(0, 1fr); }
  .journey-page .journey-nav { position: static; flex-direction: row; flex-wrap: wrap; border-left: 0; border-block: 1px solid var(--journey-edge); }
  .journey-page .journey-nav a { padding: 9px 11px; }
}
@media (max-width: 430px) { .journey-gallery { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .journey-gallery img { transition: none; } }

/* Blueprint scene */
.journey-page { background: #060b12; }
.journey-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  grid-template-columns: minmax(0, 1fr);
  min-height: clamp(510px, 56vw, 715px);
  align-content: center;
  margin-block: 0 30px;
  border-color: #234653;
  background: radial-gradient(ellipse at 70% 41%, #113341 0%, #081421 43%, #050911 80%);
}
.journey-hero::before, .journey-hero::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
}
.journey-hero::before {
  z-index: -2;
  background: url("journey-blueprint.svg") center right / cover no-repeat;
  animation: blueprint-arrive 1.1s ease-out both;
}
.journey-hero::after {
  z-index: -1;
  background: linear-gradient(90deg,#050911 0%,#050911e8 26%,#050911a0 43%,transparent 71%),
    linear-gradient(0deg,#050911bb,transparent 31%);
}
.journey-intro { width: min(100%, 560px); }
.journey-intro h1 { max-width: 10ch; font-size: clamp(3.2rem, 7vw, 7.8rem); }
.journey-intro .eyebrow { color: #8bfaff; letter-spacing: .16em; }
.journey-intro .button { background: #8bfaff; color: #051019; border-color: #8bfaff; }
.journey-intro .button:hover { background: white; border-color: white; }
.journey-explorer { grid-template-columns: minmax(0, 1fr); gap: 15px; }
.journey-page .journey-nav {
  position: static;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  border: 1px solid #29454f;
  background: #09131d;
}
.journey-page .journey-nav a { justify-content: center; min-height: 68px; border-right: 1px solid #29454f; }
.journey-page .journey-nav a:last-child { border-right: 0; }
.journey-page .journey-nav a[aria-current] { box-shadow: inset 0 -3px #8bfaff; }
.journey-chapter {
  background: radial-gradient(ellipse at 90% 0%, #133140, transparent 42%), #09111a;
  animation: journey-reveal .35s ease-out both;
}
.journey-copy { padding-left: clamp(12px, 3vw, 36px); border-left: 1px solid #71cbd4; }
.journey-gallery { grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); }
.journey-gallery figure { background: #060e18; border-color: #284f5d; }
.journey-gallery figcaption { color: #c6dce2; }
@keyframes blueprint-arrive {
  from { opacity: .25; transform: scale(1.035); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes journey-reveal {
  from { opacity: .4; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 1000px) {
  .journey-page .journey-nav { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .journey-page .journey-nav a { border-bottom: 1px solid #29454f; }
}
@media (max-width: 620px) {
  .journey-hero { min-height: 555px; align-content: end; }
  .journey-hero::before { background-position: 75% top; background-size: auto 74%; }
  .journey-hero::after { background: linear-gradient(0deg,#050911 12%,#050911ef 35%,#05091124 70%); }
  .journey-intro h1 { font-size: clamp(2.55rem, 10vw, 3.5rem); }
  .journey-page .journey-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { .journey-hero::before, .journey-chapter { animation: none; } }

.journey-page {
  background: #060b12 url("journey-blueprint.svg") right center / min(1250px, 135vw) auto fixed no-repeat;
}
.journey-page #main { background: #050b12b3; }
.journey-hero { margin-bottom: 44px; }
.journey-timeline-title { font-size: clamp(1.8rem, 4vw, 3rem); }
.journey-list {
  display: grid;
  gap: 24px;
  padding-left: clamp(20px, 4vw, 48px);
  border-left: 1px solid #4db8c8;
  margin-left: 10px;
}
.journey-chapter {
  position: relative;
  scroll-margin-top: 20px;
  background: linear-gradient(135deg, #09212bbf, #080e17db 60%);
  animation: none;
}
.journey-chapter::before {
  content: "";
  position: absolute;
  top: 34px;
  left: calc(-1 * (clamp(20px, 4vw, 48px) + 7px));
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #a1faff;
  box-shadow: 0 0 16px #7af5ff;
}
.journey-chapter:target { border-color: #7ad4e1; }
.journey-card {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(18px, 4vw, 48px);
}
.journey-copy { border: 0; padding: 0; }
.journey-open { color: #9ef9ff; }
.journey-copy .journey-open { display: inline-block; padding: 9px 13px; border: 1px solid #4c98a5; margin-bottom: 14px; }
.journey-preview {
  display: grid;
  place-items: center;
  aspect-ratio: 3 / 2;
  background: #07121aa8;
  border: 1px solid #2f5866;
  overflow: hidden;
  cursor: zoom-in;
}
.journey-preview img { width: 100%; height: 100%; min-height: 0; object-fit: contain; transition: transform .28s ease; }
.journey-preview:hover img { transform: scale(1.045); }
.journey-assets { margin-top: 12px; }
.journey-assets > summary { color: #bcd2d9; width: fit-content; cursor: pointer; }
.journey-image-count { font: .875rem ui-monospace, monospace; color: #aeeaf0; }
@media (max-width: 640px) {
  .journey-page { background-size: 165vw auto; }
  .journey-card { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .journey-preview img { transition: none; } }

.journey-copy .eyebrow, .journey-copy .journey-start-year {
  color: #91f8ff;
  font: 700 clamp(3.1rem, 7vw, 7.5rem)/1 ui-monospace, monospace;
  letter-spacing: -.075em;
  margin: 0 0 18px;
}
#retrofit .journey-copy .eyebrow { font-size: 1rem; letter-spacing: .13em; }
.journey-card:has(.machine-render) { grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr); }
.journey-gallery .machine-render, .journey-preview.machine-render,
.journey-gallery .machine-render figcaption { border: 0; background: transparent; }
.journey-gallery .machine-render { grid-column: 1 / -1; }
.journey-gallery .machine-render a, .journey-preview.machine-render { aspect-ratio: auto; }
.journey-gallery .machine-render img, .journey-preview.machine-render img {
  width: 100%; height: auto; max-height: min(66vh, 620px); object-fit: contain;
}
.journey-viewer:has(img[src$="-display.webp"], img[src$="-display.png"]) { border: 0; background: transparent; width: min(1280px, 96vw); }
.journey-viewer:has(img[src$="-display.webp"], img[src$="-display.png"]) img { height: min(78dvh, 850px); }
#marble .journey-assets h3 { margin-top: 1.5rem; }
@media(max-width: 780px) {
  .journey-card:has(.machine-render) { grid-template-columns: minmax(0,1fr); }
  .journey-copy .eyebrow, .journey-copy .journey-start-year { font-size: clamp(2rem,9.8vw,4.6rem); }
}

/* Original TEK engineering drawings in the blueprint background. */
.journey-hero::before {
  background-image: url("journey-hero-arm.svg");
  background-position: center;
  background-size: cover;
}
#super-sonic-motion .journey-copy {
  container-type: inline-size;
}
#super-sonic-motion .journey-year-range {
  font-size: min(7.5rem, 19cqi);
  white-space: nowrap;
}
.journey-chapter {
  isolation: isolate;
  --cad-view: url("journey-wireframes/router.webp");
}
.journey-chapter::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background: var(--cad-view) no-repeat 83% 55% / min(68%, 810px) auto;
  opacity: .22;
  mask-image: linear-gradient(100deg, transparent 8%, #0007 37%, black 72%);
}
.journey-chapter:nth-of-type(5n+2) { --cad-view: url("journey-wireframes/gantry.webp"); }
.journey-chapter:nth-of-type(5n+3) { --cad-view: url("journey-wireframes/gantry-drive.webp"); }
.journey-chapter:nth-of-type(5n+4) { --cad-view: url("journey-wireframes/base-rails.webp"); }
.journey-chapter:nth-of-type(5n) { --cad-view: url("journey-wireframes/spindle.webp"); }
#modular-development { --cad-view: url("journey-wireframes/bed.webp"); }
#door-production { --cad-view: url("journey-wireframes/dual-spindles.webp"); }
#ultra-sonic { --cad-view: url("journey-wireframes/inclined-spindle.webp"); }
#retrofit { --cad-view: url("journey-wireframes/dust-extractor.webp"); }
@media (max-width: 620px) {
  .journey-chapter::after {
    background-position: right center;
    background-size: 94% auto;
    opacity: .16;
  }
}

#super-sonic-2021 .journey-assets h3 {
  margin-top: 1.5rem;
}

#modular-development .journey-card {
  grid-template-columns: minmax(0, 1fr);
}

#modular-development .journey-copy .eyebrow {
  font-size: clamp(1.75rem, 5vw, 4.5rem);
  white-space: nowrap;
}

#modular-development .journey-preview img {
  width: 100%;
  height: auto;
  max-height: none;
}

#modular-development .journey-preview:hover img {
  transform: none;
}
