/* SPADT Connect - Custom Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Prompt:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&family=Inter:wght@400;500;600;700;800&family=Caveat:wght@600;700&family=Mali:ital,wght@0,600;1,600&display=swap');

:root {
  --primary-blue: #0284c7;
  --primary-dark-blue: #1d4ed8;
  --primary-navy: #0b1528;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --font-scale: 1.12; /* Increased default font scale for higher legibility */
}

body {
  font-family: 'Prompt', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text-main);
  background-color: #f8fafc;
  font-size: calc(1.0625rem * var(--font-scale)); /* Larger default body text */
  line-height: 1.6;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

/* Handwritten script text classes */
.font-handwriting {
  font-family: 'Caveat', cursive;
}
.font-handwriting-th {
  font-family: 'Mali', cursive;
}

/* Glassmorphic Navbar */
.glass-nav {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

/* Hero angled background accents matching the design */
.hero-bg-gradient {
  background: linear-gradient(135deg, #f0f7ff 0%, #e0f2fe 35%, #ffffff 70%, #f0fdf4 100%);
}

.hero-facet {
  position: absolute;
  clip-path: polygon(25% 0%, 100% 0%, 75% 100%, 0% 100%);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.12), rgba(37, 99, 235, 0.05));
  pointer-events: none;
}

/* Card hover transitions */
.service-card {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid #e2e8f0;
}

.service-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 30px -10px rgba(14, 165, 233, 0.15), 0 10px 15px -3px rgba(0, 0, 0, 0.05);
  border-color: #93c5fd;
}

/* Custom dashed connecting curve in Ecosystem section */
.ecosystem-curve {
  stroke-dasharray: 8 10;
  animation: dash 9s linear infinite;
}

@keyframes dash {
  to {
    stroke-dashoffset: -220;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ecosystem-curve,
  .mobile-menu-popup:not(.hidden) {
    animation: none;
  }
}

/* Pulse badge */
@keyframes pulse-subtle {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.15);
  }
}

.animate-pulse-subtle {
  animation: pulse-subtle 2.5s infinite ease-in-out;
}

/* Modal styles */
.modal-backdrop {
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
}

/* Accessibility Modes */
body.high-contrast {
  filter: contrast(125%);
  background-color: #ffffff !important;
  color: #000000 !important;
}

body.high-contrast .service-card {
  border: 2px solid #000000 !important;
  box-shadow: none !important;
}

body.high-contrast a, 
body.high-contrast button {
  outline: 2px solid #000 !important;
}

/* Subtle glowing gradient for More Services card */
.glow-corner {
  background: radial-gradient(circle at bottom right, rgba(56, 189, 248, 0.5) 0%, rgba(99, 102, 241, 0.3) 30%, transparent 70%);
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Image-to-code layout refinements for the approved reference direction */
.glass-nav {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.hero-section {
  min-height: 560px;
  background: #f7fbff;
}

.hero-media {
  width: 100%;
  height: 285px;
}

.hero-media img,
.featured-media img {
  display: block;
}

.hero-wash {
  background: linear-gradient(180deg, rgba(247, 251, 255, 0.04) 0%, rgba(247, 251, 255, 0.94) 88%, #f7fbff 100%);
}

.hero-copy {
  min-height: 275px;
}

.hero-slogan {
  font-family: 'Mali', cursive;
}

.featured-section {
  min-height: 390px;
}

.featured-media {
  height: 230px;
}

.featured-wash {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.94) 92%, #ffffff 100%);
}

.featured-copy {
  min-height: 390px;
}

.footer-accessibility-panel {
  border-top: 1px solid rgba(148, 163, 184, 0.25);
}

.ecosystem-network {
  isolation: isolate;
  overflow: hidden;
  border: 1px solid rgba(186, 230, 253, 0.5);
  border-radius: 2.5rem;
  background:
    radial-gradient(circle at 50% 42%, rgba(219, 234, 254, 0.72) 0, rgba(219, 234, 254, 0) 42%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(239, 246, 255, 0.8));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    inset 0 -24px 48px rgba(148, 163, 184, 0.08),
    0 18px 40px rgba(59, 130, 246, 0.08);
}

.ecosystem-network::before {
  content: '';
  position: absolute;
  inset: 10% 7%;
  z-index: 0;
  border: 1px solid rgba(125, 211, 252, 0.28);
  border-radius: 50%;
  transform: rotate(-6deg);
  box-shadow: 0 0 42px rgba(129, 140, 248, 0.12);
  pointer-events: none;
}

.ecosystem-network::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.3), transparent 40%, rgba(125, 211, 252, 0.1));
  pointer-events: none;
}

.ecosystem-network-glow {
  z-index: 1;
  background:
    radial-gradient(ellipse at 16% 28%, rgba(56, 189, 248, 0.16), transparent 26%),
    radial-gradient(ellipse at 84% 70%, rgba(167, 139, 250, 0.18), transparent 30%);
}

.ecosystem-map {
  opacity: 0.13;
  mix-blend-mode: multiply;
  filter: saturate(0.8) sepia(0.08) hue-rotate(178deg) saturate(1.55) drop-shadow(12px 14px 0 rgba(129, 140, 248, 0.08));
}

@media (min-width: 1024px) {
  .hero-section {
    min-height: 425px;
    display: block;
  }

  .hero-media {
    position: absolute;
    inset: 0 0 0 auto;
    width: 66%;
    height: 100%;
  }

  .hero-media img {
    object-position: center;
  }

  .hero-wash {
    background: linear-gradient(90deg, #f7fbff 0%, rgba(247, 251, 255, 0.98) 25%, rgba(247, 251, 255, 0.76) 43%, rgba(247, 251, 255, 0) 74%);
  }

  .hero-copy {
    min-height: 425px;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .featured-section {
    min-height: 320px;
  }

  .featured-media {
    height: 100%;
  }

  .featured-media img {
    object-position: center;
  }

  .featured-wash {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.99) 0%, rgba(255, 255, 255, 0.94) 30%, rgba(255, 255, 255, 0.58) 50%, rgba(255, 255, 255, 0.04) 78%, rgba(255, 255, 255, 0) 100%);
  }

  .featured-copy {
    min-height: 320px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: 3rem;
    padding-bottom: 3rem;
  }
}

@media (max-width: 767px) {
  .hero-copy {
    padding-top: 2.5rem;
    padding-bottom: 2.75rem;
  }

  .featured-copy {
    min-height: 360px;
  }
}

/* Mobile reference composition: compact header, immersive hero, horizontal cards */
@media (max-width: 767px) {
  .glass-nav > div:first-child {
    min-height: 4rem;
  }

  .mobile-menu-popup {
    position: absolute;
    top: calc(100% + 0.75rem);
    left: 1rem;
    right: 1rem;
    z-index: 30;
    margin-top: 0 !important;
    padding: 1rem 1.25rem 1.25rem !important;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 1.25rem;
    box-shadow: 0 20px 45px -18px rgba(15, 23, 42, 0.35);
  }

  .mobile-menu-popup:not(.hidden) {
    animation: mobile-menu-drop 220ms cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  @keyframes mobile-menu-drop {
    from {
      opacity: 0;
      transform: translateY(-0.5rem) scale(0.98);
      transform-origin: top center;
    }
    to {
      opacity: 1;
      transform: translateY(0) scale(1);
      transform-origin: top center;
    }
  }

  .glass-nav > div:first-child > a img {
    height: 2.5rem;
    max-width: 9rem;
  }

  .glass-nav > div:first-child > div:last-child {
    gap: 0.25rem;
    margin-left: auto;
  }

  .hero-section {
    min-height: 780px;
    display: block;
  }

  .hero-media {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
  }

  .hero-media img {
    object-position: 73% center;
  }

  .hero-wash {
    background: linear-gradient(180deg, rgba(247, 251, 255, 0.98) 0%, rgba(247, 251, 255, 0.9) 28%, rgba(247, 251, 255, 0.34) 56%, rgba(255, 255, 255, 0.96) 89%, #ffffff 100%);
  }

  .hero-copy {
    min-height: 780px;
    height: 100%;
    padding-top: 2rem !important;
    padding-bottom: 1.25rem !important;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
  }

  .hero-copy h1 {
    margin-top: 1rem;
    font-size: 2.15rem;
    line-height: 1.2;
    letter-spacing: -0.035em;
  }

  .hero-copy > p {
    margin-top: 1rem;
    font-size: 1rem;
    line-height: 1.55;
  }

  .hero-copy > div.mt-7 {
    margin-top: 1.25rem;
  }

  .hero-section .hero-props {
    width: 100%;
    max-width: none;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 0.25rem;
    margin-top: auto !important;
    padding-top: 1rem;
    padding-bottom: 0.25rem;
  }

  .hero-prop {
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    text-align: center;
  }

  .hero-prop > div:first-child {
    padding: 0.45rem;
    border-radius: 0.75rem;
  }

  .hero-prop > div:first-child svg {
    width: 1.45rem;
    height: 1.45rem;
  }

  .hero-prop h4 {
    font-size: 0.9rem;
    line-height: 1.2;
  }

  .hero-prop p {
    font-size: 0.66rem;
    line-height: 1.35;
  }

  #services {
    padding-top: 2.75rem !important;
    padding-bottom: 2.75rem !important;
  }

  #services > div > div:first-child {
    margin-bottom: 1.5rem !important;
  }

  #services .service-card {
    min-height: 190px;
    padding: 1rem !important;
    border-radius: 1.25rem;
  }

  #services .service-card > div:nth-child(2) {
    position: relative;
    z-index: 1;
    padding-right: 23%;
  }

  #services .service-card > div:nth-child(3) {
    position: relative;
    z-index: 1;
    margin-top: 0.75rem !important;
    padding-top: 0.75rem !important;
  }

  #services .service-card > div.absolute {
    width: 48%;
    height: 100%;
    opacity: 0.3;
  }

  #services .service-card > div:nth-child(2) > div:first-child {
    margin-bottom: 0.8rem !important;
  }

  #services .service-card .w-12.h-12 {
    width: 2.5rem;
    height: 2.5rem;
    margin-bottom: 0.7rem;
  }

  #services .service-card .w-12.h-12 svg {
    width: 1.45rem;
    height: 1.45rem;
  }

  #services .service-card h3 {
    font-size: 1.1rem;
    line-height: 1.22;
  }

  #services .service-card p {
    margin-top: 0.4rem;
    font-size: 0.78rem;
    line-height: 1.45;
  }

  #services .service-card > div:nth-child(2) [class*="flex-wrap"] {
    display: none;
  }

  #about {
    padding-top: 2.75rem !important;
    padding-bottom: 2.75rem !important;
  }

  #about .ecosystem-pillars {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.25rem;
  }

  #about .ecosystem-pillars > div {
    min-width: 0;
  }

  #about .ecosystem-pillars .w-16.h-16 {
    width: 3.5rem;
    height: 3.5rem;
  }

  #about .ecosystem-pillars .w-16.h-16 svg {
    width: 1.7rem;
    height: 1.7rem;
  }

  #about .ecosystem-pillars h4 {
    margin-top: 0.5rem;
    font-size: 0.72rem;
    line-height: 1.2;
  }

  #about .ecosystem-pillars p {
    font-size: 0.64rem;
    line-height: 1.25;
  }

  #about .ecosystem-slogan {
    right: -0.35rem;
    top: 0.75rem;
    transform: none;
    font-size: 0.52rem;
    line-height: 1.8;
  }

  .featured-section {
    min-height: 360px;
  }

  .featured-media {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
  }

  .featured-media img {
    object-position: 73% center;
  }

  .featured-wash {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, rgba(255, 255, 255, 0.94) 43%, rgba(255, 255, 255, 0.28) 76%, rgba(255, 255, 255, 0) 100%);
  }

  .featured-copy {
    min-height: 360px;
    max-width: none;
    padding-top: 2rem !important;
    padding-bottom: 1.25rem !important;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
  }

  .featured-copy h2 {
    margin-top: 0.75rem;
    font-size: 1.65rem;
    line-height: 1.2;
  }

  .featured-copy p {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    line-height: 1.45;
  }

  .site-footer {
    padding-top: 2.5rem !important;
    padding-bottom: 2rem !important;
  }

  .site-footer > div.space-y-12 > :not([hidden]) ~ :not([hidden]) {
    margin-top: 2rem;
  }

  .site-footer .inline-flex {
    border-radius: 1rem;
  }

  .site-footer img {
    max-width: 8.5rem;
  }

  .site-footer .md\:col-span-6 {
    gap: 0.75rem 1.25rem;
    font-size: 0.8rem;
  }

  .site-footer .md\:col-span-2 {
    margin-top: 0.25rem;
  }
}
