@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;1,400&display=swap');

:root {
  --bg-color: #000000;
  --panel-bg: #0a0a0a;
  --text-primary: #ffffff;
  --text-secondary: #a0a0ab;
  --text-muted: #6b6b78;
  --accent-primary: #C0FF04; /* Update based on Visily logo and purple accent */
  --accent-blue: #9ADD00;
  --gradient-primary: linear-gradient(135deg, #C0FF04 0%, #9ADD00 100%);
  --gradient-text: linear-gradient(to right, #ffffff, #a0a0ab);
  --border-color: #272730;
  --font-main: 'Inter', sans-serif;
  --font-serif: 'Playfair Display', serif;
  --max-width: 1200px;
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.2;
}

h1 {
  font-size: 4rem;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}

h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

p {
  color: var(--text-secondary);
  font-size: 1.125rem;
}

a {
  color: var(--text-primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--accent-primary);
}

/* Gradient Text Utility */
.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

.text-gradient-primary {
  background: linear-gradient(to right, #C0FF04, #8DBF00);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

/* Layout Utilities */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

.text-center {
  text-align: center;
}

/* Components */
/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 1.5rem 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent-primary);
}

.logo img {
  height: 24px;
}

.logo span {
  color: var(--text-primary);
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.nav-links a:hover, .nav-links a.active {
  color: var(--text-primary);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 2rem;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 0.875rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  outline: none;
}

.btn-primary {
  background: var(--accent-primary);
  color: #000;
  border-radius: 9999px;
}

.btn-primary:hover {
  background: #A7E600;
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(192, 255, 4, 0.3);
  color: #000;
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.4);
}

/* Footer "Automate Now" button — compact sizing */
.footer .btn-outline {
  padding: 0.6rem 1.25rem;
  font-size: 0.8rem;
  width: auto !important;
}

/* Cards */
.card {
  background: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  padding: 2rem;
  transition: var(--transition);
}

.card:hover {
  transform: translateY(-5px);
  border-color: rgba(192, 255, 4, 0.3);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.icon-box {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: var(--transition);
}

.card:hover .icon-box {
  border-color: var(--accent-primary);
  background: rgba(192, 255, 4, 0.05);
}

.card-white {
  background: #f3f4f6 !important;
  color: #000000 !important;
  border-radius: 2rem !important;
  border: none !important;
}

.card-white h3 {
  color: #000000 !important;
}

.card-white p {
  color: #4b5563 !important;
}

/* Sections */
section {
  padding: 6rem 0;
}

/* Footer */
.footer {
  background-color: var(--panel-bg);
  padding: 4rem 0 2rem;
  border-top: 1px solid var(--border-color);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer h4 {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.75rem;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.footer-links a:hover {
  color: var(--accent-primary);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.875rem;
  color: var(--text-muted);
}

.footer-bottom-links {
  display: flex;
  gap: 1.5rem;
}


/* ============================================================
   Responsive Breakpoints
   ============================================================ */

/* --- Tablet & below (≤ 1024px) --- */
@media (max-width: 1024px) {
  h1 { font-size: clamp(2.5rem, 6vw, 4rem) !important; }
  h2 { font-size: clamp(2rem, 5vw, 2.5rem) !important; }
  h3 { font-size: clamp(1.25rem, 3vw, 1.5rem) !important; }
  p  { font-size: clamp(1rem, 2vw, 1.125rem) !important; }

  /* Stack asymmetric 2-column layouts (e.g. "Who We Build For" section) */
  [style*="grid-template-columns: 1fr 1.5fr"] {
    grid-template-columns: 1fr !important;
    gap: 2.5rem !important;
  }

  /* Stats: 4-col → 2-col on tablets */
  [style*="grid-template-columns: repeat(4, 1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* --- Mobile (≤ 768px) --- */
@media (max-width: 768px) {
  h1 { font-size: clamp(2rem, 8vw, 2.5rem) !important; }
  h2 { font-size: clamp(1.75rem, 6vw, 2rem) !important; }

  /* Hide "Book Call" button in header, show hamburger instead */
  .header .btn {
    display: none !important;
  }

  .header .logo {
    font-size: 1rem !important;
    white-space: nowrap !important;
  }

  /* Full-width buttons on mobile — slightly compact */
  .btn:not(.header .btn), .animated-link {
    width: 100% !important;
    padding: 0.7rem 1.25rem !important;
    font-size: 0.875rem !important;
    margin-bottom: 0.5rem;
    box-sizing: border-box;
    text-align: center;
    justify-content: center;
  }

  /* Reduce section padding */
  section,
  [style*="padding: 8rem"],
  [style*="padding: 6rem"] {
    padding: 3rem 1rem !important;
  }

  /* Hero sections need enough top padding to clear the fixed header (~80px) */
  .hero-section,
  [style*="padding: 12rem"],
  [style*="padding: 10rem"] {
    padding-top: 7rem !important;
  }

  /* Hide Spline 3D viewer on mobile — it overlaps text and blocks interaction */
  spline-viewer {
    display: none !important;
  }

  /* Hamburger nav */
  .nav-links {
    display: none !important;
    flex-direction: column !important;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.95);
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    text-align: center;
    gap: 1rem;
    z-index: 999;
  }
  .nav-links.active {
    display: flex !important;
  }
  #hamburger-btn {
    display: flex !important;
  }

  /* Footer — 2-column grid so Solutions & Company stay side by side */
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
  /* Logo/description col spans full width */
  .footer-grid .footer-col:first-child {
    grid-column: 1 / -1;
    max-width: 100% !important;
  }
  /* "Get Started" col spans full width */
  .footer-grid .footer-col:last-child {
    grid-column: 1 / -1;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  /* Container */
  .container {
    padding: 0 1.5rem !important;
    width: 100% !important;
    overflow-x: hidden !important;
  }
  body {
    overflow-x: hidden !important;
  }

  /* Fix about.html Vision/Mission grid — minmax(400px) overflows on phones */
  [style*="minmax(400px"] {
    grid-template-columns: 1fr !important;
  }

  /* Reduce large inline-padding cards */
  [style*="padding: 6rem 4rem"] {
    padding: 3rem 1.5rem !important;
  }
  [style*="padding: 3.5rem"] {
    padding: 2rem 1.5rem !important;
  }
}

/* --- Small phones (≤ 640px) --- */
@media (max-width: 640px) {
  /* Stats: stay 2-col (already set at 1024px) — shrink further if needed */
  [style*="grid-template-columns: repeat(4, 1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* 3-col inner grids → 2-col on phones (e.g. "Who We Build For" mini-cards) */
  [style*="grid-template-columns: repeat(3, 1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Use-cases page: full-width cards on phones */
  .uc-card {
    width: 100% !important;
  }

  /* Stack horizontal button groups vertically */
  [style*="display: flex; gap: 1rem"] {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  [style*="display: flex; gap: 1rem"] > .btn {
    width: 100% !important;
    justify-content: center !important;
  }

  /* Keep footer social icons in a row (override the above) */
  .footer [style*="display: flex; gap: 1rem"] {
    flex-direction: row !important;
    align-items: center !important;
    flex-wrap: wrap;
  }

  /* Trust / feature badge rows → wrap gracefully */
  [style*="display: flex; justify-content: center"][style*="gap: 2rem"] {
    flex-wrap: wrap !important;
    gap: 1rem !important;
  }

  /* Further reduce large card padding on small phones */
  [style*="padding: 6rem 4rem"] {
    padding: 2rem 1.25rem !important;
  }
  [style*="padding: 3.5rem"] {
    padding: 1.5rem !important;
  }
}
