/* ==========================================================================
   J. Mitra & Bros — Design System
   Brand blue sampled from official JMB logo: #0095DA
   ========================================================================== */

:root {
  --brand:        #0095DA;
  --brand-600:    #0079B4;
  --brand-700:    #015F8E;
  --ink:          #0A2A43;  /* deep navy — headings */
  --ink-2:        #143A5A;
  --muted:        #51677B;  /* body / secondary text (>=4.5:1 on white) */
  --vital:        #10B981;  /* "saving lives" green — used sparingly */
  --bg:           #F5FAFD;
  --surface:      #FFFFFF;
  --line:         #E2ECF3;
  --ring:         rgba(0, 149, 218, .45);
  --shadow-sm:    0 1px 2px rgba(10, 42, 67, .06), 0 2px 8px rgba(10, 42, 67, .05);
  --shadow-md:    0 10px 30px -12px rgba(10, 42, 67, .22);
  --shadow-lg:    0 30px 60px -25px rgba(10, 42, 67, .35);
}

* { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink-2);
  background: var(--bg);
}

h1, h2, h3, h4, .font-display {
  font-family: "Figtree", "Inter", sans-serif;
  color: var(--ink);
  letter-spacing: -0.02em;
}

/* Focus visibility (a11y) ------------------------------------------------- */
a:focus-visible, button:focus-visible, input:focus-visible,
textarea:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
  border-radius: 6px;
}

.skip-link {
  position: fixed; top: -100px; left: 16px; z-index: 100;
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 10px;
  transition: top .2s ease;
}
.skip-link:focus { top: 16px; }

/* Section helpers --------------------------------------------------------- */
.kicker {
  display: inline-flex; align-items: center; gap: .6rem;
  font-family: "Figtree", sans-serif; font-weight: 700; font-size: .95rem;
  letter-spacing: .12em; text-transform: uppercase; color: var(--brand-600);
}
.kicker::before {
  content: ""; width: 34px; height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, var(--brand), transparent);
}

.lead { color: var(--muted); line-height: 1.75; }

/* Buttons ----------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  font-family: "Figtree", sans-serif; font-weight: 600; font-size: .95rem;
  padding: .82rem 1.5rem; border-radius: 999px; cursor: pointer;
  transition: background-color .2s ease, color .2s ease, box-shadow .2s ease, transform .2s ease;
  white-space: nowrap; min-height: 44px;
}
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 8px 20px -8px var(--ring); }
.btn-primary:hover { background: var(--brand-600); box-shadow: 0 12px 26px -8px var(--ring); }
.btn-ghost { background: rgba(255,255,255,.08); color: #fff; border: 1px solid rgba(255,255,255,.35); }
.btn-ghost:hover { background: rgba(255,255,255,.18); }
.btn-outline { background: #fff; color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand-600); }
.btn .ico { transition: transform .2s ease; }
.btn:hover .ico { transform: translateX(3px); }

/* Cards ------------------------------------------------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow-sm); transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}
.card-hover:hover { transform: translateY(-6px); box-shadow: 0 18px 40px -16px rgba(0,149,218,.32); border-color: #BFE0F2; }

/* Splash hover — brand colour washes across the box from the centre */
.splash { position: relative; overflow: hidden; isolation: isolate; }
.splash > * { position: relative; z-index: 1; }
.splash::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 0; height: 0;
  border-radius: 999px; transform: translate(-50%, -50%); z-index: 0;
  background: radial-gradient(circle, rgba(0,149,218,.20) 0%, rgba(0,149,218,.07) 55%, transparent 72%);
  transition: width .55s cubic-bezier(.22,.7,.2,1), height .55s cubic-bezier(.22,.7,.2,1);
}
.splash:hover::before, .splash:focus-within::before, .splash.active::before { width: 320%; height: 320%; }
.splash:hover .node-ic, .splash:hover .cap-ic { color: var(--brand); }
@media (prefers-reduced-motion: reduce) {
  .splash::before { transition: none; }
}

/* Icon tile that animates on card hover */
.cap-ic { transition: transform .35s cubic-bezier(.22,.7,.2,1), background-color .3s ease, color .3s ease; }
.card-hover:hover .cap-ic, .splash:hover .cap-ic { transform: translateY(-3px) scale(1.08); }

/* Elevated inner-page header */
.ihero { position: relative; }
.ihero > .container-x { position: relative; z-index: 3; }
.ihero::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(55% 70% at 86% -12%, rgba(0,149,218,.22), transparent 56%),
    radial-gradient(46% 64% at -6% 112%, rgba(16,185,129,.13), transparent 56%);
}
.ihero::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; z-index: 2;
  background: linear-gradient(90deg, transparent, rgba(57,182,236,.55), transparent);
}

/* Pause looping animations while their host is off-screen (perf) */
.anim-off, .anim-off * { animation-play-state: paused !important; }

/* Navbar ------------------------------------------------------------------ */
.nav-shell {
  position: fixed; inset: 16px 0 auto 0; z-index: 50;
  display: flex; justify-content: center; padding: 0 16px;
  transition: inset .3s ease;
}
.nav-bar {
  width: 100%; max-width: 1180px;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  background: rgba(255,255,255,.92); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px);
  border: 1px solid var(--line); border-radius: 16px;
  padding: .72rem .72rem .72rem 1.2rem; box-shadow: var(--shadow-sm);
  transition: box-shadow .3s ease, background .3s ease;
}
.nav-scrolled .nav-bar { box-shadow: var(--shadow-md); background: rgba(255,255,255,.95); }
.nav-link {
  position: relative; font-weight: 500; font-size: 1.03rem; color: var(--ink-2);
  padding: .5rem .2rem; transition: color .2s ease;
}
.nav-link::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 0;
  background: var(--brand); border-radius: 2px; transition: width .25s ease;
}
.nav-link:hover, .nav-link[aria-current="page"] { color: var(--brand-600); }
.nav-link:hover::after, .nav-link[aria-current="page"]::after { width: 100%; }

/* Mobile menu */
.mobile-panel {
  max-height: 0; overflow: hidden; opacity: 0;
  transition: max-height .35s ease, opacity .25s ease;
}
.mobile-panel.open { max-height: 520px; opacity: 1; }

/* Hero slideshow ---------------------------------------------------------- */
.hero-slides { position: absolute; inset: 0; }
.hero-slide {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  opacity: 0; transform: scale(1.06);
  transition: opacity 1.4s ease, transform 7s ease;
}
.hero-slide.active { opacity: 1; transform: scale(1); }
.hero-dots { display: flex; gap: .5rem; }
.hero-dot {
  width: 30px; height: 4px; border-radius: 4px; background: rgba(255,255,255,.35);
  cursor: pointer; transition: background .3s ease;
}
.hero-dot.active { background: #fff; }

/* Reusable image slideshow (e.g. manufacturing facility) ------------------ */
.ss { position: relative; overflow: hidden; }
.ss-track { position: relative; width: 100%; height: 100%; }
.ss-slide {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transform: scale(1.05);
  transition: opacity 1.2s ease, transform 6s ease;
}
.ss-slide.active { opacity: 1; transform: scale(1); }
.ss-dots { position: absolute; left: 0; right: 0; bottom: 16px; display: flex; gap: .5rem; justify-content: center; z-index: 2; }
.ss-dot {
  width: 26px; height: 4px; border-radius: 4px; background: rgba(255,255,255,.4);
  cursor: pointer; transition: background .3s ease; border: 0; padding: 0;
}
.ss-dot.active { background: #fff; }
@media (prefers-reduced-motion: reduce) {
  .ss-slide { transition: opacity .4s ease; transform: none !important; }
}

/* Scroll reveal ----------------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: .08s; }
.reveal[data-delay="2"] { transition-delay: .16s; }
.reveal[data-delay="3"] { transition-delay: .24s; }
.reveal[data-delay="4"] { transition-delay: .32s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; transition: none; }
  .hero-slide { transition: opacity .4s ease; transform: none !important; }
}

/* Partner marquee --------------------------------------------------------- */
.marquee { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.marquee-track { display: flex; gap: 3.5rem; width: max-content; animation: scroll-x 34s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes scroll-x { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marquee-track { animation: none; flex-wrap: wrap; width: auto; justify-content: center; } }

.brand-chip {
  font-family: "Figtree", sans-serif; font-weight: 700; font-size: 1.35rem;
  letter-spacing: -.01em; color: #93A8B8; filter: grayscale(1); opacity: .85;
  transition: color .3s ease, opacity .3s ease, filter .3s ease; white-space: nowrap;
}
.brand-chip:hover { color: var(--brand-600); opacity: 1; filter: grayscale(0); }

/* Products explorer ------------------------------------------------------- */
.pf-chip {
  font-family: "Figtree", sans-serif; font-weight: 600; font-size: .92rem;
  padding: .55rem 1.15rem; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; color: var(--ink-2); cursor: pointer; min-height: 44px;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.pf-chip:hover { border-color: var(--brand); color: var(--brand-600); }
.pf-chip.active { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 8px 18px -8px var(--ring); }
.pf-card { animation: pf-in .45s cubic-bezier(.2,.7,.2,1) both; }
.pf-card.hide { display: none; }
@keyframes pf-in { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .pf-card { animation: none; } }
.pf-badge { font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: .2rem .55rem; border-radius: 999px; }
.prod-thumb { height: 190px; background: #F7FBFD; display: flex; align-items: center; justify-content: center; padding: 16px; overflow: hidden; }
.prod-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Product detail modal */
.prod-modal { position: fixed; inset: 0; z-index: 60; display: none; }
.prod-modal.open { display: flex; align-items: center; justify-content: center; padding: 1rem; }
.prod-modal-overlay { position: absolute; inset: 0; background: rgba(8,27,45,.55); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.prod-modal-panel { position: relative; z-index: 1; width: 100%; max-width: 640px; max-height: 90vh; overflow: auto; background: #fff; border-radius: 20px; }
@media (min-width: 768px) { .prod-modal-panel { max-width: 840px; } }
.prod-modal.open .prod-modal-panel { animation: modal-in .3s cubic-bezier(.2,.7,.2,1); }
@keyframes modal-in { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .prod-modal.open .prod-modal-panel { animation: none; } }
.modal-x { position: absolute; top: 14px; right: 14px; z-index: 2; width: 40px; height: 40px; border-radius: 999px; background: #fff; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--ink); box-shadow: var(--shadow-sm); transition: border-color .2s, color .2s; }
.modal-x:hover { border-color: var(--brand); color: var(--brand); }
.modal-thumb { height: 300px; background: #F7FBFD; display: flex; align-items: center; justify-content: center; padding: 26px; border-radius: 20px 20px 0 0; }
.modal-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.modal-gallery { display: flex; gap: .6rem; padding: 12px 26px 0; flex-wrap: wrap; }
.modal-thumb-btn { width: 64px; height: 64px; border-radius: 12px; border: 2px solid var(--line); background: #fff; padding: 4px; cursor: pointer; overflow: hidden; transition: border-color .2s ease; }
.modal-thumb-btn img { width: 100%; height: 100%; object-fit: contain; }
.modal-thumb-btn:hover { border-color: #CFE3F0; }
.modal-thumb-btn.active { border-color: var(--brand); }

/* Partner logos ----------------------------------------------------------- */
.p-logo {
  max-height: 46px; max-width: 168px; width: auto; object-fit: contain;
  filter: grayscale(1); opacity: .66; transition: filter .3s ease, opacity .3s ease;
}
.card-hover:hover .p-logo { filter: grayscale(0); opacity: 1; }
.marquee .p-logo { max-height: 38px; max-width: 150px; }
.marquee .p-logo:hover { filter: grayscale(0); opacity: 1; }

/* Customer logos ---------------------------------------------------------- */
.c-logo {
  max-height: 54px; max-width: 150px; width: auto; object-fit: contain;
  filter: grayscale(1); opacity: .62; transition: filter .35s ease, opacity .35s ease;
}
.card-hover:hover .c-logo { filter: grayscale(0); opacity: 1; }

/* Stat counters ----------------------------------------------------------- */
.stat-num { font-family: "Figtree", sans-serif; font-weight: 800; letter-spacing: -.03em; line-height: 1; }


/* Decorative grid / glow -------------------------------------------------- */
.grid-bg {
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 35%, transparent 72%);
  mask-image: radial-gradient(ellipse at center, #000 35%, transparent 72%);
}
.glow { background: radial-gradient(circle at center, rgba(0,149,218,.18), transparent 65%); }

/* EKG line animation (hero accent) --------------------------------------- */
.ekg path {
  stroke-dasharray: 1400; stroke-dashoffset: 1400;
  animation: ekg-draw 4.5s ease-in-out infinite;
}
@keyframes ekg-draw { 0%{stroke-dashoffset:1400} 55%{stroke-dashoffset:0} 100%{stroke-dashoffset:-1400} }
@media (prefers-reduced-motion: reduce) { .ekg path { animation: none; stroke-dashoffset: 0; } }

/* India locations map ----------------------------------------------------- */
.india-wrap { position: relative; width: 100%; max-width: 520px; margin-inline: auto; }
.india-wrap img { width: 100%; height: auto; aspect-ratio: 612 / 696; display: block; filter: drop-shadow(0 18px 30px rgba(10,42,67,.12)); }
.map-pin {
  position: absolute; transform: translate(-50%, -50%); cursor: pointer;
  width: 18px; height: 18px; z-index: 2;
}
.map-pin .dot {
  position: absolute; inset: 0; margin: auto; width: 12px; height: 12px; border-radius: 999px;
  background: var(--brand); border: 2.5px solid #fff; box-shadow: 0 2px 6px rgba(10,42,67,.3);
  transition: transform .2s ease, background .2s ease;
}
.map-pin.is-hq .dot { width: 15px; height: 15px; background: var(--ink); }
.map-pin.is-mfg .dot { background: var(--vital); }
.map-pin .pulse {
  position: absolute; inset: 0; margin: auto; width: 12px; height: 12px; border-radius: 999px;
  background: var(--brand); opacity: .5; animation: pin-pulse 2.4s ease-out infinite;
}
.map-pin.is-hq .pulse { background: var(--ink); }
.map-pin.is-mfg .pulse { background: var(--vital); }
@keyframes pin-pulse { 0%{transform:scale(1);opacity:.5} 70%{transform:scale(3);opacity:0} 100%{opacity:0} }
@media (prefers-reduced-motion: reduce) { .map-pin .pulse { animation: none; opacity: 0; } }
.map-pin .label {
  position: absolute; bottom: 150%; left: 50%; transform: translateX(-50%) translateY(6px);
  background: var(--ink); color: #fff; font-size: 12px; font-weight: 600; white-space: nowrap;
  padding: 5px 10px; border-radius: 8px; opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease;
}
.map-pin .label::after { content:""; position:absolute; top:100%; left:50%; transform:translateX(-50%); border:5px solid transparent; border-top-color: var(--ink); }
.map-pin:hover { z-index: 5; }
.map-pin:hover .dot { transform: scale(1.25); }
.map-pin:hover .label, .map-pin:focus-visible .label { opacity: 1; transform: translateX(-50%) translateY(0); }
/* list <-> map linking */
.loc-row { transition: background .2s ease, border-color .2s ease; }
.loc-row.active, .loc-row:hover { background: #fff; border-color: #CFE3F0; box-shadow: var(--shadow-sm); }
.map-pin.active .dot { transform: scale(1.35); }
.map-pin.active .label { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Heritage timeline ------------------------------------------------------- */
.timeline { position: relative; }
.timeline::before {
  content: ""; position: absolute; left: 19px; top: 6px; bottom: 6px; width: 2px;
  background: linear-gradient(var(--brand), #CFE3F0); border-radius: 2px;
}
@media (min-width: 768px) { .timeline::before { left: 50%; transform: translateX(-50%); } }
.tl-item { position: relative; padding-left: 56px; }
@media (min-width: 768px) {
  .tl-item { padding-left: 0; width: 50%; }
  .tl-item:nth-child(odd) { left: 0; padding-right: 48px; text-align: right; }
  .tl-item:nth-child(even) { left: 50%; padding-left: 48px; }
}
.tl-dot {
  position: absolute; left: 11px; top: 4px; width: 18px; height: 18px; border-radius: 999px;
  background: #fff; border: 3px solid var(--brand); box-shadow: 0 0 0 4px var(--bg); z-index: 2;
}
@media (min-width: 768px) {
  .tl-item:nth-child(odd) .tl-dot { left: auto; right: -9px; }
  .tl-item:nth-child(even) .tl-dot { left: -9px; }
}
.tl-year { font-family: "Figtree", sans-serif; font-weight: 800; color: var(--brand-600); font-size: 1.4rem; letter-spacing: -.02em; }

/* Bypass circuit ---------------------------------------------------------- */
.bp-svg { width: 100%; height: auto; display: block; }
.bp-svg .tube { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.bp-svg .tube-venous { stroke: #C8E0EF; stroke-width: 13; }
.bp-svg .tube-art    { stroke: #F2CDCD; stroke-width: 13; }
.bp-svg .tube-cardio { stroke: #C4EBD9; stroke-width: 10; }
.bp-svg .flow { fill: none; stroke-linecap: round; stroke-width: 6; stroke-dasharray: 1 17; }
.bp-svg .flow-venous { stroke: #0095DA; animation: bp-flow 1.05s linear infinite; }
.bp-svg .flow-art    { stroke: #E5484D; animation: bp-flow 1.05s linear infinite; }
.bp-svg .flow-cardio { stroke: #10B981; stroke-dasharray: 1 15; animation: bp-flow 1.4s linear infinite; }
@keyframes bp-flow { to { stroke-dashoffset: -18; } }
@media (prefers-reduced-motion: reduce) { .bp-svg .flow { animation: none; stroke-dasharray: 1 9; } }

.bp-node { cursor: pointer; outline: none; }
.bp-node .node-bg { fill: #fff; stroke: #D5E3EE; stroke-width: 2.5; transition: stroke .2s ease; }
.bp-node .node-ic { stroke: var(--brand-600); fill: none; stroke-width: 2; transition: stroke .2s ease; }
.bp-node .node-tx { font-family: "Figtree", sans-serif; font-weight: 700; font-size: 15px; fill: var(--ink); }
.bp-node .node-ring { fill: none; stroke: var(--brand); stroke-width: 2.5; opacity: 0; transform-box: fill-box; transform-origin: center; }
.bp-node:hover .node-bg, .bp-node:focus-visible .node-bg, .bp-node.active .node-bg { stroke: var(--brand); }
.bp-node.active .node-ring { opacity: 1; animation: bp-ring 1.8s ease-out infinite; }
@keyframes bp-ring { 0%{transform:scale(1);opacity:.6} 70%{transform:scale(1.5);opacity:0} 100%{opacity:0} }
@media (prefers-reduced-motion: reduce){ .bp-node.active .node-ring{ animation:none; opacity:.6 } }
.bp-node.is-heart .node-ic { stroke: #E5484D; }

.bp-panel { transition: opacity .25s ease, transform .25s ease; }
.bp-legend span { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; font-weight: 600; color: var(--muted); }
.bp-legend i { width: 12px; height: 12px; border-radius: 999px; display: inline-block; }

/* Utility ----------------------------------------------------------------- */
.container-x { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: 1.25rem; }
.text-balance { text-wrap: balance; }
.divider-soft { height: 1px; background: linear-gradient(90deg, transparent, var(--line), transparent); }
