/* ============================================================
   Problem page — "The Hard Parts of Growing Older"
   Premium healthcare infographic. Builds on css/style.css tokens.
   ============================================================ */
:root {
  --orange: #ef8c43;
  --orange-deep: #d9762e;
  --orange-soft: #fbe0cc;
  --night: #1b2a44;
  --soft: #f6f8fb;
}

/* Soft blue-gradient backdrop for the whole poster */
.page {
  background: linear-gradient(180deg, #ffffff 0%, #f3f7fb 42%, #eef4fa 100%);
}
.panel {
  background: transparent;
}

.problem {
  width: min(100% - 2 * var(--gutter), var(--content));
  margin-inline: auto;
  padding-block: 8px 72px;
}

/* active nav state */
.nav__link--active {
  color: var(--teal-deep);
  font-weight: 600;
}

/* ============================================================
   OPENING BANNER
   ============================================================ */
.prob-hero {
  padding: 24px 0 8px;
}

.prob-hero__banner {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-3xl);
  background: #fff;
  box-shadow: var(--shadow-card);
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas:
    "center center"
    "left right";
}

.prob-hero__media {
  position: relative;
  margin: 0;
  overflow: hidden;
  min-height: 150px;
}
.prob-hero__media--left {
  grid-area: left;
}
.prob-hero__media--right {
  grid-area: right;
}
.prob-hero__media img {
  position: absolute;
  inset: 0;
  height: 100%;
  width: 100%;
  object-fit: cover;
  object-position: center;
}

.prob-hero__center {
  grid-area: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 30px 22px 26px;
}
.prob-hero__title {
  margin: 12px auto 0;
  max-width: 18ch;
  font-size: 27px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--navy-ink);
  text-wrap: balance;
}
.prob-hero__title .accent {
  color: var(--orange-deep);
}
.prob-hero__connector {
  width: min(340px, 86%);
  height: auto;
  margin: 12px auto 14px;
  display: block;
}
/* the connector heart beats — love & worry across the distance */
.conn-heart {
  transform-box: fill-box;
  transform-origin: center;
  animation: heartbeat 2.6s ease-in-out infinite;
}
@keyframes heartbeat {
  0% {
    transform: scale(1);
  }
  10% {
    transform: scale(1.22);
  }
  20% {
    transform: scale(1);
  }
  30% {
    transform: scale(1.16);
  }
  42%,
  100% {
    transform: scale(1);
  }
}
.prob-hero__intro {
  margin: 0 auto;
  max-width: 56ch;
  font-size: 13px;
  line-height: 1.65;
  color: var(--muted);
}

/* ============================================================
   STORY CARDS
   ============================================================ */
.story-grid {
  margin-top: 36px;
  display: grid;
  gap: 22px;
  grid-template-columns: 1fr;
}

.story-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--r-3xl);
  background: #fff;
  box-shadow: 0 1px 0 rgba(2, 43, 91, 0.05), var(--shadow-float);
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}
.story-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 1px 0 rgba(2, 43, 91, 0.05), var(--shadow-card);
}

.story-card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  width: 100%;
  overflow: hidden;
  background: #eaf1f6;
}
.story-card__media img,
.story-card__media svg {
  position: absolute;
  inset: 0;
  height: 100%;
  width: 100%;
  object-fit: cover;
  object-position: center top;
}
.scene--cool {
  background: #eaf1f6;
}
.scene--warm {
  background: #fbf2e9;
}

.story-card__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px 22px 24px;
}

.story-card__title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--navy-ink);
}
.story-card__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 26px;
  width: 26px;
  flex-shrink: 0;
  border-radius: var(--r-full);
  background: var(--teal-deep);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

/* Big single statistic */
.stat-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 10px;
}
.stat-big {
  font-size: 40px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--navy-ink);
}
.stat-caption {
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted);
}
.stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  width: 34px;
  border-radius: var(--r-full);
  background: var(--orange-soft);
  color: var(--orange-deep);
}
.stat-icon svg {
  height: 19px;
  width: 19px;
}

.story-card__lead {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--navy-ink);
}

/* Circular gauge */
.metric {
  display: flex;
  align-items: center;
  gap: 12px;
}
.gauge {
  position: relative;
  height: 54px;
  width: 54px;
  flex-shrink: 0;
}
.gauge svg {
  height: 100%;
  width: 100%;
  transform: rotate(-90deg);
}
.gauge__track {
  fill: none;
  stroke: #edeff2;
  stroke-width: 3.4;
}
.gauge__bar {
  fill: none;
  stroke: var(--orange);
  stroke-width: 3.4;
  stroke-linecap: round;
}
.gauge__num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: var(--navy-ink);
}
.metric__text {
  font-size: 13.5px;
  color: var(--muted);
}

/* Mini infographic row (icon + caption) */
.mini {
  display: flex;
  align-items: center;
  gap: 10px;
}
.mini__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  width: 34px;
  flex-shrink: 0;
  border-radius: 11px;
  background: rgba(45, 140, 140, 0.13);
  color: var(--teal-deep);
}
.mini__icon svg {
  height: 18px;
  width: 18px;
}
.mini__text {
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--muted);
}

/* Stacked stat rows (cards 2 & 6) */
.stat-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.stat-rows li {
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 14px;
  background: var(--soft);
  padding: 10px 13px;
}
.stat-rows__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  width: 36px;
  flex-shrink: 0;
  border-radius: 11px;
  background: rgba(45, 140, 140, 0.13);
  color: var(--teal-deep);
}
.stat-rows__icon svg {
  height: 19px;
  width: 19px;
}
.stat-rows__icon--alert {
  background: var(--orange-soft);
  color: var(--orange-deep);
}
.stat-rows__num {
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--navy-ink);
  flex-shrink: 0;
}
.stat-rows__num--sm {
  font-size: 17px;
  min-width: 84px;
}
.stat-rows__text {
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--muted);
}
.stat-rows--compact li {
  padding: 8px 12px;
}

/* Fall → Fear → … steps */
.steps {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.steps__item {
  display: flex;
}
.steps__dot {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 48px;
  width: 66px;
  padding: 6px;
  border-radius: 12px;
  background: #eef2f7;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.15;
  color: var(--navy-ink);
}
.steps__dot--risk {
  background: var(--orange-soft);
  color: var(--orange-deep);
}
.steps__arrow {
  color: var(--hair);
  font-size: 14px;
}

/* Provider hub + map illustrations */
.hub,
.map {
  display: flex;
  justify-content: center;
}
.hub svg {
  width: 100%;
  max-width: 250px;
  height: auto;
}
.map svg {
  width: 100%;
  max-width: 280px;
  height: auto;
}

/* Daily-gap taglets */
.taglets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.taglets li {
  border-radius: var(--r-full);
  background: var(--frame-soft);
  padding: 6px 13px;
  font-size: 12px;
  font-weight: 600;
  color: var(--navy-ink);
}

/* ============================================================
   CONNECTING THE DOTS
   ============================================================ */
.connect {
  margin-top: 52px;
  border-radius: var(--r-3xl);
  background: linear-gradient(180deg, #ffffff, #f6f9fc);
  box-shadow: 0 1px 0 rgba(2, 43, 91, 0.05), var(--shadow-card);
  padding: 40px 24px 44px;
  text-align: center;
}
.connect__heading {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--navy-ink);
}

.flow {
  margin: 28px auto 0;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: center;
  gap: 6px 4px;
  max-width: 920px;
  list-style: none;
  padding: 0;
}
.flow__node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 96px;
}
.flow__tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 56px;
  width: 56px;
  border-radius: 18px;
}
.flow__tile[data-tone="cool"] {
  background: linear-gradient(135deg, var(--teal-card), var(--teal-mist));
  color: var(--teal-deep);
}
.flow__tile[data-tone="warm"] {
  background: linear-gradient(135deg, var(--orange-soft), #fff0e2);
  color: var(--orange-deep);
}
.flow__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--navy-ink);
}
.flow__sep {
  align-self: center;
  margin-top: 14px;
  color: var(--hair);
  font-size: 18px;
}

/* ---- Motion: the flow comes alive ---- */
/* tiles bob + lift in a staggered wave */
@keyframes tile-float {
  0%,
  100% {
    transform: translateY(0) scale(1);
    box-shadow: 0 6px 14px -10px rgba(2, 43, 91, 0.25);
  }
  50% {
    transform: translateY(-9px) scale(1.06);
    box-shadow: 0 16px 28px -12px rgba(2, 43, 91, 0.4);
  }
}
.flow__tile {
  animation: tile-float 2.8s var(--ease-out) infinite;
}
.flow > li:nth-child(1) .flow__tile {
  animation-delay: 0ms;
}
.flow > li:nth-child(3) .flow__tile {
  animation-delay: 160ms;
}
.flow > li:nth-child(5) .flow__tile {
  animation-delay: 320ms;
}
.flow > li:nth-child(7) .flow__tile {
  animation-delay: 480ms;
}
.flow > li:nth-child(9) .flow__tile {
  animation-delay: 640ms;
}
.flow > li:nth-child(11) .flow__tile {
  animation-delay: 800ms;
}

/* the icon inside each tile drifts opposite for a lively parallax */
@keyframes icon-nudge {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(2px);
  }
}
.flow__tile .icon {
  animation: icon-nudge 2.8s var(--ease-out) infinite;
}

/* arrows pulse + travel toward the orb */
@keyframes arrow-travel {
  0% {
    opacity: 0.2;
    transform: translateX(-4px);
  }
  50% {
    opacity: 1;
    transform: translateX(4px);
  }
  100% {
    opacity: 0.2;
    transform: translateX(-4px);
  }
}
.flow__sep {
  animation: arrow-travel 1.8s ease-in-out infinite;
}
.flow > li:nth-child(2) {
  animation-delay: 0ms;
}
.flow > li:nth-child(4) {
  animation-delay: 150ms;
}
.flow > li:nth-child(6) {
  animation-delay: 300ms;
}
.flow > li:nth-child(8) {
  animation-delay: 450ms;
}
.flow > li:nth-child(10) {
  animation-delay: 600ms;
}

/* the down-arrow bobs into the orb */
@keyframes down-bob {
  0%,
  100% {
    transform: translateY(-3px);
    opacity: 0.65;
  }
  50% {
    transform: translateY(4px);
    opacity: 1;
  }
}
.converge-arrow svg {
  animation: down-bob 1.8s ease-in-out infinite;
}

.converge-arrow {
  margin-top: 20px;
  display: flex;
  justify-content: center;
}
.converge-arrow svg {
  height: 34px;
  width: 34px;
}

.converge {
  margin-top: 8px;
  display: flex;
  justify-content: center;
}
.converge__orb {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 178px;
  width: 178px;
  border-radius: var(--r-full);
  background: radial-gradient(circle at 50% 38%, #1c4a7e, var(--navy-deep) 72%);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  box-shadow: 0 0 0 10px rgba(239, 140, 67, 0.12),
    0 0 60px -6px rgba(239, 140, 67, 0.55),
    0 24px 50px -18px rgba(2, 43, 91, 0.5);
  animation: orb-pulse 3.2s var(--ease-out) infinite;
}
@keyframes orb-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 10px rgba(239, 140, 67, 0.12),
      0 0 50px -8px rgba(239, 140, 67, 0.45),
      0 24px 50px -18px rgba(2, 43, 91, 0.5);
  }
  50% {
    box-shadow: 0 0 0 16px rgba(239, 140, 67, 0.16),
      0 0 80px -4px rgba(239, 140, 67, 0.7),
      0 24px 50px -18px rgba(2, 43, 91, 0.5);
  }
}

.closing {
  margin: 32px auto 0;
  max-width: 62ch;
  font-size: 16px;
  line-height: 1.7;
  font-weight: 500;
  color: var(--navy-ink);
  text-wrap: balance;
}
.closing__cta {
  margin-top: 28px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (min-width: 560px) {
  /* cards become horizontal: image left, content right */
  .story-card {
    flex-direction: row;
  }
  .story-card__media {
    aspect-ratio: auto;
    width: 42%;
    flex-shrink: 0;
    align-self: stretch;
    min-height: 230px;
  }
  .story-card__body {
    width: 58%;
  }
}

@media (min-width: 640px) {
  .prob-hero__title {
    font-size: 34px;
  }
  .prob-hero__intro {
    font-size: 14px;
  }
  .connect__heading {
    font-size: 26px;
  }
}

@media (min-width: 1024px) {
  .problem {
    padding-bottom: 96px;
  }

  /* 3-column banner with photos flanking the centered text */
  .prob-hero__banner {
    grid-template-columns: 1.05fr 1.5fr 1.05fr;
    grid-template-areas: "left center right";
    min-height: 392px;
  }
  .prob-hero__media {
    min-height: 0;
  }
  /* fade the inner edge of each photo into the white center */
  .prob-hero__media--left::after,
  .prob-hero__media--right::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
  }
  .prob-hero__media--left::after {
    background: linear-gradient(to right, transparent 58%, #fff);
  }
  .prob-hero__media--right::after {
    background: linear-gradient(to left, transparent 58%, #fff);
  }
  .prob-hero__title {
    font-size: 38px;
  }

  .story-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 1fr; /* every card the same height */
  }

  .connect {
    padding: 52px 40px 56px;
  }
  .converge__orb {
    height: 200px;
    width: 200px;
    font-size: 18px;
  }
  .closing {
    font-size: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .converge__orb {
    animation: none;
  }
}
