/* ============================================
   SugarCARE — Base
   Reset, typography, primitives, nav, footer.
   Loaded after tokens.css on every page.
   ============================================ */

/* ─── RESET ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html { scroll-padding-top: calc(var(--nav-h) + 16px); }
body { margin: 0; overflow-x: hidden; }
html { overflow-x: hidden; }
img, svg, video { display: block; max-width: 100%; height: auto; }
button { font: inherit; cursor: pointer; background: none; border: none; padding: 0; color: inherit; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 700; }
p { margin: 0; }

/* ─── BODY DEFAULTS — Malayalam-first ──────────── */
body {
  font-family: var(--font-ml);
  font-size: var(--t-base);
  line-height: 1.6;
  color: var(--c-text);
  background: var(--c-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transition: opacity var(--t-fast);
}
body.show-en { font-family: var(--font-en-body); line-height: 1.55; }
/* Headings stay on the display typeface (Plus Jakarta) for tighter, more confident form */
body.show-en h1, body.show-en h2, body.show-en h3,
body.show-en h4, body.show-en h5, body.show-en h6 {
  font-family: var(--font-en);
}

/* ─── BILINGUAL VISIBILITY ─────────────────────── */
.ml { display: block; }
.en { display: none; }
span.ml, button .ml { display: inline; }
span.en, button .en { display: none; }
body.show-en .ml,
body.show-en span.ml,
body.show-en button .ml { display: none; }
body.show-en .en { display: block; }
body.show-en span.en,
body.show-en button .en { display: inline; }

/* ─── CONTAINER ────────────────────────────────── */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Body offset for fixed nav */
body.has-fixed-nav { padding-top: var(--nav-h); }

/* ─── SECTION RULES ────────────────────────────── */
/* Default: subtle hairline for intra-content section dividers */
.rule-orange {
  height: 1px;
  background: var(--c-border);
  border: 0;
  margin: 0;
}
/* Strong: 2.5px orange — reserved for major chapter breaks */
.rule-orange-strong {
  height: 2.5px;
  background: var(--c-orange);
  border: 0;
  margin: 0;
}

/* ─── PILLS ────────────────────────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--s-sm);
  padding: 6px 14px;
  border-radius: var(--r-pill);
  font-family: var(--font-en);
  font-size: var(--t-xs);
  font-weight: 600;
  background: var(--c-purple-tint);
  color: var(--c-purple);
}
.pill .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.pill-trust {
  background: var(--c-purple-tint-soft);
  color: var(--c-purple);
  border: 1px solid rgba(74,47,160,.10);
}
.pill-live {
  background: var(--c-mint-tint);
  color: #0F8A5F;
}
.pill-live .dot { animation: live-pulse 1.6s infinite; }
@keyframes live-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .35; transform: scale(.85); }
}

/* ─── BUTTONS ──────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-sm);
  padding: 12px 26px;
  border-radius: var(--r-pill);
  font-family: var(--font-en);
  font-size: var(--t-sm);
  font-weight: 700;
  letter-spacing: -.005em;
  white-space: nowrap;
  transition: transform var(--t-fast), box-shadow var(--t-fast),
              background-color var(--t-fast), color var(--t-fast);
  border: 1.5px solid transparent;
}
.btn-purple {
  background: var(--c-purple);
  color: var(--c-white);
  box-shadow: 0 4px 14px rgba(74,47,160,.25);
}
.btn-purple:hover {
  background: var(--c-purple-soft);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(74,47,160,.32);
}
.btn-orange {
  background: var(--c-orange);
  color: var(--c-white);
  box-shadow: 0 4px 14px rgba(232,106,26,.25);
}
.btn-orange:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(232,106,26,.32);
}
.btn-ghost {
  background: var(--c-white);
  color: var(--c-purple);
  border-color: var(--c-purple);
}
.btn-ghost:hover {
  background: var(--c-purple);
  color: var(--c-white);
}
.btn-lg {
  padding: 14px 30px;
  font-size: var(--t-base);
}
.btn-dark {
  background: var(--c-white);
  color: var(--c-purple-deep);
}
.btn-dark:hover {
  background: var(--c-orange);
  color: var(--c-white);
  transform: translateY(-1px);
}

/* ─── CARDS ────────────────────────────────────── */
.card-soft {
  background: var(--c-white);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-2);
  padding: var(--s-lg);
}
.card-float {
  position: absolute;
  background: var(--c-white);
  border-radius: var(--r-md);
  box-shadow: var(--sh-float);
  padding: 12px 16px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

/* ─── NAV ──────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(255,255,255,.85);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t-base-d), box-shadow var(--t-base-d);
}
.nav.scrolled {
  border-bottom-color: var(--c-border);
  box-shadow: var(--sh-1);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-h);
  gap: var(--s-md);
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.nav-logo-img {
  height: 38px;
  width: auto;
  display: block;
}
@media (max-width: 540px) {
  .nav-logo-img { height: 32px; }
}
.nav-logo {
  font-family: var(--font-en);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--c-purple-deep);
  letter-spacing: -.03em;
}
.nav-sub {
  font-family: var(--font-en);
  font-size: .75rem;
  font-weight: 600;
  color: var(--c-purple);
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--c-purple-tint-soft);
  letter-spacing: .02em;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-links a {
  padding: 8px 14px;
  font-family: var(--font-en);
  font-size: 1rem;
  font-weight: 500;
  color: var(--c-muted);
  border-radius: 8px;
  transition: color var(--t-fast), background-color var(--t-fast);
}
.nav-links a:hover {
  color: var(--c-purple);
  background: var(--c-purple-tint-soft);
}
body.show-en .nav-links a { font-family: var(--font-en); }
.nav-right {
  display: flex;
  align-items: center;
  gap: var(--s-sm);
  flex-shrink: 0;
}
.nav-phone {
  display: none;
  font-family: var(--font-en);
  font-size: .8rem;
  font-weight: 700;
  color: var(--c-purple);
}
.lang-toggle {
  display: inline-flex;
  background: var(--c-purple-tint-soft);
  border-radius: var(--r-pill);
  padding: 3px;
}
.lang-btn {
  padding: 4px 10px;
  font-family: var(--font-en);
  font-size: .7rem;
  font-weight: 700;
  color: var(--c-muted);
  border-radius: var(--r-pill);
  transition: background-color var(--t-fast), color var(--t-fast);
}
.lang-btn:hover { color: var(--c-purple); }
.lang-btn.active {
  background: var(--c-purple);
  color: var(--c-white);
}
.nav-cta {
  padding: 9px 20px;
  font-size: .8rem;
}
.nav-ham {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 6px;
}
.nav-ham span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--c-purple-deep);
  border-radius: 2px;
}
.nav-mob {
  display: none;
  flex-direction: column;
  background: rgba(26,14,80,.97);
  border-top: 1px solid rgba(255,255,255,.10);
  padding: var(--s-md) var(--gutter) var(--s-lg);
  gap: 4px;
}
.nav-mob.open { display: flex; }
.nav-mob a {
  font-family: var(--font-en);
  font-size: .9375rem;
  font-weight: 500;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,.08);
  color: rgba(255,255,255,.85);
}
.nav-mob .btn {
  margin-top: var(--s-md);
  background: var(--c-orange);
  color: var(--c-white);
  border-color: transparent;
}

@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-right .lang-toggle,
  .nav-right .nav-cta { display: none; }
  .nav-ham { display: flex; }
  .nav-phone { display: block; }
}

/* ─── FOOTER ───────────────────────────────────── */
.footer {
  background: var(--c-purple-deep);
  color: rgba(255,255,255,.72);
  padding: var(--s-2xl) 0 var(--s-lg);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: var(--s-xl);
}
.footer-brand .nav-logo {
  color: var(--c-white);
  font-size: 1.4rem;
}
.footer-brand p {
  margin-top: var(--s-md);
  font-size: .875rem;
  line-height: 1.65;
  color: var(--c-purple-light);
  max-width: 34ch;
}
.footer-col h4 {
  margin-bottom: var(--s-md);
  font-family: var(--font-en);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--c-white);
}
.footer-col ul li { margin-bottom: 10px; }
.footer-col a {
  font-size: .875rem;
  color: var(--c-purple-light);
  transition: color var(--t-fast);
}
.footer-col a:hover { color: var(--c-white); }
.footer-col li > span:not(.ml):not(.en) {
  font-size: .875rem;
  color: var(--c-purple-light);
}
.footer-bottom {
  margin-top: var(--s-xl);
  padding-top: var(--s-lg);
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s-md);
  font-size: .75rem;
  color: var(--c-purple-light);
}
.footer-bottom .lang-toggle { background: rgba(255,255,255,.08); }
.footer-bottom .lang-btn { color: rgba(255,255,255,.6); }
.footer-bottom .lang-btn:hover { color: var(--c-white); }
.footer-bottom .lang-btn.active {
  background: var(--c-white);
  color: var(--c-purple-deep);
}

@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--s-lg);
  }
}
@media (max-width: 540px) {
  .footer-grid { grid-template-columns: 1fr; }
}
