/* ==========================================================================
   Our Branches — map of Peninsular Malaysia; flags fly in on scroll
   ========================================================================== */
.br {
  position: relative;
  background: var(--white);
  overflow: hidden;
}
.br-inner {
  position: relative;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: calc(var(--nav-height) + clamp(24px, 4vh, 48px)) var(--container-pad) clamp(24px, 4vh, 48px);
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  grid-template-rows: auto 1fr;
  grid-template-areas: "head map" "list map";
  column-gap: clamp(24px, 4vw, 64px);
  align-items: start;
}
.br-head { grid-area: head; }
.br-list { grid-area: list; }
.br-mapwrap { grid-area: map; }
@media (min-width: 861px) {
  .br-inner { height: 100vh; height: 100svh; }
}

/* ---- left column ---- */
.br-eyebrow {
  margin: 0 0 var(--label-gap); display: flex; align-items: center; gap: 16px;
  font-family: var(--font-body); font-size: 15px; font-weight: 600; line-height: 1.2;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--maroon);
}
.br-eyebrow::after { content: ''; width: 40px; height: 1px; background: var(--maroon); }
.br-title { margin: 0; font-family: var(--font-display); font-size: clamp(34px, 4.2vw, 60px); line-height: 1.06; letter-spacing: -0.03em; }
.br-title span { display: block; }
.br-title__strong { font-weight: 800; color: var(--ink); }
.br-title__soft { font-weight: 400; color: #8a8480; }

/* sub-line under the title — same as "The People Behind AI FORCE" in Our Team */
.br-sub { margin: 18px 0 0; font-family: var(--font-display); font-size: clamp(17px, 1.6vw, 22px); font-weight: 400; letter-spacing: -0.01em; color: #8a8480; }

.br-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid rgba(4,4,4,0.1); }
.br-item {
  display: grid; grid-template-columns: 34px 1fr auto; align-items: baseline; gap: 8px;
  padding: 12px 0; border-bottom: 1px solid rgba(4,4,4,0.1);
  cursor: pointer; outline: none;
  opacity: 0.28; transition: opacity 0.4s ease;
}
.br-item.is-on { opacity: 1; }
.br-num { font-size: 11px; font-weight: 600; letter-spacing: 0.1em; color: var(--grey-400); font-variant-numeric: tabular-nums; }
.br-city { font-family: var(--font-display); font-size: 17px; font-weight: 600; color: var(--black); transition: color 0.2s ease; }
.br-tag { font-size: 10px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--maroon); }
.br-item.is-hot .br-city { color: var(--maroon); }

/* ---- map ---- */
.br-mapwrap { position: relative; height: 100%; min-height: 0; display: grid; place-items: center; }
.br-map {
  position: relative;
  height: 100%;
  max-height: 680px;
  aspect-ratio: 530 / 600;
  max-width: 100%;
}
.br-map svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.br-land { fill: var(--grey-050); stroke: var(--ink); stroke-width: 1.4; stroke-linejoin: round; }
.br-ghost { fill: rgba(4,4,4,0.022); stroke: none; }
.br-gridline { stroke: rgba(4,4,4,0.08); stroke-width: 1; stroke-dasharray: 2 5; vector-effect: non-scaling-stroke; }
.br-coord { font-family: var(--font-body); font-size: 9px; letter-spacing: 0.12em; fill: var(--grey-400); }
.br-trail { fill: none; stroke: var(--maroon); stroke-width: 1.2; vector-effect: non-scaling-stroke; opacity: 0.55; transition: opacity 0.5s ease; }

/* fade the faint neighbours out towards the edges */
.br-fade { mask-image: radial-gradient(ellipse 70% 65% at 50% 50%, #000 55%, transparent 100%); -webkit-mask-image: radial-gradient(ellipse 70% 65% at 50% 50%, #000 55%, transparent 100%); }

/* pins */
.br-pin { position: absolute; width: 0; height: 0; z-index: 3; }
.br-dot {
  position: absolute; left: -6px; top: -6px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--maroon); box-shadow: 0 0 0 3px var(--white);
  transform: scale(0); transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
}
.br-pin.is-hq .br-dot { left: -8px; top: -8px; width: 16px; height: 16px; }
.br-pin.is-hq .br-dot::after { content: ''; position: absolute; inset: 4px; border-radius: 50%; background: var(--white); }
.br-ring {
  position: absolute; left: -22px; top: -22px; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--maroon); opacity: 0; pointer-events: none;
}
.br-pin.is-on .br-dot { transform: scale(1); }
.br-pin.is-on .br-ring { animation: br-ping 2.6s cubic-bezier(0.22, 1, 0.36, 1) infinite; animation-delay: var(--pd, 0s); }
@keyframes br-ping { 0% { transform: scale(0.25); opacity: 0.7; } 70% { opacity: 0; } 100% { transform: scale(1.6); opacity: 0; } }
.br-pin.is-hot .br-dot { transform: scale(1.35); }

/* city label that slides out once the flag has landed */
.br-label {
  position: absolute; top: -11px; height: 22px; display: flex; align-items: center;
  padding: 0 10px; background: var(--white); border: 1px solid rgba(4,4,4,0.14);
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--black);
  white-space: nowrap; opacity: 0; pointer-events: none;
  transition: opacity 0.35s ease, transform 0.45s cubic-bezier(0.23, 1, 0.32, 1), color 0.2s, border-color 0.2s;
}
.br-pin.L .br-label { right: 16px; transform: translateX(8px); }
.br-pin.R .br-label { left: 16px; transform: translateX(-8px); }
.br-pin.is-on .br-label { opacity: 1; transform: none; pointer-events: auto; cursor: pointer; }
.br-pin.is-hot .br-label { color: var(--maroon); border-color: var(--maroon); }
.br-label b { font-weight: 600; color: var(--maroon); margin-left: 6px; }

/* flying flag (pennant on a pole) */
.br-flag {
  position: absolute; width: 0; height: 0; z-index: 4; pointer-events: none;
  will-change: transform;
}
.br-flag svg { position: absolute; left: -2px; top: -34px; width: 26px; height: 36px; overflow: visible; }
.br-flag .pole { stroke: var(--black); stroke-width: 1.4; }
.br-flag .cloth { fill: var(--maroon); }
.br-flag .foot { fill: var(--black); }
.br-flag.is-landed { opacity: 0; transition: opacity 0.25s ease; }

/* hover card */
.br-card {
  position: absolute; z-index: 10; width: 250px; padding: 16px 18px 16px;
  background: var(--white); border-top: 2px solid var(--maroon);
  box-shadow: 0 18px 40px rgba(4,4,4,0.14), 0 2px 8px rgba(4,4,4,0.06);
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity 0.22s ease, transform 0.3s cubic-bezier(0.23, 1, 0.32, 1), visibility 0s linear 0.3s;
}
.br-card.is-open { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.br-card-kicker { margin: 0 0 6px; font-size: 10px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--maroon); }
.br-card-name { margin: 0; font-family: var(--font-display); font-size: 20px; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); }
.br-card dl { margin: 12px 0 0; padding-top: 12px; border-top: 1px solid rgba(4,4,4,0.1); display: grid; gap: 8px; }
.br-card dt { font-size: 10px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--grey-400); }
.br-card dd { margin: 2px 0 0; font-size: 13px; line-height: 1.45; color: var(--ink); }
.br-card dd a { color: inherit; text-decoration: underline; text-decoration-color: rgba(103,13,33,0.3); text-underline-offset: 3px; }
.br-card dd a:hover { color: var(--maroon); }
.br-card dd.tbd { color: var(--grey-400); font-style: italic; }
.br-close { display: none; }

/* ---- tablet / phone ---- */
@media (max-width: 860px) {
  .br-inner { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; grid-template-areas: "head" "map" "list"; row-gap: 24px; padding-top: calc(var(--nav-height) + 8px); padding-bottom: var(--section-bottom); }
  .br-mapwrap { height: auto; }
  .br-map { height: auto; width: min(100%, 460px); }
  .br-list { margin-top: 0; }
}
@media (max-width: 680px) {
  .br-eyebrow { font-size: 13px; margin-bottom: 18px; }
  .br-label { font-size: 9px; height: 19px; top: -9.5px; padding: 0 7px; letter-spacing: 0.1em; }
  .br-pin.L .br-label { right: 12px; }
  .br-pin.R .br-label { left: 12px; }
  .br-card { width: 220px; padding: 14px 16px; }
  .br-card-name { font-size: 18px; padding-right: 28px; }
  .br-close {
    display: grid; place-items: center; position: absolute; top: 10px; right: 10px; width: 26px; height: 26px; padding: 0;
    background: none; border: 1px solid rgba(4,4,4,0.14); color: var(--black); cursor: pointer;
  }
  .br-close svg { width: 10px; height: 10px; stroke: currentColor; stroke-width: 1.6; fill: none; }
}
@media (prefers-reduced-motion: reduce) {
  .br-pin.is-on .br-ring { animation: none; }
  .br-dot, .br-label, .br-card { transition: none; }
}
