/* Starting a Business in Retirement — FMG CMS scrollytelling takeover */

html:has(.sbir-wrapper),
body:has(.sbir-wrapper) {
  overflow-x: clip;
}

body:has(.sbir-wrapper) {
  background: #fff !important;
}

/* Cream belongs on the piece only — not the CMS form or related content */
body:has(.sbir-wrapper) .c-matter__form-container,
body:has(.sbir-wrapper) .c-matters__container {
  background: #fff !important;
}

body:has(.sbir-wrapper) .back-to-top,
body:has(.sbir-wrapper) .c-matter__meta,
body:has(.sbir-wrapper) .c-matter__title {
  display: none !important;
}

body:has(.sbir-wrapper) .c-matter__body,
body:has(.sbir-wrapper) .c-matter--article .c-matter__body {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.sbir-wrapper {
  --sbir-paper: #f3f0e6;
  --sbir-paper-deep: #ebe6d6;
  --sbir-ink: #2f2e2a;
  --sbir-muted: #5c5a52;
  --sbir-gold: #b8913a;
  --sbir-gold-deep: #9a7428;
  --sbir-sage: #8a9a78;
  --sbir-sage-deep: #6f8160;
  --sbir-card: #faf7ef;
  --sbir-line: #d8d1c0;
  --sbir-font-display: Lora, Georgia, "Times New Roman", serif;
  --sbir-font-body: Lato, "Helvetica Neue", Arial, sans-serif;
  --sbir-max: 1120px;
  --sbir-prose: 640px;

  width: 100% !important;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  background: var(--sbir-paper);
  color: var(--sbir-ink);
  /* hidden is the fallback for Safari < 16; clip is preferred because hidden
     computes overflow-y to auto, making this a nested scroll container */
  overflow-x: hidden;
  overflow-x: clip;
  position: relative;
  box-sizing: border-box;
  font-family: var(--sbir-font-body);
}

/* Fallback: break out if the CMS article column still clamps */
.c-matter__body .sbir-wrapper {
  width: 100vw !important;
  margin-left: calc(-50vw + 50%) !important;
}

.sbir-wrapper *,
.sbir-wrapper *::before,
.sbir-wrapper *::after {
  box-sizing: border-box;
}

.sbir-wrapper img {
  max-width: 100%;
  height: auto;
  border: 0;
}

.sbir-wrapper strong,
.sbir-wrapper em,
.sbir-wrapper a,
.sbir-wrapper sup {
  color: inherit !important;
}

.sbir-inner {
  width: 100%;
  max-width: var(--sbir-max);
  margin: 0 auto;
  padding: 0 28px;
  position: relative;
  z-index: 1;
}

.sbir-glow {
  position: absolute;
  pointer-events: none;
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  z-index: 0;
}

.sbir-glow--gold {
  background-image: url("assets/glow-gold.webp");
  width: min(640px, 72vw);
  height: min(640px, 72vw);
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0.4;
}

.sbir-glow--yellow {
  background-image: url("assets/glow-yellow.webp");
  width: min(720px, 80vw);
  height: min(720px, 80vw);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.4;
}

.sbir-glow--blue {
  background-image: url("assets/glow-blue.webp");
  width: min(780px, 85vw);
  height: min(780px, 85vw);
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0.35;
}

.sbir-section {
  position: relative;
  padding: 110px 0 130px;
}

.sbir-hero {
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 96px 0 180px;
  overflow: hidden;
  isolation: isolate;
}

.sbir-hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 160px;
  pointer-events: none;
  z-index: 0;
  background: linear-gradient(to bottom, rgba(243, 240, 230, 0), var(--sbir-paper) 72%);
}

.sbir-title {
  font-family: var(--sbir-font-display) !important;
  font-size: 42px !important;
  font-weight: 500 !important;
  line-height: 1.12 !important;
  letter-spacing: -0.02em !important;
  text-align: center !important;
  color: var(--sbir-ink) !important;
  margin: 32px 0 108px !important;
}

.sbir-title span,
.sbir-title em {
  display: inline;
  font-family: inherit !important;
  font-size: inherit !important;
  font-weight: 500 !important;
  color: inherit !important;
}

.sbir-title em {
  font-style: italic !important;
}

.sbir-shops {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto 84px;
  padding: 0;
}

.sbir-shops img {
  width: 100%;
  height: auto;
  display: block;
}

.sbir-kicker-block {
  position: relative;
  margin: 18px auto 0;
  max-width: 560px;
}

.sbir-glow--golf {
  background-image: url("assets/glow-gold.webp");
  width: min(200px, 50vw);
  height: min(200px, 50vw);
  top: -48px;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0.5;
}

.sbir-golf {
  position: relative;
  z-index: 1;
  width: 40px;
  margin: 0 auto 10px;
}

.sbir-golf img {
  width: 100%;
  height: auto;
  display: block;
}

.sbir-kicker {
  font-family: var(--sbir-font-display) !important;
  font-size: 20px !important;
  font-weight: 500 !important;
  line-height: 1.4 !important;
  text-align: center !important;
  color: var(--sbir-ink) !important;
  margin: 0 auto 28px !important;
  max-width: 520px !important;
  position: relative;
  z-index: 1;
}

.sbir-down {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 8px auto 0;
  border: 1.5px solid var(--sbir-gold);
  border-radius: 50%;
  text-decoration: none !important;
  color: var(--sbir-gold) !important;
  animation: sbir-bounce 2.2s ease-in-out infinite;
}

.sbir-down span {
  display: block;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid var(--sbir-gold);
  border-bottom: 1.5px solid var(--sbir-gold);
  transform: rotate(45deg) translate(-2px, -2px);
}

@keyframes sbir-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(7px); }
}

.sbir-h2 {
  font-family: var(--sbir-font-display) !important;
  font-size: 30px !important;
  font-weight: 500 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  text-align: center !important;
  color: var(--sbir-ink) !important;
  margin: 0 0 48px !important;
}

.sbir-growth {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding-top: 140px;
  padding-bottom: 150px;
}

.sbir-growth::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: url("assets/graph-paper-sage.svg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% auto;
  opacity: 1;
}

.sbir-growth::after {
  content: none;
}

.sbir-growth .sbir-inner {
  position: relative;
  z-index: 1;
  max-width: none !important;
  width: 100% !important;
  padding-left: 32px !important;
  padding-right: 32px !important;
}

.sbir-donuts {
  display: flex;
  justify-content: center;
  gap: 48px;
  align-items: flex-start;
  margin: 0 auto 56px;
  max-width: none;
  width: 100%;
}

.sbir-donut-block {
  flex: 0 1 auto;
  text-align: center;
}

.sbir-donut {
  position: relative;
  display: grid;
  place-items: center;
  width: min(460px, 88vw);
  height: min(460px, 88vw);
  margin: 0 auto;
}

/* Stack the wedge, ring, and label in one grid cell so they share a center */
.sbir-donut-fill,
.sbir-donut-ring,
.sbir-donut-label {
  grid-area: 1 / 1;
}

.sbir-donut-fill {
  z-index: 0;
  width: 100%;
  height: 100%;
}

.sbir-donut-fill canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.sbir-donut-ring {
  z-index: 1;
  width: 76%;
  height: 76%;
  border: 1.5px solid rgba(111, 129, 96, 0.72);
  border-radius: 50%;
  box-shadow: inset -18px 0 16px -8px rgba(196, 168, 120, 0.28);
  pointer-events: none;
}

.sbir-donut-label {
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 76%;
  height: 70%;
}

.sbir-donut-num {
  font-family: var(--sbir-font-display) !important;
  font-size: 105px !important;
  font-weight: 400 !important;
  line-height: 1 !important;
  color: var(--sbir-ink) !important;
  margin: 0 !important;
  white-space: nowrap;
}

.sbir-donut-copy {
  font-family: var(--sbir-font-body) !important;
  font-size: 14.6px !important;
  line-height: 1.4 !important;
  color: var(--sbir-ink) !important;
  margin: 10px auto 0 !important;
  max-width: 205px !important;
  text-align: center !important;
  text-wrap: pretty;
}

.sbir-donut-copy strong {
  font-weight: 700 !important;
  color: inherit !important;
}

.sbir-donut-copy sup {
  font-size: 0.7em !important;
}

.sbir-aside {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 8px auto 0;
  max-width: 560px;
}

.sbir-aside img {
  width: 72px;
  height: auto;
  display: block;
}

.sbir-aside p {
  font-family: var(--sbir-font-display) !important;
  font-size: 20px !important;
  font-weight: 500 !important;
  font-style: italic !important;
  line-height: 1.4 !important;
  color: var(--sbir-ink) !important;
  margin: 0 !important;
  text-align: center !important;
}

.sbir-aside em {
  font-style: italic !important;
}

/* Designer's graph paper: sage on growth, gold here. Soft edges are in the art. */
.sbir-pillars {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.sbir-pillars::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: url("assets/graph-paper-gold.svg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% auto;
  opacity: 1;
}

.sbir-pillars::after {
  content: none;
}

.sbir-pillars .sbir-inner {
  position: relative;
  z-index: 1;
  max-width: none !important;
  width: 100% !important;
  padding-left: 32px !important;
  padding-right: 32px !important;
}

.sbir-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(200px, 1fr));
  /* start, not stretch — row stretching would override the cards' aspect-ratio
     and distort the frame art */
  align-items: start;
  gap: 48px;
  max-width: none;
  width: 100%;
  margin: 0 auto;
}

/* Frame and thumbtack are one piece of supplied art per card. The two variants
   alternate so neighbours don't share the same hand-drawn wobble.
   Padding is asymmetric because the art's front panel sits up and to the right
   inside its box, with the back panel overhanging left and bottom. Percentages
   resolve against width on every side, so all four are width-relative. */
.sbir-card {
  background-image: url("assets/card-frame-a.svg");
  background-repeat: no-repeat;
  background-size: 100% 100%;
  aspect-ratio: 227.88 / 261.11;
  padding: 23% 8.7% 12.3% 18.7%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  position: relative;
  isolation: isolate;
  min-width: 0;
  transition: transform 0.25s ease;
}

.sbir-card:nth-child(even) {
  background-image: url("assets/card-frame-b.svg");
}

.sbir-card::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 48%;
  width: 150%;
  height: 150%;
  transform: translate(-50%, -50%);
  background: url("assets/glow-yellow.webp") center / contain no-repeat;
  z-index: -1;
  pointer-events: none;
  opacity: 0.22;
}

.sbir-card:hover {
  transform: translateY(-4px);
}

/* A fixed-height box sized as a share of the card width, so all four icons
   scale with the frame art and read as the same optical size despite their
   differing aspect ratios. */
.sbir-card-icon {
  position: relative;
  width: 100%;
  padding-bottom: 34%;
  margin: 0 auto 6%;
}

.sbir-card-icon img {
  position: absolute;
  inset: 0;
  margin: auto;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: block;
}

.sbir-card-icon--empty {
  height: 12px;
  padding-bottom: 0;
  margin-bottom: 4px;
}

.sbir-card h3 {
  font-family: var(--sbir-font-body) !important;
  font-size: 20px !important;
  font-weight: 700 !important;
  color: var(--sbir-ink) !important;
  margin: 0 0 10px !important;
  line-height: 1.2 !important;
}

.sbir-card p {
  font-family: var(--sbir-font-body) !important;
  font-size: 14px !important;
  line-height: 1.5 !important;
  color: var(--sbir-muted) !important;
  margin: 0 !important;
}

/* Stats sit above the illustration. Inset from the edges so they sit
   closer together; pulled up so they don't collide with the hills. */
.sbir-expect-scene {
  position: relative;
  max-width: 1100px;
  margin: 0 auto 48px;
  padding-top: 88px;
}

.sbir-expect-art {
  position: relative;
}

.sbir-expect-art img {
  width: 100%;
  height: auto;
  display: block;
}

.sbir-expect-scene .sbir-stat {
  position: absolute;
  top: -64px;
  width: 24%;
  z-index: 2;
}

.sbir-stat--left {
  left: 12%;
}

.sbir-stat--right {
  right: 12%;
}

.sbir-stat {
  text-align: center;
}

.sbir-stat-num {
  font-family: var(--sbir-font-display) !important;
  font-size: 105px !important;
  font-weight: 400 !important;
  line-height: 1 !important;
  color: var(--sbir-ink) !important;
  margin: 0 0 12px !important;
}

.sbir-stat-copy {
  font-family: var(--sbir-font-body) !important;
  font-size: 14px !important;
  line-height: 1.5 !important;
  color: var(--sbir-ink) !important;
  margin: 0 auto !important;
  max-width: 220px !important;
}

.sbir-stat-copy strong {
  font-weight: 700 !important;
  color: inherit !important;
}

.sbir-stat-copy sup {
  font-size: 0.7em !important;
}

.sbir-caption {
  font-family: var(--sbir-font-display) !important;
  font-size: 20px !important;
  font-weight: 500 !important;
  text-align: center !important;
  color: var(--sbir-ink) !important;
  margin: 36px auto 0 !important;
}

.sbir-closing {
  text-align: center;
  padding-bottom: 80px;
  margin-bottom: 60px;
}

.sbir-quote-icon {
  width: 48px;
  margin: 0 auto 18px;
}

.sbir-quote-icon img {
  width: 100%;
  height: auto;
  display: block;
}

.sbir-quote {
  font-family: var(--sbir-font-display) !important;
  font-size: 20px !important;
  font-weight: 500 !important;
  font-style: italic !important;
  line-height: 1.4 !important;
  color: var(--sbir-ink) !important;
  margin: 0 auto 36px !important;
  max-width: 640px !important;
}

.sbir-cta {
  position: relative;
  height: 100vh;
  height: 100dvh;
  font-family: var(--sbir-font-display) !important;
  font-size: 34px !important;
  font-weight: 500 !important;
  line-height: 1.4 !important;
  color: var(--sbir-ink) !important;
  margin: 0 auto !important;
  max-width: 780px !important;
  overflow: hidden;
}

.sbir-cta-line {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 !important;
  font: inherit !important;
  color: inherit !important;
  text-align: center !important;
  will-change: transform, opacity;
  opacity: 0;
}

.sbir-cta.is-static {
  height: auto;
  overflow: visible;
}

.sbir-cta.is-static .sbir-cta-line {
  position: static;
  inset: auto;
  opacity: 1;
  transform: none;
}

.sbir-cta em {
  font-style: italic !important;
  font-family: inherit !important;
  font-size: inherit !important;
  font-weight: inherit !important;
  color: inherit !important;
}

.sbir-sources {
  text-align: left;
  margin: 72px 0 0;
  max-width: 280px;
}

.sbir-sources p {
  font-family: var(--sbir-font-display) !important;
  font-size: 12px !important;
  line-height: 1.5 !important;
  color: var(--sbir-ink) !important;
  margin: 0 !important;
  text-align: left !important;
  font-weight: 400 !important;
}

.sbir-reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.sbir-reveal.is-in {
  opacity: 1;
  transform: translateY(0);
}

.sbir-card.sbir-reveal:nth-child(1) { transition-delay: 0.05s; }
.sbir-card.sbir-reveal:nth-child(2) { transition-delay: 0.12s; }
.sbir-card.sbir-reveal:nth-child(3) { transition-delay: 0.19s; }
.sbir-card.sbir-reveal:nth-child(4) { transition-delay: 0.26s; }

@media (prefers-reduced-motion: reduce) {
  .sbir-reveal,
  .sbir-card {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .sbir-cta {
    height: auto;
    overflow: visible;
  }

  .sbir-cta-line {
    position: static;
    inset: auto;
    opacity: 1;
    transform: none;
  }

  .sbir-down {
    animation: none;
  }
}

@media (max-width: 759px) {
  .sbir-inner {
    padding: 0 20px;
  }

  .sbir-section {
    padding: 72px 0 84px;
  }

  .sbir-hero {
    min-height: 0;
    padding: 56px 0 108px;
  }

  .sbir-growth {
    padding-top: 96px;
    padding-bottom: 108px;
  }

  .sbir-shops {
    margin-bottom: 60px;
  }

  .sbir-donut-num {
    font-size: 72px !important;
  }

  .sbir-stat-num {
    font-size: 76px !important;
  }

  .sbir-donuts {
    flex-direction: column;
    align-items: center;
    gap: 40px;
  }

  .sbir-cards {
    grid-template-columns: 1fr;
    /* narrower than the old 400px so the fixed-aspect frame isn't overly tall */
    max-width: 310px;
  }

  .sbir-expect-scene {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding-top: 0;
  }

  .sbir-expect-scene .sbir-stat {
    position: static;
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
  }

  .sbir-expect-scene .sbir-stat--left {
    order: 1;
  }

  .sbir-expect-art {
    order: 2;
    width: 100%;
    margin: 8px 0 12px;
  }

  .sbir-expect-scene .sbir-stat--right {
    order: 3;
  }

  .sbir-stat-copy {
    max-width: 280px !important;
  }

}

@media (min-width: 760px) and (max-width: 980px) {
  .sbir-cards {
    grid-template-columns: 1fr 1fr;
  }

  .sbir-expect-scene .sbir-stat {
    width: 34%;
  }
}
