/* ============================================================
   safari-mobile.css
   Safari Compatibility + Enhanced Mobile Responsiveness
   ============================================================ */

/* ── 1. Safari Core Fixes ─────────────────────────────────── */

/* Prevent iOS Safari from zooming on form focus */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="search"],
  textarea,
  select {
    font-size: 16px !important;
  }
}

/* Remove Safari default form styling */
input,
textarea,
select,
button {
  -webkit-appearance: none;
  appearance: none;
  border-radius: 0;
}

/* Restore button border-radius */
button,
.btn,
.nav-cta,
.submit-btn {
  border-radius: var(--r-sm);
}

.btn {
  border-radius: 980px;
}

.nav-cta {
  border-radius: 980px;
}

/* Safari backdrop-filter with -webkit- prefix */
.navbar.scrolled {
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}

.mobile-menu {
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}

.cta-box {
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

/* Safari: position sticky */
.navbar {
  position: -webkit-sticky;
  position: fixed;
}

/* Safari: -webkit-mask for hero grid bg & marquee */
.hero-grid-bg {
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black 30%, transparent 80%);
  mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black 30%, transparent 80%);
}

.marquee-wrap {
  -webkit-mask: linear-gradient(90deg, transparent, #fff 10%, #fff 90%, transparent);
  mask: linear-gradient(90deg, transparent, #fff 10%, #fff 90%, transparent);
}

/* Safari: -webkit-clip-path for hex cta shapes */
.cta-shape.hex {
  -webkit-clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

/* Safari: -webkit-overflow-scrolling for smooth momentum scroll */
body,
.mobile-menu {
  -webkit-overflow-scrolling: touch;
}

/* Safari: text rendering */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Safari: safe-area insets for notch phones (iPhone X+) */
.navbar {
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

.footer {
  padding-bottom: calc(36px + env(safe-area-inset-bottom));
}

.mobile-menu {
  padding-left: calc(28px + env(safe-area-inset-left));
  padding-right: calc(28px + env(safe-area-inset-right));
  padding-bottom: calc(32px + env(safe-area-inset-bottom));
}

/* Safari: fix for flex gap (older Safari < 14.1) */
.nav-links {
  gap: 2px;
}

.hero-actions {
  gap: 12px;
}

.footer-grid {
  gap: 44px;
}

/* Safari: conic-gradient fallback (btn-outline animation) */
@supports not (background: conic-gradient(red, blue)) {
  .btn-outline::before {
    display: none;
  }
}

/* Safari: will-change hints for smooth animation */
.navbar,
.mobile-menu,
.nf-card,
.feat-card,
.value-card,
.vm-card,
.impact-card,
.ci-card,
.btn {
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

/* Safari: fix for animation-fill-mode */
[data-animate] {
  -webkit-animation-fill-mode: both;
  animation-fill-mode: both;
}

/* ── 2. Nav Logo Mobile Fix ───────────────────────────────── */

/* The logo is 148px on desktop (too large for mobile navbar) */
@media (max-width: 900px) {
  .nav-logo img {
    height: 56px !important;
    max-width: 180px;
  }

  .nav-inner {
    padding: 0 20px;
  }

  .hamburger {
    padding: 10px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .nav-logo img {
    height: 44px !important;
    max-width: 150px;
  }

  .nav-inner {
    padding: 0 16px;
  }
}

/* ── 3. Mobile Menu Improvements ─────────────────────────── */

.mobile-menu {
  overflow-y: auto;
  max-height: calc(100vh - var(--nav-h));
}

.mobile-menu .nav-link {
  min-height: 48px;
  display: flex;
  align-items: center;
  padding: 14px 16px;
  font-size: .95rem;
  border-radius: var(--r-sm);
  border-bottom: 1px solid var(--divider);
}

.mobile-menu .nav-cta {
  margin-top: 20px;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .95rem;
}

/* ── 4. Hero Section Mobile ───────────────────────────────── */

@media (max-width: 768px) {
  .hero {
    min-height: calc(100svh, 100vh);
    /* svh for iOS Safari address bar */
  }

  .hero-inner {
    padding: 64px 0 48px;
  }

  .hero-eyebrow {
    font-size: .65rem;
    margin-bottom: 24px;
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
    gap: 6px 8px;
  }

  .hero-slider {
    min-height: auto;
  }

  .hero-slide h1 {
    font-size: clamp(1.85rem, 7.5vw, 2.8rem) !important;
    letter-spacing: -.02em;
    line-height: 1.15;
    margin-bottom: 16px;
  }

  .hero-slide p {
    font-size: .92rem;
    line-height: 1.8;
    margin-bottom: 24px;
  }

  .hero-actions {
    -webkit-flex-direction: column;
    flex-direction: column;
    -webkit-align-items: stretch;
    align-items: stretch;
    gap: 10px;
    width: 100%;
    max-width: 340px;
    margin: 0 auto;
  }

  .hero-actions .btn {
    width: 100%;
    justify-content: center;
    min-height: 50px;
  }

  .slider-dots {
    margin-top: 28px;
  }

  .s-dot {
    width: 8px;
    height: 8px;
    min-width: 8px;
  }

  .s-dot.active {
    width: 24px;
  }
}

/* ── 5. Section & Container Mobile ───────────────────────── */

@media (max-width: 640px) {
  .section {
    padding: 56px 0;
  }

  .section-sm {
    padding: 40px 0;
  }

  .container {
    padding: 0 18px;
  }

  .text-center h2 {
    font-size: clamp(1.5rem, 5vw, 2rem);
  }

  .lead {
    font-size: 1rem;
    line-height: 1.8;
  }

  .section-rule {
    margin: 14px 0 22px;
  }
}

/* ── 6. Cards & Grids Mobile ─────────────────────────────── */

@media (max-width: 640px) {
  /* Card hover → disable transform on touch devices */
  @media (hover: none) {
    .card:hover,
    .feat-card:hover,
    .nf-card:hover,
    .vm-card:hover,
    .value-card:hover,
    .impact-card:hover,
    .ci-card:hover {
      transform: none;
      box-shadow: var(--shadow-sm);
    }
  }

  .nf-card {
    padding: 24px 20px;
  }

  .vm-card {
    padding: 32px 24px;
  }

  .value-card {
    padding: 28px 22px;
  }

  .impact-card {
    padding: 24px 20px;
  }

  .feat-card {
    padding: 28px 22px;
  }

  .cap-cell {
    padding: 28px 20px;
  }
}

/* ── 7. Contact Page Mobile ──────────────────────────────── */

@media (max-width: 640px) {
  .contact-layout {
    margin-top: 32px;
    gap: 24px;
  }

  .contact-form-wrap {
    padding: 24px 18px;
  }

  .ci-card {
    padding: 18px;
    gap: 12px;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .submit-btn {
    min-height: 50px;
    font-size: .92rem;
  }
}

/* ── 8. CTA Band Mobile ──────────────────────────────────── */

@media (max-width: 640px) {
  .cta-band {
    padding: 56px 0;
  }

  .cta-box {
    padding: 36px 20px;
  }

  .cta-box h2 {
    font-size: clamp(1.5rem, 5vw, 2rem);
    margin-bottom: 12px;
  }

  .cta-box .lead {
    font-size: .93rem;
    margin-bottom: 28px;
  }

  .cta-actions {
    -webkit-flex-direction: column;
    flex-direction: column;
    -webkit-align-items: stretch;
    align-items: stretch;
    gap: 10px;
  }

  .cta-actions .btn {
    width: 100%;
    max-width: 100%;
    min-height: 50px;
    justify-content: center;
  }
}

/* ── 9. Footer Mobile ────────────────────────────────────── */

@media (max-width: 860px) {
  .footer {
    padding: 56px 0 32px;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    padding-bottom: 36px;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .footer-brand p {
    max-width: 100%;
  }
}

@media (max-width: 640px) {
  .footer {
    padding: 48px 0 28px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
    padding-bottom: 28px;
  }

  .footer-col h5 {
    margin-bottom: 12px;
  }

  .footer-col ul {
    gap: 10px;
  }

  .footer-contact-row {
    margin-bottom: 10px;
  }

  .footer-bottom {
    -webkit-flex-direction: column;
    flex-direction: column;
    text-align: center;
    gap: 8px;
    padding-top: 20px;
  }

  .footer-socials {
    margin-top: 14px;
  }

  .soc-link {
    width: 38px;
    height: 38px;
  }
}

/* ── 10. Page Hero Mobile ────────────────────────────────── */

@media (max-width: 768px) {
  .page-hero {
    padding: 120px 0 56px;
  }

  .page-hero h1 {
    font-size: clamp(1.8rem, 6.5vw, 3rem);
    margin: 10px 0 16px;
  }

  .page-hero .lead {
    font-size: .95rem;
  }
}

@media (max-width: 480px) {
  .page-hero {
    padding: 100px 0 44px;
  }

  .page-hero h1 {
    font-size: clamp(1.65rem, 7vw, 2.4rem);
  }
}

/* ── 11. Buttons — Touch Targets ─────────────────────────── */

@media (max-width: 768px) {
  .btn {
    min-height: 46px;
    padding: 12px 22px;
    font-size: .88rem;
  }

  .nav-cta {
    min-height: 44px;
    padding: 10px 18px;
  }

  /* Enlarge touch area without changing visual */
  .nav-link {
    min-height: 44px;
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
  }
}

/* ── 12. Stats Strip Mobile ──────────────────────────────── */

@media (max-width: 640px) {
  .stats-strip {
    grid-template-columns: 1fr 1fr;
  }

  .stat-cell {
    padding: 28px 16px;
  }

  .stat-n {
    font-size: 2rem;
  }

  .stat-d {
    font-size: .75rem;
  }
}

@media (max-width: 360px) {
  .stats-strip {
    grid-template-columns: 1fr;
  }

  .stat-cell {
    border-right: none !important;
    border-bottom: 1px solid var(--border);
  }
}

/* ── 13. Neelam visual mobile ────────────────────────────── */

@media (max-width: 768px) {
  .neelam-visual {
    padding: 16px;
    max-height: 300px;
  }

  .neelam-visual img {
    max-height: 280px;
    width: auto;
    margin: 0 auto;
    border-radius: 12px;
  }
}

/* ── 14. Marquee Mobile ──────────────────────────────────── */

@media (max-width: 640px) {
  .marquee-pill {
    padding: 7px 14px;
    font-size: .78rem;
  }

  .marquee-track {
    animation-duration: 25s;
  }
}

/* ── 15. FAQ Mobile (for faq.html) ──────────────────────── */

@media (max-width: 640px) {
  .faq-q {
    padding: 18px 0;
    gap: 16px;
  }

  .faq-q h4 {
    font-size: .92rem;
  }

  .faq-toggle {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
  }
}

/* ── 16. WWB Rings Mobile ────────────────────────────────── */

@media (max-width: 860px) {
  .wwb-visual {
    display: none;
  }
}

/* ── 17. Grid-2 responsive ───────────────────────────────── */

@media (max-width: 768px) {
  .grid-2 {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

/* ── 18. Scroll Cue — hide on very short screens ─────────── */

@media (max-height: 600px) {
  .scroll-cue {
    display: none;
  }
}

/* ── 19. Safari-specific: remove tap highlight ───────────── */

a,
button,
input,
textarea,
select,
.btn,
.nav-link,
.nav-cta,
.hamburger {
  -webkit-tap-highlight-color: transparent;
}

/* ── 20. Safari: image rendering ─────────────────────────── */

img {
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

/* ── 21. Improved focus styles for accessibility ─────────── */

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ── 22. iOS Safari: fix 100vh (use svh where supported) ─── */

@supports (height: 100svh) {
  .hero {
    min-height: 100svh;
  }
}

/* ── 23. Touch device: disable expensive hover animations ─── */

@media (hover: none) {
  .cap-cell::after,
  .nf-card::before,
  .feat-card::before,
  .value-card::before,
  .vm-card::before,
  .impact-card .impact-bar::after,
  .footer::after,
  .cta-band::after,
  .btn-outline::before,
  .nav-cta::before {
    display: none;
  }

  .marquee-pill::before {
    animation: none;
  }

  .soc-link:hover {
    transform: none !important;
  }
}

/* ── 24. Extra-small phones ──────────────────────────────── */

@media (max-width: 360px) {
  .container {
    padding: 0 14px;
  }

  .nav-inner {
    padding: 0 14px;
  }

  h1 {
    font-size: 1.7rem !important;
  }

  h2 {
    font-size: 1.45rem !important;
  }

  .btn {
    padding: 11px 18px;
    font-size: .82rem;
  }

  .section {
    padding: 48px 0;
  }

  .footer-grid {
    gap: 20px;
  }
}
