/* Shared story chrome — skip link, end-of-chapter toolbar, muse token fallbacks */

:root {
  --muse-color-brand-white: #ffffff;
  --muse-color-brand-midnight: #000000;
  --muse-color-brand-medium-blue-40: #0a60ff;
  --muse-color-brand-gray-70: #536070;
  --muse-color-brand-gray-60: #6f7a87;
  --muse-color-brand-gray-40: #a7b1bd;
  --muse-color-brand-gray-20: #d0d4d9;
  --muse-color-brand-gray-15: #e1e6eb;
  --muse-font-family-default: Inter, system-ui, -apple-system, sans-serif;
}

html {
  font-size: 10px;
}

@media (max-width: 768px) {
  html,
  body {
    overflow-x: clip;
  }
}

html.story-is-booting,
html.story-is-booting body {
  overflow: hidden;
}

.story-boot {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.4rem;
  background: rgb(0 0 0 / 0.65);
  backdrop-filter: blur(4px);
  touch-action: none;
}

.story-boot[hidden] {
  display: none;
}

.story-boot__panel {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1.2rem;
  width: min(28rem, calc(100vw - 4.8rem));
}

.story-boot__label {
  margin: 0;
  font-family: var(--muse-font-family-default);
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  color: var(--muse-color-brand-white);
}

.story-boot__track {
  overflow: hidden;
  height: 0.4rem;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.24);
}

.story-boot__bar {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--muse-color-brand-medium-blue-40);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.18s ease;
}

@media (prefers-reduced-motion: reduce) {
  .story-boot__bar {
    transition: none;
  }
}

.story-skip {
  position: absolute;
  left: 1rem;
  top: 1rem;
  z-index: 1000;
  padding: 0.5rem 1rem;
  background: var(--muse-color-brand-white);
  color: var(--muse-color-brand-midnight);
  font-weight: 600;
  text-decoration: none;
  border-radius: 4px;
  transform: translateY(-150%);
  transition: transform 0.15s ease;
}

.story-skip:focus {
  transform: translateY(0);
  outline: 2px solid var(--muse-color-brand-medium-blue-40);
  outline-offset: 2px;
}

.story-toolbar-cta {
  --story-toolbar-cta-gap: 40px;
  --story-toolbar-cta-copy-gap: 8px;
  --story-toolbar-cta-graphic-width: 270px;
  --story-toolbar-cta-graphic-height: 154px;
  --story-toolbar-cta-max-width: 792px;
  --story-toolbar-cta-toolbar-gap: 40px;
  --story-toolbar-cta-section-gap: 200px;

  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--story-toolbar-cta-gap);
  width: 100%;
  max-width: var(--story-toolbar-cta-max-width);
  margin: var(--story-toolbar-cta-section-gap) auto var(--story-toolbar-cta-toolbar-gap);
  padding-inline: clamp(1rem, 4vw, 2.625rem);
  text-align: center;
}

.story-toolbar-cta__graphic {
  flex-shrink: 0;
  width: var(--story-toolbar-cta-graphic-width);
  height: var(--story-toolbar-cta-graphic-height);
  overflow: hidden;
}

.story-toolbar-cta__graphic img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.story-toolbar-cta__copy {
  display: flex;
  flex-direction: column;
  gap: var(--story-toolbar-cta-copy-gap);
  width: 100%;
}

.story-toolbar-cta__heading {
  margin: 0;
}

.story-toolbar-cta__subtext {
  margin: 0;
  color: #000;
  font-size: var(--stat-desc-desktop-font-size);
  font-weight: 400;
  line-height: 1.25;
}

.story-toolbar-cta__link {
  color: inherit;
  font-weight: inherit;
  text-decoration: none;
}

.story-toolbar-cta__link:hover {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.story-toolbar-cta__link:focus-visible {
  outline: 2px solid var(--color-accent, #0a60ff);
  outline-offset: 2px;
  border-radius: 2px;
}

@media (max-width: 768px) {
  .story-toolbar-cta {
    --story-toolbar-cta-section-gap: 100px;
  }

  .story-toolbar-cta .story-lead {
    font-size: var(--stat-value-mobile-font-size);
    letter-spacing: -0.4px;
  }

  .story-toolbar-cta__subtext {
    font-size: var(--stat-desc-mobile-font-size);
  }
}

.story-toolbar-cta + .story-toolbar {
  padding-top: 0;
}

.story-toolbar {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: center;
  width: 100%;
  flex-shrink: 0;
  padding: 1.6rem clamp(1rem, 4vw, 2.625rem);
  padding-bottom: max(1.6rem, env(safe-area-inset-bottom));
  pointer-events: auto;
}

.story-toolbar.actions-bar {
  width: 100%;
  max-width: none;
}

.story-toolbar .actions-bar__inner {
  justify-content: center;
  width: 100%;
  max-width: 144rem;
  margin: 0 auto;
}
