/* Authenticated home family-perspective experience. */
.home-focal-experience {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(390px, 2fr) minmax(520px, 3fr);
  column-gap: clamp(1.4rem, 3vw, 3rem);
  align-items: center;
  width: min(1240px, calc(100% - 64px));
  margin: 1.25rem auto 3rem;
  padding: clamp(1.45rem, 2.4vw, 2rem);
  overflow: visible;
  border: 1px solid rgba(193, 151, 82, 0.42);
  border-radius: clamp(1.35rem, 2.4vw, 1.8rem);
  background:
    radial-gradient(circle at 50% 26%, rgba(255, 255, 255, 0.88), transparent 28rem),
    linear-gradient(180deg, rgba(255, 252, 246, 0.99), rgba(247, 235, 214, 0.96)),
    url('/static/img/parchment-bg.webp') center / cover repeat;
  box-shadow:
    0 18px 38px rgba(71, 42, 18, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.75),
    inset 0 0 0 0.42rem rgba(255, 248, 231, 0.22);
}

/* Lower botanicals frame the shared hero without competing with the portraits. */
.home-focal-experience::before,
.home-focal-experience::after {
  content: "";
  position: absolute;
  bottom: -2.4rem;
  z-index: 0;
  width: clamp(6.5rem, 12vw, 9.25rem);
  height: clamp(9.5rem, 18vw, 13.5rem);
  background: url('/static/img/hero/kinvella-olive-branch.webp') center / contain no-repeat;
  opacity: 0.22;
  filter: saturate(0.72) contrast(0.94) sepia(0.14);
  pointer-events: none;
}

.home-focal-experience::before {
  left: -1.65rem;
  transform: rotate(-19deg);
}

.home-focal-experience::after {
  right: -1.65rem;
  transform: scaleX(-1) rotate(-19deg);
}

.home-focal-intro {
  --home-focal-section-gap: clamp(0.96rem, 1.08vw, 1.16rem);
  position: relative;
  z-index: 5;
  align-self: center;
  width: 100%;
  min-width: 0;
  padding: clamp(0.75rem, 1.5vw, 1rem) clamp(1.35rem, 2.2vw, 1.8rem) clamp(0.75rem, 1.5vw, 1rem) 0;
  border-right: 1px solid rgba(176, 125, 38, 0.3);
  color: #352318;
}

.home-focal-selector-slot {
  width: 100%;
}

.home-focal-selector-slot:empty {
  display: none;
}

.home-focal-selector-row {
  width: 100%;
  min-width: 0;
}

/* Share stays paired with Family Perspective only in the compact Home layout. */
.home-focal-share-mobile {
  display: none;
}

/* Family Snapshot reuses one metric-card anatomy; only the responsive grid changes. */
.home-family-snapshot {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.home-family-snapshot__header {
  display: grid;
  gap: 0.22rem;
  margin: 1.05rem 0 0.62rem;
  padding-inline: 0.18rem;
}

.focal-person-selector__label,
.home-family-view-switch__label,
.home-family-snapshot__eyebrow {
  color: #9b681f;
  font: 800 0.62rem/1.1 var(--font-sans, Inter, system-ui, sans-serif);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.home-family-snapshot__eyebrow {
  display: block;
}

.home-family-snapshot__metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(0.48rem, 0.75vw, 0.68rem);
  width: 100%;
}

.home-family-snapshot__metric {
  display: grid;
  place-items: center;
  align-content: center;
  min-width: 0;
  min-height: clamp(4.6rem, 6vw, 5.25rem);
  padding: 0.3rem 0.28rem;
  border: 1px solid color-mix(in srgb, var(--gold) 42%, transparent);
  border-radius: 0.82rem;
  background: color-mix(in srgb, var(--ofc-soft-cream) 80%, transparent);
  box-shadow: 0 0.32rem 0.9rem color-mix(in srgb, var(--ink) 5%, transparent);
  box-sizing: border-box;
}

.home-family-snapshot__metric img {
  display: block;
  width: clamp(1.62rem, 2.04vw, 1.92rem);
  height: clamp(1.62rem, 2.04vw, 1.92rem);
  object-fit: contain;
  opacity: 0.9;
}

.home-family-snapshot__metric strong {
  position: relative;
  display: grid;
  justify-items: center;
  margin-top: 0.14rem;
  color: var(--ink);
  font-family: var(--font-display, "Cormorant Garamond", Georgia, serif);
  font-size: clamp(1.85rem, 2.65vw, 2.35rem);
  font-weight: 500;
  line-height: 0.86;
  letter-spacing: -0.035em;
}

.home-family-snapshot__metric strong::after {
  content: "";
  width: clamp(2.35rem, 3.8vw, 3.4rem);
  height: 1px;
  margin-top: 0.3rem;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--gold) 70%, var(--ink) 30%), transparent);
  opacity: 0.62;
}

.home-family-snapshot__metric > span {
  max-width: 100%;
  margin-top: 0.22rem;
  overflow: hidden;
  color: var(--ink);
  font-family: var(--font-display, "Cormorant Garamond", Georgia, serif);
  font-size: clamp(0.56rem, 0.72vw, 0.68rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.035em;
  text-align: center;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.home-family-snapshot__actions {
  display: grid;
  justify-items: stretch;
  gap: 0.42rem;
  width: 100%;
  margin-top: 1.04rem;
}

body.authenticated-home .home-family-snapshot__primary.home-welcome-cta {
  width: 100%;
  box-sizing: border-box;
}

.home-family-snapshot__secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.36rem;
  min-height: 1.8rem;
  color: color-mix(in srgb, var(--ink) 74%, var(--gold) 26%);
  font-family: var(--font-display, "Cormorant Garamond", Georgia, serif);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}

.home-family-snapshot__secondary:hover,
.home-family-snapshot__secondary:focus-visible {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.home-welcome-cta__label--mobile,
.home-family-snapshot--mobile {
  display: none;
}

.focal-person-selector {
  position: relative;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0.58rem;
  overflow: visible;
  border: 0;
  border-radius: 1.22rem;
  background: transparent;
  box-shadow: none;
  box-sizing: border-box;
}

.focal-person-selector__label {
  display: block;
  margin: 0.08rem 0.72rem 0.48rem;
}

.focal-person-selector__trigger {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 0.72rem;
  width: 100%;
  min-height: 62px;
  padding: 0.45rem 0.68rem 0.45rem 0.48rem;
  border: 1px solid rgba(185, 130, 43, 0.28);
  border-radius: 0.98rem;
  color: inherit;
  background: rgba(255, 252, 245, 0.8);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}

.focal-person-selector__trigger:hover,
.focal-person-selector__trigger:focus-visible,
.focal-person-selector.is-open .focal-person-selector__trigger {
  border-color: rgba(176, 119, 29, 0.68);
  background: rgba(255, 254, 250, 0.98);
  box-shadow: 0 0 0 3px rgba(196, 146, 58, 0.11);
  outline: none;
}

.focal-person-selector__portrait,
.focal-person-selector__option-portrait {
  display: block;
  overflow: hidden;
  border: 2px solid #c59a46;
  border-radius: 50%;
  background: rgba(242, 229, 204, 0.9);
  box-sizing: border-box;
}

.focal-person-selector__portrait {
  width: 48px;
  aspect-ratio: 1;
}

.focal-person-selector__portrait img,
.focal-person-selector__option-portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.focal-person-selector__copy,
.focal-person-selector__option-copy {
  display: grid;
  align-content: center;
  gap: 0.18rem;
  min-width: 0;
}

.focal-person-selector__name,
.focal-person-selector__meta,
.focal-person-selector__option-copy strong,
.focal-person-selector__option-copy small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.focal-person-selector__name {
  color: #291b12;
  font: 600 1.08rem/1.05 var(--font-display, Georgia, serif);
}

.focal-person-selector__meta {
  color: #6c594b;
  font-size: 0.7rem;
  line-height: 1.1;
}

.focal-person-selector__chevron {
  position: relative;
  width: 0.8rem;
  height: 0.8rem;
}

.focal-person-selector__chevron::before {
  content: "";
  position: absolute;
  inset: 0.1rem 0.15rem 0.25rem;
  border-right: 2px solid #9a671d;
  border-bottom: 2px solid #9a671d;
  transform: rotate(45deg);
  transition: transform 0.16s ease;
}

.focal-person-selector.is-open .focal-person-selector__chevron::before {
  transform: translateY(0.18rem) rotate(225deg);
}

.focal-person-selector__native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  border: 0 !important;
  white-space: nowrap !important;
}

.focal-person-selector__menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 0.45rem);
  z-index: 40;
  display: grid;
  gap: 0.28rem;
  max-height: min(24rem, 62vh);
  padding: 0.46rem;
  overflow: auto;
  border: 1px solid rgba(181, 126, 39, 0.48);
  border-radius: 1rem;
  background: rgba(255, 252, 244, 0.99);
  box-shadow: 0 1.15rem 2.6rem rgba(64, 38, 15, 0.2), inset 0 1px rgba(255,255,255,.9);
}

.focal-person-selector__menu[hidden] { display: none !important; }

.focal-person-selector__option {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 0.62rem;
  width: 100%;
  min-height: 52px;
  padding: 0.38rem 0.5rem;
  border: 1px solid transparent;
  border-radius: 0.78rem;
  color: #332117;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.focal-person-selector__option:hover,
.focal-person-selector__option:focus-visible {
  border-color: rgba(185, 130, 43, 0.28);
  background: rgba(245, 229, 198, 0.5);
  outline: none;
}

.focal-person-selector__option.is-selected {
  border-color: rgba(177, 118, 25, 0.48);
  background: linear-gradient(90deg, rgba(242, 216, 158, 0.58), rgba(255, 250, 239, 0.72));
}

.focal-person-selector__option-portrait {
  width: 40px;
  aspect-ratio: 1;
}

.focal-person-selector__option-copy strong {
  color: #2d1d13;
  font: 600 0.96rem/1.05 var(--font-display, Georgia, serif);
}

.focal-person-selector__option-copy small {
  color: #705d4f;
  font-size: 0.67rem;
}

.focal-person-selector__option-check {
  color: #9c681e;
  font-weight: 900;
  opacity: 0;
}
.focal-person-selector__option.is-selected .focal-person-selector__option-check { opacity: 1; }

.focal-person-selector__status {
  display: block;
  min-height: 0;
  margin: 0.28rem 0.7rem 0;
  color: #8a6429;
  font-size: 0.62rem;
  line-height: 1.2;
}
.focal-person-selector__status:empty { display: none; }

.focal-person-selector.is-saving {
  pointer-events: none;
}

body.is-perspective-updating .focal-person-selector__trigger {
  cursor: progress;
}

/* Perspective changes replace only the affected server-rendered regions after
   every incoming portrait has decoded. The short entrance confirms the update
   without dimming, collapsing, or repainting the rest of the page. */
body.landing-page [data-perspective-region].is-perspective-entering {
  animation: kinvella-perspective-region-enter 190ms cubic-bezier(0.22, 0.72, 0.28, 1) both;
}

@keyframes kinvella-perspective-region-enter {
  from {
    opacity: 0.88;
    transform: translateY(2px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  body.landing-page [data-perspective-region].is-perspective-entering {
    animation: none;
  }
}

.home-focal-hero-column {
  grid-column: 2;
  min-width: 0;
}

.home-focal-balance {
  display: none;
}

/* Home family-view switch is intentionally non-destructive: it lets users compare
   the current family with their original starter family without restoring records. */
.home-family-view-switch {
  display: grid;
  gap: 0.36rem;
  width: 100%;
  min-width: 0;
  margin: var(--home-focal-section-gap, 0.82rem) 0 0;
  padding-top: 0;
  border-top: 0;
  box-sizing: border-box;
}

.home-family-view-switch__label {
  margin: 0 0 0 0.18rem;
}

.home-family-view-switch__control {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.2rem;
  width: 100%;
  padding: 0.2rem;
  border: 1px solid color-mix(in srgb, var(--gold) 23%, transparent);
  border-radius: 0.76rem;
  background: color-mix(in srgb, var(--ofc-soft-cream) 92%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  box-sizing: border-box;
}

.home-family-view-switch__option {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 2.04rem;
  padding: 0.42rem 0.52rem;
  border: 1px solid transparent;
  border-radius: 0.6rem;
  color: color-mix(in srgb, var(--ink-soft) 88%, var(--gold) 12%);
  font: 720 0.68rem/1 var(--font-sans, Inter, system-ui, sans-serif);
  text-align: center;
  text-decoration: none;
  transition: background-color 140ms ease, border-color 140ms ease, box-shadow 140ms ease, color 140ms ease;
}

.home-family-view-switch__option:hover {
  border-color: color-mix(in srgb, var(--gold) 18%, transparent);
  background: color-mix(in srgb, var(--gold) 7%, transparent);
  color: var(--ink);
}

.home-family-view-switch__option.is-active {
  border-color: color-mix(in srgb, var(--gold) 46%, transparent);
  background: linear-gradient(180deg, #3a2416, #211208);
  box-shadow: 0 0.25rem 0.58rem rgba(54, 31, 13, 0.14), inset 0 1px 0 rgba(255, 236, 174, 0.08);
  color: #f0d37f;
}

.home-family-view-switch__option:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--gold) 56%, transparent);
  outline-offset: 2px;
}

.home-family-view-switch__note {
  margin: 0.02rem 0.12rem 0;
  color: color-mix(in srgb, var(--ink-soft) 74%, transparent);
  font: 560 0.58rem/1.35 var(--font-sans, Inter, system-ui, sans-serif);
}

.home-welcome-portrait--main {
  position: relative;
}

.home-welcome-focal-badge {
  position: absolute;
  left: 50%;
  bottom: -10px;
  z-index: 4;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.32rem 0.75rem;
  border: 1px solid #c99941;
  border-radius: 999px;
  background: #2d1a0d;
  box-shadow: 0 4px 10px rgba(47, 28, 10, 0.18);
  color: #e8c775;
  font: 600 0.66rem/1 var(--font-sans, sans-serif);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Family Perspective focus state: use one coordinated gold treatment for the
   selected person across Legacy, KinRoots, KinLine and KinJourney. */
body.landing-page {
  --perspective-focus-gold: #c99435;
  --perspective-focus-gold-bright: #e3b95d;
  --perspective-focus-ring-soft: rgba(225, 181, 88, 0.22);
  --perspective-focus-glow: rgba(190, 132, 37, 0.34);
}

body.landing-page .perspective-focus {
  outline: 2.6px solid var(--perspective-focus-gold);
  outline-offset: 2px;
  filter: drop-shadow(0 0 0.58rem var(--perspective-focus-glow));
}

body.landing-page .perspective-focus--hero {
  outline-width: 2.6px;
  outline-color: var(--perspective-focus-gold-bright);
  filter: drop-shadow(0 0 0.68rem rgba(190, 132, 37, 0.38));
}

/* Legacy uses the same gold language, but its larger card receives a slightly
   stronger frame so the selected person is immediately recognizable. */
body.landing-page .summary-family-carousel__card.perspective-focus--legacy {
  border: 2px solid var(--perspective-focus-gold);
  outline: 2px solid rgba(227, 185, 93, 0.5);
  outline-offset: 1px;
  box-shadow:
    0 0 0 3px var(--perspective-focus-ring-soft),
    0 0.5rem 1.05rem rgba(111, 69, 17, 0.14),
    inset 0 0 0 1px rgba(255, 250, 237, 0.82);
  filter: none;
}

/* KinLine uses the same selected-person visual language as Legacy and
   KinJourney: a clear gold edge, soft outer ring and restrained warm halo. */
body.landing-page .landing-person-card-frame.perspective-focus--kinline {
  outline: 2.6px solid var(--perspective-focus-gold) !important;
  outline-offset: 3px !important;
  box-shadow:
    0 0 0 3px var(--perspective-focus-ring-soft),
    0 0 0.9rem var(--perspective-focus-glow),
    0 0.45rem 1rem rgba(74, 44, 20, 0.12) !important;
  filter: none !important;
}

body.landing-page .timeline-preview-horizontal__portrait.perspective-focus--kinline {
  border: 3px solid var(--perspective-focus-gold-bright) !important;
  outline: 2px solid rgba(227, 185, 93, 0.62) !important;
  outline-offset: 3px !important;
  box-shadow:
    0 0 0 0.3rem rgba(255, 252, 244, 0.86),
    0 0 0 0.48rem var(--perspective-focus-ring-soft),
    0 0 1rem var(--perspective-focus-glow),
    0 0.45rem 1rem rgba(74, 44, 20, 0.12) !important;
}

/* Keep the already-approved KinJourney emphasis unchanged. */
body.landing-page .landing-person-card-frame.perspective-focus--kinjourney,
body.landing-page .map-person-summary__avatar.perspective-focus--kinjourney {
  outline: 2.6px solid var(--perspective-focus-gold);
  outline-offset: 2px;
  filter: drop-shadow(0 0 0.58rem var(--perspective-focus-glow));
}

body.landing-page .tree-node-wrap.perspective-focus {
  outline: none;
  filter: none;
}

/* KinRoots is SVG, so mirror the same emphasis with a stronger metal stroke
   and halo. !important intentionally wins over relationship-mode card strokes. */
body.landing-page #treeSvg .tree-node-wrap.perspective-focus--kinroots {
  filter: drop-shadow(0 0 7px var(--perspective-focus-glow)) !important;
}

body.landing-page #treeSvg .tree-node-wrap.perspective-focus--kinroots .tree-node-card.landing-person-card-frame--svg {
  stroke: var(--perspective-focus-gold-bright) !important;
  stroke-width: 3.2px !important;
  filter:
    drop-shadow(0 5px 7px var(--landing-person-frame-feature-shadow-near))
    drop-shadow(0 10px 16px var(--landing-person-frame-feature-shadow-far))
    drop-shadow(0 0 7px var(--perspective-focus-glow)) !important;
}

body.landing-page.perspective-focus-transition-active .perspective-focus {
  animation: kinvella-perspective-focus-pulse 1.65s cubic-bezier(0.22, 0.72, 0.28, 1) both;
}

body.landing-page.perspective-focus-transition-active .tree-node-wrap.perspective-focus--kinroots {
  animation: kinvella-perspective-tree-wrap-pulse 1.65s cubic-bezier(0.22, 0.72, 0.28, 1) both;
}

body.landing-page.perspective-focus-transition-active #treeSvg .tree-node-wrap.perspective-focus--kinroots .tree-node-card.landing-person-card-frame--svg {
  animation: kinvella-perspective-tree-focus-pulse 1.65s cubic-bezier(0.22, 0.72, 0.28, 1) both;
}

body.landing-page.perspective-focus-transition-active .perspective-focus-section {
  animation: kinvella-perspective-section-pulse 1.65s ease-out both;
}

@keyframes kinvella-perspective-focus-pulse {
  0% {
    outline-color: rgba(195, 148, 55, 0.22);
    outline-width: 1px;
    outline-offset: 1px;
    filter: drop-shadow(0 0 0 rgba(183, 126, 34, 0));
  }
  28% {
    outline-color: var(--perspective-focus-gold-bright);
    outline-width: 3px;
    outline-offset: 5px;
    filter: drop-shadow(0 0 0.95rem rgba(200, 144, 43, 0.52));
  }
  58% {
    outline-color: #d3a144;
    outline-width: 2.7px;
    outline-offset: 3px;
    filter: drop-shadow(0 0 0.7rem rgba(190, 132, 37, 0.38));
  }
  100% {
    outline-color: var(--perspective-focus-gold);
    outline-width: 2.6px;
    outline-offset: 2px;
    filter: drop-shadow(0 0 0.58rem var(--perspective-focus-glow));
  }
}

@keyframes kinvella-perspective-tree-focus-pulse {
  0% { stroke: rgba(201, 148, 52, 0.45); stroke-width: 1.5px; }
  30% { stroke: var(--perspective-focus-gold-bright); stroke-width: 3.4px; }
  100% { stroke: var(--perspective-focus-gold); stroke-width: 2.6px; }
}

@keyframes kinvella-perspective-tree-wrap-pulse {
  0%, 100% { filter: drop-shadow(0 0 7px var(--perspective-focus-glow)); }
  30% { filter: drop-shadow(0 0 13px rgba(213, 160, 59, 0.58)); }
  62% { filter: drop-shadow(0 0 9px rgba(196, 139, 39, 0.44)); }
}

@keyframes kinvella-perspective-section-pulse {
  0%, 100% { outline: 0 solid rgba(202, 151, 56, 0); outline-offset: 0; }
  24% { outline: 2px solid rgba(217, 170, 76, 0.42); outline-offset: 5px; }
  62% { outline: 1px solid rgba(202, 151, 56, 0.2); outline-offset: 3px; }
}

@media (min-width: 1100px) {
  .home-focal-experience {
    grid-template-columns: minmax(17.5rem, 35fr) minmax(0, 65fr);
    column-gap: clamp(0.85rem, 1.35vw, 1.2rem);
    align-items: stretch;
    width: min(100%, 84rem);
    margin: 0.75rem auto 1.35rem;
    padding: clamp(0.78rem, 1.1vw, 1rem);
  }

  .home-focal-intro {
    --home-focal-section-gap: clamp(1.02rem, 1.12vw, 1.22rem);
    --home-focal-heading-inline: clamp(0.78rem, 0.84vw, 0.92rem);
    align-self: stretch;
    padding: clamp(0.55rem, 0.9vw, 0.8rem) clamp(0.85rem, 1.15vw, 1.05rem) clamp(0.72rem, 0.95vw, 0.9rem) 0;
  }

  .home-family-snapshot--desktop,
  .home-family-snapshot__actions--desktop {
    display: grid;
  }

  .home-family-snapshot--desktop .home-family-snapshot__header {
    margin-top: var(--home-focal-section-gap);
    margin-bottom: clamp(0.48rem, 0.52vw, 0.58rem);
  }

  .home-family-snapshot--desktop .home-family-snapshot__metric {
    min-height: clamp(4.3rem, 4.68vw, 4.82rem);
    padding-block: clamp(0.24rem, 0.28vw, 0.32rem);
  }

  .home-family-snapshot--desktop .home-family-snapshot__metric img {
    width: clamp(1.68rem, 1.68vw, 1.94rem);
    height: clamp(1.68rem, 1.68vw, 1.94rem);
  }

  .home-family-snapshot--desktop + .kinvella-onboarding-panel {
    margin-top: clamp(1.02rem, 1.08vw, 1.2rem);
  }

  .home-family-snapshot--mobile {
    display: none;
  }

  .focal-person-selector {
    padding: 0;
  }

  .focal-person-selector__label {
    margin: 0.08rem var(--home-focal-heading-inline) clamp(0.5rem, 0.54vw, 0.62rem);
    font-size: clamp(0.62rem, 0.56vw, 0.7rem);
  }

  .home-family-view-switch__label {
    margin-left: var(--home-focal-heading-inline);
  }

  .home-family-snapshot--desktop .home-family-snapshot__header {
    padding-inline: var(--home-focal-heading-inline) 0;
  }

  .focal-person-selector__trigger {
    grid-template-columns: clamp(48px, 3vw, 54px) minmax(0, 1fr) 18px;
    min-height: clamp(62px, 4vw, 70px);
    gap: clamp(0.72rem, 0.7vw, 0.84rem);
    padding: clamp(0.45rem, 0.48vw, 0.54rem) clamp(0.68rem, 0.7vw, 0.82rem) clamp(0.45rem, 0.48vw, 0.54rem) clamp(0.48rem, 0.5vw, 0.58rem);
  }

  .focal-person-selector__portrait {
    width: clamp(48px, 3vw, 54px);
  }

  .focal-person-selector__name {
    font-size: clamp(1.08rem, 1.05vw, 1.2rem);
  }

  .focal-person-selector__meta {
    font-size: clamp(0.7rem, 0.63vw, 0.76rem);
  }

  body.authenticated-home .home-focal-hero-column.home-welcome-hero {
    --home-stage-width: clamp(27rem, 30vw, 34rem);
    --home-stage-height: clamp(29.5rem, 32vw, 34rem);
    --home-main-portrait: clamp(15.8rem, 18.5vw, 20.2rem);
    --home-main-height: clamp(22rem, 25.7vw, 27.9rem);
    --home-small-portrait: clamp(8rem, 9.1vw, 9.8rem);
    --home-small-height: clamp(11.65rem, 13.2vw, 14.2rem);
    --home-hero-sigil-size: clamp(9rem, 10.5vw, 11rem);
    --home-hero-collage-margin-top: 0.6rem;
    width: 100% !important;
    max-width: 600px !important;
    margin: 0 auto !important;
    justify-self: center;
    align-self: center;
    padding: 0 !important;
    overflow: visible !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  body.authenticated-home .home-focal-hero-column.home-welcome-hero::before,
  body.authenticated-home .home-focal-hero-column.home-welcome-hero::after,
  body.authenticated-home .home-focal-experience .home-welcome-legacy-card::before,
  body.authenticated-home .home-focal-experience .home-welcome-legacy-card::after {
    display: none !important;
    content: none !important;
  }

  body.authenticated-home .home-focal-experience .home-welcome-legacy-card {
    width: 100% !important;
    padding: 0.25rem 0 0.4rem !important;
    overflow: visible !important;
  }

  body.authenticated-home .home-focal-experience .home-welcome-olive {
    display: none !important;
  }

  body.authenticated-home .home-focal-hero-column.home-welcome-hero .home-welcome-collage {
    position: relative !important;
    display: block !important;
    width: min(100%, var(--home-stage-width)) !important;
    height: var(--home-stage-height) !important;
    margin: var(--home-hero-collage-margin-top) auto 0 !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  body.authenticated-home .home-focal-hero-column.home-welcome-hero .home-welcome-collage__row {
    display: contents !important;
    margin: 0 !important;
  }

  body.authenticated-home .home-focal-hero-column.home-welcome-hero .home-welcome-portrait--main,
  body.authenticated-home .home-focal-hero-column.home-welcome-hero .home-welcome-portrait--small {
    position: absolute !important;
    inset: auto !important;
    margin: 0 !important;
    overflow: hidden !important;
    transform-origin: center bottom !important;
  }

  body.authenticated-home .home-focal-hero-column.home-welcome-hero .home-welcome-portrait--main {
    left: 50% !important;
    top: 0 !important;
    z-index: 3 !important;
    width: var(--home-main-portrait) !important;
    height: var(--home-main-height) !important;
    aspect-ratio: auto !important;
    transform: translateX(-50%) !important;
  }

  body.authenticated-home .home-focal-hero-column.home-welcome-hero .home-welcome-portrait--small {
    bottom: calc(var(--home-stage-height) - var(--home-main-height) - 1.05rem) !important;
    z-index: 4 !important;
    width: var(--home-small-portrait) !important;
    height: var(--home-small-height) !important;
    aspect-ratio: auto !important;
  }

  body.authenticated-home .home-focal-hero-column.home-welcome-hero .home-welcome-portrait--1 {
    left: calc(50% - (var(--home-main-portrait) / 2) - (var(--home-small-portrait) * 0.6)) !important;
    transform: rotate(3.5deg) !important;
  }

  body.authenticated-home .home-focal-hero-column.home-welcome-hero .home-welcome-portrait--2 {
    right: calc(50% - (var(--home-main-portrait) / 2) - (var(--home-small-portrait) * 0.6)) !important;
    transform: rotate(-3.5deg) !important;
  }

  body.authenticated-home .home-focal-hero-column.home-welcome-hero .hero-family-sigil--home {
    position: absolute !important;
    left: 50% !important;
    bottom: calc(var(--home-stage-height) - var(--home-main-height) - (var(--home-hero-sigil-size) * 0.2)) !important;
    z-index: 6 !important;
    width: var(--home-hero-sigil-size) !important;
    height: var(--home-hero-sigil-size) !important;
    margin: 0 !important;
    transform: translateX(-50%) !important;
  }
}

@media (min-width: 1440px) {
  body.authenticated-home .home-focal-hero-column.home-welcome-hero {
    --home-stage-width: clamp(31rem, 31vw, 35rem);
    --home-stage-height: clamp(32rem, 32vw, 35rem);
    --home-main-portrait: clamp(18.3rem, 18.7vw, 20.8rem);
    --home-main-height: clamp(25.2rem, 25.8vw, 28.6rem);
    --home-small-portrait: clamp(8.9rem, 9.2vw, 10.2rem);
    --home-small-height: clamp(12.9rem, 13.35vw, 14.75rem);
    --home-hero-sigil-size: clamp(9.8rem, 10.6vw, 11.4rem);
    max-width: 620px !important;
  }
}

@media (max-width: 1099px) {
  body.landing-page.authenticated-home {
    --living-hero-mobile-portrait-top-gap: clamp(0.10rem, 0.36vw, 0.16rem);
  }

  /* Home begins with Family Perspective; mobile navigation remains owned by the existing topbar. */
  body.authenticated-home .auth-share-story-mobile {
    display: none !important;
  }

  .home-focal-experience {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: min(calc(100% - 18px), 500px);
    margin: 0.55rem auto 0;
    padding: 0;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .home-focal-experience::before,
  .home-focal-experience::after,
  .home-focal-balance {
    display: none;
    content: none;
  }

  /* Let the selector and onboarding panel participate directly in the mobile
     flow so the family artwork can follow Family Perspective immediately. */
  .home-focal-intro {
    display: contents;
  }

  .home-focal-selector-slot {
    order: 1;
    width: 100%;
    min-width: 0;
  }

  .home-focal-selector-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
    gap: clamp(0.42rem, 1.8vw, 0.58rem);
    width: 100%;
    min-width: 0;
  }

  .home-family-view-switch {
    order: 2;
    margin: var(--home-focal-section-gap, 0.96rem) 0 0;
    padding-top: 0;
  }

  .home-family-view-switch__label {
    margin-left: 0.68rem;
  }

  .home-family-view-switch__control {
    max-width: 21rem;
  }

  .home-family-view-switch__option {
    min-height: 2rem;
    font-size: 0.66rem;
  }

  .home-family-view-switch__note {
    margin-left: 0.42rem;
  }

  .home-focal-hero-column {
    grid-column: 1;
    order: 3;
  }

  .home-focal-intro > .kinvella-onboarding-panel {
    order: 4;
    margin: var(--home-focal-section-gap, 0.96rem) 0 0;
  }

  .focal-person-selector {
    max-width: none;
    margin: 0;
    padding: 0;
    border-radius: 1.08rem;
  }

  .focal-person-selector__label {
    margin: 0.04rem 0.2rem 0.38rem;
    font-size: 0.62rem;
    text-align: left;
  }

  .focal-person-selector__trigger {
    grid-template-columns: 42px minmax(0, 1fr) 16px;
    min-height: 56px;
    padding: 0.38rem 0.6rem 0.38rem 0.42rem;
    border-radius: 0.88rem;
  }

  .focal-person-selector__portrait { width: 42px; }
  .focal-person-selector__name { font-size: 1rem; }
  .focal-person-selector__meta { font-size: 0.66rem; }
  .focal-person-selector__menu { max-height: min(21rem, 58vh); }

  .home-focal-share-mobile {
    display: inline-grid;
    place-items: center;
    align-content: center;
    align-self: end;
    gap: 0.22rem;
    width: clamp(4.55rem, 18.5vw, 5rem);
    min-width: 0;
    height: 56px;
    min-height: 56px;
    padding: 0.3rem 0.42rem;
    border: 1px solid rgba(185, 130, 43, 0.46);
    border-radius: 0.88rem;
    background: linear-gradient(180deg, rgba(255, 253, 247, 0.98), rgba(249, 239, 219, 0.96));
    box-shadow: 0 0.55rem 1.1rem rgba(77, 48, 18, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.82);
    color: color-mix(in srgb, var(--ink) 72%, var(--gold) 28%);
    font: 700 clamp(0.68rem, 2.65vw, 0.73rem)/1 var(--font-sans, Inter, system-ui, sans-serif);
    text-decoration: none;
    box-sizing: border-box;
  }

  .home-focal-share-mobile__icon {
    width: clamp(1.18rem, 4.8vw, 1.3rem);
    height: clamp(1.18rem, 4.8vw, 1.3rem);
  }

  .home-focal-share-mobile:hover,
  .home-focal-share-mobile:focus-visible {
    border-color: rgba(168, 111, 31, 0.72);
    color: var(--ink);
    background: linear-gradient(180deg, rgba(255, 251, 240, 1), rgba(246, 230, 194, 0.98));
  }

  .home-focal-share-mobile:focus-visible {
    outline: 2px solid rgba(181, 125, 42, 0.52);
    outline-offset: 2px;
  }

  .home-family-snapshot--desktop,
  .home-family-snapshot__actions--desktop {
    display: none;
  }

  .home-family-snapshot--mobile {
    display: block;
    width: min(calc(100% - 1.15rem), 27rem);
    margin: clamp(0.34rem, 1.2vw, 0.46rem) auto clamp(0.68rem, 2.2vw, 0.82rem);
  }

  .home-family-snapshot--mobile .home-family-snapshot__metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(0.26rem, 1.2vw, 0.42rem);
  }

  .home-family-snapshot--mobile .home-family-snapshot__metric {
    min-height: clamp(4.62rem, 18.8vw, 5.12rem);
    padding: clamp(0.2rem, 0.75vw, 0.28rem) clamp(0.08rem, 0.5vw, 0.2rem);
    border-radius: clamp(0.62rem, 2.8vw, 0.78rem);
  }

  .home-family-snapshot--mobile .home-family-snapshot__metric img {
    width: clamp(1.38rem, 5.7vw, 1.58rem);
    height: clamp(1.38rem, 5.7vw, 1.58rem);
  }

  .home-family-snapshot--mobile .home-family-snapshot__metric strong {
    margin-top: 0.1rem;
    font-size: clamp(1.5rem, 6.6vw, 1.78rem);
  }

  .home-family-snapshot--mobile .home-family-snapshot__metric strong::after {
    width: clamp(1.72rem, 8.5vw, 2.12rem);
    margin-top: 0.22rem;
  }

  .home-family-snapshot--mobile .home-family-snapshot__metric > span {
    margin-top: 0.18rem;
    font-size: clamp(0.54rem, 2.3vw, 0.62rem);
    letter-spacing: 0.015em;
  }

  .home-welcome-cta__label--desktop {
    display: none;
  }

  .home-welcome-cta__label--mobile {
    display: inline;
  }

  body.authenticated-home .home-focal-hero-column.home-welcome-hero {
    --home-main-portrait: clamp(11.52rem, 48vw, 13.08rem);
    --home-main-height: clamp(17.88rem, 74.4vw, 20.16rem);
    --home-small-portrait: clamp(5.7rem, 23.5vw, 6.45rem);
    --home-small-height: clamp(8.25rem, 34.5vw, 9.35rem);
    --home-side-overhang: clamp(0.41rem, 1.73vw, 0.47rem);
    --home-hero-sigil-size: clamp(5.2rem, 21.5vw, 5.9rem);
    --home-sigil-overhang: clamp(0.52rem, 2.15vw, 0.59rem);
    --home-stage-height: calc(var(--home-main-height) + clamp(1.25rem, 4vw, 1.6rem));
    --home-hero-width: min(calc(100% - 0.55rem), 27rem);
    --home-hero-collage-margin-top: clamp(0.08rem, 0.35vw, 0.15rem);
    --landing-person-frame-hero-band: clamp(3.2px, 0.62vw, 5.1px);
    --landing-person-frame-hero-edge: 1px;
    --landing-person-frame-hero-outline: 1px;
    --landing-person-frame-hero-inner-line: 1px;
    width: var(--home-hero-width) !important;
    max-width: var(--home-hero-width) !important;
  }

  body.authenticated-home .home-focal-hero-column.home-welcome-hero .home-welcome-collage {
    position: relative !important;
    display: block !important;
    width: 100% !important;
    max-width: 27rem !important;
    height: var(--home-stage-height) !important;
    margin: var(--home-hero-collage-margin-top) auto 0 !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  body.authenticated-home .home-focal-hero-column.home-welcome-hero .home-welcome-collage__row {
    display: contents !important;
    margin: 0 !important;
  }

  body.authenticated-home .home-focal-hero-column.home-welcome-hero .home-welcome-portrait--main,
  body.authenticated-home .home-focal-hero-column.home-welcome-hero .home-welcome-portrait--small {
    position: absolute !important;
    inset: auto !important;
    margin: 0 !important;
    overflow: hidden !important;
    transform-origin: center bottom !important;
  }

  body.authenticated-home .home-focal-hero-column.home-welcome-hero .home-welcome-portrait--main {
    left: 50% !important;
    top: 0 !important;
    z-index: 3 !important;
    width: var(--home-main-portrait) !important;
    height: var(--home-main-height) !important;
    aspect-ratio: auto !important;
    transform: translateX(-50%) !important;
  }

  body.authenticated-home .home-focal-hero-column.home-welcome-hero .home-welcome-portrait--small {
    top: calc(var(--home-main-height) - var(--home-small-height) + var(--home-side-overhang)) !important;
    bottom: auto !important;
    z-index: 4 !important;
    width: var(--home-small-portrait) !important;
    height: var(--home-small-height) !important;
    aspect-ratio: auto !important;
  }

  body.authenticated-home .home-focal-hero-column.home-welcome-hero .home-welcome-portrait--1 {
    left: calc(50% - (var(--home-main-portrait) / 2) - (var(--home-small-portrait) * 0.70)) !important;
    transform: rotate(4deg) !important;
  }

  body.authenticated-home .home-focal-hero-column.home-welcome-hero .home-welcome-portrait--2 {
    right: calc(50% - (var(--home-main-portrait) / 2) - (var(--home-small-portrait) * 0.70)) !important;
    transform: rotate(-4deg) !important;
  }

  body.authenticated-home .home-focal-hero-column.home-welcome-hero .hero-family-sigil--home {
    position: absolute !important;
    left: 50% !important;
    top: calc(var(--home-main-height) - var(--home-hero-sigil-size) + var(--home-sigil-overhang)) !important;
    bottom: auto !important;
    z-index: 6 !important;
    width: var(--home-hero-sigil-size) !important;
    height: var(--home-hero-sigil-size) !important;
    margin: 0 !important;
    transform: translateX(-50%) !important;
  }

  /* Mobile hero keeps the crest itself; the long motto ribbon reads like a duplicate CTA
     once the sigil overlaps the portraits this deeply, so omit only that flourish here. */
  body.authenticated-home .home-focal-hero-column.home-welcome-hero .hero-family-sigil--home .sigil-composed__banner,
  body.authenticated-home .home-focal-hero-column.home-welcome-hero .hero-family-sigil--home .sigil-composed__motto {
    display: none !important;
  }
}

@media (max-width: 390px) {
  body.authenticated-home .home-focal-hero-column.home-welcome-hero .home-welcome-collage {
    max-width: 100% !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .focal-person-selector {
    transition: none;
  }

  body.landing-page.perspective-focus-transition-active .perspective-focus,
  body.landing-page.perspective-focus-transition-active .perspective-focus-section,
  body.landing-page.perspective-focus-transition-active #treeSvg .tree-node-wrap.perspective-focus .tree-node-card.landing-person-card-frame--svg {
    animation: none;
  }
}
