/* Shared brand strip stays visible when a menu opens directly at a program. */
:root { --brand-strip-height: 28px; }
html { scroll-padding-top: var(--brand-strip-height); }
.brand-strip {
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 11;
  height: var(--brand-strip-height); padding-inline: 5.5%;
  color: #e5e0d6; background: #433142;
  font-size: 10px; font-weight: 400; letter-spacing: .14em; white-space: nowrap;
}
.brand-strip:focus-visible { outline: 2px solid currentColor; outline-offset: -3px; }
.skip:focus { z-index: 12; }
@media (max-width: 650px) {
  .brand-strip { padding-inline: 6%; }
  .brand-strip span:last-child { display: none; }
}

/* Shared navigation across all pages. */
.header,.home .header{height:84px;padding:0 5.5%;background:#f1eee5;color:#322e29;border-bottom:1px solid #d1cabd}
.header .brand,.home .header .brand{width:205px}
.header .nav,.home .header .nav{gap:36px;color:#322e29}
.header .nav a:not(.nav-cta){position:relative}
.header .nav a[aria-current="page"]{color:#322e29;border:0;padding-bottom:0}
.header .nav a[aria-current="page"]::after{content:"";position:absolute;left:0;right:0;bottom:-8px;height:1px;background:currentColor}
@media(max-width:900px){.header .nav,.home .header .nav{gap:22px}}
@media(max-width:650px){.header,.home .header{height:72px;padding:0 6%}.header .brand,.home .header .brand{width:175px}.header .nav,.home .header .nav{top:100%;background:#f1eee5;gap:25px}.header .nav a[aria-current="page"]::after{right:auto;width:40px;bottom:-7px}}

/* Unified wordmark: same typography and spelling as the footer. */
.header .brand,.home .header .brand{display:inline-flex;align-items:center;width:auto;gap:12px}
.header .brand img,.home .header .brand img{display:block;width:52px;height:52px;object-fit:contain;flex:none}
.header .brand .brand-wordmark{font-family:Manrope,Pretendard,sans-serif;font-size:20px;font-weight:500;line-height:1.15;letter-spacing:-.035em;white-space:nowrap;color:#322e29}
@media(max-width:650px){.header .brand,.home .header .brand{gap:9px}.header .brand img,.home .header .brand img{width:42px;height:42px}.header .brand .brand-wordmark{font-size:17px}}
@media(max-width:360px){.header .brand .brand-wordmark{font-size:15px}.header .brand img,.home .header .brand img{width:38px;height:38px}}

/* Keep navigation and scroll targets still; introduce only the arriving content. */
@media screen and (prefers-reduced-motion: no-preference) {
  @keyframes content-arrival {
    from { opacity: .16; translate: 0 20px; }
    to   { opacity: 1;   translate: 0 0; }
  }

  /* Normal page entries, or a link back to the top of the page. */
  main:not(:has(:target)) :is(.home-hero-copy, .treatment-hero-copy, .about-hero-copy, .profile-heading) > :is(h1, p, .care-entry, .profile-intro, .text-link),
  #top:target :is(.home-hero-copy, .treatment-hero-copy) > :is(h1, p, .care-entry, .text-link),
  /* The program tabs stay in place while the selected program appears. */
  .programs:target > :is(.programs-heading, .program-list, .care-group:first-of-type),
  .special-page:not(:has(:target)) .special-programs > :is(.programs-heading, .care-group:first-of-type),
  /* Direct links to an individual program land on its heading. */
  :is(.care-group, .care-category, .special-section, .about-story):target > * {
    animation: content-arrival 960ms cubic-bezier(.32,.08,.24,1) backwards;
  }
  :is(.home-hero-copy, .treatment-hero-copy, .about-hero-copy, .profile-heading) > h1 ~ :is(p, .care-entry, .profile-intro, .text-link),
  .programs:target > :is(.program-list, .care-group:first-of-type),
  .special-page:not(:has(:target)) .special-programs > .care-group:first-of-type,
  :is(.care-group, .care-category, .special-section, .about-story):target > :nth-child(2) {
    animation-delay: 220ms;
  }
}

@media screen and (max-width: 850px) and (prefers-reduced-motion: no-preference) {
  .nav-ready .nav-toggle[aria-expanded="true"] + .nav {
    animation: menu-arrival 360ms cubic-bezier(.25,.1,.25,1);
  }
  @keyframes menu-arrival {
    from { opacity: .45; translate: 0 -8px; }
    to   { opacity: 1;   translate: 0 0; }
  }
}
