/* Modules ------------------------------------------------------- */

.modules::before {
  content: "";
  position: absolute;
  top: 0;
  right: -10%;
  width: 70vw;
  height: 80%;
  background: radial-gradient(circle at 70% 30%, rgba(52, 75, 60, 0.2), transparent 65%);
  pointer-events: none;
}

.module-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
}

.module {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 26px;
  min-height: 300px;
  padding: clamp(22px, 2.4vw, 34px);
  border: 1px solid var(--line);
  background: rgba(233, 229, 216, 0.022);
  overflow: hidden;
  transition: transform 0.5s var(--ease), border-color 0.5s ease, background 0.5s ease;
}

.module::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  background: radial-gradient(340px circle at var(--mx, 50%) var(--my, 50%), rgba(166, 165, 138, 0.13), transparent 65%);
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.module::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--olive);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.6s var(--ease);
}

.module:hover {
  transform: translateY(-4px);
  border-color: rgba(166, 165, 138, 0.5);
  background: rgba(52, 75, 60, 0.2);
}

.module:hover::before,
.module:hover::after {
  opacity: 1;
}

.module:hover::after {
  transform: scaleX(1);
}

.module > * {
  position: relative;
  z-index: 1;
}

.module__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.module__num {
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--olive);
}

.module__icon {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  color: var(--olive);
  transition: transform 0.6s var(--ease), color 0.4s ease;
}

.module:hover .module__icon {
  transform: rotate(-10deg) scale(1.08);
  color: var(--ivory);
}

.module__body h3 {
  font-family: var(--serif);
  font-size: clamp(2rem, 3.4vw, 3.1rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.025em;
}

.module__sub {
  margin-top: 6px;
  font-family: var(--serif);
  font-size: 1.2rem;
  font-style: italic;
  color: var(--olive);
}

.module__text {
  max-width: 360px;
  margin-top: 14px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
}

.module__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.module__arrow {
  font-size: 16px;
  color: var(--olive);
  transition: transform 0.4s var(--ease);
}

.module:hover .module__arrow {
  transform: translate(4px, -4px);
}

.module__open {
  display: grid;
  place-items: center;
  padding: 4px;
  margin: -4px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.module__open:focus-visible {
  outline: 2px solid var(--olive);
  outline-offset: 3px;
}
