/* =========================================================
   HERO MAP — "Our service area"
   Replaces the old circular seal. Pure HTML/SVG/CSS, no map
   tiles or third-party requests. Schematic layout: distances
   from Hosur are compressed so all 16 places stay readable.
   Palette matches .home-hero (twilight navy + gold + coral).
   ========================================================= */
.hero-map{
  position:relative; width:100%; max-width:560px; margin-inline:auto;
  aspect-ratio:1 / 1;
  container-type:inline-size;
}

/* ---------- glass panel ---------- */
.hm-panel{
  position:absolute; inset:0; overflow:hidden; border-radius:28px;
  background:
    radial-gradient(ellipse 70% 60% at 30% 20%, rgba(94,84,214,.22), transparent 70%),
    linear-gradient(158deg, rgba(18,30,66,.82), rgba(16,16,48,.9));
  border:1px solid rgba(255,196,102,.30);
  box-shadow: 0 40px 70px -30px rgba(0,0,0,.65), inset 0 1px 0 rgba(255,255,255,.08), 0 0 0 6px rgba(255,196,102,.05);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.hm-svg{ position:absolute; inset:0; width:100%; height:100%; }
.hm-rings circle{ fill:none; stroke:rgba(255,196,102,.20); stroke-width:.22; stroke-dasharray:.6 1.1; }
.hm-rings circle:nth-child(odd){ stroke:rgba(255,196,102,.30); }

/* radar sweep around the head office */
.hm-sweep{ transform-box:view-box; animation:hmSweep 10s linear infinite; }
.hm-sweep line{ stroke:rgba(255,196,102,.35); stroke-width:.25; }
@keyframes hmSweep{ to{ transform:rotate(360deg); } }

/* routes: hub → each location, dashes flow outward */
.hm-route{
  fill:none; stroke:rgba(255,196,102,.42); stroke-width:.3; stroke-linecap:round;
  stroke-dasharray:1.1 1.3;
  animation:hmFlow 2.4s linear infinite, hmFade .8s ease .5s backwards;
  transition:stroke .25s, stroke-width .25s, opacity .25s;
}
@keyframes hmFlow{ to{ stroke-dashoffset:-4.8; } }
@keyframes hmFade{ from{ opacity:0; } }
.hero-map.has-active .hm-route{ opacity:.18; }
.hero-map.has-active .hm-route.is-active{ opacity:1; stroke:#FFC466; stroke-width:.55; }

/* ---------- panel header ---------- */
.hm-head{ position:absolute; left:18px; top:16px; display:flex; flex-direction:column; gap:3px; pointer-events:none; z-index:3; }
.hm-title{ font:600 .68rem/1 var(--font-mono); letter-spacing:.16em; text-transform:uppercase; color:#FFC466; }
.hm-sub{ font:500 .6rem/1.2 var(--font-mono); letter-spacing:.06em; color:rgba(247,243,234,.55); }
.hm-legend{ display:flex; align-items:center; gap:5px; margin-top:5px; font:500 .6rem/1 var(--font-mono); letter-spacing:.04em; color:rgba(247,243,234,.7); white-space:nowrap; }
.hm-legend i{ display:inline-block; width:8px; height:8px; margin-left:6px; }
.hm-legend i:first-child{ margin-left:0; }
.lg-city{ border-radius:50%; background:#FFC466; }
.lg-hill{ background:#FF9F66; clip-path:polygon(50% 0,100% 100%,0 100%); }
.lg-hq{ border-radius:50%; background:linear-gradient(135deg,#FFE2B0,#FF9F66); box-shadow:0 0 0 2px rgba(255,196,102,.3); }

/* ---------- pins ---------- */
.hm-points{ list-style:none; margin:0; padding:0; position:absolute; inset:0; z-index:2; }
.hm-pt{
  --d:11px; position:absolute; left:var(--x); top:var(--y); width:0; height:0;
  display:block; color:rgba(247,243,234,.88); text-decoration:none; outline:none;
  animation:hmPin .6s cubic-bezier(.2,.9,.3,1.3) calc(.55s + var(--i) * .07s) backwards;
  transition:opacity .25s;
}
@keyframes hmPin{ from{ opacity:0; } }
/* bigger invisible hit-area for fingers */
.hm-pt::before{ content:''; position:absolute; left:0; top:0; width:34px; height:34px; transform:translate(-50%,-50%); border-radius:50%; }

.hm-dot{
  position:absolute; left:0; top:0; width:var(--d); height:var(--d);
  transform:translate(-50%,-50%); border-radius:50%;
  background:#FFC466; box-shadow:0 0 0 3px rgba(255,196,102,.18), 0 0 14px rgba(255,196,102,.55);
  transition:transform .25s cubic-bezier(.2,.9,.3,1.4), box-shadow .25s;
}
.hm-town{ --d:8px; }
.hm-town .hm-dot{ background:#FFE2B0; box-shadow:0 0 0 2px rgba(255,226,176,.16), 0 0 9px rgba(255,226,176,.45); }
.hm-city .hm-dot::after{
  content:''; position:absolute; inset:0; border-radius:50%; border:1px solid rgba(255,196,102,.7);
  animation:hmPulse 2.8s ease-out infinite;
}
.hm-points li:nth-child(3n) .hm-city .hm-dot::after{ animation-delay:.9s; }
@keyframes hmPulse{ from{ transform:scale(1); opacity:.9; } to{ transform:scale(3); opacity:0; } }

/* hill stations = little peaks */
.hm-hill{ --d:13px; }
.hm-hill .hm-dot{
  border-radius:0; background:linear-gradient(180deg,#FFB27F,#E5764A); box-shadow:none;
  clip-path:polygon(50% 0,100% 100%,0 100%);
  filter:drop-shadow(0 0 5px rgba(255,159,102,.7));
}

/* head office */
.hm-hq{ --d:38px; z-index:3; }
.hm-hq .hm-dot{
  display:flex; align-items:center; justify-content:center; color:#2B1B4E;
  background:radial-gradient(circle at 32% 28%, #FFF1D0, #FFC466 55%, #E58A4E);
  box-shadow:0 0 0 5px rgba(255,196,102,.20), 0 0 28px 4px rgba(255,159,102,.55), inset 0 1px 2px rgba(255,255,255,.7);
}
.hm-hq .hm-dot svg{ width:20px; height:20px; }
.hm-hq .hm-dot::before, .hm-hq .hm-dot::after{
  content:''; position:absolute; inset:0; border-radius:50%; border:1.5px solid rgba(255,196,102,.75);
  animation:hmPulse 3s ease-out infinite;
}
.hm-hq .hm-dot::after{ animation-delay:1.5s; }

/* labels (font scales with the map so nothing collides) */
.hm-label{
  position:absolute; white-space:nowrap; pointer-events:none;
  font:600 clamp(9px, 2.05cqw, 12px)/1.15 var(--font-body); letter-spacing:.02em;
  color:rgba(247,243,234,.86); text-shadow:0 1px 6px rgba(8,10,36,.9), 0 0 2px rgba(8,10,36,.9);
  transition:color .25s;
}
.hm-label small{ display:block; margin-top:2px; font:500 clamp(7.5px, 1.6cqw, 9.5px)/1 var(--font-mono); letter-spacing:.06em; color:#FFC466; text-transform:uppercase; }
.hm-label b{ font-family:var(--font-display); font-size:1.18em; color:#fff; }
.hm-pt[data-side="r"] .hm-label{ left:calc(var(--d) / 2 + 7px); top:0; transform:translateY(-50%); }
.hm-pt[data-side="l"] .hm-label{ right:calc(var(--d) / 2 + 7px); top:0; transform:translateY(-50%); }
.hm-pt[data-side="b"] .hm-label{ left:0; top:calc(var(--d) / 2 + 6px); transform:translateX(-50%); text-align:center; }
.hm-pt[data-side="t"] .hm-label{ left:0; bottom:calc(var(--d) / 2 + 6px); transform:translateX(-50%); text-align:center; }

/* hover / focus / tapped */
.hero-map.has-active .hm-pt{ opacity:.5; }
.hero-map.has-active .hm-pt.is-active{ opacity:1; z-index:5; }
.hm-pt.is-active .hm-dot{ transform:translate(-50%,-50%) scale(1.55); }
.hm-pt.is-active .hm-label{ color:#FFC466; }
.hm-pt:focus-visible .hm-dot{ outline:2px solid #fff; outline-offset:3px; }

/* ---------- info bar ---------- */
.hm-info{
  position:absolute; left:14px; bottom:14px; z-index:4; max-width:calc(100% - 28px);
  display:inline-flex; align-items:center; gap:8px; padding:9px 14px; border-radius:999px;
  background:rgba(22,27,62,.72); border:1px solid rgba(255,196,102,.32);
  -webkit-backdrop-filter:blur(8px); backdrop-filter:blur(8px);
  font:500 .68rem/1 var(--font-mono); letter-spacing:.07em; text-transform:uppercase;
  color:rgba(247,243,234,.72); text-decoration:none; white-space:nowrap;
  transition:border-color .25s, color .25s, background .25s;
}
.hm-info i{ color:#FFC466; font-size:.8rem; }
.hm-info strong{ color:#FFC466; font-weight:700; letter-spacing:.08em; }
.hm-info em{ font-style:normal; color:#fff; }
.hm-info:hover, .hm-info:focus-visible{ border-color:#FFC466; color:#fff; }

/* ---------- floating stat chips ---------- */
.hm-chip{
  position:absolute; z-index:6; padding:10px 15px; border-radius:16px;
  background:rgba(22,27,62,.72); border:1px solid rgba(255,196,102,.32);
  -webkit-backdrop-filter:blur(10px); backdrop-filter:blur(10px);
  box-shadow:0 24px 46px -18px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.1);
  animation:hmFloat 6s ease-in-out infinite;
}
.hm-chip .hc-num{ font-family:var(--font-display); font-weight:700; font-size:1.15rem; color:#FFC466; line-height:1; }
.hm-chip .hc-lbl{ font:500 .6rem/1 var(--font-mono); letter-spacing:.08em; text-transform:uppercase; color:rgba(247,243,234,.72); margin-top:4px; }
.hm-chip.hc1{ top:-16px; right:-12px; }
.hm-chip.hc2{ bottom:26%; right:-18px; animation-delay:.8s; }
.hm-chip.hc3{ bottom:-18px; right:26px; animation-delay:1.6s; }
@keyframes hmFloat{ 0%,100%{ transform:translateY(0); } 50%{ transform:translateY(-6px); } }

/* ---------- responsive ---------- */
@media (max-width: 991.98px){
  .hero-map{ margin-top:24px; max-width:520px; }
}
@media (max-width: 575.98px){
  .hm-panel{ border-radius:22px; }
  .hm-head{ left:14px; top:13px; }
  .hm-sub{ display:none; }
  .hm-hq{ --d:30px; }
  .hm-hq .hm-dot svg{ width:16px; height:16px; }
  .hm-chip{ padding:8px 11px; border-radius:13px; }
  .hm-chip .hc-num{ font-size:1rem; }
  .hm-chip.hc1{ right:-6px; top:-14px; }
  .hm-chip.hc2{ right:-8px; }
  .hm-chip.hc3{ right:14px; }
  .hm-info{ left:10px; bottom:10px; padding:8px 12px; font-size:.6rem; }
  /* every place keeps its name on phones; small towns just get a slightly smaller label */
  .hm-label{ font-size:clamp(8.5px, 2.5cqw, 11px); }
  .hm-town .hm-label{ font-size:clamp(8px, 2.3cqw, 10px); font-weight:500; letter-spacing:0; }
  .hm-hq .hm-label small{ display:none; }
}
@media (prefers-reduced-motion: reduce){
  .hm-sweep, .hm-route, .hm-pt, .hm-chip, .hm-dot::before, .hm-dot::after{ animation:none !important; }
}

/* =========================================================
   PERFORMANCE — smooth map on phones & low-end devices
   • no backdrop-filter / blur on small screens (the #1 cause of scroll lag)
   • endless animations are paused whenever the map is off-screen
     (class .is-paused is toggled by hero-map.js) and on touch devices
     only the head-office pulse keeps running
   • the panel is isolated so its repaints never touch the rest of the page
   ========================================================= */
.hm-panel{ contain: layout paint style; }
.hm-sweep, .hm-chip, .hm-hq .hm-dot::before, .hm-hq .hm-dot::after{ will-change: transform; }
.hero-map.is-paused .hm-sweep,
.hero-map.is-paused .hm-route,
.hero-map.is-paused .hm-chip,
.hero-map.is-paused .hm-dot::before,
.hero-map.is-paused .hm-dot::after{ animation-play-state: paused !important; }

@media (max-width: 991.98px), (hover: none){
  /* solid glass instead of live blur */
  .hm-panel, .hm-info, .hm-chip{
    -webkit-backdrop-filter:none !important; backdrop-filter:none !important;
  }
  .hm-panel{ background:
      radial-gradient(ellipse 70% 60% at 30% 20%, rgba(94,84,214,.22), transparent 70%),
      linear-gradient(158deg, #121e42, #101030); box-shadow: 0 18px 34px -22px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.08); }
  .hm-info, .hm-chip{ background:#171c3e; box-shadow: 0 10px 20px -12px rgba(0,0,0,.6); }
  /* no radar rotation, no flowing dashes, no floating chips, no per-pin pulses */
  .hm-sweep{ animation:none !important; display:none; }
  .hm-route{ animation: hmFade .8s ease .5s backwards !important; }
  .hm-chip{ animation:none !important; }
  .hm-city .hm-dot::after{ animation:none !important; display:none; }
  /* cheaper glows */
  .hm-dot{ box-shadow: 0 0 0 3px rgba(255,196,102,.18), 0 0 6px rgba(255,196,102,.45); }
  .hm-town .hm-dot{ box-shadow: 0 0 0 2px rgba(255,226,176,.16); }
  .hm-hill .hm-dot{ filter:none !important; }
  .hm-hq .hm-dot{ box-shadow: 0 0 0 4px rgba(255,196,102,.2), 0 0 14px 2px rgba(255,159,102,.5); }
  /* pins fade in together instead of 16 staggered animations */
  .hm-pt{ animation: hmPin .5s ease .4s backwards !important; }
  .hm-pt, .hm-label{ will-change:auto; }
  /* the head office pulse (one element, 2 rings) is the only endless animation left */
  .hm-hq .hm-dot::after{ animation-duration:3.4s; }
}
