.color-story {
  --color-story-surface: var(--surface-iphone, #f5f5f7);
  --color-story-paper: #ffffff;
  --color-story-ink: #0d0d0f;
  --color-story-muted: #6c6c74;
  --color-story-faint: #9a9aa2;
  --color-story-gutter: clamp(24px, 4.2vw, 72px);
  --color-story-top: clamp(20px, 2.4vw, 38px);
  --color-story-ease: cubic-bezier(.22, .76, .2, 1);
  --color-story-speed: 420ms;
  --color-story-body: clamp(14px, 1.12vw, 20px);
  --color-story-label: clamp(9px, .68vw, 11px);
  position: relative;
  display: block !important;
  width: 100%;
  min-height: 300svh !important;
  padding: 0 !important;
  overflow: visible !important;
  color: var(--color-story-ink);
  background: var(--color-story-surface) !important;
  isolation: isolate;
}

.color-story *,
.color-story *::before,
.color-story *::after {
  box-sizing: border-box;
}

.color-story__sticky {
  position: sticky;
  top: 0;
  height: 100svh;
  min-height: 650px;
  overflow: hidden;
  padding: var(--color-story-top) var(--color-story-gutter) clamp(22px, 3vw, 44px);
  background: var(--color-story-surface);
}

.color-story__masthead {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  min-height: 54px;
  text-transform: uppercase;
}

.color-story__eyebrow,
.color-story__status,
.color-story__act-no,
.color-story__source figcaption,
.color-story__palette-group header p {
  margin: 0;
  font-size: var(--color-story-label);
  line-height: 1.25;
  letter-spacing: .16em;
}

.color-story__eyebrow {
  font-weight: 700;
}

.color-story__status {
  margin-top: 4px;
  color: var(--color-story-muted);
}

.color-story__steps {
  display: flex;
  align-items: flex-start;
  gap: clamp(14px, 2.4vw, 38px);
}

.color-story__steps button {
  appearance: none;
  display: inline-flex;
  gap: 7px;
  align-items: baseline;
  margin: 0;
  padding: 3px 0;
  border: 0;
  border-radius: 0;
  color: var(--color-story-muted);
  background: transparent;
  font: inherit;
  font-size: var(--color-story-label);
  letter-spacing: .08em;
  cursor: pointer;
  transition: color 180ms ease, transform 180ms var(--color-story-ease);
}

.color-story__steps button span {
  color: var(--color-story-faint);
  font-variant-numeric: tabular-nums;
}

.color-story__steps button:hover,
.color-story__steps button:focus-visible {
  color: var(--color-story-ink);
  transform: scale(1.035);
}

.color-story__steps button:focus-visible {
  outline: 1px solid currentColor;
  outline-offset: 5px;
}

.color-story__steps button[aria-current='step'] {
  color: var(--color-story-ink);
  font-weight: 700;
}

.color-story__stage {
  position: absolute;
  inset: clamp(84px, 9.4vh, 112px) var(--color-story-gutter) clamp(26px, 4.2vh, 54px);
}

.color-story__act {
  position: absolute;
  inset: 0;
  display: grid;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate3d(0, 4vh, 0) scale(.975);
  transform-origin: center center;
  transition:
    opacity var(--color-story-speed) ease,
    transform calc(var(--color-story-speed) + 80ms) var(--color-story-ease),
    visibility 0s linear var(--color-story-speed);
}

.color-story__act.is-current {
  z-index: 2;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate3d(0, 0, 0) scale(1);
  transition-delay: 70ms, 0ms, 0s;
}

.color-story__act.is-past {
  transform: translate3d(0, -3.2vh, 0) scale(.985);
}

.color-story__act--understanding {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: minmax(0, 1fr) auto;
  column-gap: clamp(18px, 2.3vw, 38px);
  row-gap: clamp(14px, 2vh, 24px);
}

.color-story__copy {
  grid-column: 1 / span 4;
  align-self: center;
  max-width: 520px;
}

.color-story__act-no {
  margin-bottom: clamp(14px, 2vh, 24px);
  color: var(--color-story-muted);
}

.color-story__copy h2,
.color-story__palette-heading h2 {
  margin: 0;
  font-size: clamp(36px, 4vw, 68px);
  line-height: .98;
  font-weight: 500;
  letter-spacing: -.045em;
}

.color-story__copy h3 {
  margin: clamp(18px, 2.8vh, 34px) 0 0;
  font-size: clamp(20px, 1.8vw, 30px);
  line-height: 1.18;
  font-weight: 500;
  letter-spacing: -.02em;
}

.color-story__copy > p:last-child,
.color-story__palette-heading > p {
  margin: clamp(18px, 3vh, 36px) 0 0;
  max-width: 44ch;
  color: #3d3d43;
  font-size: var(--color-story-body);
  line-height: 1.5;
}

.color-story__source {
  margin: 0;
  min-width: 0;
}

.color-story__source img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.color-story__source figcaption {
  margin-top: 8px;
  color: var(--color-story-muted);
}

.color-story__source--mood {
  grid-column: 5 / -1;
  align-self: center;
  height: min(55vh, 590px);
}

.color-story__pantones {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(10px, 1.4vw, 22px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.color-story__pantone {
  display: grid;
  grid-template-columns: 9px 24px minmax(0, 1fr);
  grid-template-areas: 'sample index name' 'sample index code';
  align-items: start;
  column-gap: 8px;
  min-width: 0;
}

.color-story__pantone-sample {
  grid-area: sample;
  width: 9px;
  height: 31px;
  background: var(--pantone-tone);
}

.color-story__pantone-index {
  grid-area: index;
  color: var(--color-story-faint);
  font-size: 10px;
}

.color-story__pantone strong {
  grid-area: name;
  overflow: hidden;
  font-size: 10px;
  line-height: 1.2;
  letter-spacing: .055em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.color-story__pantone small {
  grid-area: code;
  margin-top: 3px;
  color: var(--color-story-muted);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.color-story__act--range {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: minmax(0, 1fr);
  gap: clamp(18px, 2.4vw, 40px);
}

.color-story__copy--compact {
  grid-column: 1 / span 3;
  align-self: start;
  padding-top: clamp(12px, 3vh, 38px);
}

.color-story__copy--compact > p:last-child {
  max-width: 30ch;
}

.color-story__source--chart {
  grid-column: 4 / span 5;
  align-self: center;
  height: min(70vh, 720px);
}

.color-story__territories {
  grid-column: 9 / -1;
  align-self: center;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(18px, 3vh, 34px) clamp(18px, 2vw, 32px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.color-story__territory {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.color-story__territory > span {
  color: var(--color-story-faint);
  font-size: 18px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.color-story__territory strong,
.color-story__territory small {
  display: block;
}

.color-story__territory strong {
  font-size: clamp(11px, .82vw, 14px);
  line-height: 1.25;
  font-weight: 600;
}

.color-story__territory small {
  margin-top: 5px;
  color: var(--color-story-muted);
  font-size: 10px;
  line-height: 1.25;
}

.color-story__act--palette {
  grid-template-rows: auto minmax(0, 1fr);
  gap: clamp(16px, 2.4vh, 28px);
}

.color-story__palette-heading {
  display: grid;
  grid-template-columns: minmax(280px, .9fr) minmax(320px, 1.1fr);
  align-items: end;
  gap: 40px;
}

.color-story__palette-heading > p {
  justify-self: end;
  margin: 0;
  max-width: 50ch;
}

.color-story__palette-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(14px, 1.5vw, 24px);
  align-items: stretch;
  min-height: 0;
}

.color-story__palette-group {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: clamp(10px, 1.5vh, 16px);
  min-width: 0;
  padding: 0;
}

.color-story__palette-group header {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.color-story__palette-group header > span {
  color: var(--color-story-faint);
  font-size: 24px;
  line-height: 1;
}

.color-story__palette-group h3 {
  margin: 0;
  font-size: clamp(10px, .76vw, 13px);
  line-height: 1.2;
  font-weight: 600;
}

.color-story__palette-group header p {
  margin-top: 4px;
  color: var(--color-story-muted);
  letter-spacing: .08em;
}

.color-story__swatches {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: clamp(6px, .65vw, 10px);
  min-height: 0;
}

.color-story__swatch {
  display: grid;
  grid-template-rows: minmax(32px, 1fr) auto;
  min-width: 0;
  min-height: 0;
  background: var(--color-story-paper);
}

.color-story__swatch-color {
  display: block;
  min-height: 0;
  background: var(--swatch);
}

.color-story__swatch code {
  display: block;
  overflow: hidden;
  padding: 5px 4px 4px;
  color: #505057;
  background: var(--color-story-paper);
  font-family: inherit;
  font-size: clamp(6px, .5vw, 8px);
  line-height: 1;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.color-story__progress {
  position: absolute;
  right: var(--color-story-gutter);
  bottom: 12px;
  left: var(--color-story-gutter);
  height: 1px;
  margin: 0;
  overflow: hidden;
  background: transparent;
}

.color-story__progress span {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(1/3);
  transform-origin: left center;
  background: currentColor;
  transition: transform var(--color-story-speed) var(--color-story-ease);
}

.color-story > .page-no {
  position: fixed;
  right: var(--color-story-gutter);
  bottom: 8px;
  z-index: 6;
  color: var(--color-story-muted);
  font-size: var(--color-story-label);
}

@media (max-width: 1100px) {
  .color-story__copy {
    grid-column: 1 / span 5;
  }

  .color-story__source--mood {
    grid-column: 6 / -1;
  }

  .color-story__copy--compact {
    grid-column: 1 / span 4;
  }

  .color-story__source--chart {
    grid-column: 5 / span 5;
  }

  .color-story__territories {
    grid-column: 10 / -1;
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .color-story__palette-heading {
    grid-template-columns: 1fr 1fr;
  }

  .color-story__palette-grid {
    gap: 10px;
  }
}

@media (max-width: 760px) {
  .color-story {
    min-height: auto !important;
    overflow: clip !important;
  }

  .color-story__sticky {
    position: relative;
    height: auto;
    min-height: 0;
    overflow: visible;
    padding: 22px 20px 56px;
  }

  .color-story__masthead {
    display: block;
    min-height: 0;
  }

  .color-story__steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 22px;
  }

  .color-story__steps button {
    display: grid;
    justify-items: start;
    gap: 3px;
    text-align: left;
  }

  .color-story__stage {
    position: relative;
    inset: auto;
    display: grid;
    gap: 86px;
    margin-top: 56px;
  }

  .color-story__act,
  .color-story__act.is-current,
  .color-story__act.is-past,
  .color-story__act.is-next {
    position: relative;
    inset: auto;
    display: grid;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    transition: none;
  }

  .color-story__act[aria-hidden='true'] {
    visibility: visible;
  }

  .color-story__act--understanding,
  .color-story__act--range {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    gap: 28px;
  }

  .color-story__copy,
  .color-story__copy--compact,
  .color-story__source--mood,
  .color-story__source--chart,
  .color-story__pantones,
  .color-story__territories {
    grid-column: 1;
  }

  .color-story__copy,
  .color-story__copy--compact {
    padding-top: 0;
    align-self: auto;
  }

  .color-story__copy h2,
  .color-story__palette-heading h2 {
    font-size: clamp(34px, 12vw, 52px);
  }

  .color-story__copy h3 {
    font-size: 21px;
  }

  .color-story__source--mood,
  .color-story__source--chart {
    height: auto;
  }

  .color-story__source img {
    height: auto;
  }

  .color-story__pantones {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .color-story__pantone {
    grid-template-columns: 12px 28px minmax(0, 1fr);
  }

  .color-story__pantone-sample {
    width: 12px;
    height: 34px;
  }

  .color-story__territories {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .color-story__act--palette {
    gap: 34px;
  }

  .color-story__palette-heading {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 20px;
  }

  .color-story__palette-heading > p {
    justify-self: start;
  }

  .color-story__palette-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .color-story__palette-group {
    gap: 16px;
  }

  .color-story__swatches {
    min-height: 330px;
    gap: 9px;
  }

  .color-story__swatch code {
    padding: 7px 4px 6px;
    font-size: 9px;
  }

  .color-story__progress,
  .color-story > .page-no {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .color-story {
    min-height: auto !important;
  }

  .color-story__sticky {
    position: relative;
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .color-story__stage {
    position: relative;
    inset: auto;
    display: grid;
    gap: clamp(72px, 10vw, 120px);
    margin-top: 56px;
  }

  .color-story__act,
  .color-story__act.is-current,
  .color-story__act.is-past,
  .color-story__act.is-next {
    position: relative;
    inset: auto;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    transition: opacity 180ms ease;
  }

  .color-story__act[aria-hidden='true'] {
    visibility: visible;
  }

  .color-story__progress,
  .color-story > .page-no {
    display: none;
  }
}
