/* ==========================================================
   Global theme tokens — single source of truth.
   Tailwind (see js/tailwind.config.js) reads these variables,
   so changing a value here re-themes the whole site.
   ========================================================== */
:root {
  /* Brand */
  --color-primary: 214 64 24;        /* #D64018 orange: 4.5:1 with white text (WCAG AA). Logo orange was #FF5C35 */
  --color-primary-dark: 176 50 14;   /* hover */
  --color-primary-soft: 255 239 233; /* tinted bg */
  --color-accent-blue: 79 140 255;   /* diamond blue */
  --color-accent-yellow: 255 196 61;
  --color-accent-mint: 233 250 246;
  --color-accent-lilac: 245 243 255;
  --color-accent-cream: 255 249 238;

  --color-dark: 8 8 8;             /* hero background */
  --color-soft: 246 246 247;        /* light section bg */

  /* Neutrals */
  --color-ink: 24 24 27;             /* headings near-black */
  --color-body: 102 108 133;         /* paragraph grey */
  --color-muted: 107 114 128;        /* #6B7280: 4.8:1 on white */
  --color-line: 232 234 242;
  --color-surface: 255 255 255;
  --color-canvas: 251 251 254;

  /* Typography */
  --font-sans: "Poppins", ui-sans-serif, system-ui, sans-serif;
  --font-display: "Lexend", "Poppins", ui-sans-serif, sans-serif;

  /* Shape & depth */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --shadow-btn: 0 10px 24px -8px rgb(var(--color-primary) / 0.55);
  --shadow-card: 0 20px 50px -20px rgb(var(--color-ink) / 0.15);

  --container: 1140px;
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  color: rgb(var(--color-body));
  background: rgb(var(--color-canvas));
  -webkit-font-smoothing: antialiased;
}

/* Soft pastel glows behind sections, like the reference */
.bg-glow {
  background:
    radial-gradient(600px 400px at 85% 20%, rgb(var(--color-accent-yellow) / 0.10), transparent 70%),
    radial-gradient(500px 400px at 10% 90%, rgb(var(--color-primary) / 0.06), transparent 70%),
    radial-gradient(500px 400px at 60% 60%, rgb(var(--color-accent-mint) / 0.9), transparent 70%),
    rgb(var(--color-canvas));
  background-color: rgb(var(--color-canvas));
}
html { color-scheme: light; }

.nav-link { position: relative; }
.nav-link.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -22px;
  height: 3px; border-radius: 3px; background: rgb(var(--color-primary));
}

.reveal { opacity: 0; transform: translateY(24px); transition: all .7s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }

@keyframes float { 0%,100% { transform: translateY(0) rotate(0) } 50% { transform: translateY(-10px) rotate(8deg) } }
.float { animation: float 5s ease-in-out infinite; }

.acc-body { max-height: 0; overflow: hidden; transition: max-height .35s ease; }
.acc.open .acc-body { max-height: 200px; }
.acc.open .acc-icon { transform: rotate(180deg); }

/* Hero glowing orbs (orange instead of green) */
.orb { position:absolute; border-radius:9999px;
  background: radial-gradient(circle at 70% 50%, rgb(var(--color-primary) / .45), rgb(var(--color-primary) / .08) 55%, transparent 70%); }
.orb-ring { position:absolute; border-radius:9999px; border-left:2px solid rgb(var(--color-primary) / .35); }
.nav-dark .nav-link.active::after { bottom:-8px; }

/* ---- Sriram Software additions ---- */
.font-tamil { font-family: "Noto Sans Tamil", var(--font-sans); }
.acc.open .acc-body { max-height: 600px; }

/* Mobile sticky action bar: keep content clear of it */
@media (max-width: 767px) { body { padding-bottom: 64px; } }
details > summary::-webkit-details-marker { display: none; }
#mobileNav details[open] > summary span { transform: rotate(45deg); }

/* ---- Accessibility ---- */
/* Text-sized orange on light backgrounds: #B8350F gives 5:1+ on white, soft grey and peach tints */
body .text-primary, body .hover\:text-primary:hover, body .group:hover .group-hover\:text-primary, body .group:hover .group-hover\/i\:text-primary { color: rgb(184 53 15); }
/* Brighter orange for text on dark sections, keeps 4.5:1 contrast on #080808 */
body .bg-dark .text-primary, body footer .text-primary, body .bg-dark .hover\:text-primary:hover, body footer .hover\:text-primary:hover { color: rgb(255 122 82); }
/* Glow orbs keep the original brand orange (decorative only) */
.orb { background: radial-gradient(circle at 70% 50%, rgb(255 92 53 / .45), rgb(255 92 53 / .08) 55%, transparent 70%); }
:focus-visible { outline: 3px solid rgb(255 122 82); outline-offset: 3px; border-radius: 4px; }
.bg-surface :focus-visible, main :focus-visible { outline-color: rgb(var(--color-primary)); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .float, .animate-pulse { animation: none !important; }
  * { transition-duration: 0.01ms !important; }
}
/* White panels inside dark sections (mega menu, hero form) go back to the deeper text orange */
body .bg-dark .bg-surface .text-primary, body .bg-dark .bg-surface .hover\:text-primary:hover, body .bg-dark .bg-surface .group:hover .group-hover\/i\:text-primary { color: rgb(184 53 15); }

/* ---- Phones: card groups become swipeable rows (all text stays on the page for SEO) ---- */
@media (max-width: 767px) {
  .m-scroll { display: flex !important; overflow-x: auto; scroll-snap-type: x mandatory; gap: 14px;
              margin-inline: -16px; padding: 4px 16px 16px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .m-scroll::-webkit-scrollbar { display: none; }
  .m-scroll > * { flex: 0 0 84%; scroll-snap-align: start; }
  .m-scroll.divide-y { border-top: 0; }
  .m-scroll.divide-y > * { border: 1px solid rgb(var(--color-line)); border-radius: 8px; padding: 20px; background: rgb(var(--color-surface)); }
  .m-scroll > .reveal { opacity: 1; transform: none; }
}
/* Decorative orbs never cause sideways page scroll */
html, body { overflow-x: clip; }

/* ---- Photo cards (articles, industries): on hover the picture fades and the description slides in ---- */
.fx-card .fx-img { transition: opacity .55s ease, transform .8s ease, filter .55s ease; }
.fx-card .fx-shade, .fx-card .fx-tint { transition: opacity .55s ease; }
.fx-card .fx-tint { opacity: 0; background: linear-gradient(160deg, rgb(255 92 53 / .38), rgb(72 70 78 / .78) 50%, rgb(34 33 38 / .92)); backdrop-filter: blur(2px); }
.fx-card .fx-more { display: grid; grid-template-rows: 0fr; opacity: 0; transform: translateY(10px);
                    transition: grid-template-rows .5s ease, opacity .45s ease .05s, transform .5s ease; }
.fx-card .fx-more > * { overflow: hidden; min-height: 0; }
@media (hover: hover) {
  .fx-card:hover .fx-img, .fx-card:focus-visible .fx-img { opacity: .22; filter: grayscale(.4) blur(1px); transform: scale(1.06); }
  .fx-card:hover .fx-shade, .fx-card:focus-visible .fx-shade { opacity: .35; }
  .fx-card:hover .fx-tint, .fx-card:focus-visible .fx-tint { opacity: 1; }
  .fx-card:hover .fx-more, .fx-card:focus-visible .fx-more { grid-template-rows: 1fr; opacity: 1; transform: none; }
}
/* Touch screens have no hover, so the description is always shown */
@media (hover: none) {
  .fx-card .fx-more { grid-template-rows: 1fr; opacity: 1; transform: none; }
}

/* Home hero accent: the burst sits after the heading and turns slowly */
.burst-spin { animation: burst-spin 14s linear infinite; }
@keyframes burst-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .burst-spin { animation: none; } }

/* Leadmoon chat bubble: on phones lift it above our sticky Call / WhatsApp / Quote bar */
@media (max-width: 767px) {
  body > div[style*="2147483000"] { bottom: 76px !important; }
}

/* Swipe rows must contain their hidden screen-reader text ("Learn more about …").
   .sr-only is position:absolute; without a positioned row it escaped to <body> and made
   phones widen the page to ~1600px, stretching the fixed Call / WhatsApp / Quote bar. */
.m-scroll { position: relative; }
