/* Keep section content centered; the atmosphere crosses the section boundary. */
.tools-section, .closing-section {
  --tools-dusk-height: clamp(240px, 36svh, 360px);
  --tools-gradient-overlap: clamp(96px, 14svh, 128px);
  --tools-dusk: #2a3550;
  --tools-paper: var(--night, #fffcf5);
  --tools-day-start: var(--sea-sand, #fff3d6);
  --tools-night-gradient: linear-gradient(180deg,
    var(--tools-paper) 0%, #f7f9f8 8%, #e3ecf2 20%, #c3d4e2 34%,
    #91abc4 50%, #617e9f 66%, #3d536f 82%, #2d3b55 94%, var(--tools-dusk) 100%);
}
main > .tools-section {
  padding-block: clamp(24px, 4svh, 48px);
  background-color: var(--tools-paper);
  background-image: linear-gradient(180deg, var(--tools-day-start), var(--tools-paper));
  background-size: 100% 30%;
  background-position: center top;
  background-repeat: no-repeat;
}
.tools-section::after, .closing-section::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  pointer-events: none;
  background-image: var(--tools-night-gradient);
  background-size: 100% var(--tools-dusk-height);
  background-repeat: no-repeat;
}
.tools-section::after {
  z-index: -1;
  bottom: 0;
  height: calc(var(--tools-dusk-height) - var(--tools-gradient-overlap));
  background-position: center top;
}
.closing-section::after {
  z-index: -2;
  top: 0;
  height: var(--tools-gradient-overlap);
  background-position: center bottom;
}
main > .closing-section {
  padding-top: calc(var(--tools-gradient-overlap) + 24px);
}
.tools-section > .shell {
  position: relative;
  z-index: 1;
}
.tools-section .note {
  color: var(--ink);
  opacity: 1;
}

/* Secondary screens use the same calm color changes as the main scene. */
.feature-section :is(.feature-options button, .screen-switch button),
.story-section :is(.story-choice button, .story-choice .story-action),
.tools-section .apps-scroll-buttons button,
.closing-section :is(summary, a),
.info-page :is(a, .button),
.info-sea > .footer a {
  transition:
    color 220ms ease,
    background-color 220ms ease,
    border-color 220ms ease,
    box-shadow 220ms ease,
    transform 220ms ease;
}

@media (prefers-reduced-motion: reduce) {
  .feature-section :is(.feature-options button, .screen-switch button),
  .story-section :is(.story-choice button, .story-choice .story-action),
  .tools-section .apps-scroll-buttons button,
  .closing-section :is(summary, a),
  .info-page :is(a, .button),
  .info-sea > .footer a {
    transition: none;
  }
}

/* Reuse the hero moon so the closing section belongs to the same illustration set. */
.closing-section::before {
  width: clamp(96px, 10vw, 144px);
  border-radius: 0;
  background: url("assets/haedal-day-night-atlas-v5.png") right center / 200% 100% no-repeat;
  box-shadow: none;
  opacity: .86;
  filter: drop-shadow(0 0 22px #f1c67833);
}
