@font-face {
  font-family: "D2Coding";
  src: url("assets/fonts/D2Coding-gemstone.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

.page-history-story {
  --history-accent: #a9bdb8;
  --history-dot-size: 14px;
  --history-heading-shift: 22px;
  --history-dot-core: #d9eee8;
  --history-dot-glow-1: rgba(225, 247, 241, 0.92);
  --history-dot-glow-2: rgba(169, 205, 196, 0.54);
  --history-dot-glow-3: rgba(169, 205, 196, 0.2);
  --history-line-color: rgba(169, 189, 184, 0.44);
  --history-line-glow: rgba(169, 189, 184, 0.12);
  --history-panel: #0a0a09;
  --history-muted: rgba(245, 242, 236, 0.56);
  background: #050505;
}

.page-history-story .site-brand,
.page-history-story .clock {
  z-index: 10000;
}

.page-history-story .nav-toggle:focus-visible {
  outline-color: var(--history-accent);
}

.page-history-story .ct-link:hover .ct-letter,
.page-history-story .ct-link.is-hovered .ct-letter,
.page-history-story .ct-link:focus-visible .ct-letter,
.page-history-story .ct-link[aria-current="page"] .ct-letter {
  color: #668c84 !important;
}

.history-instrument {
  position: relative;
  z-index: 45;
  pointer-events: none;
}

.history-ruler {
  position: fixed;
  top: 50%;
  bottom: auto;
  left: 16px;
  z-index: 45;
  width: 34px;
  height: clamp(220px, 26vh, 300px);
  transform: translateY(-50%);
}

.history-ruler__ticks {
  position: absolute;
  inset: 0 auto 0 0;
  width: 18px;
  display: grid;
  grid-template-rows: repeat(41, 1fr);
  align-items: center;
}

.history-ruler__tick {
  display: block;
  width: 4px;
  height: 1px;
  background: rgba(245, 242, 236, 0.22);
}

.history-ruler__tick:nth-child(5n + 1) {
  width: 8px;
  background: rgba(245, 242, 236, 0.4);
}

.history-ruler__tick:nth-child(10n + 1) {
  width: 13px;
}

.history-ruler__marker {
  position: absolute;
  top: 0;
  left: 0;
  width: 18px;
  height: 1px;
  background: var(--history-accent);
  box-shadow: 0 0 8px var(--history-dot-glow-2);
  transform: translateY(var(--history-ruler-y, 0));
  transition: transform 160ms linear;
  will-change: transform;
}

.history-ruler__marker::after {
  content: "";
  position: absolute;
  top: -2px;
  right: -2px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--history-accent);
}

.history-ruler__value {
  position: absolute;
  right: 0;
  bottom: -1px;
  color: rgba(245, 242, 236, 0.52);
  font-size: 8px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.history-scanline {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 44;
  height: 2px;
  background: var(--history-line-color);
  box-shadow: 0 0 14px var(--history-line-glow);
  transform: translate3d(0, var(--history-scan-y, 48vh), 0);
  transition: transform 180ms linear;
  will-change: transform;
}

.history-scanline > span {
  position: absolute;
  top: -7px;
  right: 16px;
  padding-left: 8px;
  background: #050505;
  color: rgba(245, 242, 236, 0.48);
  font-size: 8px;
  font-weight: 500;
  line-height: 14px;
  text-transform: uppercase;
}

.history-scanline b {
  color: var(--history-accent);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.history-story {
  position: relative;
  width: min(100%, 920px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 1px 86px 0;
  background: var(--history-panel);
}

.history-story__intro {
  min-height: 100svh;
  padding: 19vh 0 17vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.history-kicker {
  margin: 0 0 46px;
  color: var(--history-accent);
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  text-transform: uppercase;
}

.history-story h1,
.history-story h2 {
  position: relative;
  max-width: calc(100% - var(--history-heading-shift));
  margin: 0;
  color: rgba(245, 242, 236, 0.64);
  font-weight: 450;
  letter-spacing: 0;
  transform: translate3d(0, 0, 0);
  transition:
    color 420ms ease,
    transform 760ms cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.history-travel-dot {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 3;
  width: var(--history-dot-size);
  height: var(--history-dot-size);
  border-radius: 50%;
  background: var(--history-dot-core);
  box-shadow:
    0 0 5px var(--history-dot-glow-1),
    0 0 15px var(--history-dot-glow-2),
    0 0 30px var(--history-dot-glow-3);
  opacity: 0;
  transform: translate3d(var(--history-dot-x, 0), var(--history-dot-y, -24px), 0);
  transition:
    opacity 240ms ease,
    transform 980ms cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
  pointer-events: none;
}

.history-travel-dot.is-ready {
  opacity: 1;
}

.history-story h1 {
  max-width: min(720px, calc(100% - var(--history-heading-shift)));
  font-size: 56px;
  line-height: 1.08;
}

.history-section.is-active h1,
.history-section.is-active h2 {
  color: #f5f2ec;
  transform: translate3d(var(--history-heading-shift), 0, 0);
}

.history-intro-copy {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
  margin-top: 92px;
  padding-top: 22px;
  border-top: 1px solid rgba(245, 242, 236, 0.13);
}

.history-intro-copy p,
.history-prose p {
  font-family: "D2Coding", ui-monospace, monospace;
  margin: 0;
  color: var(--history-muted);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.82;
  word-break: keep-all;
  transform: scale(1);
  transform-origin: left center;
  transition: color 320ms ease, transform 360ms cubic-bezier(0.22, 1, 0.36, 1), text-shadow 320ms ease;
}

[data-history-paragraph].is-reading {
  color: #ffffff;
  text-shadow: 0 0 18px rgba(245, 242, 236, 0.16);
  transform: scale(1.025);
}

.history-chapter {
  min-height: 100svh;
  padding: 31vh 0 24vh;
  scroll-margin-top: 10vh;
}

.history-chapter__header {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  align-items: start;
  gap: 24px;
  padding-top: 16px;
  border-top: 1px solid rgba(245, 242, 236, 0.13);
}

.history-chapter__header > p {
  margin: 6px 0 0;
  color: var(--history-accent);
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  text-transform: uppercase;
}

.history-chapter h2 {
  font-size: 40px;
  line-height: 1.08;
}

.history-prose {
  width: calc(100% - 184px);
  margin: 82px 0 0 auto;
  display: grid;
  gap: 30px;
}

.history-media,
.history-media-pair {
  margin: 0;
}

.history-media {
  position: relative;
  min-width: 0;
}

.history-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  filter: grayscale(1) contrast(1.08) brightness(0.82);
  transition: filter 900ms cubic-bezier(0.22, 1, 0.36, 1), transform 900ms cubic-bezier(0.22, 1, 0.36, 1);
}

.page-movement-story {
  --history-panel: #080908;
}

.page-movement-running {
  --history-accent: #9fc785;
  --history-dot-core: #dff4c8;
  --history-dot-glow-1: rgba(231, 255, 207, 0.94);
  --history-dot-glow-2: rgba(159, 199, 133, 0.56);
  --history-dot-glow-3: rgba(159, 199, 133, 0.22);
  --history-line-color: rgba(159, 199, 133, 0.5);
  --history-line-glow: rgba(159, 199, 133, 0.16);
}

.page-movement-wod {
  --history-accent: #e65d62;
  --history-dot-core: #ffd6d8;
  --history-dot-glow-1: rgba(255, 226, 227, 0.95);
  --history-dot-glow-2: rgba(230, 93, 98, 0.58);
  --history-dot-glow-3: rgba(230, 93, 98, 0.22);
  --history-line-color: rgba(230, 93, 98, 0.5);
  --history-line-glow: rgba(230, 93, 98, 0.16);
}

.page-movement-cleaning {
  --history-accent: #75c5c3;
  --history-dot-core: #d7fffd;
  --history-dot-glow-1: rgba(221, 255, 253, 0.95);
  --history-dot-glow-2: rgba(117, 197, 195, 0.58);
  --history-dot-glow-3: rgba(117, 197, 195, 0.22);
  --history-line-color: rgba(117, 197, 195, 0.5);
  --history-line-glow: rgba(117, 197, 195, 0.16);
}

.page-movement-stage {
  --history-accent: #d2bd84;
  --history-dot-core: #fff0c9;
  --history-dot-glow-1: rgba(255, 244, 213, 0.95);
  --history-dot-glow-2: rgba(210, 189, 132, 0.58);
  --history-dot-glow-3: rgba(210, 189, 132, 0.22);
  --history-line-color: rgba(210, 189, 132, 0.5);
  --history-line-glow: rgba(210, 189, 132, 0.16);
}

.page-movement-la {
  --history-accent: #758dde;
  --history-dot-core: #dce4ff;
  --history-dot-glow-1: rgba(229, 235, 255, 0.95);
  --history-dot-glow-2: rgba(117, 141, 222, 0.58);
  --history-dot-glow-3: rgba(117, 141, 222, 0.22);
  --history-line-color: rgba(117, 141, 222, 0.5);
  --history-line-glow: rgba(117, 141, 222, 0.16);
}

.page-movement-story .history-media img {
  filter: grayscale(0.78) saturate(0.5) contrast(1.05) brightness(0.78);
}

.page-movement-story .history-media.is-color-awake img {
  filter: grayscale(0.08) saturate(0.82) contrast(1.03) brightness(0.9);
  transform: scale(1.006);
}

.page-movement-story .history-media figcaption span:first-child {
  color: var(--history-accent);
}

.history-media--wide {
  aspect-ratio: 16 / 10;
}

.history-media--panorama {
  aspect-ratio: 16 / 8;
  margin-top: 12px;
}

.history-media--inline {
  width: 100%;
  aspect-ratio: 16 / 10;
  margin: 10px 0 4px;
}

.history-media-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
}

.history-media-pair .history-media {
  aspect-ratio: 4 / 5;
}

.history-media figcaption {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 10px;
  color: rgba(245, 242, 236, 0.44);
  font-size: 9px;
  line-height: 1.35;
  text-transform: uppercase;
}

.history-media figcaption span:last-child {
  min-width: 0;
  max-width: 70%;
  overflow-wrap: anywhere;
  text-align: right;
}

.history-chapter--closing {
  padding-bottom: 30vh;
}

.history-back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  margin-top: 38px;
  padding-bottom: 5px;
  border-bottom: 1px solid rgba(245, 242, 236, 0.46);
  color: #f5f2ec;
  font-size: 12px;
  line-height: 1;
  text-decoration: none;
  text-transform: uppercase;
  transition: border-color 220ms ease, color 220ms ease;
}

.history-story-links {
  margin-top: 42px;
}

.history-story-links .history-back-link {
  margin-top: 0;
}

.history-back-link:hover,
.history-back-link:focus-visible {
  border-color: var(--history-accent);
  color: var(--history-accent);
}

.history-story__footer {
  min-height: 48vh;
  padding: 38px 0 76px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  border-top: 1px solid rgba(245, 242, 236, 0.13);
  color: rgba(245, 242, 236, 0.46);
  font-size: 10px;
  line-height: 1.3;
  text-transform: uppercase;
}

.history-story__footer p {
  margin: 0;
}

@media (max-width: 900px) {
  .history-story {
    width: min(100%, 760px);
    padding-right: 56px;
    padding-left: 56px;
  }

  .history-story h1 {
    font-size: 48px;
  }

  .history-chapter__header {
    grid-template-columns: 120px minmax(0, 1fr);
  }

  .history-prose {
    width: calc(100% - 144px);
  }
}

@media (max-width: 600px) {
  .page-history-story {
    --history-dot-size: 13px;
    --history-heading-shift: 21px;
  }

  .page-history-story::before {
    content: "";
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 55;
    height: 60px;
    background: #050505;
    pointer-events: none;
  }

  .history-ruler {
    top: 50%;
    bottom: auto;
    left: 8px;
    width: 20px;
    height: clamp(180px, 27vh, 230px);
    transform: translateY(-50%);
  }

  .history-ruler__ticks,
  .history-ruler__marker {
    width: 13px;
  }

  .history-ruler__value,
  .history-scanline > span {
    display: none;
  }

  .history-story {
    width: 100%;
    padding-right: 20px;
    padding-left: 46px;
  }

  .history-story__intro {
    padding-top: 18vh;
    padding-bottom: 15vh;
  }

  .history-kicker {
    margin-bottom: 34px;
  }

  .history-story h1 {
    font-size: 36px;
    line-height: 1.12;
  }

  .history-intro-copy {
    grid-template-columns: 1fr;
    gap: 24px;
    margin-top: 68px;
  }

  .history-intro-copy p,
  .history-prose p {
    font-size: 14px;
    line-height: 1.78;
  }

  [data-history-paragraph].is-reading {
    transform: none;
  }

  .history-chapter {
    padding-top: 25vh;
    padding-bottom: 20vh;
  }

  .history-chapter__header {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .history-chapter__header > p {
    margin-top: 0;
  }

  .history-chapter h2 {
    font-size: 34px;
  }

  .history-prose {
    width: 100%;
    margin-top: 58px;
    gap: 25px;
  }

  .history-media--wide {
    aspect-ratio: 4 / 3;
  }

  .history-media--panorama {
    aspect-ratio: 4 / 3;
  }

  .history-media--inline {
    aspect-ratio: 4 / 3;
  }

  .history-media-pair {
    grid-template-columns: 1fr;
  }

  .history-media-pair .history-media {
    aspect-ratio: 4 / 3;
  }

  .history-media figcaption {
    font-size: 8px;
  }

  .history-chapter--closing {
    padding-bottom: 24vh;
  }

  .history-story__footer {
    min-height: 42vh;
    padding-bottom: 68px;
    align-items: flex-end;
    flex-direction: column;
    justify-content: flex-end;
    text-align: right;
  }
}

@media (prefers-reduced-motion: reduce) {
  .history-ruler__marker,
  .history-scanline,
  .history-travel-dot,
  .history-story h1,
  .history-story h2,
  .history-intro-copy p,
  .history-prose p {
    transition: none;
  }
}
