.journey {
  --trace-color: color-mix(in srgb, var(--green) 67%, var(--paper));
  --orb-rim: color-mix(in srgb, var(--green) 48%, var(--paper));
  --orb-top: var(--surface);
  --orb-base: color-mix(in srgb, var(--mint) 82%, var(--green));
  --hub-top: var(--green);
  --hub-base: var(--green-deep);
  --hub-icon: var(--surface);
  --signal: var(--green);
  --glow: color-mix(in srgb, var(--green) 23%, transparent);
  --popover-shadow: color-mix(in srgb, var(--green-deep) 18%, transparent);
  background: var(--paper);
  color: var(--ink);
}
html[data-theme="dark"] .journey {
  --trace-color: color-mix(in srgb, var(--green) 46%, var(--paper));
  --orb-top: color-mix(in srgb, var(--green) 24%, var(--green-deep));
  --orb-base: var(--green-deep);
  --hub-top: var(--accent);
  --hub-base: var(--green);
  --hub-icon: var(--green-deep);
  --signal: var(--accent);
  --popover-shadow: rgb(0 0 0 / 36%);
}
.journey-inner {
  padding-block: clamp(2.8rem, 4.5vw, 4.3rem) clamp(2.4rem, 3.6vw, 3.5rem);
}
.journey-intro {
  text-align: center;
}
.node-number, .detail-phase, .hub-caption, .outline-list li::before {
  font-family: var(--mono);
  text-transform: uppercase;
  font-weight: 500;
}
.journey-intro h2 {
  margin: 0 0 .7rem;
  font-size: clamp(2.4rem, 4.35vw, 3.9rem);
  letter-spacing: -.055em;
  line-height: 1.025;
  font-weight: 670;
}
.journey-intro h2 span { color: var(--green); }
.journey-course { font-weight: 620; font-size: 1rem; }
.journey-hint { color: var(--muted); margin-top: .2rem; font-size: .91rem; }
.journey-map {
  --left-column: 17%;
  --orb: 3.45rem;
  --hub: 5.65rem;
  position: relative;
  isolation: isolate;
  width: 100%;
  height: clamp(28rem, 57vh, 34.7rem);
  margin: 1.3rem auto .4rem;
  max-width: 70rem;
}
.journey-traces {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.trace {
  fill: none;
  stroke: var(--trace-color);
  stroke-width: 1.2;
  stroke-dasharray: 2.2 5.1;
  stroke-linecap: round;
  transition: stroke .18s;
}
.trace.selected { stroke: var(--green); stroke-width: 1.6; }
.pulse-point { fill: var(--signal); }
.pulse-glow { fill: var(--green); opacity: .75; }
.journey-hub {
  --halo: calc(var(--hub) * 1.7);
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  width: var(--halo);
  height: var(--halo);
  place-items: center;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.hub-ring, .hub-disc, .node-orb, .node-orb::after { border-radius: 50%; }
.hub-ring {
  position: absolute;
  inset: 0;
  border: 1px dotted var(--orb-rim);
  background: color-mix(in srgb, var(--green) 7%, transparent);
  animation: hub-breathe 3s ease-in-out infinite;
}
.hub-ring.inner {
  inset: 10%;
  background: color-mix(in srgb, var(--green) 13%, transparent);
  border: 1px solid var(--orb-rim);
  animation-delay: -.65s;
}
@keyframes hub-breathe {
  0%,100% { transform: scale(.975); opacity: .77; }
  50% { transform: scale(1.045); opacity: 1; }
}
.is-paused .hub-ring { animation-play-state: paused; }
.hub-disc {
  position: relative;
  width: var(--hub);
  height: var(--hub);
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--hub-top), var(--hub-base));
  box-shadow: inset 0 0 0 4px color-mix(in srgb, var(--accent) 48%, transparent), 0 0 24px var(--glow);
}
.hub-disc .icon { width: 49%; height: 49%; color: var(--hub-icon); stroke-width: 1.18; }
.hub-caption {
  position: absolute;
  top: calc(100% + .45rem);
  text-align: center;
  color: var(--muted);
  font-size: .62rem;
  line-height: 1.5;
  letter-spacing: .115em;
  white-space: nowrap;
}
.hub-caption strong { display: block; font-size: .69rem; letter-spacing: .14em; }
.session-node {
  position: absolute;
  left: var(--column);
  top: calc(var(--row) - var(--orb) / 2);
  z-index: 2;
  width: 12.15rem;
  max-width: 32%;
  display: flex;
  flex-direction: column;
  gap: 0;
  align-items: center;
  transform: translateX(-50%);
  border-radius: .85rem;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}
.node-orb {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--orb);
  height: var(--orb);
  background: linear-gradient(140deg, var(--orb-top), var(--mint) 59%, var(--orb-base));
  box-shadow: inset 0 0 0 2px var(--orb-rim), 0 3px 12px var(--glow);
  transition: box-shadow .2s;
}
.node-orb::after {
  content: "";
  position: absolute;
  inset: -5px;
  border: 1px solid var(--line);
  transition: transform .2s;
}
.node-orb .icon {
  width: 47%;
  height: 47%;
  color: var(--green);
  stroke-width: 1.42;
}
.node-number { font-size: .69rem; letter-spacing: .07em; color: var(--green); margin-top: .75rem; }
.node-title { margin-top: .17rem; color: var(--ink); font-size: .89rem; line-height: 1.24; font-weight: 600; }
.session-node[aria-expanded=true] .node-orb {
  box-shadow: inset 0 0 0 3px var(--signal), 0 0 24px var(--glow);
}
.session-node[aria-expanded=true] .node-orb::after { transform: scale(1.12); border-color: var(--orb-rim); }
.session-node[aria-expanded=true] .node-title { color: var(--green); }
.journey button:focus-visible, .journey summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
.session-detail {
  position: absolute;
  z-index: 6;
  width: min(19rem, calc(100% - 8px));
  padding: .75rem 1.05rem 1.08rem;
  border: 1px solid var(--orb-rim);
  border-radius: .68rem;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 .5rem 2rem var(--popover-shadow);
}
.session-detail::after {
  content: "";
  position: absolute;
  bottom: -.36rem;
  left: calc(var(--tip-offset) - .33rem);
  width: .66rem;
  height: .66rem;
  transform: rotate(45deg);
  border-right: 1px solid var(--orb-rim);
  border-bottom: 1px solid var(--orb-rim);
  background: var(--surface);
}
.session-detail.below::after { bottom: auto; top: -.36rem; transform: rotate(225deg); }
.detail-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.detail-phase { font-size: .69rem; letter-spacing: .05em; color: var(--green); }
.detail-close {
  flex: none;
  width: 2.4rem;
  height: 2.4rem;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: var(--wash);
  border-radius: 50%;
}
.detail-close .icon { width: 1rem; height: 1rem; }
.detail-close:hover { color: var(--green); background: var(--mint); }
.session-detail h3 { margin: .2rem 0 .36rem; font-size: 1.24rem; line-height: 1.2; letter-spacing: -.025em; }
.detail-copy { color: var(--muted); font-size: 1rem; line-height: 1.48; }
.journey-controls {
  max-width: 70rem;
  margin: .2rem auto 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.map-key { display: flex; align-items: center; gap: .62rem; font-size: .84rem; color: var(--muted); }
.map-key span { width: .35rem; height: .35rem; border-radius: 50%; flex: none; background: var(--signal); box-shadow: 0 0 0 3px var(--mint); }
.motion-control { display: flex; align-items: center; justify-content: center; gap: .45rem; white-space: nowrap; min-height: 2.55rem; padding: .45rem .9rem; border: 1px solid var(--orb-rim); border-radius: 999px; color: var(--ink); font-size: .83rem; }
.motion-control .icon { width: .94rem; height: .94rem; }
.motion-control:hover { background: var(--wash); }
.motion-control:disabled { color: var(--muted); cursor: default; }
.journey-outline { margin: 1.4rem auto 0; max-width: 70rem; border-top: 1px solid var(--line); }
.journey-outline summary {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .75rem;
  padding: .92rem .4rem .2rem;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  font-size: .89rem;
  font-weight: 550;
}
.journey-outline summary::-webkit-details-marker { display: none; }
.journey-outline summary::after {
  content: "";
  width: .49rem;
  height: .49rem;
  margin-top: -.27rem;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}
.journey-outline[open] summary::after { margin-top: .25rem; transform: rotate(225deg); }
.outline-list { counter-reset: session-number; list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 0 2.3rem; margin: 1.3rem 0 0; padding: 0; }
.outline-list li { counter-increment: session-number; position: relative; padding: .83rem 0 .9rem 2.2rem; border-top: 1px solid var(--line); }
.outline-list li::before { position: absolute; left: 0; top: 1rem; font-size: .78rem; letter-spacing: .06em; color: var(--green); content: counter(session-number, decimal-leading-zero); }
.outline-list h3 { font-size: 1.06rem; font-weight: 610; }
.outline-list p { margin-top: .26rem; font-size: 1rem; line-height: 1.48; color: var(--muted); }
@media(max-width: 800px) {
  .journey-map { --left-column: 16%; --hub: 4.7rem; }
  .session-node { max-width: 31%; }
}
@media(max-width: 600px) {
  .journey-inner { padding-inline: 1rem; padding-block: 2.8rem 2.3rem; }
  .journey-intro h2 { font-size: clamp(2.21rem, 7vw, 2.8rem); }
  .journey-hint { font-size: .85rem; }
  .journey-course { font-size: .97rem; }
  .journey-map { --left-column: 19%; --orb: 3.05rem; --hub: 3.6rem; height: 34.4rem; margin-top: 1.1rem; }
  .session-node { max-width: 36%; }
  .hub-caption, .node-title, .node-number { background: var(--paper); padding-inline: .12rem; }
  .hub-caption { font-size: .54rem; letter-spacing: .07em; }
  .hub-caption strong { font-size: .61rem; letter-spacing: .1em; }
  .node-title { font-size: .82rem; }
  .node-number { font-size: .65rem; margin-top: .68rem; }
  .journey-controls { align-items: center; gap: .7rem; }
  .map-key { font-size: .76rem; line-height: 1.4; }
  .motion-control { min-height: 2.65rem; padding-inline: .65rem; font-size: .78rem; }
  .outline-list { grid-template-columns: 1fr; }
}
@media(max-width: 365px) {
  .journey-map { --hub: 3.1rem; }
  .node-title { font-size: .78rem; }
}
@media(prefers-reduced-motion: reduce) {
  .hub-ring { animation: none; }
  .trace-lights { display: none; }
}
