/* A new chapter link must interrupt an earlier native fragment jump. */
html:has(.morning-story__chapter:target) { scroll-behavior: auto; }
/* On the first chapter the tour bar must meet the bottom of the site header. */
html:has(.morning-story #app:target) { scroll-padding-top: var(--header-height); }

/* A single studio surface lets the color come from the actual app. */
.morning-story {
  --story-paper: #fafbfc;
  --story-ink: #1e2228;
  --story-muted: #515962;
  --story-rule: #d8dce1;
  --story-bar: 62px;
  color: var(--story-ink);
  background: var(--story-paper);
}
.morning-story__nav {
  position: sticky;
  top: var(--header-height);
  z-index: 9;
  background: var(--story-paper);
  border-block: 1px solid var(--story-rule);
}
.morning-story__nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--story-bar);
  gap: 20px;
}
.morning-story .morning-story__preview {
  margin: 0;
  color: var(--story-muted);
  font-size: .82rem;
  font-weight: 600;
}
.morning-story__links {
  display: flex;
  gap: clamp(18px, 3vw, 42px);
  align-items: stretch;
}
.morning-story__links a {
  position: relative;
  display: grid;
  place-items: center;
  min-height: var(--story-bar);
  color: var(--story-muted);
  font-size: .88rem;
  font-weight: 590;
  text-decoration: none;
  white-space: nowrap;
}
.morning-story__links a::after {
  position: absolute;
  bottom: -1px;
  inset-inline: 0;
  height: 2px;
  background: var(--story-ink);
  content: "";
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .32s cubic-bezier(.22,.7,.28,1);
}
.morning-story__links a:hover, .morning-story__links a[aria-current] { color: var(--story-ink); }
.morning-story__links a[aria-current]::after, .morning-story__links a:focus-visible::after { transform: scaleX(1); }
.morning-story__stage[hidden] { display: none; }
.morning-story__chapter {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  column-gap: clamp(40px, 7vw, 100px);
  padding-block: clamp(52px, 7vw, 100px);
  border-bottom: 1px solid var(--story-rule);
  scroll-margin-top: var(--story-bar);
}
.morning-story__chapter:last-child { border: 0; }
.morning-story__copy { max-width: 33rem; }
.morning-story .morning-story__feature {
  margin: 0 0 22px;
  color: #4e616d;
  font-size: .9rem;
  font-weight: 670;
  letter-spacing: -.02em;
}
.morning-story .morning-story__copy h2 {
  margin: 0;
  color: var(--story-ink);
  font-size: clamp(2.8rem, 4.7vw, 4.9rem);
  font-weight: 710;
  letter-spacing: -.067em;
  line-height: 1.15;
  word-break: keep-all;
}
.morning-story__copy h2 + p {
  margin: clamp(20px, 2.2vw, 30px) 0 0;
  max-width: 27em;
  color: var(--story-muted);
  font-size: clamp(1rem, 1.35vw, 1.17rem);
  line-height: 1.8;
  letter-spacing: -.027em;
  word-break: keep-all;
}
.morning-story__inline { margin: 0; display: grid; justify-items: center; }
.morning-story__device {
  position: relative;
  box-sizing: content-box;
  width: clamp(205px, 19vw, 275px);
  aspect-ratio: 744 / 1618;
  border-radius: 15% / 7%;
  border: 4px solid #23252a;
  overflow: hidden;
  isolation: isolate;
  background: #edf0f4;
  box-shadow: 0 0 0 1px #95999e, 0 18px 30px -19px #18263d59, 0 36px 54px -30px #18263d4a;
}
.morning-story__device img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
/* Without JavaScript the same content reads as three illustrated chapters. */
@media (min-width: 880px) and (min-height: 520px) {
  .morning-story[data-enhanced] .morning-story__layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
    gap: clamp(40px, 7vw, 102px);
  }
  .morning-story[data-enhanced] .morning-story__stage {
    position: sticky;
    top: calc(var(--header-height) + var(--story-bar));
    display: grid;
    place-items: center;
    height: calc(100svh - var(--header-height) - var(--story-bar));
    max-height: 790px;
  }
  .morning-story__stage .morning-story__device {
    width: min(28vw, calc((100svh - var(--header-height) - var(--story-bar) - 64px) * .46), 303px);
  }
  .morning-story[data-enhanced] .morning-story__chapter {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    min-height: min(790px, calc(100svh - var(--header-height) - var(--story-bar)));
    padding-block: 38px;
  }
  .morning-story[data-enhanced] .morning-story__inline { display: none; }
  .morning-story__stage img {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: translateY(11px) scale(.99);
    transition: opacity .38s, transform .58s cubic-bezier(.22,.82,.24,1);
  }
  .morning-story__stage img[data-active] {
    opacity: 1;
    transform: translateY(0) scale(1);
    z-index: 1;
  }
}
@media (max-width: 879px) {
  .morning-story { --story-bar: 51px; }
  .morning-story__nav-inner { gap: 10px; }
  .morning-story__links { gap: clamp(12px, 3vw, 26px); }
  .morning-story__links a { font-size: .82rem; }
  .morning-story__chapter { grid-template-columns: 1fr .84fr; column-gap: 22px; }
  .morning-story .morning-story__copy h2 { font-size: clamp(2.25rem, 5vw, 3.1rem); }
}
@media (max-width: 580px) {
  .morning-story__nav-inner { flex-direction: column; gap: 0; align-items: stretch; }
  .morning-story .morning-story__preview { padding-top: 8px; font-size: .71rem; }
  .morning-story__links { gap: 24px; }
  .morning-story__links a { min-height: 40px; }
  .morning-story__chapter { grid-template-columns: 1fr; gap: 30px; padding: 42px 0 52px; scroll-margin-top: 68px; }
  .morning-story__copy { max-width: 29rem; }
  .morning-story .morning-story__feature { margin-bottom: 10px; font-size: .82rem; }
  .morning-story .morning-story__copy h2 { font-size: clamp(2.15rem, 8.5vw, 3.3rem); }
  .morning-story__copy h2 + p { margin-top: 14px; font-size: .98rem; line-height: 1.68; }
  .morning-story__device { width: clamp(205px, 58vw, 248px); }
}
/* Handheld chapters keep their own screen in the reading order. */
@media (max-width: 879px) and (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .morning-story__inline .morning-story__device {
      animation: morning-screen-arrival linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 92%;
    }
  }
}
@keyframes morning-screen-arrival {
  from { transform: translateY(18px) scale(.955); }
  to { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .morning-story__links a::after,
  .morning-story__stage img { transition: none; transform: none; }
  .morning-story__links a:not([aria-current])::after { visibility: hidden; }
}
@media print {
  .morning-story__nav, .morning-story__stage { display: none !important; }
  .morning-story[data-enhanced] .morning-story__layout { display: block; }
  .morning-story[data-enhanced] .morning-story__inline { display: grid; }
  .morning-story__chapter { break-inside: avoid; }
}
