/* Berri Helpers: directory + one page per helper. Prefix hp-. Builds on b2.css, home.css and home-motion.css. */

/* Family colours: a light tile and a deep stroke per family. */
.hp-g--money, .hp-card--money { --hp-bg: var(--b2-light-gold); --hp-fg: #7A5200; }
.hp-g--sales, .hp-card--sales { --hp-bg: var(--b2-light-berry); --hp-fg: #A81B4E; }
.hp-g--operations, .hp-card--operations { --hp-bg: var(--b2-light-blue); --hp-fg: #2D3080; }
.hp-g--people, .hp-card--people { --hp-bg: var(--b2-light-peach); --hp-fg: #8E3D10; }
.hp-g--data, .hp-card--data { --hp-bg: var(--b2-light-mint); --hp-fg: #1D5A43; }
.hp-g--industry, .hp-card--industry { --hp-bg: #E6DDF4; --hp-fg: #533786; }
.hp-g--security, .hp-card--security { --hp-bg: #D8E7EE; --hp-fg: #1F4E66; }

.hp-g { display: inline-grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 12px; background: var(--hp-bg); color: var(--hp-fg); }
.hp-g svg { width: 22px; height: 22px; }
.hp-g--s { width: 28px; height: 28px; border-radius: 8px; }
.hp-g--s svg { width: 16px; height: 16px; }
.hp-g--xl { width: 56px; height: 56px; border-radius: 16px; box-shadow: 0 10px 24px -12px var(--hp-fg); }
.hp-g--xl svg { width: 30px; height: 30px; }

.b2-nav__links a[aria-current="true"] { color: var(--b2-ink); }
.b2-nav__links a[aria-current="true"]::after { transform: scaleX(1); transform-origin: left; }
.hp-badge--xls { background: #DDF1E6; color: #1D5A43; }

/* ---------- Photographs: rounded frames that glide as you scroll ---------- */
.hp-photo { position: relative; margin: 0; overflow: hidden; border-radius: var(--b2-radius-l); aspect-ratio: 3 / 2; background: linear-gradient(135deg, var(--b2-bg-soft), var(--hp-bg, var(--b2-light-peach))); box-shadow: var(--b2-shadow-2); }
.hp-photo img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.08); color: transparent; font-size: 0; }
.hp-photo--money { --hp-bg: var(--b2-light-gold); } .hp-photo--sales { --hp-bg: var(--b2-light-berry); }
.hp-photo--operations { --hp-bg: var(--b2-light-blue); } .hp-photo--people { --hp-bg: var(--b2-light-peach); }
.hp-photo--data { --hp-bg: var(--b2-light-mint); } .hp-photo--industry { --hp-bg: #E6DDF4; } .hp-photo--security { --hp-bg: #D8E7EE; }
@keyframes hp-glide { from { transform: scale(1.14) translateY(-4%); } to { transform: scale(1.14) translateY(4%); } }
@keyframes hp-frame-in { from { opacity: .4; transform: translateY(40px) scale(.94); } to { opacity: 1; transform: none; } }
@supports (animation-timeline: view()) {
  .js .hp-photo img { animation: hp-glide linear both; animation-timeline: view(); animation-range: cover 0% cover 100%; }
  .js .hp-fam, .js .hp-top__photo { animation: hp-frame-in linear both; animation-timeline: view(); animation-range: entry 0% entry 70%; }
}

/* ---------- Directory hero with the living wall ---------- */
.hp-hero { position: relative; isolation: isolate; overflow: clip; padding-top: clamp(48px, 9vw, 112px); }
.hp-hero__in { position: relative; z-index: 1; text-align: center; display: grid; justify-items: center; gap: 18px; }
.hp-hero__h { font-size: clamp(2.75rem, 9vw, 5.5rem); }
.hp-hero__lede { margin-inline: auto; }
.hp-find { position: relative; width: min(620px, 100%); margin-top: 10px; }
.hp-find__i { position: absolute; left: 20px; top: 50%; width: 20px; height: 20px; margin-top: -10px; color: var(--b2-ink-3); pointer-events: none; }
.hp-find__in {
  width: 100%; min-height: 60px; padding: 0 20px 0 52px; border-radius: 999px; border: 1px solid var(--b2-line-strong);
  background: var(--b2-surface); font-size: 1.0625rem; box-shadow: var(--b2-shadow-2);
  transition: border-color .2s, box-shadow .3s var(--b2-ease);
}
.hp-find__in::placeholder { color: var(--b2-ink-3); }
.hp-find__in:focus-visible { outline: 2px solid var(--b2-ink); outline-offset: 2px; }

.hp-wall {
  position: relative; z-index: 1; display: grid; gap: 14px; padding: clamp(36px, 6vw, 64px) 0 clamp(24px, 4vw, 40px);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.hp-wall__row { overflow: hidden; }
.hp-wall__track { display: flex; gap: 14px; width: max-content; }
.hp-wcard {
  display: grid; grid-template-columns: 40px auto; grid-template-rows: auto auto; column-gap: 12px; align-items: center;
  padding: 12px 18px 12px 12px; border-radius: 18px; background: rgb(255 255 255 / .82); border: 1px solid var(--b2-line);
  box-shadow: var(--b2-shadow-1); white-space: nowrap;
}
.hp-wcard .hp-g { grid-row: span 2; }
.hp-wcard b { font: 650 1rem/1.2 var(--b2-display); letter-spacing: -.01em; }
.hp-wcard > span:last-child { font-size: .8125rem; color: var(--b2-ink-2); }
@keyframes hp-slide { to { transform: translateX(calc(-50% - 7px)); } }
.hp-wall__track { animation: hp-slide 120s linear infinite; }
.hp-wall__row--1 .hp-wall__track { animation-duration: 140s; animation-direction: reverse; }
.hp-wall__row--2 .hp-wall__track { animation-duration: 105s; }
.hp-wall__row--1 { padding-left: 90px; }
.hp-wall.is-off .hp-wall__track { animation-play-state: paused; }

/* ---------- Families ---------- */
.hp-fams { padding-top: clamp(40px, 7vw, 88px); }
.hp-fams__h { margin-bottom: 28px; }
.hp-fams__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 16px; }
.hp-fam {
  position: relative; display: grid; gap: 12px; padding: 10px 10px 14px; border-radius: 22px; text-decoration: none;
  background: var(--b2-surface); border: 1px solid var(--b2-line); box-shadow: var(--b2-shadow-1);
  transition: transform .35s var(--b2-ease), box-shadow .35s var(--b2-ease), border-color .2s;
}
.hp-fam .hp-photo { border-radius: 14px; box-shadow: none; }
.hp-fam__t { display: flex; align-items: center; gap: 10px; padding: 0 4px; min-height: 44px; }
.hp-fam__t b { font: 650 1rem/1.25 var(--b2-display); letter-spacing: -.01em; }
.hp-fam__n { margin-left: auto; min-width: 30px; padding: 4px 8px; border-radius: 999px; background: var(--b2-bg-soft); text-align: center; font: 600 .8rem/1 var(--b2-mono); color: var(--b2-ink-2); }
.hp-fam:hover { transform: translateY(-4px); box-shadow: var(--b2-shadow-2); }
.hp-fam[aria-pressed="true"] { border-color: var(--b2-ink); box-shadow: 0 0 0 1px var(--b2-ink), var(--b2-shadow-2); }
.hp-fam[aria-pressed="true"] .hp-fam__n { background: var(--b2-ink); color: var(--b2-bg); }

/* ---------- Directory list ---------- */
.hp-dirlist { padding-top: clamp(48px, 8vw, 96px); }
.hp-dirlist__bar { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 20px; margin-bottom: 8px; }
.hp-count { margin: 0; font: 500 .9rem/1 var(--b2-mono); color: var(--b2-ink-2); }
.hp-group { padding-top: 32px; }
.hp-group__h { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; font: 650 1.125rem/1.2 var(--b2-display); letter-spacing: -.01em; }
.hp-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 14px; }

.hp-card { position: relative; }
.hp-card__a {
  position: relative; height: 100%; display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: 14px; row-gap: 2px; align-content: start;
  padding: 18px 44px 18px 16px; border-radius: 18px; text-decoration: none; overflow: hidden;
  background: var(--b2-surface); border: 1px solid var(--b2-line); box-shadow: var(--b2-shadow-1);
  transition: transform .35s var(--b2-ease), box-shadow .35s var(--b2-ease), border-color .2s;
}
.hp-card__a::before { content: ""; position: absolute; inset: 0; z-index: 0; background: radial-gradient(120% 90% at 0% 0%, var(--hp-bg), transparent 60%); opacity: 0; transition: opacity .35s var(--b2-ease); }
.hp-card__a > * { position: relative; z-index: 1; }
.hp-card__a .hp-g { grid-row: span 2; }
.hp-card__n { margin: 0; font: 650 1.0625rem/1.25 var(--b2-display); letter-spacing: -.01em; align-self: end; }
.hp-card__r { margin: 0; font-size: .875rem; line-height: 1.45; color: var(--b2-ink-2); }
.hp-card__go { position: absolute; right: 16px; top: 50%; width: 9px; height: 9px; margin-top: -5px; border: solid var(--b2-ink-3); border-width: 1.5px 1.5px 0 0; transform: rotate(45deg); transition: transform .3s var(--b2-ease), border-color .2s; }
.hp-card__a:hover { transform: translateY(-3px); border-color: var(--b2-line-strong); box-shadow: var(--b2-shadow-2); }
.hp-card__a:hover::before { opacity: .55; }
.hp-card__a:hover .hp-card__go { transform: translateX(3px) rotate(45deg); border-color: var(--hp-fg); }

@keyframes hp-in { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.js .hp-card.is-anim { animation: hp-in .6s var(--b2-ease) both; animation-delay: calc(var(--i, 0) * 45ms); }

.hp-empty { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 56px 16px; border: 1px dashed var(--b2-line-strong); border-radius: var(--b2-radius-l); margin-top: 24px; }
.hp-empty__h { margin: 0; font: 650 1.375rem/1.2 var(--b2-display); }
.hp-empty .b2-small { margin: 0; }
.hp-empty__act { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; margin-top: 8px; }

/* ---------- Helper page ---------- */
.hp-top { position: relative; isolation: isolate; overflow: clip; padding: clamp(32px, 6vw, 80px) 0 32px; }
.hp-sky { -webkit-mask-image: linear-gradient(#000 40%, transparent 92%); mask-image: linear-gradient(#000 35%, transparent 85%); }
.hp-top__in { position: relative; z-index: 1; display: grid; gap: 36px; align-items: center; }
.hp-top__copy { display: grid; justify-items: start; gap: 16px; }
.hp-crumb { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: .875rem; color: var(--b2-ink-3); }
.hp-crumb a { color: var(--b2-ink-2); text-decoration: none; min-height: 32px; display: inline-flex; align-items: center; }
.hp-crumb a:hover { color: var(--b2-ink); text-decoration: underline; text-underline-offset: 4px; }
.hp-top__h { margin-top: 4px; }
.hp-top__act { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 8px; }
.hp-start { min-height: 52px; padding: 0 26px; font-size: 1rem; }
@keyframes hp-word { from { opacity: 0; transform: translateY(.4em); } }
.js .hp-top__h, .js .hp-hero__h { animation: hp-word .6s var(--b2-ease) both; }
.js .hp-top__lede, .js .hp-hero__lede { animation: hp-word .6s var(--b2-ease) .12s both; }
.js .hp-top__act, .js .hp-find { animation: hp-word .6s var(--b2-ease) .22s both; }
.js .hp-top .hp-g--xl { animation: hp-pop .7s cubic-bezier(.3, 1.5, .5, 1) both; }
@keyframes hp-pop { from { opacity: 0; transform: scale(.6) rotate(-12deg); } }

.hp-work { padding-top: clamp(56px, 9vw, 112px); }
.hp-work__in { display: grid; gap: 32px; align-items: start; }
.hp-work__copy .b2-h2 { margin-bottom: 20px; }
.hp-does { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.hp-does li { position: relative; padding: 16px 0 16px 34px; border-top: 1px solid var(--b2-line); font-size: 1.0625rem; line-height: 1.5; }
.hp-does li:last-child { border-bottom: 1px solid var(--b2-line); }
.hp-does li::before { content: ""; position: absolute; left: 4px; top: 23px; width: 12px; height: 12px; border-radius: 4px; background: var(--hp-bg); box-shadow: inset 0 0 0 2px var(--hp-fg); transform: rotate(45deg); }
.hp-sc .hm-app__thread { min-height: 360px; }
.hp-sc .hm-tbl td { white-space: normal; }
.hp-with { margin-left: auto; padding: 4px 10px; border-radius: 999px; background: var(--hp-bg); color: var(--hp-fg); font-size: .75rem; font-weight: 600; white-space: nowrap; }
.hp-sc .hm-app__top .hp-g { color: var(--hp-fg); }
.hp-page--money { --hp-bg: var(--b2-light-gold); --hp-fg: #7A5200; }
.hp-page--sales { --hp-bg: var(--b2-light-berry); --hp-fg: #A81B4E; }
.hp-page--operations { --hp-bg: var(--b2-light-blue); --hp-fg: #2D3080; }
.hp-page--people { --hp-bg: var(--b2-light-peach); --hp-fg: #8E3D10; }
.hp-page--data { --hp-bg: var(--b2-light-mint); --hp-fg: #1D5A43; }
.hp-page--industry { --hp-bg: #E6DDF4; --hp-fg: #533786; }
.hp-page--security { --hp-bg: #D8E7EE; --hp-fg: #1F4E66; }

.hp-rel { padding-top: clamp(64px, 10vw, 120px); }
.hp-rel__h { margin-bottom: 24px; }

.hp-band { margin-top: clamp(64px, 10vw, 120px); }
.hp-band__in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; padding-block: 36px; background: linear-gradient(var(--b2-line), var(--b2-line)) top / 100% 1px no-repeat content-box, linear-gradient(var(--b2-line), var(--b2-line)) bottom / 100% 1px no-repeat content-box; }
.hp-band__h { margin: 0; font: 650 clamp(1.375rem, 3vw, 2rem)/1.2 var(--b2-display); letter-spacing: -.02em; }

@media (min-width: 900px) {
  .hp-top__in { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 56px; }
  .hp-work__in { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 56px; }
  .hp-work__copy { position: sticky; top: calc(var(--b2-bar) + 32px); }
}
@media (max-width: 600px) {
  .hp-fams__list { grid-template-columns: 1fr 1fr; gap: 10px; }
  .hp-fam { padding: 6px 6px 8px; border-radius: 18px; gap: 8px; }
  .hp-fam .hp-photo { aspect-ratio: 4 / 3; border-radius: 12px; }
  .hp-fam__t { gap: 8px; padding: 0 2px; }
  .hp-fam__t .hp-g { width: 30px; height: 30px; border-radius: 9px; }
  .hp-fam__t .hp-g svg { width: 17px; height: 17px; }
  .hp-fam__t b { font-size: .875rem; }
  .hp-fam__n { min-width: 26px; padding: 3px 6px; font-size: .72rem; }
}
@media (max-width: 520px) {
  .hp-wcard { padding: 10px 14px 10px 10px; }
  .hp-wcard > span:last-child { display: none; }
  .hp-wcard { grid-template-rows: auto; }
  .hp-wcard .hp-g { grid-row: auto; }
  .hp-with { display: none; }
}

/* ---------- Reduced motion and ?still: everything static ---------- */
@media (prefers-reduced-motion: reduce) {
  .hp-wall__track, .js .hp-card.is-anim, .js .hp-photo img, .js .hp-fam, .js .hp-top__photo, .js .hp-top__h, .js .hp-hero__h,
  .js .hp-top__lede, .js .hp-hero__lede, .js .hp-top__act, .js .hp-find, .js .hp-top .hp-g--xl { animation: none !important; }
  .hp-card__a, .hp-fam { transition: none; }
  .hp-card__a:hover, .hp-fam:hover { transform: none; }
}
.is-still .hp-wall__track, .is-still .hp-card.is-anim, .is-still .hp-photo img, .is-still .hp-fam, .is-still .hp-top__photo,
.is-still .hp-top__h, .is-still .hp-hero__h, .is-still .hp-top__lede, .is-still .hp-hero__lede, .is-still .hp-top__act,
.is-still .hp-find, .is-still .hp-top .hp-g--xl { animation: none !important; }
