@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,100..900;1,9..144,100..900&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --bg-color: #000000;
  --card-bg: #09090b;
  --text-primary: #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --accent-color: #ffffff;
  --border-color: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.15);
  --font-serif: 'Fraunces', Georgia, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--font-sans);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==================== 1. NAVIGATION ==================== */
.clay-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 48px;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #fff;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.03em;
}

.logo-icon {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #fff 0%, #71717a 100%);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 900;
  color: #000;
}

.pill-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 4px;
  border-radius: 9999px;
}

.pill-nav-item {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 9999px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
}

.pill-nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.pill-nav-item.active {
  color: #000;
  background: #fff;
}

.nav-cta {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-text {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
}

.btn-text:hover {
  color: #fff;
}

.btn-primary {
  background: #fff;
  color: #000;
  border: 1px solid #fff;
  padding: 10px 20px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
  background: transparent;
  color: #fff;
  box-shadow: 0 4px 20px rgba(255, 255, 255, 0.2);
}

@media (max-width: 768px) {
  .clay-nav {
    padding: 16px 24px;
  }
  .pill-nav {
    display: none; /* Hide middle nav on mobile for neatness */
  }
}

/* ==================== 2. SERIF HERO ==================== */
.hero-section {
  position: relative;
  background-color: var(--bg-color);
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 50px 50px;
  background-position: center top;
  min-height: 520px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 140px 24px 20px 24px;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 800px;
  height: 350px;
  background: radial-gradient(circle, rgba(120, 119, 198, 0.12) 0%, transparent 65%);
  filter: blur(60px);
  pointer-events: none;
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(44px, 5.5vw, 72px);
  font-weight: 300;
  line-height: 1.15;
  color: var(--text-primary);
  margin-bottom: 20px;
  letter-spacing: -0.01em;
}

.hero-title em {
  font-style: italic;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.7);
}

.hero-subtitle {
  color: var(--text-secondary);
  font-size: clamp(16px, 1.8vw, 19px);
  font-weight: 400;
  line-height: 1.6;
  max-width: 620px;
  margin: 0 auto;
}

/* ==================== 3. 3D ICON CLOUD ==================== */
.icon-cloud-container {
  position: relative;
  width: 100%;
  max-width: 1200px;
  height: 380px;
  margin: 0 auto;
  overflow: visible;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 3;
}

.perspective-stage {
  perspective: 1200px;
  perspective-origin: 50% 15%;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  transform-style: preserve-3d;
}

.icon-cloud-scene {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transform: rotateX(15deg) rotateY(0deg);
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  justify-content: center;
  align-items: center;
  /* Apply a master reflection effect below the scene for webkit browsers */
  -webkit-box-reflect: below 5px linear-gradient(to bottom, transparent 40%, rgba(255, 255, 255, 0.05) 85%, rgba(255, 255, 255, 0.12) 100%);
}

.icon-cloud-card {
  position: absolute;
  transform-style: preserve-3d;
  /* The layout transform maps indices on Y-rotation, translate outward, and bills back */
  transform: translate(-50%, -50%) rotateY(var(--r)) translateZ(var(--d, 350px)) rotateY(calc(-1 * var(--r))) translateY(var(--y)) rotateX(-15deg);
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), z-index 0s;
  z-index: 1;
}

.icon-cloud-card:hover {
  /* Push hover state out slightly more on the Z-axis, scale, and rotate back cleanly */
  transform: translate(-50%, -50%) rotateY(var(--r)) translateZ(calc(var(--d, 350px) + 60px)) rotateY(calc(-1 * var(--r))) translateY(var(--y)) rotateX(-15deg) scale(1.25);
  z-index: 50;
}

.icon-cloud-card-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 14px;
  background: rgba(12, 12, 12, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 
    0 10px 30px rgba(0, 0, 0, 0.6),
    inset 0 1px 1px rgba(255, 255, 255, 0.1);
  cursor: pointer;
  animation: bounceFloat var(--speed, 4s) ease-in-out infinite alternate;
  animation-delay: var(--delay, 0s);
  transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.icon-cloud-card:hover .icon-cloud-card-inner {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 
    0 15px 40px rgba(255, 255, 255, 0.1),
    0 0 15px rgba(255, 255, 255, 0.1),
    inset 0 1px 1px rgba(255, 255, 255, 0.2);
}

.icon-cloud-card-inner svg {
  width: 32px;
  height: 32px;
  transition: transform 0.3s ease;
}

.icon-cloud-card:hover .icon-cloud-card-inner svg {
  transform: scale(1.1);
}

@keyframes bounceFloat {
  0% {
    transform: translateY(0px) rotate(0deg);
  }
  100% {
    transform: translateY(var(--f-y, -14px)) rotate(var(--f-r, 3deg));
  }
}

/* Bottom fade-out shadow/mirror layer (assists cross-browser reflection look) */
.reflection-floor-overlay {
  position: absolute;
  bottom: -40px;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(to bottom, transparent, var(--bg-color) 70%);
  pointer-events: none;
  z-index: 5;
}

/* ==================== 4. FILTER ROW ==================== */
.filter-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  margin: 80px auto 32px auto;
  max-width: 1200px;
  padding: 0 24px;
  position: relative;
  z-index: 10;
}

.filter-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none; /* Hide scrollbar Firefox */
}

.filter-pills::-webkit-scrollbar {
  display: none; /* Hide scrollbar Webkit */
}

.filter-pill {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  padding: 8px 18px;
  border-radius: 9999px;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.filter-pill:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.filter-pill.active {
  background: #fff;
  border-color: #fff;
  color: #000;
}

.search-wrapper {
  position: relative;
  min-width: 300px;
}

.search-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 12px 16px 12px 42px;
  color: #fff;
  font-family: var(--font-sans);
  font-size: 14px;
  outline: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.search-input:focus {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  display: flex;
  align-items: center;
}

.search-icon svg {
  width: 16px;
  height: 16px;
}

@media (max-width: 768px) {
  .filter-row {
    flex-direction: column;
    align-items: stretch;
    margin-top: 40px;
  }
  .search-wrapper {
    min-width: 100%;
  }
}

/* ==================== 5. 4-COLUMN CARD GRID ==================== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto 100px auto;
  padding: 0 24px;
  position: relative;
  z-index: 10;
}

@media (max-width: 1024px) {
  .cards-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

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

@media (max-width: 480px) {
  .cards-grid {
    grid-template-columns: 1fr;
  }
}

.integration-card {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  cursor: pointer;
}

/* The hover glow effect container */
.integration-card::before {
  content: '';
  position: absolute;
  inset: 0;
  /* Radial glow follow mouse position */
  background: radial-gradient(
    300px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(255, 255, 255, 0.05),
    transparent 50%
  );
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
  z-index: 1;
}

.integration-card:hover::before {
  opacity: 1;
}

.integration-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  box-shadow: 
    0 12px 30px -10px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(255, 255, 255, 0.08);
}

.card-icon-container {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  position: relative;
  z-index: 2;
  transition: all 0.3s ease;
}

.integration-card:hover .card-icon-container {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.card-icon-container svg {
  width: 24px;
  height: 24px;
}

.card-title {
  color: var(--text-primary);
  font-size: 15.5px;
  font-weight: 600;
  margin-bottom: 8px;
  position: relative;
  z-index: 2;
  letter-spacing: -0.01em;
}

.card-desc {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
  position: relative;
  z-index: 2;
}

.integration-card:hover .card-desc {
  color: #fff;
}
