/* ── MODULES ── */
.modules-section {
  padding: clamp(5rem, 8vw, 9rem) 0;
  background: oklch(19% 0.015 38);
  border-top: 1px solid oklch(100% 0 0 / 0.07);
  position: relative;
  overflow: hidden;
}

.modules-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 55% 45% at 20% 30%, oklch(68% 0.18 58 / 0.12) 0%, transparent 55%),
    radial-gradient(ellipse 45% 40% at 80% 70%, oklch(55% 0.15 180 / 0.08) 0%, transparent 50%),
    radial-gradient(ellipse 35% 35% at 60% 10%, oklch(60% 0.12 300 / 0.05) 0%, transparent 45%);
  pointer-events: none;
  z-index: 0;
}

.modules-bg-pattern { display: none; }

.modules-inner {
  position: relative;
  z-index: 1;
  padding: 0 clamp(1.5rem, 5vw, 5rem);
  max-width: 1280px;
  margin: 0 auto;
}

.modules-header {
  margin-bottom: 4rem;
}

.modules-section .section-eyebrow {
  color: oklch(68% 0.18 58 / 0.8);
}

.modules-section .section-heading {
  color: white;
  text-align: center;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.modules-section .section-body {
  color: oklch(100% 0 0 / 0.5);
  text-align: center;
  max-width: 580px;
  margin-left: auto;
  margin-right: auto;
}

.modules-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: oklch(100% 0 0 / 0.06);
  border: 1px solid oklch(100% 0 0 / 0.06);
  border-radius: 16px;
  overflow: visible;
}

.module-card {
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 32px 28px;
  position: relative;
  cursor: pointer;
  border: none;
  transition: background 0.3s ease, transform 0.35s cubic-bezier(0.34,1.2,0.64,1), box-shadow 0.35s ease, z-index 0s;
  will-change: transform;
  transform: scale(1);
  border-radius: 0;
}

/* Round corners on grid edges */
.module-card:nth-child(1) { border-radius: 16px 0 0 0; }
.module-card:nth-child(3) { border-radius: 0 16px 0 0; }
.module-card:nth-child(7) { border-radius: 0 0 0 16px; }
.module-card:nth-child(9) { border-radius: 0 0 16px 0; }

.module-card:hover {
  transform: scale(1.04);
  z-index: 5;
  box-shadow: 0 16px 40px rgba(0,0,0,0.35);
}

.module-card.reveal.in-view:hover {
  transform: scale(1.04) !important;
}

.module-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  transition: background 0.3s;
}

.module-card:hover {
  background: rgba(217, 119, 6, 0.28);
}

.module-card:hover::before {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
}

.module-card.featured {
  background: rgba(255, 255, 255, 0.04);
}
.module-card.featured:hover {
  background: rgba(217, 119, 6, 0.28);
}

.module-card.featured::before {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
}

.module-num {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: oklch(100% 0 0 / 0.25);
  margin-bottom: 16px;
  text-transform: uppercase;
  transition: color 0.3s;
}
.module-card:hover .module-num { color: oklch(100% 0 0 / 0.5); }
.module-card.featured .module-num { color: oklch(100% 0 0 / 0.25); }

.module-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: oklch(100% 0 0 / 0.07);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  transition: background 0.3s;
}
.module-card:hover .module-icon {
  background: oklch(100% 0 0 / 0.14);
}
.module-card.featured .module-icon { background: oklch(100% 0 0 / 0.07); }

.module-icon svg {
  width: 20px; height: 20px;
  stroke: var(--amber-bright);
  fill: none;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  transition: stroke 0.3s;
}
.module-card:hover .module-icon svg { stroke: white; }
.module-card.featured .module-icon svg { stroke: var(--amber-bright); }

.module-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: white;
  margin-bottom: 10px;
  line-height: 1.1;
}

.module-desc {
  font-size: 13px;
  color: oklch(100% 0 0 / 0.45);
  line-height: 1.65;
  font-weight: 400;
  transition: color 0.3s;
}
.module-card:hover .module-desc { color: oklch(100% 0 0 / 0.7); }
.module-card.featured .module-desc { color: oklch(100% 0 0 / 0.45); }

.module-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}

.module-tag {
  padding: 3px 9px;
  background: oklch(100% 0 0 / 0.06);
  border: 0.5px solid oklch(100% 0 0 / 0.12);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: oklch(100% 0 0 / 0.35);
  text-transform: uppercase;
  font-family: var(--font-mono);
  transition: all 0.3s;
}
.module-card:hover .module-tag {
  background: oklch(100% 0 0 / 0.1);
  border-color: oklch(100% 0 0 / 0.2);
  color: oklch(100% 0 0 / 0.6);
}
.module-card.featured .module-tag {
  background: oklch(100% 0 0 / 0.06);
  border-color: oklch(100% 0 0 / 0.12);
  color: oklch(100% 0 0 / 0.35);
}
