/* ==========================================================================
   Doctor 24By7 — Layout
   Grid system, hero, sections, blob backgrounds, animations
   ========================================================================== */

/* ---------- Grid ---------- */

.grid { display: grid; gap: var(--s-24); }

.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--6 { grid-template-columns: repeat(6, 1fr); }

.grid--gap-lg { gap: var(--s-32); }
.grid--gap-sm { gap: var(--s-16); }

@media (max-width: 980px) {
  .grid--3, .grid--4, .grid--6 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
  .grid--6 { grid-template-columns: repeat(2, 1fr); }
}

/* Two-column row (text + image / form) */

.row-2 {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: var(--s-64);
  align-items: center;
}
@media (max-width: 960px) {
  .row-2 { grid-template-columns: 1fr; gap: var(--s-40); }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding: calc(var(--nav-h) + var(--s-80)) 0 var(--s-96);
  background: var(--g-hero);
  color: #fff;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Ccircle cx='20' cy='20' r='1'/%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.hero__inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: var(--s-48);
  align-items: center;
}

@media (max-width: 980px) {
  .hero__inner { grid-template-columns: 1fr; text-align: center; }
  /* Content first, floating-cards visual below (DOM order). */
  .hero__visual { order: 1; margin-top: var(--s-8); }
}

.hero h1 {
  color: #fff;
  margin-bottom: var(--s-20);
}

.hero h1 .accent {
  background: linear-gradient(135deg, #FF7A99 0%, #FFB1C4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero__lead {
  font-size: var(--fs-18);
  color: rgba(255, 255, 255, 0.86);
  margin-bottom: var(--s-32);
  max-width: 560px;
}
@media (max-width: 980px) { .hero__lead { margin-left: auto; margin-right: auto; } }

.hero__ctas {
  display: flex;
  gap: var(--s-16);
  flex-wrap: wrap;
}
@media (max-width: 980px) { .hero__ctas { justify-content: center; } }

.hero__meta {
  margin-top: var(--s-48);
  display: flex;
  gap: var(--s-32);
  flex-wrap: wrap;
}
@media (max-width: 980px) { .hero__meta { justify-content: center; } }

.hero__meta-item {
  display: flex;
  flex-direction: column;
}
.hero__meta-item .num {
  font-family: var(--f-heading);
  font-weight: 800;
  font-size: var(--fs-32);
  color: #fff;
  line-height: 1;
}
.hero__meta-item .lbl {
  font-size: var(--fs-12);
  color: rgba(255, 255, 255, 0.74);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-top: 6px;
}

/* Hero visual — floating cards */

.hero__visual {
  position: relative;
  height: 460px;
}
@media (max-width: 980px) { .hero__visual { height: 320px; } }

.hero__visual-card {
  position: absolute;
  background: rgba(255, 255, 255, 0.96);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  box-shadow: var(--sh-lg);
  color: var(--c-text);
  display: flex;
  gap: 12px;
  align-items: center;
  /* Keep card text left-aligned even when the mobile hero centers its text */
  text-align: left;
  animation: spotlight 12s ease-in-out infinite;
  will-change: opacity, transform;
}

.hero__visual-card .icn {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--g-purple);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.hero__visual-card .icn.crimson { background: var(--g-crimson); }
.hero__visual-card .icn.soft { background: var(--g-purple-soft); }

.hero__visual-card .t {
  font-family: var(--f-heading);
  font-weight: 600;
  font-size: 13px;
  line-height: 1.2;
}
.hero__visual-card .d {
  font-size: 11px;
  color: var(--c-text-muted);
  margin-top: 2px;
}

/* Spotlight sequence: a card is highlighted when its 12s cycle passes 0%.
   With phase offset -d, the next highlight lands at t = 12-d — so these
   delays produce the order 1 → 2 → 3 → 4 (Purple AI first, then WhatsApp
   EMR, Secure Patient Data, Live BI Reports), one every 3 seconds. */
.hero__visual-card--1 { top: 4%; left: 4%; animation-delay: 0s; min-width: 220px; }
.hero__visual-card--2 { top: 26%; right: 0; animation-delay: -9s; min-width: 230px; }
.hero__visual-card--3 { bottom: 18%; left: 0; animation-delay: -6s; min-width: 210px; }
.hero__visual-card--4 { bottom: 0; right: 8%; animation-delay: -3s; min-width: 230px; }

/* Orb and rings: sized from the visual's height with aspect-ratio 1 and
   centered via margin:auto, so they stay perfect circles at every viewport
   (inset percentages would stretch them into ovals). transform is left free
   for the pulse/spin animations. */
.hero__visual > .ring {
  inset: 0 !important;
  margin: auto;
  height: 88%;
  width: auto;
  aspect-ratio: 1;
}
.hero__visual > .ring:nth-of-type(2) { height: 64%; }

.hero__visual-orb {
  position: absolute;
  inset: 0;
  margin: auto;
  height: 76%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.22), transparent 60%),
              var(--g-purple-soft);
  filter: blur(2px);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.4);
  animation: orb-pulse 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

@keyframes spotlight {
  0%, 18% {
    opacity: 1;
    transform: scale(1.04);
    box-shadow: var(--sh-lg), 0 0 0 1px rgba(200, 16, 46, 0.18);
  }
  28%, 95% {
    opacity: 0.45;
    transform: scale(0.94);
    box-shadow: var(--sh-sm);
  }
  100% {
    opacity: 1;
    transform: scale(1.04);
    box-shadow: var(--sh-lg), 0 0 0 1px rgba(200, 16, 46, 0.18);
  }
}

@keyframes orb-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

/* ---------- Blob backgrounds ---------- */

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
}

.blob--purple {
  background: radial-gradient(circle, rgba(224, 68, 88, 0.45), transparent 70%);
}

.blob--crimson {
  background: radial-gradient(circle, rgba(210, 20, 60, 0.22), transparent 70%);
}

.blob--deep {
  background: radial-gradient(circle, rgba(122, 15, 34, 0.35), transparent 70%);
}

.blob--xl { width: 700px; height: 700px; }
.blob--lg { width: 500px; height: 500px; }
.blob--md { width: 360px; height: 360px; }
.blob--sm { width: 220px; height: 220px; }

.blob--slow { animation: blob-drift 24s ease-in-out infinite; }
.blob--slow-reverse { animation: blob-drift 28s ease-in-out infinite reverse; }

@keyframes blob-drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(40px, -30px) scale(1.08); }
  66%      { transform: translate(-30px, 20px) scale(0.96); }
}

/* SVG blob shape (organic) */

.svg-blob {
  position: absolute;
  pointer-events: none;
  z-index: 0;
  opacity: 0.7;
}

/* ---------- Contact / CTA strip ---------- */

.cta-strip {
  position: relative;
  background: var(--g-purple);
  border-radius: var(--r-xl);
  padding: var(--s-64) var(--s-48);
  overflow: hidden;
  color: #fff;
  text-align: center;
}
.cta-strip h2 { color: #fff; margin-bottom: var(--s-16); }
.cta-strip .lead { color: rgba(255, 255, 255, 0.86); margin: 0 auto var(--s-32); }
.cta-strip__ctas {
  display: inline-flex;
  gap: var(--s-16);
  flex-wrap: wrap;
  justify-content: center;
}
@media (max-width: 600px) {
  .cta-strip { padding: var(--s-40) var(--s-24); }
}

/* ---------- Contact section ---------- */

.contact-card {
  display: flex;
  align-items: flex-start;
  gap: var(--s-16);
  padding: var(--s-20);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  transition: all var(--t-base) var(--ease-out);
}
.contact-card:hover {
  border-color: var(--c-soft-purple);
  box-shadow: var(--sh-sm);
}

.contact-card__icn {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--c-surface-tint);
  color: var(--c-primary-purple);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contact-card__t {
  font-family: var(--f-heading);
  font-weight: 600;
  font-size: var(--fs-14);
  color: var(--c-text-muted);
  margin: 0 0 2px;
}

.contact-card__v {
  font-family: var(--f-heading);
  font-weight: 600;
  font-size: var(--fs-16);
  color: var(--c-text);
  margin: 0;
  word-break: break-word;
}

/* ---------- Scroll reveal animation ---------- */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--t-slow) var(--ease-out),
              transform var(--t-slow) var(--ease-out);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal[data-delay="1"].is-visible { transition-delay: 0.08s; }
.reveal[data-delay="2"].is-visible { transition-delay: 0.16s; }
.reveal[data-delay="3"].is-visible { transition-delay: 0.24s; }
.reveal[data-delay="4"].is-visible { transition-delay: 0.32s; }

/* ---------- Logo strip (clients/partners) ---------- */

.logo-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--s-32);
  align-items: center;
}
.logo-strip img {
  max-height: 40px;
  width: auto;
  margin: 0 auto;
  opacity: 0.55;
  filter: grayscale(100%);
  transition: opacity var(--t-base), filter var(--t-base);
}
.logo-strip img:hover {
  opacity: 1;
  filter: grayscale(0%);
}
@media (max-width: 900px) {
  .logo-strip { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- AI feature ring (decoration around hero orb / sections) ---------- */

.ring {
  position: absolute;
  border-radius: 50%;
  border: 1px dashed rgba(255,255,255,0.18);
  pointer-events: none;
  animation: spin 40s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Page top spacing when no hero ---------- */

.page-top-pad { padding-top: calc(var(--nav-h) + var(--s-48)); }

/* ==========================================================================
   Mobile / tablet refinements
   Added so the existing desktop-first layout reflows cleanly on small screens
   without changing any functionality.
   ========================================================================== */

/* Tablet (≤768px): tighten section padding, shrink container gutters */
@media (max-width: 768px) {
  .section          { padding: var(--s-64) 0; }
  .section--lg      { padding: var(--s-80) 0; }
  .section--sm     { padding: var(--s-48) 0; }
  .section-header   { margin-bottom: var(--s-40); }
  .container        { padding: 0 20px; }
  .row-2            { gap: var(--s-32); }
}

/* Phone (≤600px): hero floating cards rework, tighter spacing */
@media (max-width: 600px) {
  .section          { padding: var(--s-48) 0; }
  .section--lg      { padding: var(--s-64) 0; }
  .section--sm     { padding: var(--s-32) 0; }
  .container        { padding: 0 16px; }

  /* Hero — shrink visual area and disable absolute card stacking */
  .hero             { padding: calc(var(--nav-h) + var(--s-48)) 0 var(--s-64); }
  .hero h1          { font-size: clamp(var(--fs-32), 8vw, var(--fs-40)); }
  .hero__lead       { font-size: var(--fs-16); margin-bottom: var(--s-24); }
  .hero__meta       { gap: var(--s-20); margin-top: var(--s-32); }
  .hero__meta-item .num { font-size: var(--fs-28); }
  .hero__ctas .btn  { width: 100%; justify-content: center; }

  /* Floating cards: same absolute/floating desktop composition (orb, rings,
     spotlight animation), fluidly scaled down so it fits without overflow */
  .hero__visual     { height: clamp(300px, 92vw, 380px); }
  .hero__visual-card {
    min-width: clamp(160px, 58vw, 230px);
    padding: clamp(12px, 3.4vw, 18px) clamp(14px, 3.8vw, 20px);
  }
  /* Four distinct vertical bands (~26% steps) so cards can never overlap
     on narrow screens, alternating left/right like the desktop layout. */
  .hero__visual-card--1 { top: 0;    left: 0;  right: auto; bottom: auto; }
  .hero__visual-card--2 { top: 26%;  right: 0; left: auto;  bottom: auto; }
  .hero__visual-card--3 { top: 52%;  left: 0;  right: auto; bottom: auto; }
  .hero__visual-card--4 { bottom: 0; right: 0; left: auto;  top: auto; }
  .hero__visual-card .icn { width: clamp(34px, 9vw, 44px); height: clamp(34px, 9vw, 44px); }
  .hero__visual-card .t   { font-size: clamp(11px, 3vw, 13px); }
  .hero__visual-card .d   { font-size: clamp(9px, 2.6vw, 11px); }

  /* Module/Purple-AI orb circles — scale fluidly */
  .row-2 [style*="aspect-ratio: 1"] > div[style*="width:140px"],
  .row-2 [style*="aspect-ratio: 1"] > div[style*="width:160px"] {
    width: clamp(96px, 30vw, 160px) !important;
    height: clamp(96px, 30vw, 160px) !important;
  }

  /* CTA strips — tighter padding */
  .cta-strip { padding: var(--s-32) var(--s-20); }
  .cta-strip__ctas { flex-direction: column; align-items: stretch; }
  .cta-strip__ctas .btn { width: 100%; justify-content: center; }

  /* Eyebrow + lead text spacing */
  .lead { font-size: var(--fs-16); }
}

/* Very small phones (≤380px): final guards against overflow */
@media (max-width: 380px) {
  .container        { padding: 0 12px; }
  .hero h1          { font-size: clamp(var(--fs-28), 8vw, var(--fs-32)); }
  .hero__meta       { gap: var(--s-16); }
}

/* ---------- Tables on phones: horizontal scroll affordance ---------- */
.compare-wrap,
.table-wrap {
  position: relative;
}
@media (max-width: 720px) {
  .compare-wrap::after,
  .table-wrap::after {
    content: "";
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 32px;
    pointer-events: none;
    background: linear-gradient(to left, rgba(255,250,251,0.95), transparent);
  }
  .compare-wrap::before,
  .table-wrap::before {
    content: "Swipe →";
    position: absolute;
    right: 10px;
    top: -22px;
    font-size: var(--fs-12);
    color: var(--c-text-soft);
    letter-spacing: 0.06em;
    pointer-events: none;
  }
}

/* ---------- Body scroll lock when mobile nav drawer is open ---------- */
body.has-nav-open {
  overflow: hidden;
  touch-action: none;
}
