.savings-scenes {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: clamp(880px, 66vw, 1040px);
  gap: 48px;
  padding: 58px 24px 40px;
  color: #fff;
  text-align: center;
  background: var(--forest);
  overflow: hidden;
}
.savings-scenes::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, #111d29a6 0%, #111d294d 33%, #111d291a 60%, #111d2973 100%);
  pointer-events: none;
}
.goals-intro {
  grid-row: 1;
  max-width: 760px;
  margin-inline: auto;
}
.goals-intro h2 {
  font-size: clamp(40px, 4.4vw, 64px);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.055em;
}
.goals-intro p {
  max-width: 590px;
  margin: 23px auto 29px;
  font-size: 18px;
  line-height: 1.45;
}
.goals-intro .button {
  min-height: 46px;
  padding: 12px 26px;
  font-size: 14px;
}
.goal-scene {
  grid-area: 2 / 1;
  display: grid;
  place-items: center;
  min-height: 380px;
}
.goal-scene[hidden],
.goal-controls[hidden] {
  display: none;
}
.goal-backdrop {
  position: absolute;
  inset: 0;
  z-index: -2;
}
.goal-backdrop img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
[data-goal-scene="adventure"] .goal-backdrop img { object-position: 60% center; }
.goal-card {
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  width: 300px;
  min-height: 352px;
  padding: 29px 28px 25px;
  border: 1px solid #ffffffb3;
  border-radius: 19px;
  background: #16262445;
  box-shadow: 0 12px 48px #1020260d;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.goal-symbol {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 24px;
  border: 1px solid #ffffff6b;
  border-radius: 50%;
  background: #ffffff14;
}
.goal-symbol svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.goal-name {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
}
.goal-amount {
  margin-top: 7px;
  font-size: 44px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.goal-target {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.5;
}
.goal-progress {
  appearance: none;
  display: block;
  width: 100%;
  height: 4px;
  margin-top: 25px;
  border: 0;
  border-radius: 10px;
  overflow: hidden;
  background: #ffffff40;
  color: #fff;
}
.goal-progress::-webkit-progress-bar { background: #ffffff40; }
.goal-progress::-webkit-progress-value { background: #fff; border-radius: 10px; }
.goal-progress::-moz-progress-bar { background: #fff; border-radius: 10px; }
.goal-plan {
  display: flex;
  justify-content: space-between;
  width: 100%;
  margin-top: 24px;
  font-size: 12px;
  line-height: 1.5;
}
.goal-plan b { font-weight: 500; }
.goal-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
}
.goal-tabs button {
  min-height: 44px;
  padding: 9px 23px;
  border: 1.5px solid #fff;
  border-radius: 99px;
  background: #15262024;
  color: #fff;
  font-size: 15px;
  line-height: 1.25;
}
.goal-tabs button:hover { background: #ffffff26; }
.goal-tabs button[aria-selected="true"] {
  color: #242923;
  background: #fff;
}
.goal-tabs button:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 5px;
}
.goal-status:not(.is-error) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.goal-status.is-error {
  position: absolute;
  bottom: 100px;
  left: 24px;
  right: 24px;
  margin: auto;
  max-width: 500px;
  padding: 10px 15px;
  border-radius: 10px;
  background: #20392fe6;
  font-size: 13px;
}
@media (max-width: 700px) {
  .savings-scenes {
    min-height: 830px;
    gap: 38px;
    padding: 44px 16px 32px;
  }
  .goals-intro h2 { font-size: clamp(37px, 9.5vw, 49px); }
  .goals-intro p { margin: 20px auto 24px; font-size: 16px; max-width: 32ch; }
  .goal-scene { min-height: 340px; }
  .goal-card { align-self: end; width: min(280px, 100%); min-height: 330px; padding: 26px; }
  .goal-amount { font-size: 41px; }
  .goal-tabs { gap: 7px; }
  .goal-tabs button { padding: 9px 12px; font-size: 13px; }
  [data-goal-scene="adventure"] .goal-backdrop img { object-position: center; }
  [data-goal-scene="adventure"] .goal-card { transform: translateY(24px); }
  [data-goal-scene="home"] .goal-backdrop img { object-position: 60% center; }
  [data-goal-scene="rain"] .goal-backdrop img { object-position: 60% center; }
}
@media (max-width: 360px) {
  .goal-tabs { gap: 5px; }
  .goal-tabs button { font-size: 12px; padding-inline: 10px; }
}

.goal-scene:focus-visible { outline: none; }
.goal-scene:focus-visible .goal-card { outline: 2px solid #fff; outline-offset: 6px; }

.goal-controls {
  grid-row: 3;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
@media (max-width: 700px) {
  .goal-controls { gap: 8px; }
  .goal-tabs { gap: 6px; }
  .goal-tabs button { padding-inline: 10px; }
}
@media (max-width: 380px) {
  .goal-tabs button { font-size: 12px; padding-inline: 8px; }
}

/* The card stays centred on every width; on phones the human moment sits above it. */
@media (max-width: 700px) {
  main > .savings-scenes.story { min-height: 960px; }
  .goal-backdrop { bottom: auto; height: 660px; }
  .savings-scenes::after { background: linear-gradient(180deg, #111d2980 0%, #111d2920 32%, #20392f00 43%, var(--forest) 68%); }
  .goal-scene { min-height: 530px; }
  .goal-card { min-height: 240px; background: #17352dcc; }
  .goal-symbol { display: none; }
  [data-goal-scene="adventure"] .goal-card { transform: none; }
  [data-goal-scene="adventure"] .goal-backdrop img { object-position: 65% center; }
}
