/**
 * Varsh Industries & Fabrication Pvt. Ltd. — Enterprise design tokens
 * Global corporate palette + rhythm (WCAG-oriented contrast targets).
 */

:root {
  /* Corporate neutrals & surfaces */
  --color-navy: #0f172a;
  --color-navy-light: #334155;
  --color-white: #ffffff;
  --surface-muted: #f8fafc;
  --text-primary: #111827;
  --text-secondary: #475569;
  --color-muted: #64748b;
  --border-enterprise: #cbd5e1;
  --color-border-subtle: rgba(203, 213, 225, 0.65);

  /* Primary actions — industrial blue (enterprise CTA) */
  --cta-blue: #2563eb;
  --cta-blue-hover: #1d4ed8;

  /* Brand spectrum — restrained use (logo bar / accents only) */
  --accent-red: #dc2626;
  --accent-orange: #ea580c;
  --accent-yellow: #eab308;
  --accent-green: #16a34a;
  --accent-blue: #2563eb;
  --accent-purple: #7c3aed;

  --trust-teal: #0f766e;

  --font-display: "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;

  --shadow-soft: 0 18px 48px rgba(15, 23, 42, 0.08);
  --radius-card: 0.75rem;
  --radius-btn: 0.5rem;

  /* Motion — “engineering” feel: restrained, no bounce */
  --ease-enterprise: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-micro: 180ms;
  --dur-reveal: 520ms;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--text-primary);
  background-color: var(--color-white);
  -webkit-font-smoothing: antialiased;
}

/* Homepage readability — mobile-first density (audit: ~16px body on small screens) */
.home-main-prose {
  font-size: 1rem;
  line-height: 1.65;
}

@media (min-width: 768px) {
  .home-main-prose {
    font-size: 1.0625rem;
    line-height: 1.68;
  }
}

@media (min-width: 1024px) {
  .home-main-prose {
    font-size: 1.125rem;
    line-height: 1.72;
  }
}

/* Fluid display type — enterprise scale (mobile ~34–38px → desktop ~56px) */
.hero-fluid-title {
  font-size: clamp(2.125rem, 5vw + 0.75rem, 3.5rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  font-weight: 600;
}

@media (min-width: 768px) {
  .hero-fluid-title {
    font-size: clamp(2.5rem, 3.2vw + 1.35rem, 3.5rem);
    line-height: 1.1;
  }
}

.type-fluid-h2 {
  font-size: clamp(1.625rem, 2.5vw + 1rem, 2.5rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.type-fluid-h3 {
  font-size: clamp(1.25rem, 1.5vw + 0.85rem, 1.75rem);
  line-height: 1.25;
}

/* Major section rhythm — mobile ~72px+, desktop breathing room */
.corporate-section {
  padding-top: clamp(4.5rem, 9vw, 6rem);
  padding-bottom: clamp(4.5rem, 9vw, 6rem);
}

@media (min-width: 768px) and (max-width: 1023px) {
  .corporate-section {
    padding-top: clamp(4.75rem, 8vw, 6.5rem);
    padding-bottom: clamp(4.75rem, 8vw, 6.5rem);
  }
}

@media (min-width: 1024px) {
  .corporate-section {
    padding-top: clamp(5rem, 10vw, 8.75rem);
    padding-bottom: clamp(5rem, 10vw, 8.75rem);
  }
}

.measure-prose {
  max-width: 65ch;
}

.surface-muted {
  background-color: var(--surface-muted);
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
}

/* Rainbow accent bar (logo spectrum) */
.rainbow-rule {
  height: 4px;
  border-radius: 9999px;
  background: linear-gradient(
    90deg,
    var(--accent-red),
    var(--accent-orange),
    var(--accent-yellow),
    var(--accent-green),
    var(--accent-blue),
    var(--accent-purple)
  );
}

.rainbow-border {
  position: relative;
  border-radius: var(--radius-card);
}

.rainbow-border::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  background: linear-gradient(
    135deg,
    var(--accent-red),
    var(--accent-orange),
    var(--accent-yellow),
    var(--accent-green),
    var(--accent-blue),
    var(--accent-purple)
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* Links & buttons — accent hover */
.link-accent {
  transition: color var(--dur-micro) var(--ease-enterprise), border-color var(--dur-micro) var(--ease-enterprise), opacity var(--dur-micro) var(--ease-enterprise);
}

.link-accent:hover {
  color: var(--cta-blue);
}

/* Desktop primary nav — subtle indicator, no gimmicks */
@media (min-width: 768px) {
  nav[aria-label="Primary"] a.link-accent {
    position: relative;
    padding-bottom: 2px;
  }

  nav[aria-label="Primary"] a.link-accent::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    border-radius: 1px;
    background: var(--cta-blue);
    opacity: 0.85;
    transition: width var(--dur-micro) var(--ease-enterprise);
  }

  nav[aria-label="Primary"] a.link-accent:hover::after,
  nav[aria-label="Primary"] a.link-accent:focus-visible::after {
    width: 100%;
  }
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  min-height: 48px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.01em;
  color: var(--color-white);
  background: var(--cta-blue);
  border-radius: var(--radius-btn);
  border: none;
  transition: background var(--dur-micro) var(--ease-enterprise), box-shadow var(--dur-micro) var(--ease-enterprise),
    transform var(--dur-micro) var(--ease-enterprise);
  position: relative;
  overflow: hidden;
}

.btn-primary:hover {
  background: var(--cta-blue-hover);
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.22);
  transform: translateY(-1px);
}

/* Restrained shine — single sweep on hover, low opacity */
.btn-primary:not(.btn-primary--light)::before {
  content: "";
  position: absolute;
  inset: 0;
  left: -40%;
  background: linear-gradient(105deg, transparent 0%, rgba(255, 255, 255, 0.14) 45%, transparent 75%);
  transform: skewX(-18deg) translateX(-120%);
  transition: transform 0.55s var(--ease-enterprise);
  pointer-events: none;
}

.btn-primary:not(.btn-primary--light):hover::before {
  transform: skewX(-18deg) translateX(220%);
}

/* Light button on navy / hero panels — keep contrast independent of primary blue */
.btn-primary.btn-primary--light {
  background: #fff !important;
  color: var(--color-navy) !important;
  box-shadow: none !important;
}

.btn-primary.btn-primary--light:hover {
  background: #f1f5f9 !important;
  color: var(--color-navy) !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.1) !important;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  min-height: 48px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: var(--radius-btn);
  border: 2px solid var(--border-enterprise);
  color: var(--text-primary);
  background: transparent;
  transition: border-color var(--dur-micro) var(--ease-enterprise), color var(--dur-micro) var(--ease-enterprise),
    background var(--dur-micro) var(--ease-enterprise), transform var(--dur-micro) var(--ease-enterprise),
    box-shadow var(--dur-micro) var(--ease-enterprise);
}

.btn-outline:hover {
  border-color: var(--cta-blue);
  color: var(--cta-blue);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
}

/* Cards — grounded lift, directional highlight; comfortable mobile padding */
.card-surface {
  background: var(--color-white);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
  transition: border-color var(--dur-micro) var(--ease-enterprise), transform var(--dur-micro) var(--ease-enterprise),
    box-shadow var(--dur-micro) var(--ease-enterprise);
  background-image: radial-gradient(120% 80% at 0% 0%, rgba(37, 99, 235, 0.04), transparent 42%);
}

@media (max-width: 767px) {
  .card-surface.p-8 {
    padding: 1.5rem;
  }

  .card-surface.p-6 {
    padding: 1.25rem;
  }
}

.card-surface:hover {
  border-color: rgba(37, 99, 235, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 22px 48px rgba(15, 23, 42, 0.1);
}

/* Hero industrial overlay — slate authority wash */
.hero-overlay {
  background: linear-gradient(
    105deg,
    rgba(15, 23, 42, 0.94) 0%,
    rgba(15, 23, 42, 0.8) 42%,
    rgba(15, 23, 42, 0.45) 100%
  );
}

/* Ultra-subtle industrial drift — only when image hero present */
.hero-gsap:has(.hero-overlay) {
  isolation: isolate;
}

.hero-gsap:has(.hero-overlay)::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.035;
  background-image: linear-gradient(
    105deg,
    transparent 38%,
    rgba(37, 99, 235, 0.45) 48%,
    transparent 58%
  );
  background-size: 220% 100%;
  animation: hero-drift-sweep 24s linear infinite;
}

@keyframes hero-drift-sweep {
  0% {
    background-position: 120% 0;
  }
  100% {
    background-position: -120% 0;
  }
}

.hero-gsap:has(.hero-overlay) > div.absolute {
  z-index: 0;
}

.hero-gsap:has(.hero-overlay) > div.relative {
  position: relative;
  z-index: 2;
}

/* Primary nav CTA emphasis */
.header-quote-btn {
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.28);
}

.header-quote-btn:focus-visible {
  outline: 3px solid #fbbf24;
  outline-offset: 2px;
}

/* Trust snapshot strip (homepage) */
.trust-snapshot {
  display: grid;
  gap: 1rem;
}

@media (min-width: 640px) {
  .trust-snapshot {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .trust-snapshot {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.trust-snapshot__cell {
  border-radius: var(--radius-card);
  border: 1px solid var(--color-border-subtle);
  background: #fff;
  padding: 1rem 1.15rem;
  box-shadow: 0 8px 24px rgba(11, 20, 38, 0.06);
}

.trust-snapshot__label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--color-navy);
  letter-spacing: 0.015em;
}

.trust-snapshot__hint {
  margin-top: 0.35rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--color-muted);
}

/* FAQ — native details for mobile-friendly accordion */
.faq-list details {
  border-radius: var(--radius-card);
  border: 1px solid var(--color-border-subtle);
  background: #fff;
  margin-bottom: 0.65rem;
  box-shadow: 0 6px 18px rgba(11, 20, 38, 0.05);
}

.faq-list summary {
  cursor: pointer;
  list-style: none;
  padding: 1rem 1.15rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--color-navy);
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list summary::after {
  content: "+";
  float: right;
  font-weight: 700;
  color: var(--accent-blue);
}

.faq-list details[open] summary::after {
  content: "−";
}

.faq-list details > div {
  padding: 0 1.15rem 1rem;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: #475569;
}

.faq-list summary:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: -2px;
  border-radius: var(--radius-card);
}

/* Embedded map — responsive */
.map-embed {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--color-border-subtle);
}

.map-embed iframe {
  display: block;
  width: 100%;
  min-height: 260px;
  border: 0;
}

@media (min-width: 768px) {
  .map-embed iframe {
    min-height: 320px;
  }
}

/* Sticky header — calm compaction on scroll (script toggles .site-header--scrolled) */
header.sticky {
  transition: box-shadow 0.25s var(--ease-enterprise), border-color 0.25s var(--ease-enterprise), backdrop-filter 0.25s ease;
}

header.sticky.site-header--scrolled {
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.06), 0 12px 36px rgba(15, 23, 42, 0.05);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

header.sticky.site-header--scrolled > div:first-of-type {
  padding-top: 0.75rem !important;
  padding-bottom: 0.75rem !important;
}

/* Compact sticky bar on phones — audit: logo + menu, avoid crowding */
@media (max-width: 767px) {
  header.sticky > div:first-of-type {
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
  }
}

/* Mobile CTA stack — full-width primary, comfortable tap height */
@media (max-width: 767px) {
  .mobile-cta-stack .btn-primary {
    width: 100%;
    min-height: 52px;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .mobile-cta-stack .btn-outline {
    width: 100%;
    min-height: 48px;
    justify-content: center;
  }
}

/* Site footer — clearer vertical rhythm on narrow screens */
@media (max-width: 1023px) {
  .site-footer-grid {
    gap: 2.5rem;
  }

  .site-footer-grid > div:not(:first-child) {
    padding-top: 1.5rem;
    border-top: 1px solid rgba(203, 213, 225, 0.65);
  }

  .site-footer-grid > div:first-child {
    padding-bottom: 0.25rem;
  }
}

@media (min-width: 1024px) {
  .site-footer-grid > div:not(:first-child) {
    padding-top: 0;
    border-top: none;
  }
}

/* GSAP initial states — short travel = precision, not theatre */
.js .hero-gsap .hero-line,
.js .hero-gsap .hero-sub,
.js .hero-gsap .hero-cta {
  opacity: 0;
}

.js .gsap-reveal {
  opacity: 0;
  transform: translateY(14px);
}

@media (max-width: 767px) {
  .js .gsap-reveal {
    transform: translateY(10px);
  }
}

/* Mobile nav panel — collapse fully when closed (opacity-only hid content but kept layout height) */
.mobile-panel {
  transition:
    max-height 0.32s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.22s ease,
    visibility 0.22s ease,
    border-top-width 0.22s ease;
}

.mobile-panel[data-open="false"] {
  max-height: 0;
  overflow: hidden;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  border-top-width: 0 !important;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
}

.mobile-panel[data-open="true"] {
  max-height: min(85vh, 32rem);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
}

@media (prefers-reduced-motion: reduce) {
  .mobile-panel {
    transition-duration: 0.01ms;
  }
}

/* WhatsApp — secondary channel vs formal enquiry (enterprise positioning) */
.whatsapp-float {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 50;
  width: 3rem;
  height: 3rem;
  border-radius: 9999px;
  background: #25d366;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 22px rgba(37, 211, 102, 0.28);
  opacity: 0.94;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.whatsapp-float:hover {
  transform: scale(1.04);
  opacity: 1;
  box-shadow: 0 10px 26px rgba(37, 211, 102, 0.38);
}

.whatsapp-float:focus-visible {
  outline: 3px solid var(--cta-blue);
  outline-offset: 3px;
}

.whatsapp-float svg {
  width: 1.4rem;
  height: 1.4rem;
}

/* Utility: focus ring for a11y */
:focus-visible {
  outline: 2px solid var(--cta-blue);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link:focus {
  position: fixed;
  left: 1rem;
  top: 1rem;
  width: auto;
  height: auto;
  padding: 0.5rem 1rem;
  background: var(--color-navy);
  color: var(--color-white);
  z-index: 100;
  border-radius: 0.375rem;
}

/* Mobile quote strip + FAB spacing (script injects .mobile-quote-strip) */
@media (max-width: 767px) {
  body {
    padding-bottom: calc(3.65rem + env(safe-area-inset-bottom, 0px));
  }

  .whatsapp-float {
    bottom: calc(4.15rem + env(safe-area-inset-bottom, 0px));
    right: max(1rem, env(safe-area-inset-right, 0px));
  }
}

@media (min-width: 768px) {
  .mobile-quote-strip {
    display: none !important;
  }
}

.mobile-quote-strip {
  position: fixed;
  z-index: 45;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0.85rem 1rem;
  padding-bottom: max(0.85rem, env(safe-area-inset-bottom, 0px));
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #fff;
  background: var(--cta-blue);
  box-shadow: 0 -12px 32px rgba(37, 99, 235, 0.22);
  text-decoration: none;
  transition: background 0.2s ease;
}

.mobile-quote-strip:hover {
  background: var(--cta-blue-hover);
  color: #fff;
}

.mobile-quote-strip:focus-visible {
  outline: 3px solid var(--accent-yellow);
  outline-offset: -3px;
}

/* Lightbox */
.varsh-lightbox[hidden] {
  display: none !important;
}

.varsh-lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.varsh-lightbox__backdrop {
  position: absolute;
  inset: 0;
  border: none;
  padding: 0;
  margin: 0;
  background: rgba(11, 20, 38, 0.88);
  cursor: pointer;
}

.varsh-lightbox__dialog {
  position: relative;
  z-index: 1;
  max-width: min(96vw, 56rem);
  max-height: min(90vh, 900px);
  width: 100%;
  background: #0f172a;
  border-radius: 1rem;
  padding: 0.75rem;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.45);
}

.varsh-lightbox__img {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(78vh, 820px);
  object-fit: contain;
  border-radius: 0.5rem;
}

.varsh-lightbox__caption {
  margin: 0.65rem 0.35rem 0.25rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: #e2e8f0;
  text-align: center;
}

.varsh-lightbox__close {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  z-index: 2;
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.varsh-lightbox__close:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* Purlin gallery thumb buttons */
.purlin-gallery-btn {
  display: block;
  width: 100%;
  overflow: hidden;
  border-radius: 0.75rem;
  border: 1px solid var(--color-border-subtle);
  padding: 0;
  background: #f8fafc;
  cursor: zoom-in;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  text-align: left;
}

.purlin-gallery-btn:hover {
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: var(--shadow-soft);
}

.purlin-gallery-btn:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

.purlin-gallery-btn img {
  pointer-events: none;
}

/* Reduced motion — accessibility & enterprise compliance */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hero-gsap:has(.hero-overlay)::after {
    animation: none !important;
    opacity: 0 !important;
  }

  .btn-primary:not(.btn-primary--light)::before {
    display: none !important;
  }
}

/* Mobile — lighter decoration (procurement phones, variable GPU) */
@media (max-width: 767px) {
  .hero-gsap:has(.hero-overlay)::after {
    opacity: 0.02;
    animation-duration: 32s;
  }

  .btn-primary:not(.btn-primary--light)::before {
    display: none;
  }
}

/* About — leadership portraits (uniform square crop, face anchored) */
.team-portrait-frame {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background-color: #f1f5f9;
}

.team-portrait {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.team-portrait--varsha {
  object-position: center 12%;
}

.team-portrait--krishnal {
  object-position: center 8%;
}

.team-portrait--gorakhnath {
  object-position: center 18%;
}

.team-portrait--sandip {
  object-position: center 10%;
}

.about-facility-video {
  width: 100%;
  border-radius: var(--radius-card);
  background: #0f172a;
}

.about-facility-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about-facility-gallery .gallery-tile {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius-card);
}
