/* Creo EDGAR filing tape. Uses the tokens in /assets/creo.css; defines none of its own. */

.ctape {
  display: flex;
  align-items: stretch;
  gap: 0;
  height: calc(var(--space-8) + var(--space-2));
  overflow: hidden;
  background: var(--bg-raised);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: var(--fg);
  contain: layout paint;
}

.ctape__label {
  flex: none;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0 var(--space-4);
  border-right: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg-muted);
  font-size: var(--text-xxs);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  white-space: nowrap;
}

.ctape__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--neutral);
}

.ctape.is-live .ctape__dot {
  background: var(--positive);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--positive) 20%, transparent);
}

.ctape__viewport {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 var(--space-6), #000 calc(100% - var(--space-10)), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 var(--space-6), #000 calc(100% - var(--space-10)), transparent);
}

.ctape__track {
  display: flex;
  width: max-content;
  height: 100%;
  will-change: transform;
  backface-visibility: hidden;
}

.ctape__viewport:hover .ctape__track,
.ctape__viewport:focus-within .ctape__track {
  animation-play-state: paused !important;
}

@keyframes ctape-scroll {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(var(--ctape-shift, -50%), 0, 0);
  }
}

.ctape__group {
  display: flex;
  align-items: center;
  height: 100%;
}

.ctape__item {
  display: inline-flex;
  gap: var(--space-2);
  height: 100%;
  align-items: center;
  padding: 0 var(--space-5);
  border-right: 1px solid var(--border);
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.ctape__item:hover,
.ctape__item:focus-visible {
  background: var(--bg-sunken);
  outline: none;
}

.ctape__item:focus-visible {
  box-shadow: inset 0 0 0 2px var(--focus);
}

.ctape__ticker {
  font-weight: 650;
  letter-spacing: 0.01em;
}

.ctape__form {
  padding: 2px var(--space-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--fg-muted);
  font-size: var(--text-xxs);
}

.ctape__change {
  display: inline-flex;
  gap: var(--space-1);
}

.ctape__factor,
.ctape__note,
.ctape__time {
  color: var(--fg-muted);
}

.ctape__note {
  font-style: italic;
}

.ctape__time {
  font-size: var(--text-xxs);
}

.ctape__value.is-up {
  color: var(--positive);
}

.ctape__value.is-down {
  color: var(--negative);
}

.ctape__value.is-flat {
  color: var(--neutral);
}

.ctape__empty {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 var(--space-5);
  color: var(--fg-muted);
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  .ctape__viewport {
    overflow-x: auto;
    scrollbar-width: none;
  }
  .ctape__track {
    will-change: auto;
  }
}

@media (max-width: 40rem) {
  .ctape__title {
    display: none;
  }
  .ctape__label {
    padding: 0 var(--space-3);
  }
}
