.data-glossary {
  --journey-accent: 157, 233, 212;
  position: relative;
  isolation: isolate;
}

.data-glossary-header {
  min-height: min(58svh, 620px);
  align-content: end;
  padding: clamp(56px, 9vw, 120px) clamp(4px, 3vw, 42px);
}

.data-glossary-header h3 {
  max-width: 1100px;
  font-size: clamp(42px, 6.1vw, 88px);
  line-height: 1.18;
  white-space: normal;
  text-wrap: pretty;
}

.data-glossary-header h3 span {
  display: block;
  white-space: nowrap;
}

.data-glossary-header > p {
  max-width: 830px;
  font-size: clamp(13px, 1.05vw, 17px);
  line-height: 2.05;
}

.data-journey-index {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-block: 1px solid rgba(194, 235, 229, 0.16);
  background: rgba(2, 9, 15, 0.82);
  box-shadow: 0 18px 40px rgba(0, 4, 9, 0.22);
  backdrop-filter: blur(18px) saturate(1.15);
}

.data-journey-index a {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 12px;
  align-items: center;
  min-height: 70px;
  padding: 12px 20px;
  border-right: 1px solid rgba(194, 235, 229, 0.1);
  color: rgba(228, 241, 245, 0.48);
  text-decoration: none;
  transition: color 220ms ease, background 220ms ease, box-shadow 220ms ease;
}

.data-journey-index a:last-child { border-right: 0; }

.data-journey-index span {
  grid-row: 1 / 3;
  color: rgba(var(--journey-accent), 0.65);
  font: 700 9px/1 Consolas, "Courier New", monospace;
  letter-spacing: 0.14em;
}

.data-journey-index strong {
  font-family: var(--font-ja);
  font-size: clamp(12px, 1vw, 15px);
  font-weight: 600;
  letter-spacing: 0.11em;
}

.data-journey-index a::after {
  grid-column: 2;
  width: 0;
  height: 1px;
  content: "";
  background: rgb(var(--journey-accent));
  box-shadow: 0 0 12px rgba(var(--journey-accent), 0.7);
  transition: width 420ms cubic-bezier(0.16, 1, 0.3, 1);
}

.data-journey-index a:hover,
.data-journey-index a:focus-visible,
.data-journey-index a[aria-current="step"] {
  color: #f5fbff;
  background: rgba(var(--journey-accent), 0.08);
  outline: none;
}

.data-journey-index a[aria-current="step"]::after { width: 100%; }

.data-journey-progress {
  position: sticky;
  z-index: 21;
  top: 69px;
  height: 2px;
  pointer-events: none;
  background: rgba(211, 241, 238, 0.05);
}

.data-journey-progress i {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #80ead1, #83cdeb 72%, #c0a6ff);
  box-shadow: 0 0 16px rgba(126, 229, 216, 0.7);
  transition: width 80ms linear;
}

.data-glossary-grid.data-journey {
  display: block;
  margin-top: 0;
}

.data-chapter {
  --chapter-rgb: 126, 231, 208;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(390px, 0.85fr);
  gap: clamp(28px, 4vw, 68px);
  min-height: 190svh;
  padding: clamp(28px, 5vw, 76px) 0;
  border-top: 1px solid rgba(var(--chapter-rgb), 0.14);
}

.data-chapter[data-data-chapter="flow"] { --chapter-rgb: 111, 213, 232; }
.data-chapter[data-data-chapter="human"] { --chapter-rgb: 238, 180, 125; }
.data-chapter[data-data-chapter="space"] { --chapter-rgb: 185, 157, 255; }

.data-chapter:nth-of-type(even) {
  grid-template-columns: minmax(390px, 0.85fr) minmax(0, 1.15fr);
}

.data-chapter:nth-of-type(even) .data-chapter-scene { order: 2; }
.data-chapter:nth-of-type(even) .data-chapter-content { order: 1; }

.data-chapter-scene {
  position: sticky;
  top: 92px;
  align-self: start;
  height: calc(100svh - 120px);
  min-height: 560px;
  overflow: hidden;
  border: 1px solid rgba(var(--chapter-rgb), 0.24);
  border-radius: 3px;
  background: #06121c;
  box-shadow: 0 35px 100px rgba(0, 5, 11, 0.42);
}

.data-chapter-scene::after {
  position: absolute;
  z-index: 4;
  inset: 12px;
  border: 1px solid rgba(234, 252, 250, 0.08);
  content: "";
  pointer-events: none;
}

.data-chapter-scene img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.86) brightness(0.72) contrast(1.06);
  transform: scale(1.08) translate3d(0, var(--scene-shift, 0), 0);
  transition: filter 700ms ease;
  will-change: transform;
}

.data-chapter.is-current .data-chapter-scene img {
  filter: saturate(0.98) brightness(0.82) contrast(1.04);
}

.data-chapter-shade {
  position: absolute;
  z-index: 2;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(1, 7, 12, 0.08) 38%, rgba(1, 7, 12, 0.88)),
    linear-gradient(90deg, rgba(1, 7, 12, 0.5), transparent 55%);
  pointer-events: none;
}

.data-chapter:nth-of-type(even) .data-chapter-shade {
  background:
    linear-gradient(180deg, rgba(1, 7, 12, 0.08) 38%, rgba(1, 7, 12, 0.88)),
    linear-gradient(270deg, rgba(1, 7, 12, 0.5), transparent 55%);
}

.data-chapter-number {
  position: absolute;
  z-index: 3;
  top: 25px;
  right: 30px;
  color: rgba(237, 250, 250, 0.11);
  font: 500 clamp(72px, 9vw, 140px)/1 Georgia, "Times New Roman", serif;
  letter-spacing: -0.08em;
}

.data-scene-readout {
  position: absolute;
  z-index: 5;
  right: clamp(28px, 4vw, 58px);
  bottom: clamp(28px, 5vw, 62px);
  left: clamp(28px, 4vw, 58px);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 18px;
  align-items: end;
  min-height: 100px;
  padding: 21px 23px;
  border-left: 2px solid rgba(var(--chapter-rgb), 0.9);
  background: linear-gradient(90deg, rgba(1, 9, 15, 0.82), rgba(1, 9, 15, 0.28));
  backdrop-filter: blur(12px);
}

.data-scene-readout span {
  grid-column: 1 / -1;
  color: rgba(var(--chapter-rgb), 0.82);
  font: 700 8px/1 Consolas, "Courier New", monospace;
  letter-spacing: 0.2em;
}

.data-scene-readout strong {
  overflow: hidden;
  color: #f4fbff;
  font-family: var(--font-ja);
  font-size: clamp(17px, 1.45vw, 23px);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-scene-readout small {
  justify-self: end;
  color: rgba(224, 239, 243, 0.74);
  font-family: var(--font-ja);
  font-size: clamp(10px, 0.76vw, 12px);
  letter-spacing: 0.06em;
  text-align: right;
}

.data-scene-readout.is-changing {
  animation: data-readout-change 460ms cubic-bezier(0.16, 1, 0.3, 1);
}

.data-chapter-content {
  align-self: start;
  padding: 14svh 0 20svh;
}

.data-chapter-heading {
  margin-bottom: clamp(55px, 9svh, 100px);
  padding-inline: clamp(4px, 2vw, 24px);
}

.data-chapter-heading > p:first-child {
  margin: 0 0 18px;
  color: rgba(var(--chapter-rgb), 0.78);
  font: 700 9px/1.2 Consolas, "Courier New", monospace;
  letter-spacing: 0.2em;
}

.data-chapter-heading h4 {
  margin: 0;
  color: #f4fbff;
  font-family: var(--font-ja);
  font-size: clamp(29px, 3vw, 46px);
  font-weight: 520;
  line-height: 1.48;
  letter-spacing: -0.035em;
  word-break: keep-all;
  overflow-wrap: normal;
  text-wrap: pretty;
}

.data-chapter-heading h4 span {
  display: block;
  white-space: nowrap;
}

.data-chapter-heading > p:last-child {
  max-width: 590px;
  margin: 24px 0 0;
  color: rgba(222, 237, 242, 0.66);
  font-family: var(--font-ja);
  font-size: clamp(12px, 0.95vw, 15px);
  line-height: 2.05;
  letter-spacing: 0.055em;
}

.data-chapter-cards {
  display: grid;
  gap: clamp(44px, 8svh, 86px);
}

.data-chapter .data-source-card {
  position: relative;
  min-height: min(52svh, 490px);
  padding: clamp(27px, 3vw, 40px);
  border: 1px solid rgba(189, 227, 232, 0.13);
  border-left-color: rgba(var(--chapter-rgb), 0.2);
  background:
    linear-gradient(140deg, rgba(var(--chapter-rgb), 0.065), transparent 46%),
    rgba(2, 10, 16, 0.78);
  box-shadow: 0 22px 70px rgba(0, 4, 9, 0.2);
  opacity: 0.38;
  transform: translateY(34px) scale(0.985);
  transition:
    opacity 620ms ease,
    transform 620ms cubic-bezier(0.16, 1, 0.3, 1),
    border-color 320ms ease,
    box-shadow 320ms ease;
}

.data-chapter .data-source-card::before {
  position: absolute;
  top: -1px;
  bottom: -1px;
  left: -1px;
  width: 2px;
  content: "";
  background: rgb(var(--chapter-rgb));
  box-shadow: 0 0 18px rgba(var(--chapter-rgb), 0.62);
  opacity: 0;
  transform: scaleY(0.2);
  transform-origin: center;
  transition: opacity 320ms ease, transform 520ms cubic-bezier(0.16, 1, 0.3, 1);
}

.data-chapter .data-source-card.is-visible { opacity: 0.7; transform: none; }

.data-chapter .data-source-card.is-active {
  border-color: rgba(var(--chapter-rgb), 0.42);
  opacity: 1;
  transform: translateY(-2px);
  box-shadow: 0 28px 90px rgba(0, 4, 9, 0.35), 0 0 50px rgba(var(--chapter-rgb), 0.055);
}

.data-chapter .data-source-card.is-active::before { opacity: 1; transform: scaleY(1); }

.data-chapter .data-source-card-head { color: rgba(var(--chapter-rgb), 0.86); }

.data-chapter .data-source-card h4 {
  font-size: clamp(20px, 1.7vw, 27px);
}

.data-chapter .data-source-card > p,
.data-chapter .data-source-use {
  font-size: clamp(11px, 0.82vw, 13px);
  line-height: 2;
}

.data-chapter .data-source-use {
  margin-top: auto;
  border-left-color: rgba(var(--chapter-rgb), 0.72);
}

.data-chapter .data-source-card a { color: rgba(var(--chapter-rgb), 0.84); }

.data-journey-epilogue {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(28px, 5vw, 80px);
  align-items: center;
  min-height: 0;
  margin-top: clamp(54px, 8vw, 100px);
  padding: clamp(28px, 3.5vw, 48px) clamp(20px, 4vw, 58px);
  border-top: 1px solid rgba(164, 235, 217, 0.18);
  border-bottom: 1px solid rgba(164, 235, 217, 0.12);
  text-align: left;
  background:
    radial-gradient(circle at 82% 50%, rgba(89, 206, 179, 0.1), transparent 34%),
    linear-gradient(90deg, rgba(3, 12, 18, 0.96), rgba(6, 23, 29, 0.88));
}

.data-journey-epilogue > div > p {
  margin: 0 0 10px;
  color: rgba(157, 233, 212, 0.76);
  font: 700 8px/1 Consolas, "Courier New", monospace;
  letter-spacing: 0.2em;
}

.data-journey-epilogue h4 {
  margin: 0;
  color: #f4fbff;
  font-family: var(--font-ja);
  font-size: clamp(22px, 2.5vw, 36px);
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.5;
}

.data-journey-epilogue button {
  display: inline-grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  justify-self: end;
  min-width: 280px;
  min-height: 56px;
  margin: 0;
  padding: 0 20px;
  border: 1px solid rgba(157, 233, 212, 0.42);
  color: #eefaf7;
  background: rgba(91, 206, 178, 0.08);
  cursor: pointer;
  font-family: var(--font-ja);
  font-size: 12px;
  letter-spacing: 0.08em;
  transition: border-color 220ms ease, background 220ms ease, box-shadow 220ms ease, transform 220ms ease;
}

.data-journey-epilogue button span {
  color: #9de9d4;
  font: 700 8px/1 Consolas, "Courier New", monospace;
  letter-spacing: 0.16em;
}

.data-journey-epilogue button:hover,
.data-journey-epilogue button:focus-visible {
  border-color: rgba(192, 255, 239, 0.86);
  background: rgba(107, 226, 196, 0.15);
  box-shadow: 0 0 36px rgba(111, 224, 196, 0.16);
  outline: none;
  transform: translateY(-2px);
}

@keyframes data-readout-change {
  0% { opacity: 0.22; filter: blur(5px); transform: translateY(8px); }
  100% { opacity: 1; filter: blur(0); transform: none; }
}

@media (max-width: 900px) {
  .data-glossary-header { min-height: 50svh; padding-inline: 2px; }
  .data-glossary-header h3 { font-size: clamp(37px, 10.5vw, 60px); }

  .data-journey-index {
    grid-template-columns: repeat(4, minmax(136px, 1fr));
    overflow-x: auto;
    scrollbar-width: none;
  }
  .data-journey-index::-webkit-scrollbar { display: none; }
  .data-journey-index a { min-height: 58px; padding: 10px 13px; }
  .data-journey-progress { top: 57px; }

  .data-chapter,
  .data-chapter:nth-of-type(even) {
    display: block;
    min-height: 0;
    padding: 0 0 15svh;
  }

  .data-chapter:nth-of-type(even) .data-chapter-scene,
  .data-chapter:nth-of-type(even) .data-chapter-content { order: initial; }

  .data-chapter-scene {
    top: 59px;
    height: 58svh;
    min-height: 400px;
    border-inline: 0;
  }

  .data-chapter-scene img { transform: scale(1.06) translate3d(0, var(--scene-shift, 0), 0); }
  .data-chapter-number { top: 18px; right: 20px; }

  .data-scene-readout {
    right: 17px;
    bottom: 32px;
    left: 17px;
    min-height: 82px;
    padding: 16px 17px;
  }

  .data-scene-readout strong { font-size: 16px; }
  .data-scene-readout small { max-width: 160px; font-size: 9px; }

  .data-chapter-content {
    position: relative;
    z-index: 6;
    margin: -7svh 14px 0;
    padding: 0;
  }

  .data-chapter-heading {
    margin: 0 0 40px;
    padding: 26px 22px 30px;
    border-top: 1px solid rgba(var(--chapter-rgb), 0.32);
    background: rgba(2, 10, 16, 0.9);
    backdrop-filter: blur(15px);
  }

  .data-chapter-heading h4 { font-size: clamp(22px, 6.2vw, 30px); }
  .data-chapter-heading > p:last-child { font-size: 11px; }
  .data-chapter-cards { gap: 28px; }

  .data-chapter .data-source-card {
    min-height: 0;
    padding: 24px 20px;
    opacity: 0.68;
    transform: translateY(20px);
  }

  .data-chapter .data-source-card.is-active { transform: none; }

  .data-journey-epilogue {
    grid-template-columns: 1fr;
    gap: 22px;
    min-height: 0;
    padding: 28px 20px;
  }

  .data-journey-epilogue button {
    justify-self: stretch;
    min-width: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .data-chapter-scene img,
  .data-chapter .data-source-card,
  .data-scene-readout,
  .data-journey-index a::after { transition: none; }
}
