/* 02 Journey: a pinned stage over the aerial view of the line world. The cards stand in two
   staggered columns, the trail runs down the gutter between them (world.js), and each card
   reaches out to its marker on the trail (connectors.js). The skill globe turns to the card
   in view (journey.js). */
.journey{position:relative;height:540svh;isolation:isolate}
.journey-stage{position:sticky;top:0;height:100svh;min-height:650px;overflow:hidden;isolation:isolate}
.journey-heading{position:absolute;top:calc(var(--topbar) + 1.4svh);left:37%;z-index:2}
.journey-heading h2{margin:0;font:520 clamp(2.4rem,4.1vw,4.2rem)/.98 var(--sans);letter-spacing:-.04em;color:var(--ink)}
.journey-heading em{font:italic 400 1.16em/.9 var(--serif);letter-spacing:-.01em}
.journey-heading p{margin:12px 0 0;font:400 11.5px/1 var(--mono);letter-spacing:.06em;color:var(--muted)}

.journey-links{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;overflow:visible}
.journey-links path{fill:none;stroke-linecap:round}
.journey-links .link{stroke:var(--hl-edge);stroke-width:var(--hl-w);stroke-dashoffset:var(--length,0);transition:stroke-dashoffset .7s var(--ease-expo) .12s,stroke .3s}
.journey-links .link.on{stroke-dashoffset:0}
.journey-links circle{fill:var(--paper);stroke:var(--ink);stroke-width:1.2;transform-box:fill-box;transform-origin:center;transform:scale(0);transition:transform .55s var(--ease-expo),fill .3s,stroke .3s}
.journey-links circle.on{transform:scale(1)}
.journey-links circle.active{transform:scale(1.35);fill:var(--accent);stroke:var(--accent)}

/* Cards: opaque plates with a hairline ring and a soft lift. */
.journey-card{position:absolute;left:5%;top:11%;width:24%;min-height:150px;padding:16px 18px 15px;border-radius:14px;background:var(--plate);color:var(--ink);box-shadow:var(--card),var(--lift);clip-path:inset(-64px round 14px);transition:opacity .25s,transform .6s var(--ease-expo),clip-path .6s var(--ease-expo),box-shadow .4s var(--ease-out)}
.journey-card:nth-child(2){left:37%;top:26.5%}
.journey-card:nth-child(3){top:42%}
.journey-card:nth-child(4){left:37%;top:57.5%}
.journey-card:nth-child(5){top:73%}
.card-meta{display:flex;align-items:center;gap:8px;padding-right:40px;margin-bottom:10px;font:400 11.5px/1 var(--mono);color:var(--muted);font-variant-numeric:tabular-nums}
.card-meta span{white-space:nowrap}
.card-meta span:first-child{color:var(--ink);transition:color .3s}
.card-meta i{width:20px;height:1px;flex-shrink:0;background:var(--line-2);transition:background-color .3s}
.chapter-icon{position:absolute;right:16px;top:13px;width:26px;height:26px;fill:none;stroke:var(--ink-2);stroke-width:1.15;stroke-linecap:round;stroke-linejoin:round}
.journey-card h3{margin:0 0 4px;font:560 clamp(1.05rem,.55rem + .85vw,1.45rem)/1.2 var(--sans);letter-spacing:-.02em;clip-path:inset(-4px -4px -6px);transition:clip-path .7s var(--ease-expo)}
.journey-card h4{margin:0 0 6px;max-width:85%;font:500 13px/1.35 var(--sans);color:var(--ink-2);text-wrap:pretty}
.journey-card p{margin:0;max-width:84%;font-size:13px;line-height:1.5;color:var(--muted);text-wrap:pretty}
.chapter-go{position:absolute;right:12px;bottom:12px;display:grid;place-items:center;width:34px;height:34px;padding:0;border:0;border-radius:50%;background:var(--stone);color:var(--ink);cursor:pointer;transition:background-color .2s,color .2s,transform .16s var(--ease-out)}
.chapter-go::after{content:'';position:absolute;inset:-5px}
.chapter-go svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;transition:transform .3s var(--ease-out)}
@media(hover:hover){.chapter-go:hover{background:var(--ink);color:var(--paper)}.chapter-go:hover svg{transform:translateX(2px)}}
.chapter-go:active{transform:scale(.92)}
.chapter-go:focus-visible{outline-offset:3px;border-radius:50%}
.journey-card.active{box-shadow:0 0 0 1px var(--ink),var(--lift-lg);transform:scale(1.02)}
.journey-card.active .card-meta span:first-child{color:var(--accent)}
.journey-card.active .card-meta i{background:var(--accent)}
.journey-live .journey-card{transition:opacity .45s var(--ease-expo),transform .8s var(--ease-expo),clip-path .8s var(--ease-expo),filter .6s var(--ease-expo),box-shadow .4s var(--ease-out)}
.journey-live .journey-card:not(.revealed){opacity:.14;transform:translateY(22px);clip-path:inset(0 0 52% 0 round 14px);filter:blur(4px)}
.journey-live .journey-card:not(.revealed) h3{clip-path:inset(0 100% 0 0)}
.journey-live .journey-card:focus-within{opacity:1;transform:none;clip-path:inset(-64px round 14px);filter:none}
.journey-live .journey-card:focus-within h3{clip-path:inset(-4px -4px -6px)}

/* The skill globe: a plate drawn as a wireframe sphere, its tags turning with it. */
/* The globe also shrinks with the screen's height, so its caption and the skills button always fit the stage. */
.skills-orbit{position:absolute;left:66.5%;top:26%;width:min(28vw,calc(74svh - 132px),550px);aspect-ratio:1;touch-action:pan-y}
.sphere-rim{position:absolute;inset:0;border-radius:50%;background:var(--plate);box-shadow:var(--card),var(--lift-lg);pointer-events:none}
.sphere-rim svg{position:absolute;inset:0;width:100%;height:100%;overflow:visible}
.sphere-rim path{fill:none;stroke:var(--hl-lo);stroke-width:var(--hl-w);vector-effect:non-scaling-stroke}
.sphere-rim path.front{stroke:var(--hl-mid)}
.sphere-rim path.orbit{stroke:var(--hl-edge);stroke-dasharray:1 4}
.sphere-rim path.equator{stroke:var(--hl-edge)}
.tag-sphere{position:absolute;inset:0;z-index:1;border-radius:50%;cursor:grab}
.tag-sphere:active{cursor:grabbing}
.sphere-tag{position:absolute;left:50%;top:50%;white-space:nowrap;padding:5px 10px;border-radius:999px;background:var(--plate);box-shadow:var(--card);color:var(--ink-2);font:500 clamp(10.5px,.78vw,13px)/1 var(--sans);letter-spacing:-.005em;transform-origin:center;user-select:none;transition:background-color .3s,color .3s,box-shadow .3s}
.sphere-tag.focused{background:var(--ink);color:var(--paper);box-shadow:0 0 0 1px var(--ink),var(--lift)}
.sphere-caption{position:absolute;left:0;right:0;top:calc(100% + 22px);display:flex;flex-direction:column;align-items:center;gap:7px;text-align:center;font:400 11px/1 var(--mono);letter-spacing:.06em;color:var(--muted)}
.sphere-caption span:first-child{font:560 15px/1.2 var(--sans);letter-spacing:-.01em;color:var(--ink)}
/* Short desktop screens: tighter cards. */
@media(min-width:1101px) and (max-height:760px){
  .journey-stage{min-height:600px}
  .journey-card{min-height:132px;padding:12px 16px}
  .card-meta{margin-bottom:6px}
  .journey-card h3{margin-bottom:3px}
  .chapter-icon{width:22px;height:22px;top:11px}
  .chapter-go{width:30px;height:30px;bottom:10px}
  .journey-card:nth-child(1){top:10%}.journey-card:nth-child(2){top:25%}.journey-card:nth-child(3){top:40%}.journey-card:nth-child(4){top:55%}.journey-card:nth-child(5){top:70%}
}

/* Stacked (phone and tablet): cards and the interactive globe. */
@media(max-width:1100px){
  .journey{height:auto}
  .journey-stage{position:relative;display:flex;flex-direction:column;height:auto;min-height:0;padding:calc(var(--topbar) + 24px) var(--gutter) 72px;overflow:visible}
  .journey-heading{position:relative;left:auto;top:auto;order:-2;margin-bottom:30px}
  .journey-heading h2{font-size:clamp(2.4rem,10vw,3.8rem)}
  .journey-links{display:none}
  .journey-cards{display:flex;flex-direction:column;gap:18px}
  .journey-card,.journey-card:nth-child(n){position:relative;left:auto;top:auto;width:94%;min-height:150px;padding:18px 20px}
  .journey-card:nth-child(even){align-self:flex-end}
  .journey-card h3{font-size:1.5rem}
  .journey-live .journey-card:not(.revealed){opacity:1;transform:none;clip-path:inset(-64px round 14px);filter:none}
  .journey-live .journey-card:not(.revealed) h3{clip-path:inset(-4px -4px -6px)}
  .journey-card.active{transform:none}
  .skills-orbit{position:relative;left:auto;top:auto;align-self:center;width:min(82vw,380px);max-width:100%;margin:32px 0 58px}
  .sphere-rim,.tag-sphere,.sphere-caption{display:block}
}
@media(min-width:701px) and (max-width:1100px){
  .journey-cards{display:grid;grid-template-columns:1fr 1fr;gap:18px}
  .journey-card,.journey-card:nth-child(n){width:auto}
  .journey-card:nth-child(even){align-self:stretch}
}
.journey-reduced{height:auto}
.journey-reduced .journey-stage{position:relative;height:100svh}
@media(max-width:1100px){.journey-reduced .journey-stage{height:auto}}
@media(prefers-reduced-motion:reduce){
  .journey-card,.journey-live .journey-card{transition:opacity .15s,background-color .15s,box-shadow .15s}
  .journey-card h3{transition:none}
  .journey-card.active{transform:none}
  .journey-links *{transition:none!important}
}

/* Separate the journey from the detailed drawing without removing the forest. */
.journey-stage::before{content:'';position:absolute;inset:0;z-index:0;pointer-events:none;background:color-mix(in srgb,var(--paper) 24%,transparent)}
.journey-heading,.journey-card,.journey-links,.skills-orbit{z-index:1}
.journey-heading h2{text-shadow:0 1px 0 var(--paper),0 0 18px var(--paper)}
.journey-links .link{stroke:var(--ink);stroke-width:1.6;opacity:.72}
.journey-links circle{stroke:var(--ink);stroke-width:1.8}
.journey-card{box-shadow:0 0 0 1px var(--line-2),var(--lift);border-left:3px solid var(--line-2)}
.journey-card.active{border-left-color:var(--ink);box-shadow:0 0 0 1px var(--ink),var(--lift-lg)}
.sphere-rim{background:var(--plate);box-shadow:0 0 0 1px var(--line-2),var(--lift-lg)}
.sphere-rim path.front,.sphere-rim path.equator{stroke:var(--hl-edge)}
.sphere-tag.focused{background:var(--ink);color:var(--paper);box-shadow:0 0 0 1px var(--ink),var(--lift)}
.sphere-caption span:first-child{background:var(--plate);padding:7px 12px;border-radius:999px;box-shadow:0 0 0 1px var(--line-2)}
.world .journey-trail > path.nf{stroke:var(--ink);stroke-width:1.8}
.world .at-rest .journey-trail > path.nf{stroke-width:calc(1.8 / var(--cam-s,1))}
