:root {
  --atlas-paper: var(--site-light-surface, #f9fdfe);
  --atlas-ink: #171b1a;
  --atlas-muted: #68706e;
  --atlas-faint: rgb(23 27 26 / 12%);
  --atlas-line: rgb(23 27 26 / 23%);
  --atlas-accent: #2d3432;
}

html,
body {
  height: 100%;
  overflow: hidden;
  background: var(--atlas-paper);
}

body {
  color: var(--atlas-ink);
}

button {
  border: 0;
  background: none;
}

.process-atlas,
.atlas-viewport {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 100svh;
  overflow: hidden;
}

.atlas-viewport::before {
  position: absolute;
  z-index: 1;
  inset: 0;
  background:
    radial-gradient(circle at 68% 36%, rgb(209 216 213 / 22%), transparent 34%),
    linear-gradient(180deg, rgb(255 255 255 / 48%), transparent 34%);
  content: "";
  pointer-events: none;
}

.atlas-world {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 0;
  width: 2780px;
  height: 1000px;
  transform-origin: 0 0;
  transition: transform 1100ms cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.atlas-map {
  position: absolute;
  inset: 0;
  width: 2780px;
  height: 1000px;
  overflow: visible;
}

.atlas-lanes line {
  stroke: var(--atlas-faint);
  stroke-width: 1.2;
}

.atlas-lanes,
.atlas-lane-labels,
.atlas-route-optional {
  transition: opacity 480ms ease;
}

.atlas-lane-labels {
  fill: var(--atlas-muted);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.atlas-route {
  fill: none;
  stroke: var(--atlas-line);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.atlas-route-main path {
  marker-end: url("#atlas-arrow");
  transition:
    stroke 360ms ease,
    stroke-width 360ms ease,
    opacity 360ms ease;
}

.process-atlas:not([data-state="overview"]) .atlas-lanes,
.process-atlas:not([data-state="overview"]) .atlas-route-optional {
  opacity: 0.24;
}

.process-atlas:not([data-state="overview"]) .atlas-lane-labels {
  opacity: 0;
}

.process-atlas:not([data-state="overview"]) .atlas-route-main path {
  opacity: 0.2;
}

.process-atlas:not([data-state="overview"]) .atlas-route-main path.is-passed {
  opacity: 0.48;
}

.process-atlas:not([data-state="overview"]) .atlas-route-main path.is-current {
  opacity: 1;
}

.atlas-route-main path.is-passed {
  stroke: rgb(23 27 26 / 62%);
}

.atlas-route-main path.is-current {
  stroke: var(--atlas-ink);
  stroke-width: 3.2;
}

.atlas-route marker path {
  fill: var(--atlas-line);
}

.atlas-route-optional {
  stroke: rgb(110 100 92 / 38%);
  stroke-dasharray: 8 10;
  stroke-width: 1.6;
}

.atlas-route-optional path {
  marker-end: url("#atlas-arrow-optional");
}

.atlas-route-optional text {
  fill: rgb(110 100 92 / 68%);
  font-size: 14px;
  letter-spacing: 0.03em;
  text-anchor: middle;
}

.atlas-node {
  position: absolute;
  top: var(--node-y);
  left: var(--node-x);
  display: grid;
  width: 180px;
  min-height: 92px;
  align-content: center;
  padding: 16px 18px 15px;
  border: 1px solid rgb(23 27 26 / 19%);
  border-radius: 10px;
  background: rgb(249 253 254 / 82%);
  box-shadow: 0 16px 38px -32px rgb(23 27 26 / 45%);
  transform: translate(-50%, -50%);
  transition:
    opacity 460ms ease,
    border-color 460ms ease,
    background-color 460ms ease,
    box-shadow 460ms ease,
    transform 700ms cubic-bezier(0.16, 1, 0.3, 1);
}

.atlas-node span {
  position: absolute;
  top: 9px;
  right: 11px;
  color: rgb(23 27 26 / 43%);
  font-size: 11px;
  font-weight: 740;
  letter-spacing: 0.04em;
}

.atlas-node strong,
.atlas-node small {
  display: block;
}

.atlas-node strong {
  color: var(--atlas-ink);
  font-size: 17px;
  font-weight: 730;
  letter-spacing: -0.045em;
  line-height: 1.15;
}

.atlas-node small {
  margin-top: 8px;
  color: var(--atlas-muted);
  font-size: 12px;
  font-weight: 520;
  letter-spacing: -0.025em;
}

.atlas-node-action {
  border-color: rgb(23 27 26 / 36%);
  cursor: pointer;
}

.atlas-node-action:hover,
.atlas-node-action:focus-visible {
  border-color: rgb(23 27 26 / 72%);
  outline: none;
  transform: translate(-50%, -50%) scale(1.05);
}

.process-atlas[data-state="cad"] .atlas-node:not([data-node="2"]):not([data-node="3"]):not([data-node="4"]),
.process-atlas[data-state="sample"] .atlas-node:not([data-node="3"]):not([data-node="4"]):not([data-node="5"]) {
  opacity: 0.16;
}

.process-atlas[data-state="cad"] .atlas-node[data-node="3"],
.process-atlas[data-state="sample"] .atlas-node[data-node="4"] {
  border-color: rgb(23 27 26 / 74%);
  background: rgb(249 253 254 / 94%);
  box-shadow: 0 24px 64px -34px rgb(23 27 26 / 70%);
  transform: translate(-50%, -50%) scale(1.09);
}

.atlas-overview {
  position: absolute;
  z-index: 5;
  top: clamp(7.5rem, 13vh, 15rem);
  left: clamp(2rem, 6vw, 11rem);
  transition:
    opacity 380ms ease,
    transform 780ms cubic-bezier(0.16, 1, 0.3, 1);
}

.atlas-overview > p,
.atlas-copy-route {
  margin: 0 0 20px;
  color: var(--atlas-muted);
  font-size: clamp(0.68rem, 0.62vw, 1.15rem);
  font-weight: 760;
  letter-spacing: 0.16em;
}

.atlas-overview h1 {
  max-width: 13em;
  margin: 0;
  font-size: clamp(2.8rem, 3.15vw, 7.6rem);
  font-weight: 680;
  letter-spacing: -0.065em;
  line-height: 1.12;
}

.atlas-overview-note {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: clamp(1.8rem, 3.2vh, 4.4rem);
  color: var(--atlas-muted);
  font-size: clamp(0.76rem, 0.65vw, 1.2rem);
}

.atlas-overview-note::before {
  width: clamp(2.6rem, 4vw, 7rem);
  height: 1px;
  background: var(--atlas-line);
  content: "";
}

.atlas-overview-note span,
.atlas-overview-note strong {
  display: block;
}

.atlas-overview-note strong {
  color: var(--atlas-ink);
  font-weight: 680;
}

.atlas-scene {
  position: absolute;
  z-index: 4;
  inset: 0;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition:
    visibility 0s linear 650ms,
    opacity 480ms ease;
}

.process-atlas:not([data-state="overview"]) .atlas-scene {
  visibility: visible;
  opacity: 1;
  transition-delay: 0s;
}

.process-atlas:not([data-state="overview"]) .atlas-overview {
  opacity: 0;
  transform: translateY(-34px);
  pointer-events: none;
}

.atlas-particles {
  position: absolute;
  width: min(61vw, 1880px);
  aspect-ratio: 3 / 2;
  opacity: 0;
  filter: saturate(0.9) contrast(1.02);
  transition:
    top 1050ms cubic-bezier(0.16, 1, 0.3, 1),
    left 1050ms cubic-bezier(0.16, 1, 0.3, 1),
    opacity 620ms ease 180ms,
    transform 1050ms cubic-bezier(0.16, 1, 0.3, 1);
}

.process-atlas[data-state="cad"] .atlas-particles {
  top: 14vh;
  left: 34vw;
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

.process-atlas[data-state="sample"] .atlas-particles {
  top: 17vh;
  left: 3vw;
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1.02);
}

.atlas-copy {
  position: absolute;
  z-index: 2;
  width: min(28vw, 820px);
  transition:
    top 940ms cubic-bezier(0.16, 1, 0.3, 1),
    right 940ms cubic-bezier(0.16, 1, 0.3, 1),
    left 940ms cubic-bezier(0.16, 1, 0.3, 1),
    opacity 360ms ease,
    transform 800ms cubic-bezier(0.16, 1, 0.3, 1);
}

.process-atlas[data-state="cad"] .atlas-copy {
  top: 33vh;
  right: auto;
  left: 7vw;
}

.process-atlas[data-state="sample"] .atlas-copy {
  top: 32vh;
  right: 7vw;
  left: auto;
}

.atlas-copy-index {
  display: flex;
  width: min(14rem, 100%);
  align-items: center;
  gap: 12px;
  margin-bottom: clamp(1rem, 2.2vh, 2.8rem);
  color: var(--atlas-muted);
  font-size: clamp(0.72rem, 0.68vw, 1.3rem);
  font-weight: 720;
  letter-spacing: 0.08em;
}

.atlas-copy-index i {
  height: 1px;
  flex: 1;
  background: var(--atlas-line);
}

.atlas-copy-route {
  margin-bottom: 0.9rem;
}

.atlas-copy h2 {
  margin: 0;
  font-size: clamp(2.5rem, 3.35vw, 7.8rem);
  font-weight: 690;
  letter-spacing: -0.07em;
  line-height: 1.05;
}

.atlas-copy-description {
  max-width: 28em;
  margin: clamp(1rem, 2.2vh, 2.8rem) 0 0;
  color: #58605e;
  font-size: clamp(1rem, 1vw, 2rem);
  font-weight: 470;
  letter-spacing: -0.035em;
  line-height: 1.72;
}

.atlas-handoff {
  position: absolute;
  z-index: 3;
  right: 8vw;
  bottom: 13vh;
  display: grid;
  gap: 6px;
  margin: 0;
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 380ms ease 460ms,
    transform 620ms cubic-bezier(0.16, 1, 0.3, 1) 420ms;
}

.process-atlas[data-state="sample"] .atlas-handoff {
  opacity: 1;
  transform: translateY(0);
}

.atlas-handoff span {
  color: var(--atlas-muted);
  font-size: clamp(0.68rem, 0.58vw, 1rem);
  font-weight: 700;
  letter-spacing: 0.12em;
}

.atlas-handoff strong {
  font-size: clamp(0.88rem, 0.78vw, 1.4rem);
  font-weight: 700;
}

.atlas-controls {
  position: absolute;
  z-index: 20;
  right: clamp(1.4rem, 3vw, 5rem);
  bottom: clamp(1.4rem, 3vh, 4.2rem);
  display: flex;
  align-items: stretch;
  border-top: 1px solid var(--atlas-line);
}

.atlas-controls button {
  position: relative;
  display: grid;
  min-width: clamp(8.2rem, 9.4vw, 18rem);
  gap: 4px;
  padding: 13px 18px 11px;
  color: var(--atlas-muted);
  cursor: pointer;
  text-align: left;
  transition: color 240ms ease;
}

.atlas-controls button::before {
  position: absolute;
  top: -2px;
  right: 0;
  left: 0;
  height: 3px;
  background: var(--atlas-ink);
  content: "";
  opacity: 0;
  transform: scaleX(0.4);
  transition:
    opacity 220ms ease,
    transform 460ms cubic-bezier(0.16, 1, 0.3, 1);
}

.atlas-controls button:hover,
.atlas-controls button:focus-visible,
.atlas-controls button.is-active {
  color: var(--atlas-ink);
}

.atlas-controls button.is-active::before {
  opacity: 1;
  transform: scaleX(1);
}

.atlas-controls span,
.atlas-controls strong {
  display: block;
}

.atlas-controls span {
  font-size: clamp(0.66rem, 0.52vw, 0.94rem);
  font-weight: 750;
  letter-spacing: 0.08em;
}

.atlas-controls strong {
  font-size: clamp(0.76rem, 0.66vw, 1.16rem);
  font-weight: 650;
  letter-spacing: -0.035em;
}

.atlas-instruction {
  position: absolute;
  z-index: 20;
  bottom: clamp(1.8rem, 3.6vh, 5rem);
  left: clamp(1.4rem, 3vw, 5rem);
  margin: 0;
  color: var(--atlas-muted);
  font-size: clamp(0.72rem, 0.58vw, 1rem);
}

.atlas-instruction span {
  display: inline-grid;
  width: 1.8rem;
  height: 1.8rem;
  margin-right: 8px;
  place-items: center;
  border: 1px solid var(--atlas-line);
  border-radius: 50%;
}

.atlas-status {
  position: fixed;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (max-width: 900px) {
  .atlas-viewport::before {
    background: linear-gradient(180deg, rgb(255 255 255 / 58%), transparent 46%);
  }

  .atlas-overview {
    top: 7rem;
    right: 1.4rem;
    left: 1.4rem;
  }

  .atlas-overview h1 {
    font-size: clamp(2.25rem, 10vw, 3.6rem);
  }

  .atlas-overview-note {
    display: grid;
    gap: 5px;
  }

  .atlas-overview-note::before {
    display: none;
  }

  .atlas-particles,
  .process-atlas[data-state="cad"] .atlas-particles,
  .process-atlas[data-state="sample"] .atlas-particles {
    top: 17vh;
    left: 2vw;
    width: 96vw;
    transform: none;
  }

  .atlas-copy,
  .process-atlas[data-state="cad"] .atlas-copy,
  .process-atlas[data-state="sample"] .atlas-copy {
    top: auto;
    right: 1.4rem;
    bottom: 8.4rem;
    left: 1.4rem;
    width: auto;
    padding: 1rem 0 0.75rem;
    background: linear-gradient(90deg, var(--atlas-paper) 82%, transparent);
    box-shadow: 0 -1.25rem 2.5rem var(--atlas-paper);
  }

  .atlas-copy-index {
    margin-bottom: 0.75rem;
  }

  .atlas-copy-route {
    margin-bottom: 0.5rem;
  }

  .atlas-copy h2 {
    font-size: clamp(2.15rem, 9vw, 3.2rem);
  }

  .atlas-copy-description {
    max-width: 33em;
    margin-top: 0.75rem;
    font-size: 0.95rem;
    line-height: 1.55;
  }

  .atlas-handoff {
    display: none;
  }

  .atlas-controls {
    right: 1rem;
    bottom: 1rem;
    left: 1rem;
  }

  .atlas-controls button {
    min-width: 0;
    flex: 1;
    padding: 10px 8px 8px;
  }

  .atlas-controls strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .atlas-instruction {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .atlas-world,
  .atlas-overview,
  .atlas-scene,
  .atlas-particles,
  .atlas-copy,
  .atlas-handoff,
  .atlas-controls button::before {
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }
}
