body:has(#hero:not(.hidden)) .topbar {
  position: absolute;
  z-index: 5;
  inset: 14px 28px auto;
  min-height: 66px;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  text-shadow: 0 1px 5px rgba(0, 0, 0, .55);
}
body:has(#hero:not(.hidden)) .topbar .brand { padding: 8px 10px; border-radius: 6px; background: #fff; text-shadow: none; }
body:has(#hero:not(.hidden)) .topbar .brand small { color: #697080; }
.home-header-link { display: none; }
body:has(#hero:not(.hidden)) .home-header-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: 8px 18px;
  color: #fff;
  font-size: 16px;
  text-decoration: none;
}
body:has(#hero:not(.hidden)) .topbar-catalog-link {
  min-height: 44px;
  margin-left: 16px;
  padding-inline: 20px;
  border-color: transparent;
  background: #fff;
  color: #202124;
  font-size: 15px;
  font-weight: 400;
  text-shadow: none;
}
body:has(#hero:not(.hidden)) .topbar-catalog-link b { display: none; }
#hero.home-hero { width: 100%; max-width: none; margin: 0; padding: 8px 8px 0; }
.home-cover {
  position: relative;
  isolation: isolate;
  display: flex;
  min-height: min(900px, calc(100svh - 76px));
  align-items: center;
  justify-content: center;
  padding: 140px 24px 64px;
  overflow: hidden;
  border-radius: 24px;
  background: #384b43;
}
.home-scene-stage { position: absolute; inset: 0; z-index: -2; pointer-events: none; }
.home-cover-media { position: absolute; inset: 0; }
.home-cover-media img { display: block; width: 100%; height: 100%; object-fit: contain; }
.home-cover[data-layered="true"] .home-cover-media img { object-fit: cover; }
/* Foregrounds scale uniformly within side lanes, independently of the background crop. */
.home-scene-person { position: absolute; top: 112px; bottom: 18px; width: min(30%, calc((100% - min(700px, 62%)) / 2 - 24px)); height: calc(100% - 130px); object-fit: contain; object-position: center bottom; }
.home-scene-person-left { left: 16px; }
.home-scene-person-right { right: 16px; }
.home-cover[data-portrait="true"] .home-scene-person { top: 104px; bottom: 0; height: calc(100% - 104px); }
.home-scene-person[hidden] { display: none; }
.home-cover::before { content: ""; position: absolute; inset: 0; z-index: -1; background: rgba(21, 28, 25, .18); }
.home-cover[data-scene="winter"]::before { background: rgba(21, 28, 25, .28); }
#hero h1, .home-cover-kicker { text-shadow: 0 1px 12px rgba(0, 0, 0, .18); }
.home-scene-controls { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; color: #fff; }
.home-scene-arrow { display: grid; width: 44px; height: 44px; flex-shrink: 0; place-items: center; padding: 0; border: 1px solid rgba(255, 255, 255, .6); border-radius: 50%; background: rgba(25, 32, 29, .35); }
.home-scene-arrow img { filter: invert(1); }
.home-scene-arrow:hover { background: rgba(25, 32, 29, .65); }
.home-scene-arrow:focus-visible { outline: 3px solid #fc0; outline-offset: 3px; }
.home-scene-controls[aria-busy="true"] .home-scene-arrow { opacity: .65; }
.home-scene-controls[hidden] { display: none; }
#hero .home-hero-copy { width: min(820px, 62%); max-width: 820px; margin: 0; text-align: center; color: #fff; }
.home-cover-kicker { margin: 0 0 36px; font-size: 17px; line-height: 1.4; }
#hero h1 { max-width: 820px; margin: 0 auto; color: #fff; font-size: 44px; font-weight: 400; line-height: 1.16; letter-spacing: 0; }
.home-discovery {
  width: min(100%, 700px);
  margin: 76px auto 0;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, .58);
  border-radius: 28px;
  background: rgba(241, 242, 237, .5);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
#hero .home-search { grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: center; margin: 0; padding: 0 8px 0 16px; border-radius: 999px; background: rgba(255, 255, 255, .78); }
#hero .home-search input { height: 48px; padding: 0; font-size: 16px; }
#hero .home-search input::placeholder { color: #626760; }
#hero .home-search button { min-width: 64px; height: 34px; padding: 0 12px; border-radius: 999px; background: #e3e6dd; color: #252b25; box-shadow: none; font-size: 13px; font-weight: 500; }
.home-search-icon { opacity: .8; }
.home-categories { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-block: 8px; }
.home-categories button { min-width: 0; height: 50px; min-height: 50px; padding: 8px 10px; border: 0; border-radius: 999px; background: #fff; color: #232723; font-size: 15px; line-height: 1.25; transition: background-color 150ms ease, transform 140ms var(--motion-out); }
.home-category-short { display: none; }
.home-personal-intro, .home-personal-duration, .home-start-mobile { display: none; }
#hero .button.home-calculator-button { display: flex; gap: 12px; width: 100%; min-height: 52px; padding: 10px 14px; border: 0; border-radius: 999px; background: #eef4e8; color: #232723; box-shadow: none; font-size: 16px; font-weight: 500; }
.home-quiz-note { display: inline-block; flex-shrink: 0; padding: 5px 9px; border: 0; border-radius: 6px; background: #c93838; color: #fff; font-size: 12px; font-weight: 500; line-height: 1.25; white-space: nowrap; transform: rotate(-4deg); animation: home-quiz-nudge 10s linear 10s infinite; }
@keyframes home-quiz-nudge {
  0%, 4%, 100% { transform: translateX(0) rotate(-4deg); }
  .8% { transform: translateX(-1px) rotate(-6deg); }
  1.6% { transform: translateX(1px) rotate(-2deg); }
  2.4% { transform: translateX(-1px) rotate(-5deg); }
  3.2% { transform: translateX(1px) rotate(-3deg); }
}
.home-categories button:focus-visible, .home-header-link:focus-visible { outline: 3px solid #fc0; outline-offset: 3px; }
.home-categories button:active { transform: scale(.98); }
#hero .home-search-results { width: min(1340px, calc(100% - 64px)); margin: 0 auto 56px; padding-top: 24px; }
@media (hover: hover) and (pointer: fine) {
  .home-categories button:hover { background: #eef4e8; }
  #hero .button.home-calculator-button:hover { background: #dcebd4; }
  #hero .home-search button:hover { background: #ccd5c4; }
  .home-header-link:hover { text-decoration: underline; text-underline-offset: 5px; }
}
@media (min-width: 1800px) {
  .home-cover { min-height: min(980px, calc(100svh - 80px)); }
  #hero h1 { font-size: 50px; }
  .home-discovery { margin-top: 90px; }
}
@media (max-height: 760px) and (min-width: 761px) {
  .home-cover { padding-top: 106px; padding-bottom: 72px; }
  .home-cover-kicker { margin-bottom: 22px; font-size: 15px; }
  #hero h1 { font-size: 36px; }
  .home-discovery { margin-top: 34px; }
}
@media (max-width: 1080px) and (min-width: 761px) {
  .home-header-link { display: none !important; }
  #hero .home-hero-copy { width: 62%; }
  #hero h1 { font-size: 36px; }
  .home-categories button { font-size: 13px; }
  .home-cover-media img { object-position: center; }
}
@media (max-width: 760px) {
  body:has(#hero:not(.hidden)) .topbar .brand { padding: 6px; }
  body:has(#hero:not(.hidden)) .topbar { inset: 12px 14px auto; min-height: 46px; padding: 4px; gap: 8px; }
  body:has(#hero:not(.hidden)) .home-header-link { display: none; }
  body:has(#hero:not(.hidden)) .topbar-catalog-link { min-height: 36px; margin: 0; padding: 6px 10px; font-size: 12px; white-space: nowrap; }
  #hero.home-hero { padding: 6px 6px 0; overflow: visible; }
  .home-cover { min-height: min(760px, calc(100svh - 64px)); padding: 108px 12px 84px; border-radius: 18px; }
  .home-cover-media img { object-position: center top; }
  #hero .home-hero-copy { width: 100%; }
  .home-cover-kicker { display: none; }
  #hero h1 { font-size: 30px; line-height: 1.16; }
  .home-discovery { margin-top: 24px; padding: 8px; border-radius: 24px; }
  #hero .home-search { grid-template-columns: 18px minmax(0, 1fr) auto; gap: 6px; padding-left: 12px; }
  .home-search-icon { width: 18px; height: 18px; }
  #hero .home-search input { height: 44px; padding: 0; font-size: 13px; }
  #hero .home-search button { min-width: 51px; width: auto; height: 30px; padding: 0 8px; font-size: 12px; }
  .home-categories { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-categories button { height: 44px; min-height: 44px; padding: 7px 8px; font-size: 13px; }
  #hero .button.home-calculator-button { flex-direction: column; min-height: 76px; padding-inline: 8px; font-size: 13px; gap: 5px; }
  #hero .home-search-results { width: calc(100% - 28px); margin: 0 auto 32px; }
}
@media (max-width: 760px) and (max-height: 740px) {
  .home-cover { padding-top: 96px; padding-bottom: 72px; }
  #hero h1 { font-size: 27px; }
  .home-discovery { margin-top: 20px; }
  .home-categories { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .home-categories button { height: 36px; min-height: 36px; padding: 7px 3px; font-size: 11px; }
  .home-category-full { display: none; }
  .home-category-short { display: inline; }
}
@media (prefers-reduced-motion: reduce) {
  .home-categories button { transition: none; }
  .home-quiz-note { animation: none; }
}

/* Below this width the side figures become too small to read naturally. */
@media (width < 1480px) {
  .home-scene-person { display: none; }
  .home-scene-stage { overflow: hidden; }
  .home-cover-media { inset: -20px; }
  .home-cover-media img { filter: blur(8px); }
  .home-cover::before, .home-cover[data-scene="winter"]::before { background: rgba(21, 28, 25, .38); }
}
@media (max-width: 760px) {
  .home-scene-controls { bottom: 16px; }
  .home-cover-media { animation: home-background-drift 25s cubic-bezier(.45, 0, .55, 1) infinite; animation-play-state: paused; }
  .home-cover.is-background-moving .home-cover-media { animation-play-state: running; }
  .home-cover-media img { filter: blur(3px); }
  .home-cover::before, .home-cover[data-scene="winter"]::before { background: rgba(21, 28, 25, .32); }
  .home-personal-prompt { margin-top: 16px; padding: 16px 4px 4px; border-top: 1px solid rgba(255, 255, 255, .55); }
  #hero .home-personal-intro { display: block; margin: 0 0 12px; color: #202820; font-size: 14px; font-weight: 500; line-height: 1.4; text-shadow: none; }
  #hero .button.home-calculator-button { flex-direction: row; justify-content: center; gap: 10px; min-height: 48px; padding: 12px; border-radius: 8px; background: #0756c9; color: #fff; font-size: 15px; line-height: 1.4; }
  #hero .home-calculator-button:active { background: #0647a6; }
  #hero .home-calculator-button:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
  .home-start-desktop, .home-calculator-button .home-quiz-note { display: none; }
  .home-start-mobile { display: inline; }
  img.home-start-mobile { flex-shrink: 0; filter: invert(1); }
  #hero .home-personal-duration { display: block; margin: 8px 0 0; color: #303b31; font-size: 12px; line-height: 1.4; text-shadow: none; }
}
@keyframes home-background-drift {
  0%, 100% { transform: translate3d(-1%, 0, 0) scale(1.035); }
  50% { transform: translate3d(1%, -1%, 0) scale(1.1); }
}
@media (prefers-reduced-motion: reduce) {
  .home-cover-media { animation: none; }
}
@media (max-width: 360px) and (max-height: 640px) {
  #hero h1 { font-size: 23px; }
  .home-discovery { margin-top: 18px; }
}

/* Compact program collections share one horizontal rail on every viewport. */
#hero .home-search-results { --collection-gutter: max(24px, calc((100% - 1200px) / 2)); width: 100%; padding-top: 32px; scroll-margin-top: 24px; }
#hero .home-results-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-inline: var(--collection-gutter) 24px; }
#hero .home-results-head h2 { font-size: 25px; line-height: 1.2; }
#hero .home-results-head p { margin: 8px 0 0; font-size: 14px; line-height: 1.4; }
.home-results-controls { display: flex; flex-shrink: 0; gap: 8px; }
.home-results-controls[hidden], #homeResultsAll[hidden] { display: none; }
.home-results-controls button { display: grid; place-items: center; flex-shrink: 0; width: 40px; height: 40px; padding: 0; border: 1px solid #dfe3e1; border-radius: 50%; background: #fff; }
.home-results-controls button:disabled { opacity: .3; cursor: default; }
.home-results-controls button:focus-visible { outline: 2px solid #198356; outline-offset: 3px; }
#hero .home-program-grid { display: grid; grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 284px; gap: 12px; align-items: stretch; margin-top: 24px; padding: 4px 24px 12px var(--collection-gutter); overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scroll-padding-inline: var(--collection-gutter); scrollbar-width: none; cursor: grab; }
#hero .home-program-grid::-webkit-scrollbar { display: none; }
#hero .home-program-grid.is-dragging { scroll-snap-type: none; cursor: grabbing; }
#hero .home-program-grid a { cursor: inherit; user-select: none; -webkit-user-drag: none; }
#hero .home-program-grid img { user-select: none; -webkit-user-drag: none; }
#hero .home-program-grid.is-empty { grid-template-columns: minmax(0, 1fr); grid-auto-flow: row; grid-auto-columns: auto; }
#hero .home-program-card { display: flex; flex-direction: column; min-width: 0; min-height: 0; gap: 0; padding: 6px 6px 12px; border: 0; border-radius: 8px; background: transparent; scroll-snap-align: start; }
#hero .home-program-card:focus-visible { outline: 2px solid #198356; outline-offset: 2px; }
.home-program-media { width: 100%; aspect-ratio: 1; overflow: hidden; border-radius: 8px; background: #f2f3f4; }
.home-program-icon { display: block; width: 100%; height: 100%; object-fit: contain; }
#hero .home-program-labels { gap: 4px; padding: 8px 6px 0; }
#hero .home-program-labels span { padding: 0; border-radius: 0; background: transparent; color: #858585; font-size: 14px; font-weight: 400; line-height: 1.3; }
#hero .home-program-labels .home-program-status { width: 100%; color: #875b1d; }
#hero .home-program-labels .home-program-status.is-closed { color: #747a76; }
#hero .home-program-card h3 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; margin: 3px 6px 0; color: #292929; font-size: 18px; font-weight: 400; line-height: 1.25; overflow-wrap: anywhere; }
#hero .home-program-media + h3 { margin-top: 8px; }
#hero .home-program-territory { margin: 4px 6px 0; color: #858585; font-size: 14px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#hero .home-program-card footer { display: block; margin-top: 0; padding: 3px 6px 0; line-height: 1.3; }
#hero .home-program-card footer strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #858585; font-size: 14px; font-weight: 400; line-height: 1.3; }
#hero .home-catalog-card { position: relative; display: flex; flex-direction: column; gap: 0; padding: 6px 6px 12px; border-radius: 8px; background: #f2f3f4; color: #202124; text-decoration: none; scroll-snap-align: start; }
#hero .home-catalog-card h3 { margin: 12px 8px 0; font-size: 18px; font-weight: 400; line-height: 1.25; }
.home-catalog-arrow { margin: 16px 8px 0; }
#hero .home-catalog-card:focus-visible { outline: 2px solid #198356; outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) {
  #hero .home-program-card:hover { background: #f3f4f5; }
  .home-results-controls button:not(:disabled):hover { background: #eef4e8; }
}
@media (max-width: 760px) {
  #hero .home-search-results { --collection-gutter: 12px; width: 100%; padding-top: 26px; }
  #hero .home-results-head { gap: 12px; align-items: flex-start; }
  #hero .home-results-head h2 { font-size: 22px; }
  #hero .home-results-head p { font-size: 13px; }
  #hero .home-program-grid { grid-auto-columns: 240px; gap: 10px; padding-right: 12px; }
}
